Skip to content

Commit

Permalink
rpcdaemon: remove awaitable create_state (#1270)
Browse files Browse the repository at this point in the history
  • Loading branch information
lupin012 authored Jun 22, 2023
1 parent 6bbeb7c commit 8361208
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 41 deletions.
4 changes: 0 additions & 4 deletions silkworm/silkrpc/commands/debug_api_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,6 @@ class DummyTransaction : public ethdb::Transaction {
co_return cursor;
}

awaitable<std::shared_ptr<silkworm::State>> create_state(const core::rawdb::DatabaseReader& /* db_reader */, uint64_t /* block_number */) override {
co_return nullptr;
}

std::shared_ptr<silkworm::State> create_state(boost::asio::any_io_executor&, const core::rawdb::DatabaseReader&, uint64_t) override {
return nullptr;
}
Expand Down
4 changes: 0 additions & 4 deletions silkworm/silkrpc/commands/engine_api_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ namespace {
co_return nullptr;
}

awaitable<std::shared_ptr<silkworm::State>> create_state(const core::rawdb::DatabaseReader& /* db_reader */, uint64_t /* block_number */) override {
co_return nullptr;
}

std::shared_ptr<silkworm::State> create_state(boost::asio::any_io_executor&, const core::rawdb::DatabaseReader&, uint64_t) override {
return nullptr;
}
Expand Down
5 changes: 0 additions & 5 deletions silkworm/silkrpc/core/account_dumper_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,6 @@ class DummyTransaction : public ethdb::Transaction {
co_return cursor;
}

boost::asio::awaitable<std::shared_ptr<silkworm::State>> create_state(const core::rawdb::DatabaseReader& /* db_reader */,
uint64_t /* block_number */) override {
co_return nullptr;
}

std::shared_ptr<silkworm::State> create_state(boost::asio::any_io_executor&, const core::rawdb::DatabaseReader&, uint64_t) override {
return nullptr;
}
Expand Down
5 changes: 0 additions & 5 deletions silkworm/silkrpc/core/account_walker_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,6 @@ class DummyTransaction : public ethdb::Transaction {
co_return cursor;
}

boost::asio::awaitable<std::shared_ptr<silkworm::State>> create_state(const core::rawdb::DatabaseReader& /* db_reader */,
uint64_t /* block_number */) override {
co_return nullptr;
}

std::shared_ptr<silkworm::State> create_state(boost::asio::any_io_executor&, const core::rawdb::DatabaseReader&, uint64_t) override {
return nullptr;
}
Expand Down
4 changes: 0 additions & 4 deletions silkworm/silkrpc/core/storage_walker_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,6 @@ class DummyTransaction : public ethdb::Transaction {
co_return cursor;
}

boost::asio::awaitable<std::shared_ptr<silkworm::State>> create_state(const core::rawdb::DatabaseReader& /* db_reader */, uint64_t /* block_number */) override {
co_return nullptr;
}

std::shared_ptr<silkworm::State> create_state(boost::asio::any_io_executor&, const core::rawdb::DatabaseReader&, uint64_t) override {
return nullptr;
}
Expand Down
4 changes: 0 additions & 4 deletions silkworm/silkrpc/ethdb/file/local_transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ boost::asio::awaitable<std::shared_ptr<CursorDupSort>> LocalTransaction::get_cur
co_return cursor;
}

boost::asio::awaitable<std::shared_ptr<silkworm::State>> LocalTransaction::create_state(const core::rawdb::DatabaseReader&, uint64_t block_number) {
co_return std::make_shared<silkworm::rpc::state::LocalState>(block_number, chaindata_env_);
}

