Rename block override field names

This commit is contained in:
Sina Mahmoodi 2023-09-04 12:28:56 +02:00
parent d4e332e268
commit b0e78695f5
2 changed files with 15 additions and 15 deletions

View file

@ -1003,9 +1003,9 @@ type BlockOverrides struct {
Difficulty *hexutil.Big // No-op if we're simulating post-merge calls. Difficulty *hexutil.Big // No-op if we're simulating post-merge calls.
Time *hexutil.Uint64 Time *hexutil.Uint64
GasLimit *hexutil.Uint64 GasLimit *hexutil.Uint64
Coinbase *common.Address FeeRecipient *common.Address
Random *common.Hash PrevRandao *common.Hash
BaseFee *hexutil.Big BaseFeePerGas *hexutil.Big
} }
// Apply overrides the given header fields into the given block context. // Apply overrides the given header fields into the given block context.
@ -1025,14 +1025,14 @@ func (diff *BlockOverrides) Apply(blockCtx *vm.BlockContext) {
if diff.GasLimit != nil { if diff.GasLimit != nil {
blockCtx.GasLimit = uint64(*diff.GasLimit) blockCtx.GasLimit = uint64(*diff.GasLimit)
} }
if diff.Coinbase != nil { if diff.FeeRecipient != nil {
blockCtx.Coinbase = *diff.Coinbase blockCtx.Coinbase = *diff.FeeRecipient
} }
if diff.Random != nil { if diff.PrevRandao != nil {
blockCtx.Random = diff.Random blockCtx.Random = diff.PrevRandao
} }
if diff.BaseFee != nil { if diff.BaseFeePerGas != nil {
blockCtx.BaseFee = diff.BaseFee.ToInt() blockCtx.BaseFee = diff.BaseFeePerGas.ToInt()
} }
} }

View file

@ -849,7 +849,7 @@ func TestMulticallV1(t *testing.T) {
blocks: []CallBatch{{ blocks: []CallBatch{{
BlockOverrides: &BlockOverrides{ BlockOverrides: &BlockOverrides{
Number: (*hexutil.Big)(big.NewInt(11)), Number: (*hexutil.Big)(big.NewInt(11)),
Coinbase: &cac, FeeRecipient: &cac,
}, },
Calls: []TransactionArgs{ Calls: []TransactionArgs{
{ {