Skip to content

Commit

Permalink
keep deprecatedContract behavior for previously deployed contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
darioush committed Sep 26, 2024
1 parent 311dbd9 commit c4ea40c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
17 changes: 15 additions & 2 deletions core/state_transition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func TestNativeAssetContractCall(t *testing.T) {
makeTx(1, contractAddr, common.Big0, 100_000, big.NewInt(params.LaunchMinGasPrice), nil), // No input data is necessary, since this will hit the contract's fallback function.
}

phase6Tests := map[string]stateTransitionTest{
tests := map[string]stateTransitionTest{
"phase5": {
config: params.TestApricotPhase5Config,
txs: txs,
Expand All @@ -167,10 +167,23 @@ func TestNativeAssetContractCall(t *testing.T) {
gasUsed: []uint64{132091, 21618},
want: "",
},
"durango": {
config: params.TestDurangoChainConfig,
txs: txs,
gasUsed: []uint64{132117, 21618},
want: "",
},
"etna": {
config: params.TestEtnaChainConfig,
txs: txs,
gasUsed: []uint64{132117, 21618},
want: "",
},
}

for name, stTest := range phase6Tests {
for name, stTest := range tests {
t.Run(name, func(t *testing.T) {
stTest.config.SetEthUpgrades()
executeStateTransitionTest(t, stTest)
})
}
Expand Down
3 changes: 3 additions & 0 deletions core/vm/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ var PrecompiledContractsCancun = map[common.Address]contract.StatefulPrecompiled
common.BytesToAddress([]byte{8}): newWrappedPrecompiledContract(&bn256PairingIstanbul{}),
common.BytesToAddress([]byte{9}): newWrappedPrecompiledContract(&blake2F{}),
common.BytesToAddress([]byte{0x0a}): newWrappedPrecompiledContract(&kzgPointEvaluation{}),
genesisContractAddr: &deprecatedContract{},
NativeAssetBalanceAddr: &deprecatedContract{},
NativeAssetCallAddr: &deprecatedContract{},
}

// PrecompiledContractsBLS contains the set of pre-compiled Ethereum
Expand Down

0 comments on commit c4ea40c

Please sign in to comment.