Skip to content

Commit

Permalink
Merge pull request ethereum#100 from mdehoog/eip4844-tests
Browse files Browse the repository at this point in the history
Fix syntax errors in tests
  • Loading branch information
Inphi authored Feb 7, 2023
2 parents 83bc851 + d3ef900 commit 8444ecf
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
3 changes: 2 additions & 1 deletion core/txpool/txpool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ func init() {
eip1559Config = &cpy
eip1559Config.BerlinBlock = common.Big0
eip1559Config.LondonBlock = common.Big0
eip1559Config.ShardingForkTime = common.Big0 // for blob tx tests
var zeroTime uint64
eip1559Config.ShardingForkTime = &zeroTime // for blob tx tests
}

type testBlockChain struct {
Expand Down
2 changes: 1 addition & 1 deletion core/vm/gas_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func TestEIP2200(t *testing.T) {
statedb.Finalise(true) // Push the state into the "original" slot

vmctx := BlockContext{
Time: big.NewInt(0),
Time: 0,
CanTransfer: func(StateDB, common.Address, *big.Int) bool { return true },
Transfer: func(StateDB, common.Address, common.Address, *big.Int) {},
}
Expand Down
4 changes: 2 additions & 2 deletions core/vm/instructions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var alphabetSoup = "ABCDEF090807060504030201ffffffffffffffffffffffffffffffffffff
var commonParams []*twoOperandParams
var twoOpMethods map[string]executionFunc
var emptyContext BlockContext = BlockContext{
Time: big.NewInt(0),
Time: 0,
}

type contractRef struct {
Expand Down Expand Up @@ -729,7 +729,7 @@ func TestRandom(t *testing.T) {
{name: "hash(0x010203)", random: crypto.Keccak256Hash([]byte{0x01, 0x02, 0x03})},
} {
var (
env = NewEVM(BlockContext{Random: &tt.random, Time: big.NewInt(0)}, TxContext{}, nil, params.TestChainConfig, Config{})
env = NewEVM(BlockContext{Random: &tt.random, Time: 0}, TxContext{}, nil, params.TestChainConfig, Config{})
stack = newstack()
pc = uint64(0)
evmInterpreter = env.interpreter
Expand Down
2 changes: 1 addition & 1 deletion core/vm/interpreter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var loopInterruptTests = []string{
func TestLoopInterrupt(t *testing.T) {
address := common.BytesToAddress([]byte("contract"))
vmctx := BlockContext{
Time: big.NewInt(0),
Time: 0,
Transfer: func(StateDB, common.Address, common.Address, *big.Int) {},
}

Expand Down
4 changes: 2 additions & 2 deletions eth/catalyst/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1440,8 +1440,8 @@ func TestEIP4844(t *testing.T) {
if ep.ExcessDataGas == nil {
t.Fatal("got nil ExcessDataGas")
}
if len(ep.Transactions) != 1 {
t.Fatal("unexpected transactions")
if len(ep.Transactions) != 0 {
t.Fatal("expected zero transactions")
}

if status, err := api.NewPayloadV3(*ep); err != nil {
Expand Down
6 changes: 4 additions & 2 deletions tests/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (

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

var zeroTime uint64

// Forks table defines supported forks and their chain config.
var Forks = map[string]*params.ChainConfig{
"Frontier": {
Expand Down Expand Up @@ -284,8 +286,8 @@ var Forks = map[string]*params.ChainConfig{
ArrowGlacierBlock: big.NewInt(0),
MergeNetsplitBlock: big.NewInt(0),
TerminalTotalDifficulty: big.NewInt(0),
ShanghaiTime: big.NewInt(0),
ShardingForkTime: big.NewInt(0),
ShanghaiTime: &zeroTime,
ShardingForkTime: &zeroTime,
},
}

Expand Down

0 comments on commit 8444ecf

Please sign in to comment.