@@ -9,33 +9,40 @@ import (
9
9
gethcommon "github.com/ethereum/go-ethereum/common"
10
10
"github.com/ethereum/go-ethereum/common/hexutil"
11
11
gethtypes "github.com/ethereum/go-ethereum/core/types"
12
+ "github.com/kkrt-labs/go-utils/common"
12
13
"github.com/stretchr/testify/assert"
13
14
"github.com/stretchr/testify/require"
14
15
)
15
16
16
17
func TestRPCHeader (t * testing.T ) {
17
18
header := & gethtypes.Header {
18
- ParentHash : gethcommon.Hash {},
19
- UncleHash : gethcommon .HexToHash ("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" ),
20
- ReceiptHash : gethcommon .HexToHash ("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ),
21
- TxHash : gethcommon .HexToHash ("0x661a9febcfa8f1890af549b874faf9fa274aede26ef489d9db0b25daa569450e" ),
22
- Number : big .NewInt (100 ),
23
- GasLimit : 1000 ,
24
- GasUsed : 10000 ,
25
- Time : 1000 ,
26
- Difficulty : big .NewInt (100 ),
27
- Extra : hexutil .MustDecode ("0xabcd" ),
28
- Bloom : gethtypes.Bloom {},
29
- Coinbase : gethcommon .HexToAddress ("0x5E0c840B55d49377070e131ed93B69393218C444" ),
30
- MixDigest : gethcommon.Hash {},
31
- Nonce : gethtypes .EncodeNonce (25 ),
32
- Root : gethcommon.Hash {},
19
+ ParentHash : gethcommon.Hash {},
20
+ UncleHash : gethcommon .HexToHash ("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" ),
21
+ ReceiptHash : gethcommon .HexToHash ("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" ),
22
+ TxHash : gethcommon .HexToHash ("0x661a9febcfa8f1890af549b874faf9fa274aede26ef489d9db0b25daa569450e" ),
23
+ Number : big .NewInt (100 ),
24
+ GasLimit : 1000 ,
25
+ GasUsed : 10000 ,
26
+ Time : 1000 ,
27
+ Difficulty : big .NewInt (100 ),
28
+ Extra : hexutil .MustDecode ("0xabcd" ),
29
+ Bloom : gethtypes.Bloom {},
30
+ Coinbase : gethcommon .HexToAddress ("0x5E0c840B55d49377070e131ed93B69393218C444" ),
31
+ MixDigest : gethcommon.Hash {},
32
+ Nonce : gethtypes .EncodeNonce (25 ),
33
+ Root : gethcommon.Hash {},
34
+ BaseFee : big .NewInt (100 ),
35
+ WithdrawalsHash : common .Ptr (gethcommon.Hash {}),
36
+ BlobGasUsed : common .Ptr (uint64 (8 )),
37
+ ExcessBlobGas : common .Ptr (uint64 (9 )),
38
+ ParentBeaconRoot : common .Ptr (gethcommon .HexToHash ("0xeacd31ced729baf258bd42cdbd42617ad326b0c64ac2079f97c072d8c086c27f" )),
39
+ RequestsHash : common .Ptr (gethcommon .HexToHash ("0xc420b56fcdd9edfe80e9fc11d773cb48793778f46216963bc418133579e6963b" )),
33
40
}
34
41
35
42
rpcHeader := new (Header ).FromHeader (header )
36
43
assert .Equal (t , header .Hash (), rpcHeader .Hash )
37
44
38
- b , err := json .Marshal (rpcHeader )
45
+ b , err := json .Marshal (header )
39
46
require .NoError (t , err )
40
47
41
48
rpcHeader2 := new (Header )
0 commit comments