Enable anonymisation (#1073)

* Enabled confidential identities in:
** IssuerFlow
** Trader demo
** Two party deal flows
** Two party trade flows
** Corda RPC tests
** Cash flows
** Integration testing tutorial
** Node monitor model tests
** CollectSignatureFlow
* Relay local node's confidential identities to counterparties when requesting transaction
signatures, so counterparties know where the inputs come from.
* Require all identities are known in finality flow
* Ensure all identities in FxTransactionBuildTutorial are known to each other

* Add flow for syncing identities to a number of counterparties

* Address PR comments

* Disable anonymisation in example code

* Revert unnecessary changes remaining from earlier rebases

* Corrections after rebase

* Remove unneeded identity registration

Remove unneeded identity registrations from tests, which sometimes cause duplicated entries in the database

* Revert accidental change in examples

* Revert unneeded imports

* Revert changes to CoreFlowHandlers.kt
This commit is contained in:
Ross Nicoll
2017-09-11 14:29:37 +01:00
committed by GitHub
parent 330db73c5d
commit 65dcfe4abe
18 changed files with 55 additions and 38 deletions

View File

@ -56,7 +56,6 @@ class TraderDemoTest : NodeBasedTest() {
val expectedBCash = clientB.cashCount + 1
val expectedPaper = listOf(clientA.commercialPaperCount + 1, clientB.commercialPaperCount)
// TODO: Enable anonymisation
clientBank.runIssuer(amount = 100.DOLLARS, buyerName = nodeA.info.legalIdentity.name, sellerName = nodeB.info.legalIdentity.name)
clientB.runSeller(buyerName = nodeA.info.legalIdentity.name, amount = 5.DOLLARS)

View File

@ -51,12 +51,11 @@ class TraderDemoClientApi(val rpc: CordaRPCOps) {
val notaryNode = rpc.nodeIdentityFromParty(notaryLegalIdentity)
?: throw IllegalStateException("Unable to locate notary node in network map cache")
val amounts = calculateRandomlySizedAmounts(amount, 3, 10, Random())
val anonymous = false
rpc.startFlow(::CashIssueFlow, amount, OpaqueBytes.of(1), notaryNode.notaryIdentity).returnValue.getOrThrow()
// Pay random amounts of currency up to the requested amount
amounts.forEach { pennies ->
// TODO This can't be done in parallel, perhaps due to soft-locking issues?
rpc.startFlow(::CashPaymentFlow, amount.copy(quantity = pennies), buyer, anonymous).returnValue.getOrThrow()
rpc.startFlow(::CashPaymentFlow, amount.copy(quantity = pennies), buyer).returnValue.getOrThrow()
}
println("Cash issued to buyer")