41 lines
1011 B
Go
41 lines
1011 B
Go
//go:build plugeth_parallel
|
|
|
|
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"
|
|
sdtypes "github.com/cerc-io/plugeth-statediff/types"
|
|
)
|
|
|
|
type Args = statediff.Args
|
|
type Params = statediff.Params
|
|
|
|
type StateObject = sdtypes.StateObject
|
|
|
|
func MakeBuilder(sdb state.Database) statediff.Builder {
|
|
b := statediff.NewBuilder(adapt.GethStateView(sdb))
|
|
b.SetSubtrieWorkers(32)
|
|
return b
|
|
}
|
|
|
|
func CommitDefaultGenesis(db ethdb.Database) {
|
|
core.DefaultGenesisBlock().MustCommit(db, triedb.NewDatabase(db, nil))
|
|
}
|
|
|
|
func init() {
|
|
test_helpers.QuietLogs()
|
|
}
|
|
|
|
func GetMainnetBlocks() []*types.Block {
|
|
return mainnet.GetBlocks()
|
|
}
|