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§
Sourcefn force_transfer_all_assets(
from: &AccountId,
to: &AccountId,
) -> Result<bool, DispatchError>
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§
Sourcefn ensure_successful(_from: &AccountId)
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.