Skip to content

Commit

Permalink
make MigrationContractStaging.unstageContract no-op if non-existent
Browse files Browse the repository at this point in the history
  • Loading branch information
sisyphusSmiling committed Jan 29, 2024
1 parent 484ca2b commit 60af686
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contracts/MigrationContractStaging.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,14 @@ access(all) contract MigrationContractStaging {
access(all) fun unstageContract(host: &Host, name: String) {
pre {
self.stagingCutoff == nil || self.stagingCutoff! > getCurrentBlock().height: "Staging period has ended"
self.isStaged(address: host.address(), name: name): "Contract is not staged"
}
post {
!self.isStaged(address: host.address(), name: name): "Contract is still staged"
}
let address: Address = host.address()
if self.stagedContracts[address] == nil {
return
}
let capsuleUUID: UInt64 = self.removeStagedContract(address: address, name: name)
?? panic("Problem destroying update Capsule")
emit StagingStatusUpdated(
Expand Down

0 comments on commit 60af686

Please sign in to comment.