refactor dev genesis

This commit is contained in:
Dror Tirosh 2024-06-05 14:46:44 +03:00
parent 94156da356
commit 53a08f0c13

View file

@ -39,10 +39,7 @@ type testContextBuilder struct {
func newTestContextBuilder(t *testing.T) *testContextBuilder { func newTestContextBuilder(t *testing.T) *testContextBuilder {
genesisAlloc := types.GenesisAlloc{} genesisAlloc := types.GenesisAlloc{}
chainConfig := params.AllDevChainProtocolChanges chainConfig := params.AllDevChainProtocolChanges
// probably bug in geth..
chainConfig.PragueTime = chainConfig.CancunTime
return &testContextBuilder{ return &testContextBuilder{
t: t, t: t,
@ -53,9 +50,11 @@ func newTestContextBuilder(t *testing.T) *testContextBuilder {
func (tb *testContextBuilder) build() *testContext { func (tb *testContextBuilder) build() *testContext {
genesis := &core.Genesis{ genesis := &core.Genesis{
Config: params.AllDevChainProtocolChanges, Config: tb.chainConfig,
Alloc: tb.genesisAlloc, Alloc: tb.genesisAlloc,
Difficulty: big.NewInt(0),
} }
genesis = core.DeveloperGenesisBlock(10_000_000, &common.Address{})
genesisBlock := genesis.ToBlock() genesisBlock := genesis.ToBlock()
gaspool := new(core.GasPool).AddGas(genesisBlock.GasLimit()) gaspool := new(core.GasPool).AddGas(genesisBlock.GasLimit())