pub trait SyncBlocks: SyncWallet {
// Required methods
fn get_wallet_block(
&self,
block_height: BlockHeight,
) -> Result<WalletBlock, Self::Error>;
fn get_wallet_blocks_mut(
&mut self,
) -> Result<&mut BTreeMap<BlockHeight, WalletBlock>, Self::Error>;
// Provided methods
fn append_wallet_blocks(
&mut self,
wallet_blocks: BTreeMap<BlockHeight, WalletBlock>,
) -> Result<(), Self::Error> { ... }
fn truncate_wallet_blocks(
&mut self,
truncate_height: BlockHeight,
) -> Result<(), Self::Error> { ... }
}Expand description
Trait for interfacing crate::wallet::WalletBlocks with wallet data
Required Methods§
Sourcefn get_wallet_block(
&self,
block_height: BlockHeight,
) -> Result<WalletBlock, Self::Error>
fn get_wallet_block( &self, block_height: BlockHeight, ) -> Result<WalletBlock, Self::Error>
Get a stored wallet compact block from wallet data by block height
Must return error if block is not found
Sourcefn get_wallet_blocks_mut(
&mut self,
) -> Result<&mut BTreeMap<BlockHeight, WalletBlock>, Self::Error>
fn get_wallet_blocks_mut( &mut self, ) -> Result<&mut BTreeMap<BlockHeight, WalletBlock>, Self::Error>
Get mutable reference to wallet blocks
Provided Methods§
Sourcefn append_wallet_blocks(
&mut self,
wallet_blocks: BTreeMap<BlockHeight, WalletBlock>,
) -> Result<(), Self::Error>
fn append_wallet_blocks( &mut self, wallet_blocks: BTreeMap<BlockHeight, WalletBlock>, ) -> Result<(), Self::Error>
Append wallet compact blocks to wallet data
Sourcefn truncate_wallet_blocks(
&mut self,
truncate_height: BlockHeight,
) -> Result<(), Self::Error>
fn truncate_wallet_blocks( &mut self, truncate_height: BlockHeight, ) -> Result<(), Self::Error>
Removes all wallet blocks above the given block_height.