Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions templates/delete_version_boundary.cdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import NodeVersionBeacon from 0xe467b9dd11fa00df

/// Transaction that allows NodeVersionAdmin to delete the
/// version boundary mapping in the versionTable at the specified
/// block height parameter

transaction(blockHeightBoundaryToDelete: UInt64) {

let NodeVersionBeaconAdminRef: &NodeVersionBeacon.Admin

prepare(acct: auth(BorrowValue) &Account) {
// Borrow a reference to the NodeVersionAdmin resource
self.NodeVersionBeaconAdminRef = acct.storage.borrow<&NodeVersionBeacon.Admin>
(from: NodeVersionBeacon.AdminStoragePath)
?? panic("Couldn't borrow NodeVersionBeaconAdmin Resource")
}

execute {
// Delete the version from the version table at the specified block height boundary
self.NodeVersionBeaconAdminRef.deleteVersionBoundary(blockHeight: blockHeightBoundaryToDelete)
}
}