Skip to content

Commit

Permalink
tests: discard precompiled contract slot for Miko fork
Browse files Browse the repository at this point in the history
  • Loading branch information
chiphamskymavis committed Jan 7, 2025
1 parent 04ee133 commit c65920b
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"reflect"
"testing"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/eth/tracers/logger"

"github.com/ethereum/go-ethereum/core/rawdb"
Expand All @@ -31,10 +32,21 @@ import (
"github.com/ethereum/go-ethereum/core/vm"
)

// discard the proof of possession precompiled contract
func resetPrecompiledContracts() {
addrProofOfPossession := common.BytesToAddress([]byte{106})
delete(vm.PrecompiledContractsConsortiumMiko, addrProofOfPossession)
delete(vm.PrecompiledContractsBerlin, addrProofOfPossession)
delete(vm.PrecompiledContractsCancun, addrProofOfPossession)
}

func TestState(t *testing.T) {
resetPrecompiledContracts()

t.Parallel()

st := new(testMatcher)

// Long tests:
st.slow(`^stAttackTest/ContractCreationSpam`)
st.slow(`^stBadOpcode/badOpcodes`)
Expand All @@ -53,9 +65,9 @@ func TestState(t *testing.T) {
st.skipLoad(`^stStaticCall/static_Call1MB`)

// Broken tests:
// Expected failures:
st.skipLoad(`^stPreCompiledContracts`) // Ronin contract are not match with Ethereum

// Expected failures:
//st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Byzantium/0`, "bug in test")
//st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Byzantium/3`, "bug in test")
//st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Constantinople/0`, "bug in test")
Expand All @@ -82,6 +94,7 @@ func TestState(t *testing.T) {
return result
})
})

t.Run(key+"/hash/snap", func(t *testing.T) {
withTrace(t, test.gasLimit(subtest), func(vmconfig vm.Config) error {
var result error
Expand Down

0 comments on commit c65920b

Please sign in to comment.