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

add a testcase to TestLegacyReceiptDecoding
pull/25927/head
zhiqiangxu 2 years ago committed by GitHub
parent ea26fc8a6c
commit a724163e59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      core/types/receipt_test.go

@ -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) {
} }
} }
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(),

Loading…
Cancel
Save