From 2cb48ea7385989c1fdcb970ec374322aa0322c7f Mon Sep 17 00:00:00 2001 From: yperbasis Date: Tue, 17 Sep 2024 14:09:14 +0200 Subject: [PATCH] Estimate gas test --- silkworm/rpc/core/estimate_gas_oracle_test.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/silkworm/rpc/core/estimate_gas_oracle_test.cpp b/silkworm/rpc/core/estimate_gas_oracle_test.cpp index c507e59a24..eb64b29039 100644 --- a/silkworm/rpc/core/estimate_gas_oracle_test.cpp +++ b/silkworm/rpc/core/estimate_gas_oracle_test.cpp @@ -41,11 +41,9 @@ namespace silkworm::rpc { -struct RemoteDatabaseTest : db::test_util::KVTestBase { +class RemoteDatabaseTest : public db::test_util::KVTestBase { public: - // RemoteDatabase holds the KV stub by std::unique_ptr, so we cannot rely on mock stub from base class - StrictMockKVStub* kv_stub_ = new StrictMockKVStub; - db::kv::api::CoherentStateCache state_cache_; + db::kv::api::CoherentStateCache state_cache; test::BackEndMock backend; }; @@ -102,7 +100,7 @@ TEST_CASE("estimate gas") { test::BackEndMock backend; auto tx = std::make_unique(*remote_db_test.stub, remote_db_test.grpc_context_, - &remote_db_test.state_cache_, + &remote_db_test.state_cache, ethdb::kv::block_provider(&backend), ethdb::kv::block_number_from_txn_hash_provider(&backend)); const db::chain::RemoteChainStorage storage{*tx, ethdb::kv::block_provider(&backend), ethdb::kv::block_number_from_txn_hash_provider(&backend)};