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§
sourcefn init_contract_balances<S>(
&mut self,
contract_id: &ContractId,
balances: S,
) -> Result<(), StorageError>
fn init_contract_balances<S>( &mut self, contract_id: &ContractId, balances: S, ) -> Result<(), StorageError>
Initialize the balances of the contract from the all leaves. This method is more performant than inserting balances one by one.
fn update_contract_balances( &mut self, balances: impl IntoIterator<Item = TableEntry<ContractsAssets>>, ) -> Result<(), StorageError>
Object Safety§
This trait is not object safe.