-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all existing epoch recovery tests passing
- Loading branch information
1 parent
22e91d8
commit 2ed3a2e
Showing
4 changed files
with
90 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import FlowIDTableStaking from "FlowIDTableStaking" | ||
import FlowEpoch from "FlowEpoch" | ||
import FlowClusterQC from "FlowClusterQC" | ||
|
||
// This transaction invokes recoverNewEpoch without the safety checks that exist in the | ||
// production version of the transaction. Used for testing only. | ||
transaction(recoveryEpochCounter: UInt64, | ||
startView: UInt64, | ||
stakingEndView: UInt64, | ||
endView: UInt64, | ||
targetDuration: UInt64, | ||
targetEndTime: UInt64, | ||
clusterAssignments: [[String]], | ||
clusterQCVoteData: [FlowClusterQC.ClusterQCVoteData], | ||
dkgPubKeys: [String], | ||
dkgGroupKey: String, | ||
dkgIdMapping: {String: Int}, | ||
nodeIDs: [String], | ||
unsafeAllowOverwrite: Bool) { | ||
|
||
prepare(signer: auth(BorrowValue) &Account) { | ||
let epochAdmin = signer.storage.borrow<&FlowEpoch.Admin>(from: FlowEpoch.adminStoragePath) | ||
?? panic("Could not borrow epoch admin from storage path") | ||
|
||
epochAdmin.recoverNewEpoch( | ||
recoveryEpochCounter: recoveryEpochCounter, | ||
startView: startView, | ||
stakingEndView: stakingEndView, | ||
endView: endView, | ||
targetDuration: targetDuration, | ||
targetEndTime: targetEndTime, | ||
clusterAssignments: clusterAssignments, | ||
clusterQCVoteData: clusterQCVoteData, | ||
dkgPubKeys: dkgPubKeys, | ||
dkgGroupKey: dkgGroupKey, | ||
dkgIdMapping: dkgIdMapping, | ||
nodeIDs: nodeIDs | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package static | ||
|
||
import ( | ||
_ "embed" | ||
) | ||
|
||
// RecoverNewEpochUnchecked is a transaction script that invokes recoverNewEpoch without any safety checks. | ||
// | ||
//go:embed "recover_new_epoch_unchecked.cdc" | ||
var RecoverNewEpochUnchecked string |