From 3daabda23fe0e0a88b3cdfc9a17f61f789888cf9 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Fri, 29 Mar 2024 13:36:45 +0100 Subject: [PATCH] add empty withdrawals obj --- internal/ethapi/simulate.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/internal/ethapi/simulate.go b/internal/ethapi/simulate.go index 297d7d0513..cb5e3529ab 100644 --- a/internal/ethapi/simulate.go +++ b/internal/ethapi/simulate.go @@ -53,15 +53,16 @@ type simBlock struct { } type simBlockResult struct { - Number hexutil.Uint64 `json:"number"` - Hash common.Hash `json:"hash"` - Time hexutil.Uint64 `json:"timestamp"` - GasLimit hexutil.Uint64 `json:"gasLimit"` - GasUsed hexutil.Uint64 `json:"gasUsed"` - FeeRecipient common.Address `json:"feeRecipient"` - BaseFee *hexutil.Big `json:"baseFeePerGas"` - PrevRandao common.Hash `json:"prevRandao"` - Calls []simCallResult `json:"calls"` + Number hexutil.Uint64 `json:"number"` + Hash common.Hash `json:"hash"` + Time hexutil.Uint64 `json:"timestamp"` + GasLimit hexutil.Uint64 `json:"gasLimit"` + GasUsed hexutil.Uint64 `json:"gasUsed"` + FeeRecipient common.Address `json:"feeRecipient"` + BaseFee *hexutil.Big `json:"baseFeePerGas"` + PrevRandao common.Hash `json:"prevRandao"` + Withdrawals types.Withdrawals `json:"withdrawals"` + Calls []simCallResult `json:"calls"` } func simBlockResultFromHeader(header *types.Header, callResults []simCallResult) simBlockResult { @@ -74,7 +75,9 @@ func simBlockResultFromHeader(header *types.Header, callResults []simCallResult) FeeRecipient: header.Coinbase, BaseFee: (*hexutil.Big)(header.BaseFee), PrevRandao: header.MixDigest, - Calls: callResults, + // Withdrawals will be always empty in the context of a simulated block. + Withdrawals: make(types.Withdrawals, 0), + Calls: callResults, } }