Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IOUState:
- @BelongsToContract(IOUContract::class)
- data class IOUState(val value: Int,
- val lender: Party,
- val borrower: Party,
- val thirdParty: Party,
- override val linearId: UniqueIdentifier = UniqueIdentifier()):
- LinearState, QueryableState {
- /** The public keys of the involved parties. */
- //override val participants: MutableList<AbstractParty> get() = mutableListOf(lender, borrower)
- override val participants = mutableListOf(lender, borrower)
- ExampleFlow:
- var iouState = IOUState(iouValue, serviceHub.myInfo.legalIdentities.first(), otherParty, thirdParty)
- iouState.participants.add(thirdParty)
- val txCommand = Command(IOUContract.Commands.Create(), iouState.participants.map { it.owningKey })
- val counterparties = iouState.participants.map { it as Party }.filter { it.owningKey != ourIdentity.owningKey }.toSet()
- counterparties.forEach { p -> flowSessions.add(initiateFlow(p))}
- val fullySignedTx = subFlow(CollectSignaturesFlow(partSignedTx, flowSessions, GATHERING_SIGS.childProgressTracker()))
- // Stage 5.
- progressTracker.currentStep = FINALISING_TRANSACTION
- // Notarise and record the transaction in both parties' vaults.
- return subFlow(FinalityFlow(fullySignedTx, flowSessions, FINALISING_TRANSACTION.childProgressTracker()))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement