From c60a6a2962c95e4bafd5e295bf1b3332baf2bfd9 Mon Sep 17 00:00:00 2001 From: Giulio rebuffo Date: Fri, 7 Apr 2023 23:09:11 +0200 Subject: [PATCH] return [] instead of null for withdrawals (#7279) --- turbo/adapter/ethapi/api.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/turbo/adapter/ethapi/api.go b/turbo/adapter/ethapi/api.go index 244b1b573c8..c690bd2909c 100644 --- a/turbo/adapter/ethapi/api.go +++ b/turbo/adapter/ethapi/api.go @@ -341,6 +341,11 @@ func RPCMarshalBlockExDeprecated(block *types.Block, inclTx bool, fullTx bool, b fields["withdrawals"] = block.Withdrawals() } + // Ensure that withdrawals is not null at all times. + if fields["withdrawals"] == nil { + fields["withdrawals"] = []*types.Withdrawal{} + } + return fields, nil }