Allow other pallets to check asset ids. (#12666)

* Make it easier for other pallets to check asset ids.

* Avoid boxing

* cargo fmt
This commit is contained in:
Squirrel
2022-11-11 14:22:17 +00:00
committed by GitHub
parent bd2166de79
commit ba12f3af9d
5 changed files with 63 additions and 3 deletions
@@ -27,6 +27,8 @@ use sp_std::vec::Vec;
pub mod approvals;
mod balanced;
pub mod enumerable;
pub use enumerable::InspectEnumerable;
pub mod metadata;
pub use balanced::{Balanced, Unbalanced};
mod imbalance;
@@ -0,0 +1,26 @@
// This file is part of Substrate.
// Copyright (C) 2019-2022 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use crate::traits::fungibles::Inspect;
/// Interface for enumerating assets in existence or owned by a given account.
pub trait InspectEnumerable<AccountId>: Inspect<AccountId> {
type AssetsIterator;
/// Returns an iterator of the collections in existence.
fn asset_ids() -> Self::AssetsIterator;
}