diff --git a/silkworm/db/kv/grpc/client/remote_cursor_test.cpp b/silkworm/db/kv/grpc/client/remote_cursor_test.cpp index 9f283618dc..ca8f370376 100644 --- a/silkworm/db/kv/grpc/client/remote_cursor_test.cpp +++ b/silkworm/db/kv/grpc/client/remote_cursor_test.cpp @@ -75,11 +75,11 @@ class RemoteCursorTest : public test_util::KVTestBase { co_return tx_id_pair; } + RemoteCursor& remote_cursor() { return remote_cursor_; } + private: TxRpc tx_rpc_{grpc_context_}; - - public: - RemoteCursor remote_cursor{tx_rpc_}; + RemoteCursor remote_cursor_{tx_rpc_}; }; #ifndef SILKWORM_SANITIZE @@ -99,8 +99,8 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::open_cursor", "[rpc][ethdb][kv EXPECT_CALL(reader_writer_, Read).WillOnce(test::read_success_with(grpc_context_, open_pair)); // Execute the test: opening a cursor on specified table should succeed and cursor should have expected cursor ID - CHECK_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); - CHECK(remote_cursor.cursor_id() == 3); + CHECK_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); + CHECK(remote_cursor().cursor_id() == 3); } SECTION("failure in write") { // Set the call expectations: @@ -110,7 +110,7 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::open_cursor", "[rpc][ethdb][kv EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test: opening a cursor should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.open_cursor("table1", false)), + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().open_cursor("table1", false)), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } @@ -126,7 +126,7 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::open_cursor", "[rpc][ethdb][kv EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test: opening a cursor should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.open_cursor("table1", false)), + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().open_cursor("table1", false)), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } @@ -153,11 +153,11 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::close_cursor", "[rpc][ethdb][k .WillOnce(test::read_success_with(grpc_context_, remote::Pair{})); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: closing a cursor should succeed and reset the cursor ID - CHECK_NOTHROW(spawn_and_wait(remote_cursor.close_cursor())); - CHECK(remote_cursor.cursor_id() == 0); + CHECK_NOTHROW(spawn_and_wait(remote_cursor().close_cursor())); + CHECK(remote_cursor().cursor_id() == 0); } SECTION("failure in write") { // Set the call expectations: @@ -176,10 +176,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::close_cursor", "[rpc][ethdb][k EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: closing a cursor should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.close_cursor()), boost::system::system_error, + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().close_cursor()), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } SECTION("failure in read") { @@ -203,10 +203,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::close_cursor", "[rpc][ethdb][k EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: closing a cursor should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.close_cursor()), boost::system::system_error, + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().close_cursor()), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } } @@ -239,11 +239,11 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::seek", "[rpc][ethdb][kv][remot .WillOnce(test::read_success_with(grpc_context_, seek_pair)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking a key should succeed and return the expected value api::KeyValue kv; - CHECK_NOTHROW(kv = spawn_and_wait(remote_cursor.seek(kPlainStateKeyBytes))); + CHECK_NOTHROW(kv = spawn_and_wait(remote_cursor().seek(kPlainStateKeyBytes))); CHECK(kv.key == kPlainStateKeyBytes); CHECK(kv.value == kPlainStateValueBytes); } @@ -269,10 +269,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::seek", "[rpc][ethdb][kv][remot EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking a key should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.seek(kPlainStateKeyBytes)), boost::system::system_error, + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().seek(kPlainStateKeyBytes)), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } SECTION("failure in read") { @@ -300,10 +300,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::seek", "[rpc][ethdb][kv][remot EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking a key should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.seek(kPlainStateKeyBytes)), boost::system::system_error, + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().seek(kPlainStateKeyBytes)), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } } @@ -336,11 +336,11 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::seek_exact", "[rpc][ethdb][kv] .WillOnce(test::read_success_with(grpc_context_, seek_pair)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking a key should succeed and return the expected value api::KeyValue kv; - CHECK_NOTHROW(kv = spawn_and_wait(remote_cursor.seek_exact(kPlainStateKeyBytes))); + CHECK_NOTHROW(kv = spawn_and_wait(remote_cursor().seek_exact(kPlainStateKeyBytes))); CHECK(kv.key == kPlainStateKeyBytes); CHECK(kv.value == kPlainStateValueBytes); } @@ -366,10 +366,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::seek_exact", "[rpc][ethdb][kv] EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking a key should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.seek_exact(kPlainStateKeyBytes)), boost::system::system_error, + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().seek_exact(kPlainStateKeyBytes)), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } SECTION("failure in read") { @@ -397,10 +397,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::seek_exact", "[rpc][ethdb][kv] EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking a key should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.seek_exact(kPlainStateKeyBytes)), boost::system::system_error, + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().seek_exact(kPlainStateKeyBytes)), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } } @@ -431,11 +431,11 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::first", "[rpc][ethdb][kv][remo .WillOnce(test::read_success_with(grpc_context_, first_pair)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking first key should succeed and return the expected value api::KeyValue kv; - CHECK_NOTHROW(kv = spawn_and_wait(remote_cursor.first())); + CHECK_NOTHROW(kv = spawn_and_wait(remote_cursor().first())); CHECK(kv.key == kPlainStateKeyBytes); CHECK(kv.value == kPlainStateValueBytes); } @@ -459,10 +459,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::first", "[rpc][ethdb][kv][remo EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_aborted(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking first key should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.first()), boost::system::system_error, test::exception_has_aborted_grpc_status_code()); + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().first()), boost::system::system_error, test::exception_has_aborted_grpc_status_code()); } SECTION("failure in read") { // Set the call expectations: @@ -487,10 +487,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::first", "[rpc][ethdb][kv][remo EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking a key should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.first()), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().first()), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } } @@ -520,11 +520,11 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::last", "[rpc][ethdb][kv][remot .WillOnce(test::read_success_with(grpc_context_, first_pair)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking last key should succeed and return the expected value api::KeyValue kv; - CHECK_NOTHROW(kv = spawn_and_wait(remote_cursor.last())); + CHECK_NOTHROW(kv = spawn_and_wait(remote_cursor().last())); CHECK(kv.key == kPlainStateKeyBytes); CHECK(kv.value == kPlainStateValueBytes); } @@ -548,10 +548,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::last", "[rpc][ethdb][kv][remot EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_aborted(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking last key should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.last()), boost::system::system_error, test::exception_has_aborted_grpc_status_code()); + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().last()), boost::system::system_error, test::exception_has_aborted_grpc_status_code()); } SECTION("failure in read") { // Set the call expectations: @@ -576,10 +576,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::last", "[rpc][ethdb][kv][remot EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking a key should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.last()), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().last()), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } } @@ -609,11 +609,11 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::next", "[rpc][ethdb][kv][remot .WillOnce(test::read_success_with(grpc_context_, next_pair)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking next key should succeed and return the expected value api::KeyValue kv; - CHECK_NOTHROW(kv = spawn_and_wait(remote_cursor.next())); + CHECK_NOTHROW(kv = spawn_and_wait(remote_cursor().next())); CHECK(kv.key == kPlainStateKeyBytes); CHECK(kv.value == kPlainStateValueBytes); } @@ -637,10 +637,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::next", "[rpc][ethdb][kv][remot EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking next key should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.next()), boost::system::system_error, + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().next()), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } SECTION("failure in read") { @@ -666,10 +666,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::next", "[rpc][ethdb][kv][remot EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking a key should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.next()), boost::system::system_error, + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().next()), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } } @@ -700,11 +700,11 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::next_dup", "[rpc][ethdb][kv][r .WillOnce(test::read_success_with(grpc_context_, next_pair)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", true))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", true))); // Execute the test: seeking next key should succeed and return the expected value api::KeyValue kv; - CHECK_NOTHROW(kv = spawn_and_wait(remote_cursor.next_dup())); + CHECK_NOTHROW(kv = spawn_and_wait(remote_cursor().next_dup())); CHECK(kv.key == kPlainStateKeyBytes); CHECK(kv.value == kPlainStateValueBytes); } @@ -728,10 +728,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::next_dup", "[rpc][ethdb][kv][r EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", true))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", true))); // Execute the test: seeking next key should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.next_dup()), boost::system::system_error, + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().next_dup()), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } SECTION("failure in read") { @@ -757,10 +757,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::next_dup", "[rpc][ethdb][kv][r EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", true))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", true))); // Execute the test: seeking a key should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.next_dup()), boost::system::system_error, + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().next_dup()), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } } @@ -794,11 +794,11 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::seek_both", "[rpc][ethdb][kv][ .WillOnce(test::read_success_with(grpc_context_, seek_pair)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking a key should succeed and return the expected value silkworm::Bytes value; - CHECK_NOTHROW(value = spawn_and_wait(remote_cursor.seek_both(kAccountChangeSetKeyBytes, kAccountChangeSetSubkeyBytes))); + CHECK_NOTHROW(value = spawn_and_wait(remote_cursor().seek_both(kAccountChangeSetKeyBytes, kAccountChangeSetSubkeyBytes))); CHECK(value == kAccountChangeSetValueBytes); } SECTION("failure in write") { @@ -823,10 +823,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::seek_both", "[rpc][ethdb][kv][ EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking a key should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.seek_both(kAccountChangeSetKeyBytes, kAccountChangeSetSubkeyBytes)), boost::system::system_error, + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().seek_both(kAccountChangeSetKeyBytes, kAccountChangeSetSubkeyBytes)), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } SECTION("failure in read") { @@ -854,10 +854,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::seek_both", "[rpc][ethdb][kv][ EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking a key should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.seek_both(kAccountChangeSetKeyBytes, kAccountChangeSetSubkeyBytes)), boost::system::system_error, + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().seek_both(kAccountChangeSetKeyBytes, kAccountChangeSetSubkeyBytes)), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } } @@ -891,11 +891,11 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::seek_both_exact", "[rpc][ethdb .WillOnce(test::read_success_with(grpc_context_, seek_pair)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking a key should succeed and return the expected value api::KeyValue kv; - CHECK_NOTHROW(kv = spawn_and_wait(remote_cursor.seek_both_exact(kAccountChangeSetKeyBytes, kAccountChangeSetSubkeyBytes))); + CHECK_NOTHROW(kv = spawn_and_wait(remote_cursor().seek_both_exact(kAccountChangeSetKeyBytes, kAccountChangeSetSubkeyBytes))); CHECK(kv.key == kAccountChangeSetKeyBytes); CHECK(kv.value == kAccountChangeSetValueBytes); } @@ -921,10 +921,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::seek_both_exact", "[rpc][ethdb EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking a key should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.seek_both_exact(kAccountChangeSetKeyBytes, kAccountChangeSetSubkeyBytes)), boost::system::system_error, + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().seek_both_exact(kAccountChangeSetKeyBytes, kAccountChangeSetSubkeyBytes)), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } SECTION("failure in read") { @@ -952,10 +952,10 @@ TEST_CASE_METHOD(RemoteCursorTest, "RemoteCursor::seek_both_exact", "[rpc][ethdb EXPECT_CALL(reader_writer_, Finish).WillOnce(test::finish_streaming_cancelled(grpc_context_)); // Execute the test preconditions: open a new cursor on specified table - REQUIRE_NOTHROW(spawn_and_wait(remote_cursor.open_cursor("table1", false))); + REQUIRE_NOTHROW(spawn_and_wait(remote_cursor().open_cursor("table1", false))); // Execute the test: seeking a key should raise an exception w/ expected gRPC status code - CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor.seek_both_exact(kAccountChangeSetKeyBytes, kAccountChangeSetSubkeyBytes)), boost::system::system_error, + CHECK_THROWS_MATCHES(spawn_and_wait(remote_cursor().seek_both_exact(kAccountChangeSetKeyBytes, kAccountChangeSetSubkeyBytes)), boost::system::system_error, test::exception_has_cancelled_grpc_status_code()); } }