From a724163e59756ef6f8cd92adec039bb046a8a82f Mon Sep 17 00:00:00 2001 From: zhiqiangxu <652732310@qq.com> Date: Mon, 3 Oct 2022 18:56:21 +0800 Subject: [PATCH] core/types: add a testcase to TestLegacyReceiptDecoding (#25909) add a testcase to TestLegacyReceiptDecoding --- core/types/receipt_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/types/receipt_test.go b/core/types/receipt_test.go index bba18d2a7b..6f0953bdec 100644 --- a/core/types/receipt_test.go +++ b/core/types/receipt_test.go @@ -96,6 +96,10 @@ func TestLegacyReceiptDecoding(t *testing.T) { name string encode func(*Receipt) ([]byte, error) }{ + { + "ReceiptForStorage", + encodeAsReceiptForStorage, + }, { "StoredReceiptRLP", encodeAsStoredReceiptRLP, @@ -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(),