Skip to content

Commit f90c948

Browse files
zhiqiangxushekhirin
authored andcommitted
core/types: add a testcase to TestLegacyReceiptDecoding (ethereum#25909)
add a testcase to TestLegacyReceiptDecoding
1 parent 6be7a20 commit f90c948

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/types/receipt_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ func TestLegacyReceiptDecoding(t *testing.T) {
9696
name string
9797
encode func(*Receipt) ([]byte, error)
9898
}{
99+
{
100+
"ReceiptForStorage",
101+
encodeAsReceiptForStorage,
102+
},
99103
{
100104
"StoredReceiptRLP",
101105
encodeAsStoredReceiptRLP,
@@ -170,6 +174,10 @@ func TestLegacyReceiptDecoding(t *testing.T) {
170174
}
171175
}
172176

177+
func encodeAsReceiptForStorage(want *Receipt) ([]byte, error) {
178+
return rlp.EncodeToBytes((*ReceiptForStorage)(want))
179+
}
180+
173181
func encodeAsStoredReceiptRLP(want *Receipt) ([]byte, error) {
174182
stored := &storedReceiptRLP{
175183
PostStateOrStatus: want.statusEncoding(),

0 commit comments

Comments
 (0)