std::shared_ptr<silkworm::State> LocalTransaction::create_state(boost::asio::any_io_executor&, const core::rawdb::DatabaseReader&, uint64_t block_number) {
return std::make_shared<silkworm::rpc::state::LocalState>(block_number, chaindata_env_);
}
Expand Down
1 change: 0 additions & 1 deletion silkworm/silkrpc/ethdb/file/local_transaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class LocalTransaction : public Transaction {

boost::asio::awaitable<std::shared_ptr<CursorDupSort>> cursor_dup_sort(const std::string& table) override;

boost::asio::awaitable<std::shared_ptr<silkworm::State>> create_state(const core::rawdb::DatabaseReader& db_reader, uint64_t block_number) override;
std::shared_ptr<silkworm::State> create_state(boost::asio::any_io_executor& executor, const core::rawdb::DatabaseReader& db_reader, uint64_t block_number) override;

boost::asio::awaitable<void> close() override;
Expand Down
5 changes: 0 additions & 5 deletions silkworm/silkrpc/ethdb/kv/remote_transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ boost::asio::awaitable<std::shared_ptr<CursorDupSort>> RemoteTransaction::get_cu
co_return cursor;
}

boost::asio::awaitable<std::shared_ptr<silkworm::State>> RemoteTransaction::create_state(const core::rawdb::DatabaseReader& db_reader, uint64_t block_number) {
auto executor = co_await boost::asio::this_coro::executor;
co_return std::make_shared<silkworm::rpc::state::RemoteState>(executor, db_reader, block_number);
}

std::shared_ptr<silkworm::State> RemoteTransaction::create_state(boost::asio::any_io_executor& executor, const core::rawdb::DatabaseReader& db_reader, uint64_t block_number) {
return std::make_shared<silkworm::rpc::state::RemoteState>(executor, db_reader, block_number);
}
Expand Down
1 change: 0 additions & 1 deletion silkworm/silkrpc/ethdb/kv/remote_transaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class RemoteTransaction : public Transaction {

boost::asio::awaitable<std::shared_ptr<CursorDupSort>> cursor_dup_sort(const std::string& table) override;

boost::asio::awaitable<std::shared_ptr<silkworm::State>> create_state(const core::rawdb::DatabaseReader& db_reader, uint64_t block_number) override;
std::shared_ptr<silkworm::State> create_state(boost::asio::any_io_executor& executor, const core::rawdb::DatabaseReader& db_reader, uint64_t block_number) override;

boost::asio::awaitable<void> close() override;
Expand Down
1 change: 0 additions & 1 deletion silkworm/silkrpc/ethdb/transaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class Transaction {

virtual boost::asio::awaitable<std::shared_ptr<CursorDupSort>> cursor_dup_sort(const std::string& table) = 0;

virtual boost::asio::awaitable<std::shared_ptr<silkworm::State>> create_state(const core::rawdb::DatabaseReader& db_reader, uint64_t block_number) = 0;
virtual std::shared_ptr<silkworm::State> create_state(boost::asio::any_io_executor& executor, const core::rawdb::DatabaseReader& db_reader, uint64_t block_number) = 0;

virtual boost::asio::awaitable<void> close() = 0;
Expand Down
5 changes: 0 additions & 5 deletions silkworm/silkrpc/test/dummy_transaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ class DummyTransaction : public ethdb::Transaction {
co_return cursor_;
}

boost::asio::awaitable<std::shared_ptr<silkworm::State>> create_state(const core::rawdb::DatabaseReader& /* db_reader */,
uint64_t /* block_number */) override {
co_return nullptr;
}

std::shared_ptr<silkworm::State> create_state(boost::asio::any_io_executor&, const core::rawdb::DatabaseReader&, uint64_t) override {
return nullptr;
}
Expand Down
2 changes: 0 additions & 2 deletions silkworm/silkrpc/test/mock_transaction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ class MockTransaction : public ethdb::Transaction {
MOCK_METHOD((boost::asio::awaitable<void>), open, ());
MOCK_METHOD((boost::asio::awaitable<std::shared_ptr<ethdb::Cursor>>), cursor, (const std::string&));
MOCK_METHOD((boost::asio::awaitable<std::shared_ptr<ethdb::CursorDupSort>>), cursor_dup_sort, (const std::string&));
MOCK_METHOD((boost::asio::awaitable<std::shared_ptr<silkworm::State>>), create_state,
(const core::rawdb::DatabaseReader&, uint64_t));
MOCK_METHOD((std::shared_ptr<silkworm::State>), create_state,
(boost::asio::any_io_executor&, const core::rawdb::DatabaseReader&, uint64_t));
MOCK_METHOD((boost::asio::awaitable<void>), close, ());
Expand Down

0 comments on commit 8361208

Please sign in to comment.