Matthew Layton
Matthew Layton

Reputation: 42390

Corda - Explicit Contract Upgrades

R3's official Corda documentation states that...

Bank B initiates the upgrade flow, which will send an upgrade proposal to all contract participants. Each of the participants of the contract state will sign and return the contract state upgrade proposal once they have validated and agreed with the upgrade. The upgraded transaction will be recorded in every participant’s node by the flow.

val rpcClient : CordaRPCClient = << Bank B's Corda RPC Client >>
val rpcB = rpcClient.proxy()
rpcB.startFlow({ stateAndRef, upgrade -> ContractUpgradeFlow(stateAndRef, upgrade) },
    <<StateAndRef of the contract state>>,
    DummyContractV2::class.java)

After executing the ContractUpgradeFlow should I expect to see a consumed V1 state and a newly created V2 state?

Upvotes: 0

Views: 66

Answers (1)

tudor
tudor

Reputation: 131

After executing the ContractUpgradeFlow should I expect to see a consumed V1 state and a newly created V2 state?

Yes, that is correct.

Upvotes: 2

Related Questions