Minor: add a warning suppression over an unchecked cast in the upgrade code.

This commit is contained in:
Mike Hearn 2017-02-18 16:09:20 +00:00
parent 036b2597d3
commit 0b33b52d1a

View File

@ -30,6 +30,7 @@ object ContractUpgradeFlow {
val command = commandData.value as UpgradeCommand val command = commandData.value as UpgradeCommand
val participants: Set<CompositeKey> = input.participants.toSet() val participants: Set<CompositeKey> = input.participants.toSet()
val keysThatSigned: Set<CompositeKey> = commandData.signers.toSet() val keysThatSigned: Set<CompositeKey> = commandData.signers.toSet()
@Suppress("UNCHECKED_CAST")
val upgradedContract = command.upgradedContractClass.newInstance() as UpgradedContract<ContractState, *> val upgradedContract = command.upgradedContractClass.newInstance() as UpgradedContract<ContractState, *>
requireThat { requireThat {
"The signing keys include all participant keys" by keysThatSigned.containsAll(participants) "The signing keys include all participant keys" by keysThatSigned.containsAll(participants)