Skip to content

Instantly share code, notes, and snippets.

@lightclient
Last active December 3, 2020 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lightclient/af944a74f6e8debcbb1232ac007df3cc to your computer and use it in GitHub Desktop.
Save lightclient/af944a74f6e8debcbb1232ac007df3cc to your computer and use it in GitHub Desktop.
Parsing EIP-2718 Block Test Case
https://github.com/ethereum/go-ethereum/blob/7a22d848c851b1dcc89344049e5be9833fde1e97/core/types/block_test.go#L71
--
f9 0316 // outer length
f9 0211 // header length
a0 0000000000000000000000000000000000000000000000000000000000000000 // parent hash
a0 1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347 // uncle hash
94 8888f1f195afa192cfee860698584c030f4c9db1 // coinbase
a0 ef1552a40b7165c3cd773806b9e0c165b75356e0314bf0706f279c729f51e017 // root hash
a0 8dae65c92dceddaa2fabec652b550258568abed0de8ae7482e662afa5cd6bef7 // tx hash
a0 cafe75574d59780665a97fbfd11365c7545aa8f1abf4e5e12e8243334ef7286b // receipt hash
b9 0100
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 // bloom
83 020000 // difficulty
82 0200 // number
83 2fefd8 // gas limit
82 a410 // gas used
84 5506eb07 // time
96 636f6f6c65737420626c6f636b206f6e20636861696e // extra
a0 bd4472abb6659ebe3ee06ee4d7b72a00a9f4d001caca51342001075469aff498 // mix digest
88 a13a5a8c8f2bb1c4 // nonce
f8 ff
// legacy transaction
f8 5f
80 // acount nonce
0a // gas price
82 c350 // gas limit
94 095e7baea6a6c7c4c2dfeb977efac326af552d87
0a // amount
80 // payload
1ba09bea4c4daac7c7c52e093e6a4c35dbbcf8856f1af7b059ba20253e70848d094fa08a8fae537ce25ed8cb5af9adac3f141af69bd515bd2ba031522df09b97dd72b1 // signature
// typed transaction
01 // transaction type
f8 9b
01 // chain id
80 // account nonce
0a // gas price
83 01e241 // gas limit
94 095e7baea6a6c7c4c2dfeb977efac326af552d87
80 // amount
80 // payload
f838f7940000000000000000000000000000000000000001e1a00000000000000000000000000000000000000000000000000000000000000000 // access list
01a078b8236a3b26d56c7d4ba94a36e64c5ea086619e489c005ece0ac7bd8356be22a02fea9f3d5aaff74ac1e996e590f7152ea74ed300c59909b2921b73237c7b0692 // signature
c0 // uncle headers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment