pub(crate) trait CatchupDataSource: Sync {
// Required methods
fn get_accounts(
&self,
instance: &NodeState,
height: u64,
view: ViewNumber,
accounts: &[FeeAccount],
) -> impl Send + Future<Output = Result<FeeMerkleTree>>;
fn get_frontier(
&self,
instance: &NodeState,
height: u64,
view: ViewNumber,
) -> impl Send + Future<Output = Result<BlocksFrontier>>;
fn get_chain_config(
&self,
commitment: Commitment<ChainConfig>,
) -> impl Send + Future<Output = Result<ChainConfig>>;
fn get_leaf_chain(
&self,
height: u64,
) -> impl Send + Future<Output = Result<Vec<Leaf2>>>;
fn get_reward_accounts_v2(
&self,
instance: &NodeState,
height: u64,
view: ViewNumber,
accounts: &[RewardAccountV2],
) -> impl Send + Future<Output = Result<RewardMerkleTreeV2>>;
fn get_reward_accounts_v1(
&self,
instance: &NodeState,
height: u64,
view: ViewNumber,
accounts: &[RewardAccountV1],
) -> impl Send + Future<Output = Result<RewardMerkleTreeV1>>;
// Provided methods
fn get_account(
&self,
instance: &NodeState,
height: u64,
view: ViewNumber,
account: FeeAccount,
) -> impl Send + Future<Output = Result<AccountQueryData>> { ... }
fn get_reward_account_v2(
&self,
instance: &NodeState,
height: u64,
view: ViewNumber,
account: RewardAccountV2,
) -> impl Send + Future<Output = Result<RewardAccountQueryDataV2>> { ... }
fn get_reward_account_v1(
&self,
instance: &NodeState,
height: u64,
view: ViewNumber,
account: RewardAccountV1,
) -> impl Send + Future<Output = Result<RewardAccountQueryDataV1>> { ... }
}
Required Methods§
Sourcefn get_accounts(
&self,
instance: &NodeState,
height: u64,
view: ViewNumber,
accounts: &[FeeAccount],
) -> impl Send + Future<Output = Result<FeeMerkleTree>>
fn get_accounts( &self, instance: &NodeState, height: u64, view: ViewNumber, accounts: &[FeeAccount], ) -> impl Send + Future<Output = Result<FeeMerkleTree>>
Get the state of the requested accounts
.
The state is fetched from a snapshot at the given height and view, which must correspond!
height
is provided to simplify lookups for backends where data is not indexed by view.
This function is intended to be used for catchup, so view
should be no older than the last
decided view.
Sourcefn get_frontier(
&self,
instance: &NodeState,
height: u64,
view: ViewNumber,
) -> impl Send + Future<Output = Result<BlocksFrontier>>
fn get_frontier( &self, instance: &NodeState, height: u64, view: ViewNumber, ) -> impl Send + Future<Output = Result<BlocksFrontier>>
Get the blocks Merkle tree frontier.
The state is fetched from a snapshot at the given height and view, which must correspond!
height
is provided to simplify lookups for backends where data is not indexed by view.
This function is intended to be used for catchup, so view
should be no older than the last
decided view.
fn get_chain_config( &self, commitment: Commitment<ChainConfig>, ) -> impl Send + Future<Output = Result<ChainConfig>>
fn get_leaf_chain( &self, height: u64, ) -> impl Send + Future<Output = Result<Vec<Leaf2>>>
fn get_reward_accounts_v2( &self, instance: &NodeState, height: u64, view: ViewNumber, accounts: &[RewardAccountV2], ) -> impl Send + Future<Output = Result<RewardMerkleTreeV2>>
fn get_reward_accounts_v1( &self, instance: &NodeState, height: u64, view: ViewNumber, accounts: &[RewardAccountV1], ) -> impl Send + Future<Output = Result<RewardMerkleTreeV1>>
Provided Methods§
Sourcefn get_account(
&self,
instance: &NodeState,
height: u64,
view: ViewNumber,
account: FeeAccount,
) -> impl Send + Future<Output = Result<AccountQueryData>>
fn get_account( &self, instance: &NodeState, height: u64, view: ViewNumber, account: FeeAccount, ) -> impl Send + Future<Output = Result<AccountQueryData>>
Get the state of the requested account
.
The state is fetched from a snapshot at the given height and view, which must correspond!
height
is provided to simplify lookups for backends where data is not indexed by view.
This function is intended to be used for catchup, so view
should be no older than the last
decided view.
Sourcefn get_reward_account_v2(
&self,
instance: &NodeState,
height: u64,
view: ViewNumber,
account: RewardAccountV2,
) -> impl Send + Future<Output = Result<RewardAccountQueryDataV2>>
fn get_reward_account_v2( &self, instance: &NodeState, height: u64, view: ViewNumber, account: RewardAccountV2, ) -> impl Send + Future<Output = Result<RewardAccountQueryDataV2>>
Get the state of the requested account
.
The state is fetched from a snapshot at the given height and view, which must correspond!
height
is provided to simplify lookups for backends where data is not indexed by view.
This function is intended to be used for catchup, so view
should be no older than the last
decided view.
fn get_reward_account_v1( &self, instance: &NodeState, height: u64, view: ViewNumber, account: RewardAccountV1, ) -> impl Send + Future<Output = Result<RewardAccountQueryDataV1>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.