Reputation: 42229
I have a scenario where I want to issue several states to the network, but the states have different participants
Example
val state1 = ExampleState(ALICE, BOB)
val state2 = ExampleState(BOB, CHARLIE)
val command = Command(ExampleCommand.Issue(), ...participants?)
val transaction = TransactionBuilder(NOTARY)
.addOutputState(state1, EXAMPLE_CONTRACT_ID)
.addOutputState(state2, EXAMPLE_CONTRACT_ID)
.addCommand(command)
Observations The first state needs to be signed by ALICE and BOB, but the second state needs to be signed by BOB and CHARLIE
Is it possible to perform this kind of transaction; i.e. a single transaction with multiple states, where each state may have different participants?
Upvotes: 1
Views: 532
Reputation: 922
Yes, you shouldn't need to do anything special.
The PublicKeys listed in Commands are usually a subset of the PublicKeys in the participant lists of the states in the transaction.
Bear in mind that the distribution list for the transaction will be the union of all sets of participants in each state.
Upvotes: 1