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

@ -26,8 +26,8 @@ import java.util.*
@CordaSerializable
private data class FxRequest(val tradeId: String,
val amount: Amount<Issued<Currency>>,
val owner: PartyAndCertificate,
val counterparty: PartyAndCertificate,
val owner: Party,
val counterparty: Party,
val notary: Party? = null)
@CordaSerializable
@ -103,8 +103,8 @@ private fun prepareOurInputsAndOutputs(serviceHub: ServiceHub, request: FxReques
class ForeignExchangeFlow(val tradeId: String,
val baseCurrencyAmount: Amount<Issued<Currency>>,
val quoteCurrencyAmount: Amount<Issued<Currency>>,
val baseCurrencyBuyer: PartyAndCertificate,
val baseCurrencySeller: PartyAndCertificate) : FlowLogic<SecureHash>() {
val baseCurrencyBuyer: Party,
val baseCurrencySeller: Party) : FlowLogic<SecureHash>() {
@Suspendable
override fun call(): SecureHash {
// Select correct sides of the Fx exchange to query for.
@ -208,7 +208,7 @@ class ForeignExchangeFlow(val tradeId: String,
}
@InitiatedBy(ForeignExchangeFlow::class)
class ForeignExchangeRemoteFlow(val source: PartyAndCertificate) : FlowLogic<Unit>() {
class ForeignExchangeRemoteFlow(val source: Party) : FlowLogic<Unit>() {
@Suspendable
override fun call() {
// Initial receive from remote party