Trait TrackingCopyExt

Source
pub trait TrackingCopyExt<R> {
    type Error;

Show 20 methods // Required methods fn read_account_key( &mut self, account_hash: AccountHash, ) -> Result<Key, Self::Error>; fn get_block_time(&self) -> Result<Option<BlockTime>, Self::Error>; fn get_balance_hold_config( &self, hold_kind: BalanceHoldAddrTag, ) -> Result<Option<(BlockTime, HoldBalanceHandling, u64)>, Self::Error>; fn get_purse_balance_key(&self, purse_key: Key) -> Result<Key, Self::Error>; fn get_balance_hold_addresses( &self, purse_addr: URefAddr, ) -> Result<Vec<BalanceHoldAddr>, Self::Error>; fn get_total_balance(&self, key: Key) -> Result<Motes, Self::Error>; fn get_available_balance( &mut self, balance_key: Key, ) -> Result<Motes, Self::Error>; fn get_purse_balance_key_with_proof( &self, purse_key: Key, ) -> Result<(Key, TrieMerkleProof<Key, StoredValue>), Self::Error>; fn get_total_balance_with_proof( &self, balance_key: Key, ) -> Result<(U512, TrieMerkleProof<Key, StoredValue>), Self::Error>; fn clear_expired_balance_holds( &mut self, purse_addr: URefAddr, filter: Vec<(BalanceHoldAddrTag, HoldsEpoch)>, ) -> Result<(), Self::Error>; fn get_balance_holds( &mut self, purse_addr: URefAddr, block_time: BlockTime, interval: u64, ) -> Result<BTreeMap<BlockTime, BalanceHolds>, Self::Error>; fn get_balance_holds_with_proof( &self, purse_addr: URefAddr, ) -> Result<BTreeMap<BlockTime, BalanceHoldsWithProof>, Self::Error>; fn get_message_topics( &self, entity_addr: EntityAddr, ) -> Result<MessageTopics, Self::Error>; fn get_named_keys( &self, entity_addr: EntityAddr, ) -> Result<NamedKeys, Self::Error>; fn get_v1_entry_points( &self, entity_addr: EntityAddr, ) -> Result<EntryPoints, Self::Error>; fn get_package( &mut self, package_hash: HashAddr, ) -> Result<Package, Self::Error>; fn get_contract( &mut self, contract_hash: ContractHash, ) -> Result<Contract, Self::Error>; fn get_system_entity_registry( &self, ) -> Result<SystemHashRegistry, Self::Error>; fn get_checksum_registry( &mut self, ) -> Result<Option<ChecksumRegistry>, Self::Error>; fn get_byte_code( &mut self, byte_code_hash: ByteCodeHash, ) -> Result<ByteCode, Self::Error>;
}
Expand description

Higher-level operations on the state via a TrackingCopy.

Required Associated Types§

Source

type Error

The type for the returned errors.

Required Methods§

Source

fn read_account_key( &mut self, account_hash: AccountHash, ) -> Result<Key, Self::Error>

Reads the entity key for a given account hash.

Source

fn get_block_time(&self) -> Result<Option<BlockTime>, Self::Error>

Returns block time associated with checked out root hash.

Source

fn get_balance_hold_config( &self, hold_kind: BalanceHoldAddrTag, ) -> Result<Option<(BlockTime, HoldBalanceHandling, u64)>, Self::Error>

Returns balance hold configuration settings for imputed kind of balance hold.

Source

fn get_purse_balance_key(&self, purse_key: Key) -> Result<Key, Self::Error>

Gets the purse balance key for a given purse.

Source

fn get_balance_hold_addresses( &self, purse_addr: URefAddr, ) -> Result<Vec<BalanceHoldAddr>, Self::Error>

Gets the balance hold keys for the imputed purse (if any).

Source

fn get_total_balance(&self, key: Key) -> Result<Motes, Self::Error>

Returns total balance.

Source

fn get_available_balance( &mut self, balance_key: Key, ) -> Result<Motes, Self::Error>

Returns the available balance, considering any holds from holds_epoch to now.

Source

fn get_purse_balance_key_with_proof( &self, purse_key: Key, ) -> Result<(Key, TrieMerkleProof<Key, StoredValue>), Self::Error>

Gets the purse balance key for a given purse and provides a Merkle proof.

Source

fn get_total_balance_with_proof( &self, balance_key: Key, ) -> Result<(U512, TrieMerkleProof<Key, StoredValue>), Self::Error>

Gets the balance at a given balance key and provides a Merkle proof.

Source

fn clear_expired_balance_holds( &mut self, purse_addr: URefAddr, filter: Vec<(BalanceHoldAddrTag, HoldsEpoch)>, ) -> Result<(), Self::Error>

Clear expired balance holds.

Source

fn get_balance_holds( &mut self, purse_addr: URefAddr, block_time: BlockTime, interval: u64, ) -> Result<BTreeMap<BlockTime, BalanceHolds>, Self::Error>

Gets the balance holds for a given balance, without Merkle proofs.

Source

fn get_balance_holds_with_proof( &self, purse_addr: URefAddr, ) -> Result<BTreeMap<BlockTime, BalanceHoldsWithProof>, Self::Error>

Gets the balance holds for a given balance, with Merkle proofs.

Source

fn get_message_topics( &self, entity_addr: EntityAddr, ) -> Result<MessageTopics, Self::Error>

Returns the collection of message topics (if any) for a given HashAddr.

Source

fn get_named_keys( &self, entity_addr: EntityAddr, ) -> Result<NamedKeys, Self::Error>

Returns the collection of named keys for a given AddressableEntity.

Source

fn get_v1_entry_points( &self, entity_addr: EntityAddr, ) -> Result<EntryPoints, Self::Error>

Returns the collection of entry points for a given AddresableEntity.

Source

fn get_package( &mut self, package_hash: HashAddr, ) -> Result<Package, Self::Error>

Gets a package by hash.

Source

fn get_contract( &mut self, contract_hash: ContractHash, ) -> Result<Contract, Self::Error>

Get a Contract record.

Source

fn get_system_entity_registry(&self) -> Result<SystemHashRegistry, Self::Error>

Gets the system entity registry.

Source

fn get_checksum_registry( &mut self, ) -> Result<Option<ChecksumRegistry>, Self::Error>

Gets the system checksum registry.

Source

fn get_byte_code( &mut self, byte_code_hash: ByteCodeHash, ) -> Result<ByteCode, Self::Error>

Gets byte code by hash.

Implementors§