From b0e78695f509e1e6fe002b55978890f059ec5f67 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Mon, 4 Sep 2023 12:28:56 +0200 Subject: [PATCH] Rename block override field names --- internal/ethapi/api.go | 26 +++++++++++++------------- internal/ethapi/api_test.go | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 8676ed6f4c..e1a5fdec00 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -999,13 +999,13 @@ func (diff *StateOverride) ApplyMulticall(state *state.StateDB, precompiles vm.P // BlockOverrides is a set of header fields to override. type BlockOverrides struct { - Number *hexutil.Big - Difficulty *hexutil.Big // No-op if we're simulating post-merge calls. - Time *hexutil.Uint64 - GasLimit *hexutil.Uint64 - Coinbase *common.Address - Random *common.Hash - BaseFee *hexutil.Big + Number *hexutil.Big + Difficulty *hexutil.Big // No-op if we're simulating post-merge calls. + Time *hexutil.Uint64 + GasLimit *hexutil.Uint64 + FeeRecipient *common.Address + PrevRandao *common.Hash + BaseFeePerGas *hexutil.Big } // 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 { blockCtx.GasLimit = uint64(*diff.GasLimit) } - if diff.Coinbase != nil { - blockCtx.Coinbase = *diff.Coinbase + if diff.FeeRecipient != nil { + blockCtx.Coinbase = *diff.FeeRecipient } - if diff.Random != nil { - blockCtx.Random = diff.Random + if diff.PrevRandao != nil { + blockCtx.Random = diff.PrevRandao } - if diff.BaseFee != nil { - blockCtx.BaseFee = diff.BaseFee.ToInt() + if diff.BaseFeePerGas != nil { + blockCtx.BaseFee = diff.BaseFeePerGas.ToInt() } } diff --git a/internal/ethapi/api_test.go b/internal/ethapi/api_test.go index 01afa58856..42a3a1f2ca 100644 --- a/internal/ethapi/api_test.go +++ b/internal/ethapi/api_test.go @@ -848,8 +848,8 @@ func TestMulticallV1(t *testing.T) { tag: latest, blocks: []CallBatch{{ BlockOverrides: &BlockOverrides{ - Number: (*hexutil.Big)(big.NewInt(11)), - Coinbase: &cac, + Number: (*hexutil.Big)(big.NewInt(11)), + FeeRecipient: &cac, }, Calls: []TransactionArgs{ {