mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-03 01:53:48 +00:00
core/types: add a testcase to TestLegacyReceiptDecoding (#25909)
add a testcase to TestLegacyReceiptDecoding
This commit is contained in:
parent
ea26fc8a6c
commit
a724163e59
1 changed files with 8 additions and 0 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue