mirror of
https://github.com/corda/corda.git
synced 2025-06-22 00:57:21 +00:00
Replaces keys and parties in states with AbstractParty
Switch to using AbstractParty as the standard identifier for parties in states, so that full parties can be used during construction of transactions and anonymised parties when the transaction is being added to the ledger.
This commit is contained in:
@ -79,7 +79,7 @@ class TransactionDSL<out T : TransactionDSLInterpreter>(val interpreter: T) : Tr
|
||||
val transaction = ledgerInterpreter._unverifiedTransaction(null, TransactionBuilder(notary = DUMMY_NOTARY)) {
|
||||
output { state }
|
||||
// Add a dummy randomised output so that the transaction id differs when issuing the same state multiple times
|
||||
val nonceState = DummyContract.SingleOwnerState(Random().nextInt(), DUMMY_NOTARY.owningKey)
|
||||
val nonceState = DummyContract.SingleOwnerState(Random().nextInt(), DUMMY_NOTARY)
|
||||
output { nonceState }
|
||||
}
|
||||
input(transaction.outRef<ContractState>(0).ref)
|
||||
|
@ -4,6 +4,7 @@ import net.corda.core.contracts.Attachment
|
||||
import net.corda.core.contracts.PartyAndReference
|
||||
import net.corda.core.crypto.*
|
||||
import net.corda.core.flows.StateMachineRunId
|
||||
import net.corda.core.identity.AbstractParty
|
||||
import net.corda.core.identity.AnonymousParty
|
||||
import net.corda.core.identity.Party
|
||||
import net.corda.core.messaging.SingleMessageRecipient
|
||||
@ -28,7 +29,6 @@ import java.io.ByteArrayInputStream
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.File
|
||||
import java.io.InputStream
|
||||
import java.nio.file.Path
|
||||
import java.nio.file.Paths
|
||||
import java.security.KeyPair
|
||||
import java.security.PrivateKey
|
||||
@ -90,7 +90,7 @@ class MockIdentityService(val identities: List<Party>,
|
||||
}
|
||||
|
||||
override fun getAllIdentities(): Iterable<Party> = ArrayList(keyToParties.values)
|
||||
override fun partyFromAnonymous(party: AnonymousParty): Party? = keyToParties[party.owningKey]
|
||||
override fun partyFromAnonymous(party: AbstractParty): Party? = keyToParties[party.owningKey]
|
||||
override fun partyFromAnonymous(partyRef: PartyAndReference): Party? = partyFromAnonymous(partyRef.party)
|
||||
override fun partyFromKey(key: PublicKey): Party? = keyToParties[key]
|
||||
override fun partyFromName(name: String): Party? = nameToParties[X500Name(name)]
|
||||
|
Reference in New Issue
Block a user