Change PartyAndCertificate to an aggregate class (#778)

Change PartyAndCertificate to an aggregate class instead of a subclass of Party. This reduces the changes compared to M11, as well as avoiding risk of accidental serialization of a PartyAndCertificate (which may be very large) where a Party is expected.

Cleaned up initial nodes known to the identity service, in particular mock nodes now know about themselves; previously full nodes registered themselves but mock nodes did not.
This commit is contained in:
Ross Nicoll
2017-06-01 18:54:44 +01:00
committed by GitHub
parent 20b806cb62
commit e2214c95b4
70 changed files with 270 additions and 256 deletions

View File

@ -7,7 +7,7 @@ import net.corda.core.contracts.TransactionGraphSearch
import net.corda.core.div
import net.corda.core.flows.FlowLogic
import net.corda.core.flows.InitiatedBy
import net.corda.core.identity.PartyAndCertificate
import net.corda.core.identity.Party
import net.corda.core.node.NodeInfo
import net.corda.core.transactions.SignedTransaction
import net.corda.core.utilities.Emoji
@ -17,7 +17,7 @@ import net.corda.flows.TwoPartyTradeFlow
import java.util.*
@InitiatedBy(SellerFlow::class)
class BuyerFlow(val otherParty: PartyAndCertificate) : FlowLogic<Unit>() {
class BuyerFlow(val otherParty: Party) : FlowLogic<Unit>() {
object STARTING_BUY : ProgressTracker.Step("Seller connected, purchasing commercial paper asset")

View File

@ -12,7 +12,6 @@ import net.corda.core.flows.InitiatingFlow
import net.corda.core.flows.StartableByRPC
import net.corda.core.identity.AbstractParty
import net.corda.core.identity.Party
import net.corda.core.identity.PartyAndCertificate
import net.corda.core.node.NodeInfo
import net.corda.core.seconds
import net.corda.core.transactions.SignedTransaction
@ -25,10 +24,10 @@ import java.util.*
@InitiatingFlow
@StartableByRPC
class SellerFlow(val otherParty: PartyAndCertificate,
class SellerFlow(val otherParty: Party,
val amount: Amount<Currency>,
override val progressTracker: ProgressTracker) : FlowLogic<SignedTransaction>() {
constructor(otherParty: PartyAndCertificate, amount: Amount<Currency>) : this(otherParty, amount, tracker())
constructor(otherParty: Party, amount: Amount<Currency>) : this(otherParty, amount, tracker())
companion object {
val PROSPECTUS_HASH = SecureHash.parse("decd098666b9657314870e192ced0c3519c2c9d395507a238338f8d003929de9")