Skip to content

Commit

Permalink
fix current failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshvanahalli committed Sep 21, 2023
1 parent a1f8141 commit fe56a0f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
6 changes: 4 additions & 2 deletions core/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,20 @@ func TestInvalidCliqueConfig(t *testing.T) {
}
}

func newUint64(val uint64) *uint64 { return &val }

func TestSetupGenesis(t *testing.T) {
var (
customghash = common.HexToHash("0x89c99d90b79719238d2645c7642f2c9295246e80775b38cfd162b696817fbd50")
customg = Genesis{
Config: &params.ChainConfig{HomesteadBlock: big.NewInt(3)},
Config: &params.ChainConfig{HomesteadBlock: big.NewInt(3), MaxCodeSize: newUint64(params.MaxCodeSize), MaxInitCodeSize: newUint64(params.MaxInitCodeSize)},
Alloc: GenesisAlloc{
{1}: {Balance: big.NewInt(1), Storage: map[common.Hash]common.Hash{{1}: {1}}},
},
}
oldcustomg = customg
)
oldcustomg.Config = &params.ChainConfig{HomesteadBlock: big.NewInt(2)}
oldcustomg.Config = &params.ChainConfig{HomesteadBlock: big.NewInt(2), MaxCodeSize: newUint64(params.MaxCodeSize), MaxInitCodeSize: newUint64(params.MaxInitCodeSize)}
tests := []struct {
name string
fn func(ethdb.Database) (*params.ChainConfig, common.Hash, error)
Expand Down
6 changes: 6 additions & 0 deletions core/state_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ func TestStateProcessorErrors(t *testing.T) {
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
Ethash: new(params.EthashConfig),
MaxCodeSize: newUint64(params.MaxCodeSize),
MaxInitCodeSize: newUint64(params.MaxInitCodeSize),
}
signer = types.LatestSigner(config)
key1, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")
Expand Down Expand Up @@ -237,6 +239,8 @@ func TestStateProcessorErrors(t *testing.T) {
PetersburgBlock: big.NewInt(0),
IstanbulBlock: big.NewInt(0),
MuirGlacierBlock: big.NewInt(0),
MaxCodeSize: newUint64(params.MaxCodeSize),
MaxInitCodeSize: newUint64(params.MaxInitCodeSize),
},
Alloc: GenesisAlloc{
common.HexToAddress("0x71562b71999873DB5b286dF957af199Ec94617F7"): GenesisAccount{
Expand Down Expand Up @@ -333,6 +337,8 @@ func TestStateProcessorErrors(t *testing.T) {
TerminalTotalDifficulty: big.NewInt(0),
TerminalTotalDifficultyPassed: true,
ShanghaiTime: u64(0),
MaxCodeSize: newUint64(params.MaxCodeSize),
MaxInitCodeSize: newUint64(params.MaxInitCodeSize),
},
Alloc: GenesisAlloc{
common.HexToAddress("0x71562b71999873DB5b286dF957af199Ec94617F7"): GenesisAccount{
Expand Down
8 changes: 5 additions & 3 deletions core/vm/runtime/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,9 @@ func TestRuntimeJSTracer(t *testing.T) {
t.Fatal(err)
}
_, _, err = Call(main, nil, &Config{
GasLimit: 1000000,
State: statedb,
ChainConfig: params.TestChainConfig,
GasLimit: 1000000,
State: statedb,
EVMConfig: vm.Config{
Tracer: tracer,
}})
Expand Down Expand Up @@ -866,7 +867,8 @@ func TestJSTracerCreateTx(t *testing.T) {
t.Fatal(err)
}
_, _, _, err = Create(code, &Config{
State: statedb,
ChainConfig: params.TestChainConfig,
State: statedb,
EVMConfig: vm.Config{
Tracer: tracer,
}})
Expand Down
6 changes: 6 additions & 0 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ var (
Ethash: new(EthashConfig),
Clique: nil,
ArbitrumChainParams: DisableArbitrumParams(),
MaxCodeSize: newUint64(MaxCodeSize),
MaxInitCodeSize: newUint64(MaxInitCodeSize),
}

// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
Expand Down Expand Up @@ -187,6 +189,8 @@ var (
Ethash: nil,
Clique: &CliqueConfig{Period: 0, Epoch: 30000},
ArbitrumChainParams: DisableArbitrumParams(),
MaxCodeSize: newUint64(MaxCodeSize),
MaxInitCodeSize: newUint64(MaxInitCodeSize),
}

// TestChainConfig contains every protocol change (EIPs) introduced
Expand Down Expand Up @@ -217,6 +221,8 @@ var (
Ethash: new(EthashConfig),
Clique: nil,
ArbitrumChainParams: DisableArbitrumParams(),
MaxCodeSize: newUint64(MaxCodeSize),
MaxInitCodeSize: newUint64(MaxInitCodeSize),
}

// NonActivatedConfig defines the chain configuration without activating
Expand Down

0 comments on commit fe56a0f

Please sign in to comment.