A temporary fix for contract upgrade transactions:

during LedgerTransaction verification run the right logic based on whether
it contains the UpgradeCommand.

Move ContractUpgradeFlowTest away from createSomeNodes()

Remove assembleBareTx as it's not used
This commit is contained in:
Andrius Dagys
2017-09-27 17:43:30 +01:00
parent c0dd8d338e
commit f8a43a8331
9 changed files with 44 additions and 68 deletions

View File

@ -2,7 +2,6 @@ package net.corda.node.services
import co.paralleluniverse.fibers.Suspendable
import net.corda.core.contracts.ContractState
import net.corda.core.contracts.UpgradeCommand
import net.corda.core.contracts.UpgradedContract
import net.corda.core.contracts.requireThat
import net.corda.core.flows.*
@ -64,9 +63,6 @@ class ContractUpgradeHandler(otherSide: FlowSession) : AbstractStateReplacementF
"The proposed upgrade ${proposal.modification.javaClass} is a trusted upgrade path" using (proposal.modification.name == authorisedUpgrade)
"The proposed tx matches the expected tx for this upgrade" using (proposedTx == expectedTx)
}
ContractUpgradeFlow.verify(
oldStateAndRef.state,
expectedTx.outRef<ContractState>(0).state,
expectedTx.toLedgerTransaction(serviceHub).commandsOfType<UpgradeCommand>().single())
proposedTx.toLedgerTransaction(serviceHub).verify()
}
}