TARAXA
sync_state.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 
5 #include "SyncStateObject.h"
7 #include "network/network.hpp"
8 
9 namespace graphql::taraxa {
10 
11 class SyncState {
12  public:
13  explicit SyncState(std::shared_ptr<::taraxa::final_chain::FinalChain> final_chain,
14  std::weak_ptr<::taraxa::Network> network) noexcept;
15 
16  response::Value getStartingBlock() const noexcept;
17  response::Value getCurrentBlock() const noexcept;
18  response::Value getHighestBlock() const noexcept;
19  std::optional<response::Value> getPulledStates() const noexcept;
20  std::optional<response::Value> getKnownStates() const noexcept;
21 
22  private:
23  std::shared_ptr<::taraxa::final_chain::FinalChain> final_chain_;
24  std::weak_ptr<::taraxa::Network> network_;
25 };
26 
27 } // namespace graphql::taraxa
Definition: sync_state.hpp:11
SyncState(std::shared_ptr<::taraxa::final_chain::FinalChain > final_chain, std::weak_ptr<::taraxa::Network > network) noexcept
Definition: sync_state.cpp:8
std::optional< response::Value > getKnownStates() const noexcept
Definition: sync_state.cpp:34
std::weak_ptr<::taraxa::Network > network_
Definition: sync_state.hpp:24
response::Value getStartingBlock() const noexcept
Definition: sync_state.cpp:12
std::shared_ptr<::taraxa::final_chain::FinalChain > final_chain_
Definition: sync_state.hpp:23
response::Value getHighestBlock() const noexcept
Definition: sync_state.cpp:18
std::optional< response::Value > getPulledStates() const noexcept
Definition: sync_state.cpp:32
response::Value getCurrentBlock() const noexcept
Definition: sync_state.cpp:14
Definition: account.hpp:10