Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
copy changes from original PR
  • Loading branch information
tonyalaribe committed Nov 15, 2022
commit 1e9572a4f86ff3d206b5b794803cba2d7d39abfc
20 changes: 8 additions & 12 deletions frame/support/src/traits/tokens/fungibles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,19 +267,16 @@ pub trait Create<AccountId>: Inspect<AccountId> {

/// Trait for providing the ability to destroy existing fungible assets.
pub trait Destroy<AccountId>: Inspect<AccountId> {
/// The witness data needed to destroy an asset.
type DestroyWitness;

/// Provide the appropriate witness data needed to destroy an asset.
fn get_destroy_witness(id: &Self::AssetId) -> Option<Self::DestroyWitness>;

/// Destroy an existing fungible asset.
/// * `id`: The `AssetId` to be destroyed.
/// * `witness`: Any witness data that needs to be provided to complete the operation
/// successfully.
/// Start the destruction an existing fungible asset.
/// * `id`: The `AssetId` to be destroyed. successfully.
/// * `maybe_check_owner`: An optional account id that can be used to authorize the destroy
/// command. If not provided, we will not do any authorization checks before destroying the
/// command. If not provided, no authorization checks will be performed before destroying
/// asset.
fn start_destroy(id: Self::AssetId, maybe_check_owner: Option<AccountId>) -> DispatchResult;

/// Destroy all accounts associated with a given asset.
/// `destroy_accounts` should only be called after `start_destroy` has been called, and the
/// asset is in a `Destroying` state
///
/// * `id`: The identifier of the asset to be destroyed. This must identify an existing asset.
/// * `max_items`: The maximum number of accounts to be destroyed for a given call of the
Expand All @@ -293,7 +290,6 @@ pub trait Destroy<AccountId>: Inspect<AccountId> {
/// times to fully destroy all approvals. It will destroy `max_items` approvals at a
/// time.
fn destroy_accounts(id: Self::AssetId, max_items: u32) -> Result<u32, DispatchError>;

/// Destroy all approvals associated with a given asset up to the `max_items`
/// `destroy_approvals` should only be called after `start_destroy` has been called, and the
/// asset is in a `Destroying` state
Expand Down