Update eth-testing #7

Merged
roysc merged 4 commits from update-fixtures into main 2024-07-09 12:02:52 +00:00
4 changed files with 20 additions and 2 deletions
Showing only changes of commit e23243d59d - Show all commits

View File

@ -5,8 +5,11 @@ package statediff
import ( import (
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/cerc-io/eth-testing/chaindata/mainnet"
"github.com/ethereum/go-ethereum/statediff" "github.com/ethereum/go-ethereum/statediff"
sdtypes "github.com/ethereum/go-ethereum/statediff/types" sdtypes "github.com/ethereum/go-ethereum/statediff/types"
) )
@ -27,3 +30,7 @@ func CommitDefaultGenesis(db ethdb.Database) {
func init() { func init() {
log.Root().SetHandler(log.DiscardHandler()) log.Root().SetHandler(log.DiscardHandler())
} }
func GetMainnetBlocks() []*types.Block {
return mainnet.GetBlocks()
}

View File

@ -5,9 +5,11 @@ package statediff
import ( import (
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/triedb" "github.com/ethereum/go-ethereum/triedb"
"github.com/cerc-io/eth-testing/chains/mainnet"
statediff "github.com/cerc-io/plugeth-statediff" statediff "github.com/cerc-io/plugeth-statediff"
"github.com/cerc-io/plugeth-statediff/adapt" "github.com/cerc-io/plugeth-statediff/adapt"
"github.com/cerc-io/plugeth-statediff/test_helpers" "github.com/cerc-io/plugeth-statediff/test_helpers"
@ -27,6 +29,10 @@ func CommitDefaultGenesis(db ethdb.Database) {
core.DefaultGenesisBlock().MustCommit(db, triedb.NewDatabase(db, nil)) core.DefaultGenesisBlock().MustCommit(db, triedb.NewDatabase(db, nil))
} }
func GetMainnetBlocks() []*types.Block {
return mainnet.GetBlocks()
}
func init() { func init() {
test_helpers.QuietLogs() test_helpers.QuietLogs()
} }

View File

@ -5,9 +5,11 @@ package statediff
import ( import (
"github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/triedb" "github.com/ethereum/go-ethereum/triedb"
"github.com/cerc-io/eth-testing/chains/mainnet"
statediff "github.com/cerc-io/plugeth-statediff" statediff "github.com/cerc-io/plugeth-statediff"
"github.com/cerc-io/plugeth-statediff/adapt" "github.com/cerc-io/plugeth-statediff/adapt"
"github.com/cerc-io/plugeth-statediff/test_helpers" "github.com/cerc-io/plugeth-statediff/test_helpers"
@ -32,3 +34,7 @@ func CommitDefaultGenesis(db ethdb.Database) {
func init() { func init() {
test_helpers.QuietLogs() test_helpers.QuietLogs()
} }
func GetMainnetBlocks() []*types.Block {
return mainnet.GetBlocks()
}

View File

@ -14,7 +14,6 @@ import (
"github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/core/vm"
"github.com/cerc-io/eth-statediff-compliance/internal/statediff" "github.com/cerc-io/eth-statediff-compliance/internal/statediff"
"github.com/cerc-io/eth-testing/chains/mainnet"
) )
var ( var (
@ -25,7 +24,7 @@ var (
func loadChain() { func loadChain() {
db := rawdb.NewMemoryDatabase() db := rawdb.NewMemoryDatabase()
statediff.CommitDefaultGenesis(db) statediff.CommitDefaultGenesis(db)
blocks = mainnet.GetBlocks() blocks = statediff.GetMainnetBlocks()
chain, _ = core.NewBlockChain(db, nil, nil, nil, ethash.NewFaker(), vm.Config{}, nil, nil) chain, _ = core.NewBlockChain(db, nil, nil, nil, ethash.NewFaker(), vm.Config{}, nil, nil)
_, err := chain.InsertChain(blocks[1:]) _, err := chain.InsertChain(blocks[1:])
if err != nil { if err != nil {