referrerpolicy=no-referrer-when-downgrade

TransferAllAssets

Trait TransferAllAssets 

Source
pub trait TransferAllAssets<AccountId> {
    // Required method
    fn force_transfer_all_assets(
        from: &AccountId,
        to: &AccountId,
    ) -> Result<bool, DispatchError>;

    // Provided method
    fn ensure_successful(_from: &AccountId) { ... }
}
Expand description

Transfer all assets held by an account (e.g. a stale bounty sub-account) back to another.

Required Methods§

Source

fn force_transfer_all_assets( from: &AccountId, to: &AccountId, ) -> Result<bool, DispatchError>

Transfer all assets from one account to another, possibly reaping from.

Returns true if any balance was actually transferred, false if the account was already empty.

Provided Methods§

Source

fn ensure_successful(_from: &AccountId)

Mint benchmark amounts of each relevant asset into from.

Called during benchmarking so that force_transfer_all_assets exercises real transfers instead of being a no-op. The default implementation is a no-op.

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.

Implementations on Foreign Types§

Source§

impl<AccountId> TransferAllAssets<AccountId> for ()

Implementors§

Source§

impl<AccountId, C> TransferAllAssets<AccountId> for TransferFungible<AccountId, C>
where C: FungibleMutate<AccountId>, AccountId: Eq,

Source§

impl<AccountId, Fungibles, RelevantAssets> TransferAllAssets<AccountId> for TransferAllFungibles<AccountId, Fungibles, RelevantAssets>
where Fungibles: FungiblesMutate<AccountId> + FungiblesCreate<AccountId>, RelevantAssets: Get<Vec<<Fungibles as FungiblesInspect<AccountId>>::AssetId>>, AccountId: Eq + Clone,