Skip to content

Commit ae50cb4

Browse files
authored
Merge pull request #8145 from onflow/josh/deploy-scheduler-before-staking-collection
Deploy LockedTokens and StakingCollection after scheduled transactions
2 parents 50ea7e4 + 189aa63 commit ae50cb4

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

engine/execution/state/bootstrap/bootstrap_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestBootstrapLedger(t *testing.T) {
5757
}
5858

5959
func TestBootstrapLedger_ZeroTokenSupply(t *testing.T) {
60-
expectedStateCommitmentBytes, _ := hex.DecodeString("25d43f1c2183d7f60ca58dcaa6ea44546c8ca089a79dc21759bf64fa58919269")
60+
expectedStateCommitmentBytes, _ := hex.DecodeString("2a5475ed7fb1a4f76b1aa1c592dfebe913d9b441cc9102fe3870a2a3c9329d87")
6161
expectedStateCommitment, err := flow.ToStateCommitment(expectedStateCommitmentBytes)
6262
require.NoError(t, err)
6363

@@ -104,7 +104,7 @@ func TestBootstrapLedger_ZeroTokenSupply(t *testing.T) {
104104
// - transaction fee deduction
105105
// This tests that the state commitment has not changed for the bookkeeping parts of the transaction.
106106
func TestBootstrapLedger_EmptyTransaction(t *testing.T) {
107-
expectedStateCommitmentBytes, _ := hex.DecodeString("7066b254876bc873c682a46199010837149ecae1415871074d0a592385aea1f6")
107+
expectedStateCommitmentBytes, _ := hex.DecodeString("3932e2b94bc248ce6f50defe435e5cdbdb7c572fd44eb39d954b37c2aa5a2720")
108108
expectedStateCommitment, err := flow.ToStateCommitment(expectedStateCommitmentBytes)
109109
require.NoError(t, err)
110110

fvm/bootstrap.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -453,15 +453,6 @@ func (b *bootstrapExecutor) Execute() error {
453453

454454
b.deployRandomBeaconHistory(service, &env)
455455

456-
// deploy staking proxy contract to the service account
457-
b.deployStakingProxyContract(service, &env)
458-
459-
// deploy locked tokens contract to the service account
460-
b.deployLockedTokensContract(service, &env)
461-
462-
// deploy staking collection contract to the service account
463-
b.deployStakingCollection(service, &env)
464-
465456
// sets up the EVM environment
466457
b.setupEVM(service, nonFungibleToken, fungibleToken, flowToken, &env)
467458
b.setupVMBridge(service, &env)
@@ -481,6 +472,15 @@ func (b *bootstrapExecutor) Execute() error {
481472
return err
482473
}
483474

475+
// deploy staking proxy contract to the service account
476+
b.deployStakingProxyContract(service, &env)
477+
478+
// deploy locked tokens contract to the service account
479+
b.deployLockedTokensContract(service, &env)
480+
481+
// deploy staking collection contract to the service account
482+
b.deployStakingCollection(service, &env)
483+
484484
b.registerNodes(service, fungibleToken, flowToken)
485485

486486
// set the list of nodes which are allowed to stake in this network

utils/unittest/execution_state.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const ServiceAccountPrivateKeySignAlgo = crypto.ECDSAP256
2323
const ServiceAccountPrivateKeyHashAlgo = hash.SHA2_256
2424

2525
// Pre-calculated state commitment with root account with the above private key
26-
const GenesisStateCommitmentHex = "a06a77174c21f4661c2ff607654bad3b7fddf492b441113156c12284bcec098c"
26+
const GenesisStateCommitmentHex = "78d704954cb4c058e98defc406d8979613d14c33afa462fa86f5805692cc71a0"
2727

2828
var GenesisStateCommitment flow.StateCommitment
2929

@@ -87,10 +87,10 @@ func genesisCommitHexByChainID(chainID flow.ChainID) string {
8787
return GenesisStateCommitmentHex
8888
}
8989
if chainID == flow.Testnet {
90-
return "f0d013957e65454205d87ef22f67e623951a2c6472444018bbb5c6282bc14bd7"
90+
return "b785b3d48e9af817deddd18020c47291c1c583efab5adf0c6b102850b95ca8e6"
9191
}
9292
if chainID == flow.Sandboxnet {
9393
return "e1c08b17f9e5896f03fe28dd37ca396c19b26628161506924fbf785834646ea1"
9494
}
95-
return "dc282dbef22d2127281094f8aaa2ce827431f0f4f0df0520e776b58e6ec06b17"
95+
return "c43c9654c5ff3db601373d68243c4bca79303c75ce89ae8c4d3866615800a23a"
9696
}

0 commit comments

Comments
 (0)