[ENT-1859] Handle issue transactions with time window (#809)

This commit is contained in:
Thomas Schroeter 2018-05-09 13:12:33 +01:00 committed by GitHub
parent 8517f51d49
commit 750e368283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -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 {

View File

@ -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()
}
}
}