@@ -91,6 +91,64 @@ TEST(statetest_loader, block_info_dec)
91
91
EXPECT_EQ (bi.number , 1 );
92
92
}
93
93
94
+ TEST (statetest_loader, block_info_0_current_difficulty)
95
+ {
96
+ constexpr std::string_view input = R"( {
97
+ "currentCoinbase": "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
98
+ "currentGasLimit": "100000000000000000",
99
+ "currentNumber": "1",
100
+ "currentTimestamp": "1000",
101
+ "currentDifficulty": "0",
102
+ "parentBaseFee": "7",
103
+ "parentGasUsed": "0",
104
+ "parentGasLimit": "100000000000000000",
105
+ "parentTimstamp": "0",
106
+ "blockHashes": {
107
+ "0": "0xc305d826e3784046a7e9d31128ef98d3e96133fe454c16ef630574d967dfdb1a"
108
+ },
109
+ "ommers": [],
110
+ "withdrawals": [],
111
+ "parentUncleHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
112
+ })" ;
113
+
114
+ const auto bi = test::from_json<state::BlockInfo>(json::json::parse (input));
115
+ EXPECT_EQ (bi.coinbase , 0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba_address);
116
+ EXPECT_EQ (bi.prev_randao , 0x00_bytes32);
117
+ EXPECT_EQ (bi.gas_limit , 100000000000000000 );
118
+ EXPECT_EQ (bi.base_fee , 7 );
119
+ EXPECT_EQ (bi.timestamp , 1000 );
120
+ EXPECT_EQ (bi.number , 1 );
121
+ }
122
+
123
+ TEST (statetest_loader, block_info_0_parent_difficulty)
124
+ {
125
+ constexpr std::string_view input = R"( {
126
+ "currentCoinbase": "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba",
127
+ "currentGasLimit": "100000000000000000",
128
+ "currentNumber": "1",
129
+ "currentTimestamp": "1000",
130
+ "parentDifficulty": "0x0",
131
+ "parentBaseFee": "7",
132
+ "parentGasUsed": "0",
133
+ "parentGasLimit": "100000000000000000",
134
+ "parentTimstamp": "0",
135
+ "blockHashes": {
136
+ "0": "0xc305d826e3784046a7e9d31128ef98d3e96133fe454c16ef630574d967dfdb1a"
137
+ },
138
+ "ommers": [],
139
+ "withdrawals": [],
140
+ "parentUncleHash": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347"
141
+ })" ;
142
+
143
+ const auto bi = test::from_json<state::BlockInfo>(json::json::parse (input));
144
+ EXPECT_EQ (bi.coinbase , 0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba_address);
145
+ EXPECT_EQ (bi.prev_randao , 0x00_bytes32);
146
+ EXPECT_EQ (bi.gas_limit , 100000000000000000 );
147
+ EXPECT_EQ (bi.base_fee , 7 );
148
+ EXPECT_EQ (bi.timestamp , 1000 );
149
+ EXPECT_EQ (bi.number , 1 );
150
+ }
151
+
94
152
TEST (statetest_loader, block_info_0_random)
95
153
{
96
154
constexpr std::string_view input = R"( {
0 commit comments