Pass a FilteredTransaction instead of a Signed transaction to a non-validating notary flow to preserve privacy.

This also means that the non-validating notary can service requests on the network without loading any custom plugins.
This commit is contained in:
Andrius Dagys
2017-02-08 17:11:00 +00:00
parent 98c30f6432
commit a19dd55257
8 changed files with 117 additions and 70 deletions

View File

@ -53,7 +53,7 @@ class RaftNotaryServiceTests : NodeBasedTest() {
val ex = assertFailsWith(NotaryException::class) { secondSpend.resultFuture.getOrThrow() }
val error = ex.error as NotaryError.Conflict
assertEquals(error.tx, secondSpendTx.tx)
assertEquals(error.txId, secondSpendTx.id)
}
private fun issueState(node: AbstractNode, notary: Party, notaryKey: KeyPair): StateAndRef<*> {

View File

@ -4,6 +4,7 @@ import net.corda.core.crypto.Party
import net.corda.core.node.services.ServiceType
import net.corda.core.node.services.TimestampChecker
import net.corda.core.node.services.UniquenessProvider
import net.corda.flows.NonValidatingNotaryFlow
import net.corda.flows.NotaryFlow
import net.corda.node.services.api.ServiceHubInternal
@ -16,6 +17,6 @@ class SimpleNotaryService(services: ServiceHubInternal,
}
override fun createFlow(otherParty: Party): NotaryFlow.Service {
return NotaryFlow.Service(otherParty, timestampChecker, uniquenessProvider)
return NonValidatingNotaryFlow(otherParty, timestampChecker, uniquenessProvider)
}
}

View File

@ -128,7 +128,7 @@ class NotaryServiceTests {
val ex = assertFailsWith(NotaryException::class) { future.resultFuture.getOrThrow() }
val notaryError = ex.error as NotaryError.Conflict
assertEquals(notaryError.tx, stx2.tx)
assertEquals(notaryError.txId, stx2.id)
notaryError.conflict.verified()
}