Created
December 23, 2018 17:57
-
-
Save apemon/9021ba4c70e4d38e551860b38a94381b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@InitiatingFlow | |
@StartableByRPC | |
class ProxyNameIssueFlow(val state: ProxyNameState): FlowLogic<SignedTransaction>() { | |
@Suspendable | |
override fun call(): SignedTransaction { | |
val notary = serviceHub.networkMapCache.notaryIdentities.first() | |
val issueCommand = Command(ProxyNameContract.Commands.Issue(), state.participants.map { it.owningKey }) | |
val builder = TransactionBuilder(notary = notary) | |
builder.addOutputState(state, ProxyNameContract.PROXYNAME_CONTRACT_ID) | |
builder.addCommand(issueCommand) | |
builder.verify(serviceHub) | |
val ptx = serviceHub.signInitialTransaction(builder) | |
val ftx = subFlow(FinalityFlow(ptx)) | |
subFlow(BroadcastTransaction(ftx)) | |
return ftx | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment