Skip to content

Commit

Permalink
internal/ethapi: don't omit empty txes, uncles from getBlock responses
Browse files Browse the repository at this point in the history
This should return an empty array when empty.

Resolves #332

Date: 2021-03-12 07:47:43-06:00
Signed-off-by: meows <[email protected]>
  • Loading branch information
meowsbits committed Mar 12, 2021
1 parent a7e6418 commit 996a8f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -1216,8 +1216,8 @@ func (h *RPCMarshalHeaderT) setAsPending() {
// RPCMarshalBlockT is a type handling RPC serialization for types.Block.
type RPCMarshalBlockT struct {
*RPCMarshalHeaderT
Transactions []interface{} `json:"transactions,omitempty"`
Uncles []common.Hash `json:"uncles,omitempty"`
Transactions []interface{} `json:"transactions"`
Uncles []common.Hash `json:"uncles"`

Error string `json:"error,omitempty"`

Expand All @@ -1230,8 +1230,8 @@ type RPCMarshalBlockT struct {
// RPCMarshalHeaderT is an embedded struct.
type RPCMarshalBlockTIR struct {
*RPCMarshalHeaderT
Transactions []interface{} `json:"transactions,omitempty"`
Uncles []common.Hash `json:"uncles,omitempty"`
Transactions []interface{} `json:"transactions"`
Uncles []common.Hash `json:"uncles"`

Error string `json:"error,omitempty"`

Expand Down

0 comments on commit 996a8f5

Please sign in to comment.