Make notary flow return a collection of signatures to support the BFT… (#264)

Make notary flow return a collection of signatures to support the BFT notary. For a single-node or RAFT notary it would just contain a single signature.
This commit is contained in:
Andrius Dagys
2017-02-22 11:11:35 +00:00
committed by GitHub
parent c7abbe8791
commit 006faa82a1
8 changed files with 36 additions and 33 deletions

View File

@ -55,8 +55,8 @@ class NotaryServiceTests {
}
val future = runNotaryClient(stx)
val signature = future.getOrThrow()
signature.verifyWithECDSA(stx.id)
val signatures = future.getOrThrow()
signatures.forEach { it.verifyWithECDSA(stx.id) }
}
@Test fun `should sign a unique transaction without a timestamp`() {
@ -68,8 +68,8 @@ class NotaryServiceTests {
}
val future = runNotaryClient(stx)
val signature = future.getOrThrow()
signature.verifyWithECDSA(stx.id)
val signatures = future.getOrThrow()
signatures.forEach { it.verifyWithECDSA(stx.id) }
}
@Test fun `should report error for transaction with an invalid timestamp`() {
@ -132,7 +132,7 @@ class NotaryServiceTests {
notaryError.conflict.verified()
}
private fun runNotaryClient(stx: SignedTransaction): ListenableFuture<DigitalSignature.WithKey> {
private fun runNotaryClient(stx: SignedTransaction): ListenableFuture<List<DigitalSignature.WithKey>> {
val flow = NotaryFlow.Client(stx)
val future = clientNode.services.startFlow(flow).resultFuture
net.runNetwork()

View File

@ -78,7 +78,7 @@ class ValidatingNotaryServiceTests {
assertEquals(setOf(expectedMissingKey), missingKeys)
}
private fun runClient(stx: SignedTransaction): ListenableFuture<DigitalSignature.WithKey> {
private fun runClient(stx: SignedTransaction): ListenableFuture<List<DigitalSignature.WithKey>> {
val flow = NotaryFlow.Client(stx)
val future = clientNode.services.startFlow(flow).resultFuture
net.runNetwork()