Unverified Commit a724163e authored by zhiqiangxu's avatar zhiqiangxu Committed by GitHub

core/types: add a testcase to TestLegacyReceiptDecoding (#25909)

add a testcase to TestLegacyReceiptDecoding
parent ea26fc8a
...@@ -96,6 +96,10 @@ func TestLegacyReceiptDecoding(t *testing.T) { ...@@ -96,6 +96,10 @@ func TestLegacyReceiptDecoding(t *testing.T) {
name string name string
encode func(*Receipt) ([]byte, error) encode func(*Receipt) ([]byte, error)
}{ }{
{
"ReceiptForStorage",
encodeAsReceiptForStorage,
},
{ {
"StoredReceiptRLP", "StoredReceiptRLP",
encodeAsStoredReceiptRLP, encodeAsStoredReceiptRLP,
...@@ -170,6 +174,10 @@ func TestLegacyReceiptDecoding(t *testing.T) { ...@@ -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) { func encodeAsStoredReceiptRLP(want *Receipt) ([]byte, error) {
stored := &storedReceiptRLP{ stored := &storedReceiptRLP{
PostStateOrStatus: want.statusEncoding(), PostStateOrStatus: want.statusEncoding(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment