@@ -54,8 +54,8 @@ TEST_CASE_METHOD(RemoteStateTest, "async remote buffer", "[rpc][core][remote_buf
5454 .WillRepeatedly (InvokeWithoutArgs ([]() -> Task<Bytes> {
5555 co_return Bytes{};
5656 }));
57- const BlockNum block_num = 1'000'000 ;
58- AsyncRemoteState state{transaction, chain_storage, block_num, std:: nullopt };
57+ const TxnId txn_id = 244087591818874 ;
58+ AsyncRemoteState state{transaction, chain_storage, txn_id };
5959 const auto code_read{spawn_and_wait (state.read_code (address, kEmptyHash ))};
6060 CHECK (code_read.empty ());
6161 }
@@ -73,8 +73,8 @@ TEST_CASE_METHOD(RemoteStateTest, "async remote buffer", "[rpc][core][remote_buf
7373 co_return response;
7474 }));
7575
76- const BlockNum block_num = 1'000'000 ;
77- AsyncRemoteState state{transaction, chain_storage, block_num };
76+ const TxnId txn_id = 244087591818874 ;
77+ AsyncRemoteState state{transaction, chain_storage, txn_id };
7878 const evmc::bytes32 code_hash{0x04491edcd115127caedbd478e2e7895ed80c7847e903431f94f9cfa579cad47f_bytes32};
7979 const auto code_read{spawn_and_wait (state.read_code (address, code_hash))};
8080 CHECK (code_read == ByteView{kCode });
@@ -101,9 +101,6 @@ TEST_CASE_METHOD(RemoteStateTest, "async remote buffer", "[rpc][core][remote_buf
101101 }
102102
103103 SECTION (" read_storage with empty response from db" ) {
104- EXPECT_CALL (transaction, first_txn_num_in_block (1'000'001 )).WillOnce (Invoke ([]() -> Task<TxnId> {
105- co_return 0 ;
106- }));
107104 EXPECT_CALL (transaction, get_as_of (_)).WillOnce (Invoke ([=](Unused) -> Task<db::kv::api::GetAsOfResult> {
108105 db::kv::api::GetAsOfResult response{
109106 .success = true ,
@@ -280,8 +277,8 @@ TEST_CASE_METHOD(RemoteStateTest, "async remote buffer", "[rpc][core][remote_buf
280277 .value = Bytes{}};
281278 co_return response;
282279 }));
283- const BlockNum block_num = 1'000'000 ;
284- AsyncRemoteState state{transaction, chain_storage, block_num };
280+ const TxnId txn_id = 244087591818874 ;
281+ AsyncRemoteState state{transaction, chain_storage, txn_id };
285282 const auto account_read{spawn_and_wait (state.read_account (address))};
286283 CHECK (account_read == std::nullopt );
287284 }
@@ -296,9 +293,9 @@ TEST_CASE_METHOD(RemoteStateTest, "async remote buffer", "[rpc][core][remote_buf
296293 .value = Bytes{}};
297294 co_return response;
298295 }));
299- const BlockNum block_num = 1'000'000 ;
296+ const TxnId txn_id = 244087591818874 ;
297+ AsyncRemoteState state{transaction, chain_storage, txn_id};
300298 const evmc::bytes32 code_hash{0x04491edcd115127caedbd478e2e7895ed80c7847e903431f94f9cfa579cad47f_bytes32};
301- AsyncRemoteState state{transaction, chain_storage, block_num};
302299 const auto code_read{spawn_and_wait (state.read_code (address, code_hash))};
303300 CHECK (code_read.empty ());
304301 }
@@ -313,16 +310,16 @@ TEST_CASE_METHOD(RemoteStateTest, "async remote buffer", "[rpc][core][remote_buf
313310 .value = Bytes{}};
314311 co_return response;
315312 }));
316- const BlockNum block_num = 1'000'000 ;
317313 const evmc::bytes32 location{0x04491edcd115127caedbd478e2e7895ed80c7847e903431f94f9cfa579cad47f_bytes32};
318- AsyncRemoteState state{transaction, chain_storage, block_num};
314+ const TxnId txn_id = 244087591818874 ;
315+ AsyncRemoteState state{transaction, chain_storage, txn_id};
319316 const auto storage_read{spawn_and_wait (state.read_storage (address, 0 , location))};
320317 CHECK (storage_read == 0x0000000000000000000000000000000000000000000000000000000000000000_bytes32);
321318 }
322319
323320 SECTION (" AsyncRemoteState::previous_incarnation returns ok" ) {
324- const BlockNum block_num = 1'000'000 ;
325- AsyncRemoteState state{transaction, chain_storage, block_num };
321+ const TxnId txn_id = 244087591818874 ;
322+ AsyncRemoteState state{transaction, chain_storage, txn_id };
326323 const auto prev_incarnation{spawn_and_wait (state.previous_incarnation (address))};
327324 CHECK (prev_incarnation == 0 );
328325 }
@@ -335,36 +332,39 @@ TEST_CASE_METHOD(RemoteStateTest, "async remote buffer", "[rpc][core][remote_buf
335332 }
336333
337334 SECTION (" AsyncRemoteState::current_canonical_block returns ok" ) {
338- const BlockNum block_num = 1'000'000 ;
339- AsyncRemoteState state{transaction, chain_storage, block_num };
335+ const TxnId txn_id = 244087591818874 ;
336+ AsyncRemoteState state{transaction, chain_storage, txn_id };
340337 const auto current_canonical_block{spawn_and_wait (state.current_canonical_block ())};
341338 CHECK (current_canonical_block == 0 );
342339 }
343340
344341 SECTION (" AsyncRemoteState::total_difficulty with empty response from chain storage" ) {
342+ const TxnId txn_id = 244087591818874 ;
345343 const BlockNum block_num = 1'000'000 ;
344+ AsyncRemoteState state{transaction, chain_storage, txn_id};
346345 const Hash block_hash{0x04491edcd115127caedbd478e2e7895ed80c7847e903431f94f9cfa579cad47f_bytes32};
347- AsyncRemoteState state{transaction, chain_storage, block_num};
348346 EXPECT_CALL (chain_storage, read_total_difficulty (block_hash, block_num))
349347 .WillOnce (Invoke ([](Unused, Unused) -> Task<std::optional<intx::uint256>> { co_return std::nullopt ; }));
350348 const auto total_difficulty{spawn_and_wait (state.total_difficulty (block_num, block_hash))};
351349 CHECK (total_difficulty == std::nullopt );
352350 }
353351
354352 SECTION (" AsyncRemoteState::read_header with empty response from chain storage" ) {
353+ const TxnId txn_id = 244087591818874 ;
355354 const BlockNum block_num = 1'000'000 ;
355+ AsyncRemoteState state{transaction, chain_storage, txn_id};
356356 const Hash block_hash{0x04491edcd115127caedbd478e2e7895ed80c7847e903431f94f9cfa579cad47f_bytes32};
357- AsyncRemoteState state{transaction, chain_storage, block_num};
358357 EXPECT_CALL (chain_storage, read_header (block_num, block_hash))
359358 .WillOnce (Invoke ([](Unused, Unused) -> Task<std::optional<BlockHeader>> { co_return std::nullopt ; }));
360359 const auto block_header{spawn_and_wait (state.read_header (block_num, block_hash))};
361360 CHECK (block_header == std::nullopt );
362361 }
363362
364363 SECTION (" AsyncRemoteState::read_body with empty response from from chain storage" ) {
365- const BlockNum block_num = 1'000'000 ;
366364 const Hash block_hash{0x04491edcd115127caedbd478e2e7895ed80c7847e903431f94f9cfa579cad47f_bytes32};
367- AsyncRemoteState state{transaction, chain_storage, block_num};
365+ const TxnId txn_id = 244087591818874 ;
366+ const BlockNum block_num = 1'000'000 ;
367+ AsyncRemoteState state{transaction, chain_storage, txn_id};
368368 BlockBody body;
369369 EXPECT_CALL (chain_storage, read_body (block_hash, block_num, body))
370370 .WillOnce (Invoke ([](Unused, Unused, Unused) -> Task<bool > { co_return true ; }));
@@ -378,10 +378,11 @@ TEST_CASE_METHOD(RemoteStateTest, "async remote buffer", "[rpc][core][remote_buf
378378 .WillRepeatedly (InvokeWithoutArgs ([=]() -> Task<Bytes> {
379379 co_return Bytes{};
380380 }));
381+ const TxnId txn_id = 244087591818874 ;
381382 const BlockNum block_num = 1'000'000 ;
382383 EXPECT_CALL (chain_storage, read_canonical_header_hash (block_num))
383384 .WillOnce (Invoke ([](Unused) -> Task<std::optional<Hash>> { co_return std::nullopt ; }));
384- AsyncRemoteState state{transaction, chain_storage, block_num };
385+ AsyncRemoteState state{transaction, chain_storage, txn_id };
385386 const auto canonical_hash{spawn_and_wait (state.canonical_hash (block_num))};
386387 CHECK (canonical_hash == std::nullopt );
387388 }
0 commit comments