pub trait BalanceOnHold<AssetId, AccountId, Balance> {
// Required methods
fn balance_on_hold(asset: AssetId, who: &AccountId) -> Option<Balance>;
fn died(asset: AssetId, who: &AccountId);
fn contains_holds(asset: AssetId) -> bool;
}
Expand description
This trait indicates a balance that is on hold for an asset account.
A balance on hold is a balance that, while is assigned to an account, is outside the direct control of it. Instead, is being held by the system logic (i.e. Pallets) and can be eventually burned or released.
Required Methods§
Sourcefn balance_on_hold(asset: AssetId, who: &AccountId) -> Option<Balance>
fn balance_on_hold(asset: AssetId, who: &AccountId) -> Option<Balance>
Return the held balance.
If Some
, it means some balance is on hold, and it can be
infallibly burned.
If None
is returned, then no balance is on hold for who
’s asset
account.
Sourcefn died(asset: AssetId, who: &AccountId)
fn died(asset: AssetId, who: &AccountId)
Called after an account has been removed.
It is expected that this method is called only when there is no balance on hold. Otherwise, an account should not be removed.
Sourcefn contains_holds(asset: AssetId) -> bool
fn contains_holds(asset: AssetId) -> bool
Return a value that indicates if there are registered holds for a given asset.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.