Trait fuel_core::database::balances::BalancesInitializer

source ·
pub trait BalancesInitializer {
    // Required methods
    fn init_contract_balances<S>(
        &mut self,
        contract_id: &ContractId,
        balances: S,
    ) -> Result<(), StorageError>
       where S: Iterator<Item = (AssetId, Word)>;
    fn update_contract_balances(
        &mut self,
        balances: impl IntoIterator<Item = TableEntry<ContractsAssets>>,
    ) -> Result<(), StorageError>;
}

Required Methods§

source

fn init_contract_balances<S>( &mut self, contract_id: &ContractId, balances: S, ) -> Result<(), StorageError>
where S: Iterator<Item = (AssetId, Word)>,

Initialize the balances of the contract from the all leaves. This method is more performant than inserting balances one by one.

source

fn update_contract_balances( &mut self, balances: impl IntoIterator<Item = TableEntry<ContractsAssets>>, ) -> Result<(), StorageError>

Object Safety§

This trait is not object safe.

Implementors§