Skip to content

Instantly share code, notes, and snippets.

@amolpednekar
Created January 8, 2019 04:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amolpednekar/bc9cf47fa9ef9ed2deaf4c9f18a4dca8 to your computer and use it in GitHub Desktop.
Save amolpednekar/bc9cf47fa9ef9ed2deaf4c9f18a4dca8 to your computer and use it in GitHub Desktop.
// Initiate the upgrade of all the State instances using OldContract.
partyAProxy.vaultQuery(OldState::class.java).states
.filter { stateAndRef ->
stateAndRef.state.contract.equals(OldContract.id)
}
.forEach { stateAndRef ->
partyAProxy.startFlowDynamic(
ContractUpgradeFlow.Initiate::class.java,
stateAndRef,
NewContractAndState::class.java)
}
// Give the node the time to run the contract upgrade flows.
Thread.sleep(10000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment