mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
refactor dev genesis
This commit is contained in:
parent
94156da356
commit
53a08f0c13
1 changed files with 4 additions and 5 deletions
|
|
@ -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())
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue