Skip to content

Commit 30cb755

Browse files
committed
update test config for most tests to not deploy the bridge
1 parent 4921c30 commit 30cb755

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

engine/execution/state/bootstrap/bootstrap_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func TestBootstrapLedger(t *testing.T) {
5353
}
5454

5555
func TestBootstrapLedger_ZeroTokenSupply(t *testing.T) {
56-
expectedStateCommitmentBytes, _ := hex.DecodeString("27e23bc91b53d9b3b20af6e23ef506009715798ea32cae78157d84840e8747f5")
56+
expectedStateCommitmentBytes, _ := hex.DecodeString("ac2eaefb594337486722fd11a64fc465038790822b646ddd8264c4a8595c9a61")
5757
expectedStateCommitment, err := flow.ToStateCommitment(expectedStateCommitmentBytes)
5858
require.NoError(t, err)
5959

fvm/bootstrap.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ type BootstrapParams struct {
8787
storagePerFlow cadence.UFix64
8888
restrictedAccountCreationEnabled cadence.Bool
8989
setupEVMEnabled cadence.Bool
90+
setupVMBridgeEnabled cadence.Bool
9091

9192
// versionFreezePeriod is the number of blocks in the future where the version
9293
// changes are frozen. The Node version beacon manages the freeze period,
@@ -229,6 +230,13 @@ func WithSetupEVMEnabled(enabled cadence.Bool) BootstrapProcedureOption {
229230
}
230231
}
231232

233+
func WithSetupVMBridgeEnabled(enabled cadence.Bool) BootstrapProcedureOption {
234+
return func(bp *BootstrapProcedure) *BootstrapProcedure {
235+
bp.setupVMBridgeEnabled = enabled
236+
return bp
237+
}
238+
}
239+
232240
func WithRestrictedContractDeployment(restricted *bool) BootstrapProcedureOption {
233241
return func(bp *BootstrapProcedure) *BootstrapProcedure {
234242
bp.restrictedContractDeployment = restricted
@@ -583,7 +591,7 @@ func (b *bootstrapExecutor) deployMetadataViews(fungibleToken, nonFungibleToken
583591
}
584592

585593
func (b *bootstrapExecutor) deployCrossVMMetadataViews(nonFungibleToken flow.Address, env *templates.Environment) {
586-
if bool(b.setupEVMEnabled) && b.ctx.Chain.ChainID().Transient() {
594+
if bool(b.setupEVMEnabled) && bool(b.setupVMBridgeEnabled) && b.ctx.Chain.ChainID().Transient() {
587595
crossVMMVContract := contracts.CrossVMMetadataViews(*env)
588596

589597
txError, err := b.invokeMetaTransaction(
@@ -1009,7 +1017,7 @@ func (stubEntropyProvider) RandomSource() ([]byte, error) {
10091017
func (b *bootstrapExecutor) setupVMBridge(serviceAddress flow.Address, env *templates.Environment) {
10101018
// only setup VM bridge for transient networks
10111019
// this is because the evm storage account for testnet and mainnet do not exist yet after boostrapping
1012-
if bool(b.setupEVMEnabled) && b.ctx.Chain.ChainID().Transient() {
1020+
if bool(b.setupEVMEnabled) && bool(b.setupVMBridgeEnabled) && b.ctx.Chain.ChainID().Transient() {
10131021

10141022
bridgeEnv := bridge.Environment{
10151023
CrossVMNFTAddress: env.ServiceAccountAddress,

fvm/fvm_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3131,7 +3131,7 @@ func TestVMBridge(t *testing.T) {
31313131
}
31323132

31333133
t.Run("successful FT Type Onboarding and Bridging", newVMTest().
3134-
withBootstrapProcedureOptions(fvm.WithSetupEVMEnabled(true)).
3134+
withBootstrapProcedureOptions(fvm.WithSetupEVMEnabled(true), fvm.WithSetupVMBridgeEnabled(true)).
31353135
withContextOptions(ctxOpts...).
31363136
run(func(
31373137
t *testing.T,
@@ -3356,7 +3356,7 @@ func TestVMBridge(t *testing.T) {
33563356
)
33573357

33583358
t.Run("successful NFT Type Onboarding and Bridging", newVMTest().
3359-
withBootstrapProcedureOptions(fvm.WithSetupEVMEnabled(true)).
3359+
withBootstrapProcedureOptions(fvm.WithSetupEVMEnabled(true), fvm.WithSetupVMBridgeEnabled(true)).
33603360
withContextOptions(ctxOpts...).
33613361
run(func(
33623362
t *testing.T,

utils/unittest/execution_state.go

+3-3
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 = "605fb9f25b76ba9e194feeb967b5d4a9cfbadba5249a57b2e4cecf536cf2a7cd"
26+
const GenesisStateCommitmentHex = "a0eb770539abfbdf2d6d4af1c45b3ccd469334f40db427040ab04b7c26346c46"
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 "daa9705ebb9778ede626afc4863cd09549e575d0faf8661efaedf91473b1553f"
90+
return "1140a7b30156dd7db2d877276dfe9c5cd4bff19a0cae3fc41b0a764fda41693e"
9191
}
9292
if chainID == flow.Sandboxnet {
9393
return "e1c08b17f9e5896f03fe28dd37ca396c19b26628161506924fbf785834646ea1"
9494
}
95-
return "3bb8b7c2866ae153302dae44342a835ea8a5b4919f4a1bc7d0be47f8416235c2"
95+
return "9b6b11cf152a9db180b9ea26e6ea5ea6de0e404edfa8e886546e28feea6f9dac"
9696
}

0 commit comments

Comments
 (0)