difftreelog
refactor remove id from collection info
in: master
3 files changed
node/src/chain_spec.rsdiffbeforeafterboth1//2// This file is subject to the terms and conditions defined in3// file 'LICENSE', which is part of this source code package.4//56// use nft_runtime::{7// AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig, Signature, SudoConfig,8// SystemConfig, WASM_BINARY,9// };10// use nft_runtime::{ContractsConfig, ContractsSchedule, NftConfig, CollectionType};11use nft_runtime::*;12use sc_service::ChainType;13use sp_consensus_aura::sr25519::AuthorityId as AuraId;14use sp_core::{sr25519, Pair, Public};15use sp_finality_grandpa::AuthorityId as GrandpaId;16use sp_runtime::traits::{IdentifyAccount, Verify};17use serde_json::map::Map;18// use crate::chain_spec::api::chain_extension::*;1920// Note this is the URL for the telemetry server21//const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";2223/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.24pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig>;2526/// Helper function to generate a crypto pair from seed27pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {28 TPublic::Pair::from_string(&format!("//{}", seed), None)29 .expect("static values are valid; qed")30 .public()31}3233type AccountPublic = <Signature as Verify>::Signer;3435/// Helper function to generate an account ID from seed36pub fn get_account_id_from_seed<TPublic: Public>(seed: &str) -> AccountId37where38 AccountPublic: From<<TPublic::Pair as Pair>::Public>,39{40 AccountPublic::from(get_from_seed::<TPublic>(seed)).into_account()41}4243/// Helper function to generate an authority key for Aura44pub fn authority_keys_from_seed(s: &str) -> (AuraId, GrandpaId) {45 (get_from_seed::<AuraId>(s), get_from_seed::<GrandpaId>(s))46}4748pub fn development_config() -> Result<ChainSpec, String> {49 let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;5051 let mut properties = Map::new();52 properties.insert("tokenSymbol".into(), "UniqueTest".into());53 properties.insert("tokenDecimals".into(), 15.into());54 properties.insert("ss58Format".into(), 42.into()); // Generic Substrate wildcard (SS58 checksum preimage)5556 Ok(ChainSpec::from_genesis(57 // Name58 "Development",59 // ID60 "dev",61 ChainType::Development,62 move || testnet_genesis(63 wasm_binary,64 // Initial PoA authorities65 vec![66 authority_keys_from_seed("Alice"),67 ],68 // Sudo account69 get_account_id_from_seed::<sr25519::Public>("Alice"),70 // Pre-funded accounts71 vec![72 get_account_id_from_seed::<sr25519::Public>("Alice"),73 get_account_id_from_seed::<sr25519::Public>("Bob"),74 get_account_id_from_seed::<sr25519::Public>("Alice//stash"),75 get_account_id_from_seed::<sr25519::Public>("Bob//stash"),76 ],77 true,78 ),79 // Bootnodes80 vec![],81 // Telemetry82 None,83 // Protocol ID84 None,85 // Properties86 Some(properties),87 // Extensions88 None,89 ))90}9192pub fn local_testnet_config() -> Result<ChainSpec, String> {93 let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;9495 Ok(ChainSpec::from_genesis(96 // Name97 "Local Testnet",98 // ID99 "local_testnet",100 ChainType::Local,101 move || testnet_genesis(102 wasm_binary,103 // Initial PoA authorities104 vec![105 authority_keys_from_seed("Alice"),106 authority_keys_from_seed("Bob"),107 ],108 // Sudo account109 get_account_id_from_seed::<sr25519::Public>("Alice"),110 // Pre-funded accounts111 vec![112 get_account_id_from_seed::<sr25519::Public>("Alice"),113 get_account_id_from_seed::<sr25519::Public>("Bob"),114 get_account_id_from_seed::<sr25519::Public>("Charlie"),115 get_account_id_from_seed::<sr25519::Public>("Dave"),116 get_account_id_from_seed::<sr25519::Public>("Eve"),117 get_account_id_from_seed::<sr25519::Public>("Ferdie"),118 get_account_id_from_seed::<sr25519::Public>("Alice//stash"),119 get_account_id_from_seed::<sr25519::Public>("Bob//stash"),120 get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),121 get_account_id_from_seed::<sr25519::Public>("Dave//stash"),122 get_account_id_from_seed::<sr25519::Public>("Eve//stash"),123 get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),124 ],125 true,126 ),127 // Bootnodes128 vec![],129 // Telemetry130 None,131 // Protocol ID132 None,133 // Properties134 None,135 // Extensions136 None,137 ))138}139140fn testnet_genesis(141 wasm_binary: &[u8],142 initial_authorities: Vec<(AuraId, GrandpaId)>,143 root_key: AccountId,144 endowed_accounts: Vec<AccountId>,145 enable_println: bool,146) -> GenesisConfig {147148 let vested_accounts = vec![149 get_account_id_from_seed::<sr25519::Public>("Bob"),150 ];151152 GenesisConfig {153 system: Some(SystemConfig {154 code: wasm_binary.to_vec(),155 changes_trie_config: Default::default(),156 }),157 pallet_balances: Some(BalancesConfig {158 balances: endowed_accounts159 .iter()160 .cloned()161 .map(|k| (k, 1 << 100))162 .collect(),163 }),164 pallet_aura: Some(AuraConfig {165 authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(),166 }),167 pallet_grandpa: Some(GrandpaConfig {168 authorities: initial_authorities169 .iter()170 .map(|x| (x.1.clone(), 1))171 .collect(),172 }),173 pallet_treasury: Some(Default::default()),174 pallet_sudo: Some(SudoConfig { key: root_key }),175 pallet_vesting: Some(VestingConfig {176 vesting: vested_accounts177 .iter()178 .cloned()179 .map(|k| (k, 1000, 100, 1 << 98))180 .collect(),181 }),182 pallet_nft: Some(NftConfig {183 collection_id: vec![(184 1,185 Collection {186 id: 1,187 owner: get_account_id_from_seed::<sr25519::Public>("Alice"),188 mode: CollectionMode::NFT,189 access: AccessMode::Normal,190 decimal_points: 0,191 name: vec![],192 description: vec![],193 token_prefix: vec![],194 mint_mode: false,195 offchain_schema: vec![],196 schema_version: SchemaVersion::default(),197 sponsor: get_account_id_from_seed::<sr25519::Public>("Alice"),198 sponsor_confirmed: true,199 const_on_chain_schema: vec![],200 variable_on_chain_schema: vec![],201 limits: CollectionLimits::default()202 },203 )],204 nft_item_id: vec![],205 fungible_item_id: vec![],206 refungible_item_id: vec![],207 chain_limit: ChainLimits {208 collection_numbers_limit: 100000,209 account_token_ownership_limit: 1000000,210 collections_admins_limit: 5,211 custom_data_limit: 2048,212 nft_sponsor_transfer_timeout: 15,213 fungible_sponsor_transfer_timeout: 15,214 refungible_sponsor_transfer_timeout: 15,215 offchain_schema_limit: 1024,216 variable_on_chain_schema_limit: 1024,217 const_on_chain_schema_limit: 1024,218 },219 }),220 pallet_contracts: Some(ContractsConfig {221 current_schedule: ContractsSchedule {222 enable_println,223 ..Default::default()224 },225 }),226 }227}1//2// This file is subject to the terms and conditions defined in3// file 'LICENSE', which is part of this source code package.4//56// use nft_runtime::{7// AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig, Signature, SudoConfig,8// SystemConfig, WASM_BINARY,9// };10// use nft_runtime::{ContractsConfig, ContractsSchedule, NftConfig, CollectionType};11use nft_runtime::*;12use sc_service::ChainType;13use sp_consensus_aura::sr25519::AuthorityId as AuraId;14use sp_core::{sr25519, Pair, Public};15use sp_finality_grandpa::AuthorityId as GrandpaId;16use sp_runtime::traits::{IdentifyAccount, Verify};17use serde_json::map::Map;18// use crate::chain_spec::api::chain_extension::*;1920// Note this is the URL for the telemetry server21//const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";2223/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.24pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig>;2526/// Helper function to generate a crypto pair from seed27pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {28 TPublic::Pair::from_string(&format!("//{}", seed), None)29 .expect("static values are valid; qed")30 .public()31}3233type AccountPublic = <Signature as Verify>::Signer;3435/// Helper function to generate an account ID from seed36pub fn get_account_id_from_seed<TPublic: Public>(seed: &str) -> AccountId37where38 AccountPublic: From<<TPublic::Pair as Pair>::Public>,39{40 AccountPublic::from(get_from_seed::<TPublic>(seed)).into_account()41}4243/// Helper function to generate an authority key for Aura44pub fn authority_keys_from_seed(s: &str) -> (AuraId, GrandpaId) {45 (get_from_seed::<AuraId>(s), get_from_seed::<GrandpaId>(s))46}4748pub fn development_config() -> Result<ChainSpec, String> {49 let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;5051 let mut properties = Map::new();52 properties.insert("tokenSymbol".into(), "UniqueTest".into());53 properties.insert("tokenDecimals".into(), 15.into());54 properties.insert("ss58Format".into(), 42.into()); // Generic Substrate wildcard (SS58 checksum preimage)5556 Ok(ChainSpec::from_genesis(57 // Name58 "Development",59 // ID60 "dev",61 ChainType::Development,62 move || testnet_genesis(63 wasm_binary,64 // Initial PoA authorities65 vec![66 authority_keys_from_seed("Alice"),67 ],68 // Sudo account69 get_account_id_from_seed::<sr25519::Public>("Alice"),70 // Pre-funded accounts71 vec![72 get_account_id_from_seed::<sr25519::Public>("Alice"),73 get_account_id_from_seed::<sr25519::Public>("Bob"),74 get_account_id_from_seed::<sr25519::Public>("Alice//stash"),75 get_account_id_from_seed::<sr25519::Public>("Bob//stash"),76 ],77 true,78 ),79 // Bootnodes80 vec![],81 // Telemetry82 None,83 // Protocol ID84 None,85 // Properties86 Some(properties),87 // Extensions88 None,89 ))90}9192pub fn local_testnet_config() -> Result<ChainSpec, String> {93 let wasm_binary = WASM_BINARY.ok_or("Development wasm binary not available".to_string())?;9495 Ok(ChainSpec::from_genesis(96 // Name97 "Local Testnet",98 // ID99 "local_testnet",100 ChainType::Local,101 move || testnet_genesis(102 wasm_binary,103 // Initial PoA authorities104 vec![105 authority_keys_from_seed("Alice"),106 authority_keys_from_seed("Bob"),107 ],108 // Sudo account109 get_account_id_from_seed::<sr25519::Public>("Alice"),110 // Pre-funded accounts111 vec![112 get_account_id_from_seed::<sr25519::Public>("Alice"),113 get_account_id_from_seed::<sr25519::Public>("Bob"),114 get_account_id_from_seed::<sr25519::Public>("Charlie"),115 get_account_id_from_seed::<sr25519::Public>("Dave"),116 get_account_id_from_seed::<sr25519::Public>("Eve"),117 get_account_id_from_seed::<sr25519::Public>("Ferdie"),118 get_account_id_from_seed::<sr25519::Public>("Alice//stash"),119 get_account_id_from_seed::<sr25519::Public>("Bob//stash"),120 get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),121 get_account_id_from_seed::<sr25519::Public>("Dave//stash"),122 get_account_id_from_seed::<sr25519::Public>("Eve//stash"),123 get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),124 ],125 true,126 ),127 // Bootnodes128 vec![],129 // Telemetry130 None,131 // Protocol ID132 None,133 // Properties134 None,135 // Extensions136 None,137 ))138}139140fn testnet_genesis(141 wasm_binary: &[u8],142 initial_authorities: Vec<(AuraId, GrandpaId)>,143 root_key: AccountId,144 endowed_accounts: Vec<AccountId>,145 enable_println: bool,146) -> GenesisConfig {147148 let vested_accounts = vec![149 get_account_id_from_seed::<sr25519::Public>("Bob"),150 ];151152 GenesisConfig {153 system: Some(SystemConfig {154 code: wasm_binary.to_vec(),155 changes_trie_config: Default::default(),156 }),157 pallet_balances: Some(BalancesConfig {158 balances: endowed_accounts159 .iter()160 .cloned()161 .map(|k| (k, 1 << 100))162 .collect(),163 }),164 pallet_aura: Some(AuraConfig {165 authorities: initial_authorities.iter().map(|x| (x.0.clone())).collect(),166 }),167 pallet_grandpa: Some(GrandpaConfig {168 authorities: initial_authorities169 .iter()170 .map(|x| (x.1.clone(), 1))171 .collect(),172 }),173 pallet_treasury: Some(Default::default()),174 pallet_sudo: Some(SudoConfig { key: root_key }),175 pallet_vesting: Some(VestingConfig {176 vesting: vested_accounts177 .iter()178 .cloned()179 .map(|k| (k, 1000, 100, 1 << 98))180 .collect(),181 }),182 pallet_nft: Some(NftConfig {183 collection_id: vec![(184 1,185 Collection {186 owner: get_account_id_from_seed::<sr25519::Public>("Alice"),187 mode: CollectionMode::NFT,188 access: AccessMode::Normal,189 decimal_points: 0,190 name: vec![],191 description: vec![],192 token_prefix: vec![],193 mint_mode: false,194 offchain_schema: vec![],195 schema_version: SchemaVersion::default(),196 sponsor: get_account_id_from_seed::<sr25519::Public>("Alice"),197 sponsor_confirmed: true,198 const_on_chain_schema: vec![],199 variable_on_chain_schema: vec![],200 limits: CollectionLimits::default()201 },202 )],203 nft_item_id: vec![],204 fungible_item_id: vec![],205 refungible_item_id: vec![],206 chain_limit: ChainLimits {207 collection_numbers_limit: 100000,208 account_token_ownership_limit: 1000000,209 collections_admins_limit: 5,210 custom_data_limit: 2048,211 nft_sponsor_transfer_timeout: 15,212 fungible_sponsor_transfer_timeout: 15,213 refungible_sponsor_transfer_timeout: 15,214 offchain_schema_limit: 1024,215 variable_on_chain_schema_limit: 1024,216 const_on_chain_schema_limit: 1024,217 },218 }),219 pallet_contracts: Some(ContractsConfig {220 current_schedule: ContractsSchedule {221 enable_println,222 ..Default::default()223 },224 }),225 }226}pallets/nft/src/lib.rsdiffbeforeafterboth--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -13,6 +13,7 @@
#[cfg(feature = "std")]
pub use serde::*;
+use core::ops::{Deref, DerefMut};
use codec::{Decode, Encode};
pub use frame_support::{
construct_runtime, decl_event, decl_module, decl_storage, decl_error,
@@ -126,7 +127,6 @@
#[derive(Encode, Decode, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub struct Collection<T: Config> {
- pub id: CollectionId,
pub owner: T::AccountId,
pub mode: CollectionMode,
pub access: AccessMode,
@@ -144,6 +144,25 @@
pub const_on_chain_schema: Vec<u8>, //
}
+pub struct CollectionHandle<T: Config> {
+ pub id: CollectionId,
+ collection: Collection<T>,
+}
+
+impl<T: Config> Deref for CollectionHandle<T> {
+ type Target = Collection<T>;
+
+ fn deref(&self) -> &Self::Target {
+ &self.collection
+ }
+}
+
+impl<T: Config> DerefMut for CollectionHandle<T> {
+ fn deref_mut(&mut self) -> &mut Self::Target {
+ &mut self.collection
+ }
+}
+
#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
pub struct NftItemType<AccountId> {
@@ -617,7 +636,6 @@
// Create new collection
let new_collection = Collection {
- id: next_id,
owner: who.clone(),
name: collection_name,
mode: mode.clone(),
@@ -1579,7 +1597,7 @@
let sender = ensure_signed(origin)?;
let mut target_collection = Self::get_collection(collection_id)?;
Self::check_owner_permissions(&target_collection, sender.clone())?;
- let old_limits = target_collection.limits;
+ let old_limits = &target_collection.limits;
let chain_limits = ChainLimit::get();
// collection bounds
@@ -1608,7 +1626,7 @@
impl<T: Config> Module<T> {
- pub fn transfer_internal(sender: T::AccountId, recipient: T::AccountId, target_collection: &Collection<T>, item_id: TokenId, value: u128) -> DispatchResult {
+ pub fn transfer_internal(sender: T::AccountId, recipient: T::AccountId, target_collection: &CollectionHandle<T>, item_id: TokenId, value: u128) -> DispatchResult {
// Limits check
Self::is_correct_transfer(target_collection, &recipient)?;
@@ -1636,7 +1654,7 @@
}
- fn is_correct_transfer(collection: &Collection<T>, recipient: &T::AccountId) -> DispatchResult {
+ fn is_correct_transfer(collection: &CollectionHandle<T>, recipient: &T::AccountId) -> DispatchResult {
let collection_id = collection.id;
// check token limit and account token limit
@@ -1646,7 +1664,7 @@
Ok(())
}
- fn can_create_items_in_collection(collection: &Collection<T>, sender: &T::AccountId, owner: &T::AccountId) -> DispatchResult {
+ fn can_create_items_in_collection(collection: &CollectionHandle<T>, sender: &T::AccountId, owner: &T::AccountId) -> DispatchResult {
let collection_id = collection.id;
// check token limit and account token limit
@@ -1664,7 +1682,7 @@
Ok(())
}
- fn validate_create_item_args(target_collection: &Collection<T>, data: &CreateItemData) -> DispatchResult {
+ fn validate_create_item_args(target_collection: &CollectionHandle<T>, data: &CreateItemData) -> DispatchResult {
match target_collection.mode
{
CollectionMode::NFT => {
@@ -1702,7 +1720,7 @@
Ok(())
}
- fn create_item_no_validation(collection: &Collection<T>, owner: T::AccountId, data: CreateItemData) -> DispatchResult {
+ fn create_item_no_validation(collection: &CollectionHandle<T>, owner: T::AccountId, data: CreateItemData) -> DispatchResult {
let collection_id = collection.id;
match data
@@ -1739,7 +1757,7 @@
Ok(())
}
- fn add_fungible_item(collection: &Collection<T>, owner: &T::AccountId, value: u128) -> DispatchResult {
+ fn add_fungible_item(collection: &CollectionHandle<T>, owner: &T::AccountId, value: u128) -> DispatchResult {
let collection_id = collection.id;
// Does new owner already have an account?
@@ -1763,7 +1781,7 @@
Ok(())
}
- fn add_refungible_item(collection: &Collection<T>, item: ReFungibleItemType<T::AccountId>) -> DispatchResult {
+ fn add_refungible_item(collection: &CollectionHandle<T>, item: ReFungibleItemType<T::AccountId>) -> DispatchResult {
let collection_id = collection.id;
let current_index = <ItemListIndex>::get(collection_id)
@@ -1788,7 +1806,7 @@
Ok(())
}
- fn add_nft_item(collection: &Collection<T>, item: NftItemType<T::AccountId>) -> DispatchResult {
+ fn add_nft_item(collection: &CollectionHandle<T>, item: NftItemType<T::AccountId>) -> DispatchResult {
let collection_id = collection.id;
let current_index = <ItemListIndex>::get(collection_id)
@@ -1811,7 +1829,7 @@
}
fn burn_refungible_item(
- collection: &Collection<T>,
+ collection: &CollectionHandle<T>,
item_id: TokenId,
owner: &T::AccountId,
) -> DispatchResult {
@@ -1857,7 +1875,7 @@
Ok(())
}
- fn burn_nft_item(collection: &Collection<T>, item_id: TokenId) -> DispatchResult {
+ fn burn_nft_item(collection: &CollectionHandle<T>, item_id: TokenId) -> DispatchResult {
let collection_id = collection.id;
ensure!(
@@ -1878,7 +1896,7 @@
Ok(())
}
- fn burn_fungible_item(owner: &T::AccountId, collection: &Collection<T>, value: u128) -> DispatchResult {
+ fn burn_fungible_item(owner: &T::AccountId, collection: &CollectionHandle<T>, value: u128) -> DispatchResult {
let collection_id = collection.id;
ensure!(
@@ -1905,16 +1923,20 @@
Ok(())
}
- pub fn get_collection(collection_id: CollectionId) -> Result<Collection<T>, sp_runtime::DispatchError> {
+ pub fn get_collection(collection_id: CollectionId) -> Result<CollectionHandle<T>, sp_runtime::DispatchError> {
Ok(<CollectionById<T>>::get(collection_id)
+ .map(|collection| CollectionHandle {
+ id: collection_id,
+ collection
+ })
.ok_or(Error::<T>::CollectionNotFound)?)
}
- fn save_collection(collection: Collection<T>) {
- <CollectionById<T>>::insert(collection.id, collection);
+ fn save_collection(collection: CollectionHandle<T>) {
+ <CollectionById<T>>::insert(collection.id, collection.collection);
}
- fn check_owner_permissions(target_collection: &Collection<T>, subject: T::AccountId) -> DispatchResult {
+ fn check_owner_permissions(target_collection: &CollectionHandle<T>, subject: T::AccountId) -> DispatchResult {
ensure!(
subject == target_collection.owner,
Error::<T>::NoPermission
@@ -1923,7 +1945,7 @@
Ok(())
}
- fn is_owner_or_admin_permissions(collection: &Collection<T>, subject: T::AccountId) -> bool {
+ fn is_owner_or_admin_permissions(collection: &CollectionHandle<T>, subject: T::AccountId) -> bool {
let mut result: bool = subject == collection.owner;
let exists = <AdminList<T>>::contains_key(collection.id);
@@ -1937,7 +1959,7 @@
}
fn check_owner_or_admin_permissions(
- collection: &Collection<T>,
+ collection: &CollectionHandle<T>,
subject: T::AccountId,
) -> DispatchResult {
let result = Self::is_owner_or_admin_permissions(collection, subject.clone());
@@ -1951,7 +1973,7 @@
fn owned_amount(
subject: T::AccountId,
- target_collection: &Collection<T>,
+ target_collection: &CollectionHandle<T>,
item_id: TokenId,
) -> Option<u128> {
let collection_id = target_collection.id;
@@ -1979,7 +2001,7 @@
}
}
- fn is_item_owner(subject: T::AccountId, target_collection: &Collection<T>, item_id: TokenId) -> bool {
+ fn is_item_owner(subject: T::AccountId, target_collection: &CollectionHandle<T>, item_id: TokenId) -> bool {
let collection_id = target_collection.id;
match target_collection.mode {
@@ -1999,7 +2021,7 @@
}
}
- fn check_white_list(collection: &Collection<T>, address: &T::AccountId) -> DispatchResult {
+ fn check_white_list(collection: &CollectionHandle<T>, address: &T::AccountId) -> DispatchResult {
let collection_id = collection.id;
let mes = Error::<T>::AddresNotInWhiteList;
@@ -2011,7 +2033,7 @@
/// Check if token exists. In case of Fungible, check if there is an entry for
/// the owner in fungible balances double map
fn token_exists(
- target_collection: &Collection<T>,
+ target_collection: &CollectionHandle<T>,
item_id: TokenId,
owner: &T::AccountId
) -> DispatchResult {
@@ -2029,7 +2051,7 @@
}
fn transfer_fungible(
- collection: &Collection<T>,
+ collection: &CollectionHandle<T>,
value: u128,
owner: &T::AccountId,
recipient: &T::AccountId,
@@ -2059,7 +2081,7 @@
}
fn transfer_refungible(
- collection: &Collection<T>,
+ collection: &CollectionHandle<T>,
item_id: TokenId,
value: u128,
owner: T::AccountId,
@@ -2142,7 +2164,7 @@
}
fn transfer_nft(
- collection: &Collection<T>,
+ collection: &CollectionHandle<T>,
item_id: TokenId,
sender: T::AccountId,
new_owner: T::AccountId,
@@ -2180,7 +2202,7 @@
}
fn set_re_fungible_variable_data(
- collection: &Collection<T>,
+ collection: &CollectionHandle<T>,
item_id: TokenId,
data: Vec<u8>
) -> DispatchResult {
@@ -2195,7 +2217,7 @@
}
fn set_nft_variable_data(
- collection: &Collection<T>,
+ collection: &CollectionHandle<T>,
item_id: TokenId,
data: Vec<u8>
) -> DispatchResult {
runtime_types.jsondiffbeforeafterboth--- a/runtime_types.json
+++ b/runtime_types.json
@@ -32,7 +32,6 @@
"VariableData": "Vec<u8>"
},
"Collection": {
- "Id": "CollectionId",
"Owner": "AccountId",
"Mode": "CollectionMode",
"Access": "AccessMode",