move fixture module to reexports

This commit is contained in:
Roy Crihfield 2024-07-09 19:20:14 +08:00
parent efa2b5cdc5
commit e23243d59d
4 changed files with 20 additions and 2 deletions

View File

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

View File

@ -5,9 +5,11 @@ package statediff
import (
"github.com/ethereum/go-ethereum/core"
"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/triedb"
"github.com/cerc-io/eth-testing/chains/mainnet"
statediff "github.com/cerc-io/plugeth-statediff"
"github.com/cerc-io/plugeth-statediff/adapt"
"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))
}
func GetMainnetBlocks() []*types.Block {
return mainnet.GetBlocks()
}
func init() {
test_helpers.QuietLogs()
}

View File

@ -5,9 +5,11 @@ package statediff
import (
"github.com/ethereum/go-ethereum/core"
"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/triedb"
"github.com/cerc-io/eth-testing/chains/mainnet"
statediff "github.com/cerc-io/plugeth-statediff"
"github.com/cerc-io/plugeth-statediff/adapt"
"github.com/cerc-io/plugeth-statediff/test_helpers"
@ -32,3 +34,7 @@ func CommitDefaultGenesis(db ethdb.Database) {
func init() {
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/cerc-io/eth-statediff-compliance/internal/statediff"
"github.com/cerc-io/eth-testing/chains/mainnet"
)
var (
@ -25,7 +24,7 @@ var (
func loadChain() {
db := rawdb.NewMemoryDatabase()
statediff.CommitDefaultGenesis(db)
blocks = mainnet.GetBlocks()
blocks = statediff.GetMainnetBlocks()
chain, _ = core.NewBlockChain(db, nil, nil, nil, ethash.NewFaker(), vm.Config{}, nil, nil)
_, err := chain.InsertChain(blocks[1:])
if err != nil {