Skip to content

Commit

Permalink
Test that API Receipts can Unmarshal to types.Receipts
Browse files Browse the repository at this point in the history
  • Loading branch information
axelKingsley committed Jun 3, 2024
1 parent 966c435 commit f277a43
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/ethapi/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2202,7 +2202,14 @@ func TestRPCGetBlockReceipts(t *testing.T) {
t.Errorf("test %d: want no error, have %v", i, err)
continue
}
// confirm the result matches the expected output
testRPCResponseWithFile(t, i, result, "eth_getBlockReceipts", tt.file)

// confirm the api structure can marshal and unmarshal to Receipts
var rec types.Receipts
data, err := json.MarshalIndent(result, "", " ")
require.NoError(t, err)
require.NoError(t, json.Unmarshal(data, &rec))
}
}

Expand Down

0 comments on commit f277a43

Please sign in to comment.