Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions rpc/backend/chain_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,15 @@ func (b *Backend) FeeHistory(
return nil, err
}

// the eth rpc spec requires a hex string to be returned for these values, so if they are nil then default them to 0x0
if oneFeeHistory.BaseFee == nil {
oneFeeHistory.BaseFee = big.NewInt(0)
}

if oneFeeHistory.NextBaseFee == nil {
oneFeeHistory.NextBaseFee = big.NewInt(0)
}

// copy
thisBaseFee[index] = (*hexutil.Big)(oneFeeHistory.BaseFee)
thisBaseFee[index+1] = (*hexutil.Big)(oneFeeHistory.NextBaseFee)
Expand Down