pub trait ContractsAssetsStorage: StorageMutate<ContractsAssets> {
// Provided methods
fn contract_asset_id_balance(
&self,
id: &ContractId,
asset_id: &AssetId,
) -> Result<Option<u64>, Self::Error> { ... }
fn contract_asset_id_balance_insert(
&mut self,
contract: &ContractId,
asset_id: &AssetId,
value: u64,
) -> Result<(), Self::Error> { ... }
fn contract_asset_id_balance_replace(
&mut self,
contract: &ContractId,
asset_id: &AssetId,
value: u64,
) -> Result<Option<u64>, Self::Error> { ... }
}
Expand description
Storage operations for contract assets.
Provided Methods§
sourcefn contract_asset_id_balance(
&self,
id: &ContractId,
asset_id: &AssetId,
) -> Result<Option<u64>, Self::Error>
fn contract_asset_id_balance( &self, id: &ContractId, asset_id: &AssetId, ) -> Result<Option<u64>, Self::Error>
Fetch the balance of an asset ID in a contract storage.
sourcefn contract_asset_id_balance_insert(
&mut self,
contract: &ContractId,
asset_id: &AssetId,
value: u64,
) -> Result<(), Self::Error>
fn contract_asset_id_balance_insert( &mut self, contract: &ContractId, asset_id: &AssetId, value: u64, ) -> Result<(), Self::Error>
Update the balance of an asset ID in a contract storage.
sourcefn contract_asset_id_balance_replace(
&mut self,
contract: &ContractId,
asset_id: &AssetId,
value: u64,
) -> Result<Option<u64>, Self::Error>
fn contract_asset_id_balance_replace( &mut self, contract: &ContractId, asset_id: &AssetId, value: u64, ) -> Result<Option<u64>, Self::Error>
Update the balance of an asset ID in a contract storage. Returns the old balance, if any.