use super::*;
use codec::{Decode, Encode, MaxEncodedLen};
use frame_support::traits::{fungible::Inspect as FunInspect, fungibles::Inspect};
use scale_info::TypeInfo;
use sp_runtime::traits::StaticLookup;
pub type AssetIdOf<T> = <<T as Config>::Assets as Inspect<<T as SystemConfig>::AccountId>>::AssetId;
pub type AssetBalanceOf<T> =
<<T as Config>::Assets as Inspect<<T as SystemConfig>::AccountId>>::Balance;
pub type DepositOf<T> =
<<T as Config>::Currency as FunInspect<<T as SystemConfig>::AccountId>>::Balance;
pub type AccountIdLookupOf<T> = <<T as SystemConfig>::Lookup as StaticLookup>::Source;
#[derive(Decode, Encode, Default, PartialEq, Eq, MaxEncodedLen, TypeInfo)]
pub struct Details<AssetId, Fractions, Deposit, AccountId> {
pub asset: AssetId,
pub fractions: Fractions,
pub deposit: Deposit,
pub asset_creator: AccountId,
}
#[cfg(feature = "runtime-benchmarks")]
pub trait BenchmarkHelper<AssetId, CollectionId, ItemId> {
fn asset(id: u32) -> AssetId;
fn collection(id: u32) -> CollectionId;
fn nft(id: u32) -> ItemId;
}
#[cfg(feature = "runtime-benchmarks")]
impl<AssetId, CollectionId, ItemId> BenchmarkHelper<AssetId, CollectionId, ItemId> for ()
where
AssetId: From<u32>,
CollectionId: From<u32>,
ItemId: From<u32>,
{
fn asset(id: u32) -> AssetId {
id.into()
}
fn collection(id: u32) -> CollectionId {
id.into()
}
fn nft(id: u32) -> ItemId {
id.into()
}
}