Skip to content

Commit

Permalink
core/types: add a testcase to TestLegacyReceiptDecoding (ethereum#25909)
Browse files Browse the repository at this point in the history
add a testcase to TestLegacyReceiptDecoding
  • Loading branch information
zhiqiangxu authored and shekhirin committed Jun 6, 2023
1 parent 6be7a20 commit f90c948
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/types/receipt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ func TestLegacyReceiptDecoding(t *testing.T) {
name string
encode func(*Receipt) ([]byte, error)
}{
{
"ReceiptForStorage",
encodeAsReceiptForStorage,
},
{
"StoredReceiptRLP",
encodeAsStoredReceiptRLP,
Expand Down Expand Up @@ -170,6 +174,10 @@ func TestLegacyReceiptDecoding(t *testing.T) {
}
}

func encodeAsReceiptForStorage(want *Receipt) ([]byte, error) {
return rlp.EncodeToBytes((*ReceiptForStorage)(want))
}

func encodeAsStoredReceiptRLP(want *Receipt) ([]byte, error) {
stored := &storedReceiptRLP{
PostStateOrStatus: want.statusEncoding(),
Expand Down

0 comments on commit f90c948

Please sign in to comment.