Skip to content

Commit 4a2dd17

Browse files
committed
tests: add excessDataGas to header parser
1 parent ae66830 commit 4a2dd17

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

tests/block_test_util.go

+18-12
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ type btHeader struct {
8989
Timestamp uint64
9090
BaseFeePerGas *big.Int
9191
WithdrawalsRoot *common.Hash
92+
ExcessDataGas *big.Int
9293
}
9394

9495
type btHeaderMarshaling struct {
@@ -99,6 +100,7 @@ type btHeaderMarshaling struct {
99100
GasUsed math.HexOrDecimal64
100101
Timestamp math.HexOrDecimal64
101102
BaseFeePerGas *math.HexOrDecimal256
103+
ExcessDataGas *math.HexOrDecimal256
102104
}
103105

104106
func (t *BlockTest) Run(snapshotter bool) error {
@@ -163,18 +165,19 @@ func (t *BlockTest) Run(snapshotter bool) error {
163165

164166
func (t *BlockTest) genesis(config *params.ChainConfig) *core.Genesis {
165167
return &core.Genesis{
166-
Config: config,
167-
Nonce: t.json.Genesis.Nonce.Uint64(),
168-
Timestamp: t.json.Genesis.Timestamp,
169-
ParentHash: t.json.Genesis.ParentHash,
170-
ExtraData: t.json.Genesis.ExtraData,
171-
GasLimit: t.json.Genesis.GasLimit,
172-
GasUsed: t.json.Genesis.GasUsed,
173-
Difficulty: t.json.Genesis.Difficulty,
174-
Mixhash: t.json.Genesis.MixHash,
175-
Coinbase: t.json.Genesis.Coinbase,
176-
Alloc: t.json.Pre,
177-
BaseFee: t.json.Genesis.BaseFeePerGas,
168+
Config: config,
169+
Nonce: t.json.Genesis.Nonce.Uint64(),
170+
Timestamp: t.json.Genesis.Timestamp,
171+
ParentHash: t.json.Genesis.ParentHash,
172+
ExtraData: t.json.Genesis.ExtraData,
173+
GasLimit: t.json.Genesis.GasLimit,
174+
GasUsed: t.json.Genesis.GasUsed,
175+
Difficulty: t.json.Genesis.Difficulty,
176+
Mixhash: t.json.Genesis.MixHash,
177+
Coinbase: t.json.Genesis.Coinbase,
178+
Alloc: t.json.Pre,
179+
BaseFee: t.json.Genesis.BaseFeePerGas,
180+
ExcessDataGas: t.json.Genesis.ExcessDataGas,
178181
}
179182
}
180183

@@ -283,6 +286,9 @@ func validateHeader(h *btHeader, h2 *types.Header) error {
283286
if !reflect.DeepEqual(h.WithdrawalsRoot, h2.WithdrawalsHash) {
284287
return fmt.Errorf("withdrawalsRoot: want: %v have: %v", h.WithdrawalsRoot, h2.WithdrawalsHash)
285288
}
289+
if !reflect.DeepEqual(h.ExcessDataGas, h2.ExcessDataGas) {
290+
return fmt.Errorf("excessDataGas: want: %v have: %v", h.ExcessDataGas, h2.ExcessDataGas)
291+
}
286292
return nil
287293
}
288294

tests/gen_btheader.go

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)