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.
Time *hexutil.Uint64
GasLimit *hexutil.Uint64
Coinbase *common.Address
Random *common.Hash
BaseFee *hexutil.Big
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()
}
}

View file

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