mirror of
https://github.com/corda/corda.git
synced 2025-03-17 17:45:17 +00:00
[ENT-1859] Handle issue transactions with time window (#809)
This commit is contained in:
parent
8517f51d49
commit
750e368283
@ -138,6 +138,16 @@ class MySQLNotaryServiceTests : IntegrationTest() {
|
||||
signatures.forEach { checkSignature(it) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `notarise issue tx with time-window`() {
|
||||
val txBuilder = DummyContract.generateInitial(Random().nextInt(), notaryParty, node.info.singleIdentity().ref(0))
|
||||
.setTimeWindow(node.services.clock.instant(), 30.seconds)
|
||||
|
||||
val issueTx = node.services.signInitialTransaction(txBuilder)
|
||||
val signature = node.services.startFlow(NotaryFlow.Client(issueTx)).resultFuture.getOrThrow(5.seconds)
|
||||
signature.first().verify(issueTx.id)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `should re-sign a transaction with an expired time-window`() {
|
||||
val stx = run {
|
||||
|
@ -357,6 +357,9 @@ class MySQLUniquenessProvider(
|
||||
}
|
||||
|
||||
private fun findAlreadyCommitted(connection: Connection, states: List<StateRef>): Map<StateRef, StateConsumptionDetails> {
|
||||
if (states.isEmpty()) {
|
||||
return emptyMap()
|
||||
}
|
||||
val queryString = buildQueryString(states.size)
|
||||
val preparedStatement = connection.prepareStatement(queryString).apply {
|
||||
var parameterIndex = 0
|
||||
@ -439,4 +442,4 @@ class MySQLUniquenessProvider(
|
||||
dataSource.close()
|
||||
processorThread.interrupt()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user