difftreelog
Merge branch 'dev' of https://github.com/usetech-llc/nft_parachain
in: master
5 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3085,11 +3085,13 @@
dependencies = [
"frame-support",
"frame-system",
+ "pallet-transaction-payment",
"parity-scale-codec",
"serde",
"sp-core",
"sp-io",
"sp-runtime",
+ "sp-std",
]
[[package]]
doc/application_development.mddiffbeforeafterboth--- a/doc/application_development.md
+++ b/doc/application_development.md
@@ -16,6 +16,54 @@

+## Custom Types for JS API
+
+```
+{
+ "Schedule": {
+ "version": "u32",
+ "put_code_per_byte_cost": "Gas",
+ "grow_mem_cost": "Gas",
+ "regular_op_cost": "Gas",
+ "return_data_per_byte_cost": "Gas",
+ "event_data_per_byte_cost": "Gas",
+ "event_per_topic_cost": "Gas",
+ "event_base_cost": "Gas",
+ "call_base_cost": "Gas",
+ "instantiate_base_cost": "Gas",
+ "dispatch_base_cost": "Gas",
+ "sandbox_data_read_cost": "Gas",
+ "sandbox_data_write_cost": "Gas",
+ "transfer_cost": "Gas",
+ "instantiate_cost": "Gas",
+ "max_event_topics": "u32",
+ "max_stack_height": "u32",
+ "max_memory_pages": "u32",
+ "max_table_size": "u32",
+ "enable_println": "bool",
+ "max_subject_len": "u32"
+ },
+ "NftItemType": {
+ "Collection": "u64",
+ "Owner": "AccountId",
+ "Data": "Vec<u8>"
+ },
+ "CollectionType": {
+ "Owner": "AccountId",
+ "NextItemId": "u64",
+ "Name": "Vec<u16>",
+ "Description": "Vec<u16>",
+ "TokenPrefix": "Vec<u8>",
+ "CustomDataSize": "u32",
+ "Sponsor": "AccountId",
+ "UnconfirmedSponsor": "AccountId"
+ },
+ "Address": "AccountId",
+ "LookupSource": "AccountId",
+ "Weight": "u64"
+}
+```
+
## NFT Palette Methods
### Collection Management
pallets/nft/Cargo.tomldiffbeforeafterboth--- a/pallets/nft/Cargo.toml
+++ b/pallets/nft/Cargo.toml
@@ -37,6 +37,19 @@
# third-party dependencies
serde = { version = "1.0.102", features = ["derive"] }
+[dependencies.sp-std]
+default-features = false
+git = 'https://github.com/usetech-llc/substrate.git'
+branch = 'rc4_ext_dispatch_reenabled'
+version = '2.0.0-rc4'
+
+[dependencies.transaction-payment]
+default-features = false
+git = 'https://github.com/usetech-llc/substrate.git'
+package = 'pallet-transaction-payment'
+branch = 'rc4_ext_dispatch_reenabled'
+version = '2.0.0-rc4'
+
[package]
authors = ['Substrate DevHub <https://github.com/substrate-developer-hub>']
description = 'FRAME pallet nft'
@@ -57,4 +70,5 @@
'frame-support/std',
'frame-system/std',
'sp-runtime/std',
+ 'sp-std/std',
]
pallets/nft/src/lib.rsdiffbeforeafterboth1#![cfg_attr(not(feature = "std"), no_std)]23/// For more guidance on Substrate FRAME, see the example pallet4/// https://github.com/paritytech/substrate/blob/master/frame/example/src/lib.rs56use codec::{Decode, Encode};7use frame_support::{decl_event, decl_module, decl_storage, dispatch::DispatchResult, ensure};8use frame_system::{self as system, ensure_signed};9use sp_runtime::sp_std::prelude::Vec;1011#[cfg(test)]12mod mock;1314#[cfg(test)]15mod tests;1617#[derive(Encode, Decode, Debug, Eq, Clone, PartialEq)]18pub enum CollectionMode {19 Invalid,20 // custom data size21 NFT(u32),22 // amount23 Fungible(u32),24 ReFungible,25}2627impl Into<u8> for CollectionMode {28 fn into(self) -> u8{29 match self {30 CollectionMode::Invalid => 0,31 CollectionMode::NFT(_) => 1,32 CollectionMode::Fungible(_) => 2,33 CollectionMode::ReFungible => 3,34 }35 }36}3738#[derive(Encode, Decode, Debug, Clone, PartialEq)]39pub enum AccessMode {40 Normal,41 WhiteList,42}43impl Default for AccessMode { fn default() -> Self { Self::Normal } }4445impl Default for CollectionMode { fn default() -> Self { Self::Invalid } }4647#[derive(Encode, Decode, Default, Clone, PartialEq)]48#[cfg_attr(feature = "std", derive(Debug))]49pub struct Ownership<AccountId> {50 pub owner: AccountId,51 pub fraction: u12852}5354#[derive(Encode, Decode, Default, Clone, PartialEq)]55#[cfg_attr(feature = "std", derive(Debug))]56pub struct CollectionType<AccountId> {57 pub owner: AccountId,58 pub mode: CollectionMode,59 pub access: AccessMode,60 pub next_item_id: u64,61 pub decimal_points: u32,62 pub name: Vec<u16>, // 64 include null escape char63 pub description: Vec<u16>, // 256 include null escape char64 pub token_prefix: Vec<u8>, // 16 include null escape char65 pub custom_data_size: u32,66 pub offchain_schema: Vec<u8>,67 pub sponsor: AccountId, // Who pays fees. If set to default address, the fees are applied to the transaction sender68 pub unconfirmed_sponsor: AccountId, // Sponsor address that has not yet confirmed sponsorship69}7071#[derive(Encode, Decode, Default, Clone, PartialEq)]72#[cfg_attr(feature = "std", derive(Debug))]73pub struct CollectionAdminsType<AccountId> {74 pub admin: AccountId,75 pub collection_id: u64,76}7778#[derive(Encode, Decode, Default, Clone, PartialEq)]79#[cfg_attr(feature = "std", derive(Debug))]80pub struct NftItemType<AccountId> {81 pub collection: u64,82 pub owner: AccountId,83 pub data: Vec<u8>,84}8586#[derive(Encode, Decode, Default, Clone, PartialEq)]87#[cfg_attr(feature = "std", derive(Debug))]88pub struct FungibleItemType<AccountId> {89 pub collection: u64,90 pub owner: Vec<AccountId>,91 pub data: Vec<u64>,92}9394#[derive(Encode, Decode, Default, Clone, PartialEq)]95#[cfg_attr(feature = "std", derive(Debug))]96pub struct ReFungibleItemType<AccountId> {97 pub collection: u64,98 pub owner: Vec<Ownership<AccountId>>,99}100101pub trait Trait: system::Trait {102 type Event: From<Event<Self>> + Into<<Self as system::Trait>::Event>;103}104105decl_storage! {106 trait Store for Module<T: Trait> as Nft {107108 // Private members109 NextCollectionID: u64;110 ItemListIndex: map hasher(blake2_128_concat) u64 => u64;111112 pub Collection get(fn collection): map hasher(identity) u64 => CollectionType<T::AccountId>;113 pub AdminList get(fn admin_list_collection): map hasher(identity) u64 => Vec<T::AccountId>;114115 // Balance owner per collection map116 pub Balance get(fn balance_count): double_map hasher(blake2_128_concat) u64, hasher(blake2_128_concat) T::AccountId => u64;117 pub ApprovedList get(fn approved): double_map hasher(blake2_128_concat) u64, hasher(blake2_128_concat) u64 => Vec<T::AccountId>;118119 // Item collections120 pub NftItemList get(fn nft_item_id): double_map hasher(blake2_128_concat) u64, hasher(blake2_128_concat) u64 => NftItemType<T::AccountId>;121 pub FungibleItemList get(fn fungible_item_id): double_map hasher(blake2_128_concat) u64, hasher(blake2_128_concat) u64 => FungibleItemType<T::AccountId>;122 pub ReFungibleItemList get(fn refungible_item_id): double_map hasher(blake2_128_concat) u64, hasher(blake2_128_concat) u64 => ReFungibleItemType<T::AccountId>;123124 pub AddressTokens get(fn address_tokens): double_map hasher(blake2_128_concat) u64, hasher(blake2_128_concat) T::AccountId => Vec<u64>;125 }126}127128decl_event!(129 pub enum Event<T>130 where131 AccountId = <T as system::Trait>::AccountId,132 {133 Created(u64, u8, AccountId),134 ItemCreated(u64, u64),135 ItemDestroyed(u64, u64),136 }137);138139decl_module! {140 pub struct Module<T: Trait> for enum Call where origin: T::Origin {141142 fn deposit_event() = default;143144 // Create collection of NFT with given parameters145 //146 // @param customDataSz size of custom data in each collection item147 // returns collection ID148 #[weight = 0]149 pub fn create_collection( origin,150 collection_name: Vec<u16>,151 collection_description: Vec<u16>,152 token_prefix: Vec<u8>,153 mode: CollectionMode) -> DispatchResult {154155 // Anyone can create a collection156 let who = ensure_signed(origin)?;157 let custom_data_size = match mode {158 CollectionMode::NFT(size) => size,159 _ => 0160 };161162 let decimal_points = match mode {163 CollectionMode::Fungible(points) => points,164 _ => 0165 };166167 // check params168 ensure!(decimal_points < 100, "decimal_points parameter must be lower than 100"); 169170 let mut name = collection_name.to_vec();171 name.push(0);172 ensure!(name.len() <= 64, "Collection name can not be longer than 63 char");173174 let mut description = collection_description.to_vec();175 description.push(0);176 ensure!(name.len() <= 256, "Collection description can not be longer than 255 char");177178 let mut prefix = token_prefix.to_vec();179 prefix.push(0);180 ensure!(prefix.len() <= 16, "Token prefix can not be longer than 15 char");181182 // Generate next collection ID183 let next_id = NextCollectionID::get()184 .checked_add(1)185 .expect("collection id error");186187 NextCollectionID::put(next_id);188189 // Create new collection190 let new_collection = CollectionType {191 owner: who.clone(),192 name: name,193 mode: mode.clone(),194 access: AccessMode::Normal,195 description: description,196 decimal_points: decimal_points,197 token_prefix: prefix,198 next_item_id: next_id,199 offchain_schema: Vec::new(),200 custom_data_size: custom_data_size,201 sponsor: T::AccountId::default(),202 unconfirmed_sponsor: T::AccountId::default(),203 };204205 // Add new collection to map206 <Collection<T>>::insert(next_id, new_collection);207208 // call event209 Self::deposit_event(RawEvent::Created(next_id, mode.into(), who.clone()));210211 Ok(())212 }213214 #[weight = 0]215 pub fn destroy_collection(origin, collection_id: u64) -> DispatchResult {216217 let sender = ensure_signed(origin)?;218 Self::check_owner_permissions(collection_id, sender)?;219220 <AddressTokens<T>>::remove_prefix(collection_id);221 <ApprovedList<T>>::remove_prefix(collection_id);222 <Balance<T>>::remove_prefix(collection_id);223 <ItemListIndex>::remove(collection_id);224 <AdminList<T>>::remove(collection_id);225 <Collection<T>>::remove(collection_id);226227 Ok(())228 }229230 #[weight = 0]231 pub fn change_collection_owner(origin, collection_id: u64, new_owner: T::AccountId) -> DispatchResult {232233 let sender = ensure_signed(origin)?;234 Self::check_owner_permissions(collection_id, sender)?;235 let mut target_collection = <Collection<T>>::get(collection_id);236 target_collection.owner = new_owner;237 <Collection<T>>::insert(collection_id, target_collection);238239 Ok(())240 }241242 #[weight = 0]243 pub fn add_collection_admin(origin, collection_id: u64, new_admin_id: T::AccountId) -> DispatchResult {244245 let sender = ensure_signed(origin)?;246 Self::check_owner_or_admin_permissions(collection_id, sender)?;247 let mut admin_arr: Vec<T::AccountId> = Vec::new();248249 if <AdminList<T>>::contains_key(collection_id)250 {251 admin_arr = <AdminList<T>>::get(collection_id);252 ensure!(!admin_arr.contains(&new_admin_id), "Account already has admin role");253 }254255 admin_arr.push(new_admin_id);256 <AdminList<T>>::insert(collection_id, admin_arr);257258 Ok(())259 }260261 #[weight = 0]262 pub fn remove_collection_admin(origin, collection_id: u64, account_id: T::AccountId) -> DispatchResult {263264 let sender = ensure_signed(origin)?;265 Self::check_owner_or_admin_permissions(collection_id, sender)?;266267 if <AdminList<T>>::contains_key(collection_id)268 {269 let mut admin_arr = <AdminList<T>>::get(collection_id);270 admin_arr.retain(|i| *i != account_id);271 <AdminList<T>>::insert(collection_id, admin_arr);272 }273274 Ok(())275 }276277 #[weight = 0]278 pub fn create_item(origin, collection_id: u64, properties: Vec<u8>, owner: T::AccountId) -> DispatchResult {279280 let sender = ensure_signed(origin)?;281282 // check size283 let target_collection = <Collection<T>>::get(collection_id);284 ensure!(target_collection.custom_data_size >= properties.len() as u32, "Size of item is too large");285286 Self::check_owner_or_admin_permissions(collection_id, sender.clone())?;287288 let new_balance = <Balance<T>>::get(collection_id, owner.clone()) + 1;289 <Balance<T>>::insert(collection_id, owner.clone(), new_balance);290291 // TODO: implement other modes292 match target_collection.mode 293 {294 CollectionMode::NFT(_) => {295 // Create nft item296 let item = NftItemType {297 collection: collection_id,298 owner: owner,299 data: properties,300 };301 302 Self::add_nft_item(item)?;303 304 },305 _ => ()306 };307308 // call event309 Self::deposit_event(RawEvent::ItemCreated(collection_id, <ItemListIndex>::get(collection_id)));310311 Ok(())312 }313314 #[weight = 0]315 pub fn burn_item(origin, collection_id: u64, item_id: u64) -> DispatchResult {316317 let sender = ensure_signed(origin)?;318 let item_owner = Self::is_item_owner(sender.clone(), collection_id, item_id);319 if !item_owner320 {321 Self::check_owner_or_admin_permissions(collection_id, sender.clone())?;322 }323 324 Self::burn_nft_item(collection_id, item_id)?;325326 // call event327 Self::deposit_event(RawEvent::ItemDestroyed(collection_id, item_id));328329 Ok(())330 }331332 #[weight = 0]333 pub fn transfer(origin, recipient: T::AccountId, collection_id: u64, item_id: u64, value: u64) -> DispatchResult {334335 let sender = ensure_signed(origin)?;336 let item_owner = Self::is_item_owner(sender.clone(), collection_id, item_id);337 if !item_owner338 {339 Self::check_owner_or_admin_permissions(collection_id, sender.clone())?;340 }341342 let target_collection = <Collection<T>>::get(collection_id);343344 // TODO: implement other modes345 match target_collection.mode 346 {347 CollectionMode::NFT(_) => Self::transfer_nft(collection_id, item_id, recipient)?,348 _ => ()349 };350351 Ok(())352 }353354 #[weight = 0]355 pub fn approve(origin, approved: T::AccountId, collection_id: u64, item_id: u64) -> DispatchResult {356357 let sender = ensure_signed(origin)?;358359 let item_owner = Self::is_item_owner(sender.clone(), collection_id, item_id);360 if !item_owner361 {362 Self::check_owner_or_admin_permissions(collection_id, sender.clone())?;363 }364365 let list_exists = <ApprovedList<T>>::contains_key(collection_id, item_id);366 if list_exists {367368 let mut list = <ApprovedList<T>>::get(collection_id, item_id);369 let item_contains = list.contains(&approved.clone());370371 if !item_contains {372 list.push(approved.clone());373 }374 } else {375376 let mut itm = Vec::new();377 itm.push(approved.clone());378 <ApprovedList<T>>::insert(collection_id, item_id, itm);379 }380381 Ok(())382 }383384 #[weight = 0]385 pub fn transfer_from(origin, recipient: T::AccountId, collection_id: u64, item_id: u64, ) -> DispatchResult {386387 let mut approved: bool = false; 388 let sender = ensure_signed(origin)?;389 let approved_list_exists = <ApprovedList<T>>::contains_key(collection_id, item_id);390 if approved_list_exists391 {392 let list_itm = <ApprovedList<T>>::get(collection_id, item_id);393 approved = list_itm.contains(&recipient.clone());394 }395396 if !approved397 {398 Self::check_owner_or_admin_permissions(collection_id, sender)?;399 }400 401 let target_collection = <Collection<T>>::get(collection_id);402403 match target_collection.mode404 {405 CollectionMode::NFT(_) => Self::transfer_nft(collection_id, item_id, recipient)?,406 // TODO: implement other modes407 _ => ()408 };409410 Ok(())411 }412413 #[weight = 0]414 pub fn safe_transfer_from(origin, collection_id: u64, item_id: u64, new_owner: T::AccountId) -> DispatchResult {415416 // let no_perm_mes = "You do not have permissions to modify this collection";417 // ensure!(<ApprovedList<T>>::contains_key((collection_id, item_id)), no_perm_mes);418 // let list_itm = <ApprovedList<T>>::get((collection_id, item_id));419 // ensure!(list_itm.contains(&new_owner.clone()), no_perm_mes);420421 // // on_nft_received call422423 // Self::transfer(origin, collection_id, item_id, new_owner)?;424425 Ok(())426 }427428 #[weight = 0]429 pub fn set_offchain_schema(430 origin,431 collection_id: u64,432 schema: Vec<u8>433 ) -> DispatchResult {434 let sender = ensure_signed(origin)?;435 Self::check_owner_or_admin_permissions(collection_id, sender.clone())?;436 437 let mut target_collection = <Collection<T>>::get(collection_id);438 target_collection.offchain_schema = schema;439 <Collection<T>>::insert(collection_id, target_collection);440441 Ok(()) 442 }443 }444}445446impl<T: Trait> Module<T> {447448 fn collection_exists(collection_id: u64) -> DispatchResult{449 ensure!(<Collection<T>>::contains_key(collection_id), "This collection does not exist");450 Ok(())451 }452453 fn check_owner_permissions(collection_id: u64, subject: T::AccountId) -> DispatchResult {454455 Self::collection_exists(collection_id)?;456457 let target_collection = <Collection<T>>::get(collection_id);458 ensure!(subject == target_collection.owner, "You do not own this collection");459460 Ok(())461 }462463 fn check_owner_or_admin_permissions(collection_id: u64, subject: T::AccountId) -> DispatchResult {464465 Self::collection_exists(collection_id)?;466467 let target_collection = <Collection<T>>::get(collection_id);468 let is_owner = subject == target_collection.owner;469470 let no_perm_mes = "You do not have permissions to modify this collection";471 let exists = <AdminList<T>>::contains_key(collection_id);472473 if !is_owner474 {475 ensure!(exists, no_perm_mes);476 ensure!(<AdminList<T>>::get(collection_id).contains(&subject), no_perm_mes);477 }478 Ok(())479 }480481 fn is_item_owner(subject: T::AccountId, collection_id: u64, item_id: u64) -> bool{482483 let target_collection = <Collection<T>>::get(collection_id);484485 match target_collection.mode {486 CollectionMode::NFT(_) => <NftItemList<T>>::get(collection_id, item_id).owner == subject,487 CollectionMode::Fungible(_) => <FungibleItemList<T>>::get(collection_id, item_id).owner.contains(&subject),488 CollectionMode::ReFungible => <ReFungibleItemList<T>>::get(collection_id, item_id).owner.iter().any(|i| i.owner == subject),489 CollectionMode::Invalid => false490 }491 }492493 fn add_nft_item(item: NftItemType<T::AccountId>) -> DispatchResult {494495 let current_index = <ItemListIndex>::get(item.collection)496 .checked_add(1)497 .expect("Item list index id error");498499 Self::add_token_index(item.collection, current_index, item.owner.clone())?;500501 <ItemListIndex>::insert(item.collection, current_index);502 <NftItemList<T>>::insert(item.collection, current_index, item);503504 Ok(())505 }506507 fn burn_nft_item(collection_id: u64, item_id: u64) -> DispatchResult {508 509 let item = <NftItemList<T>>::get(collection_id, item_id);510 Self::remove_token_index(collection_id, item_id, item.owner.clone())?;511512 // update balance513 let new_balance = <Balance<T>>::get(collection_id, item.owner.clone()).checked_sub(1).unwrap();514 <Balance<T>>::insert(collection_id, item.owner.clone(), new_balance);515 <NftItemList<T>>::remove(collection_id, item_id);516517 Ok(())518 }519520 fn transfer_nft(collection_id: u64, item_id: u64, new_owner: T::AccountId) -> DispatchResult {521522 let mut item = <NftItemList<T>>::get(collection_id, item_id);523524 // update balance525 let balance_old_owner = <Balance<T>>::get(collection_id, item.owner.clone()).checked_sub(1).unwrap();526 <Balance<T>>::insert(collection_id, item.owner.clone(), balance_old_owner);527528 let balance_new_owner = <Balance<T>>::get(collection_id, new_owner.clone()).checked_add(1).unwrap();529 <Balance<T>>::insert(collection_id, new_owner.clone(), balance_new_owner);530531 // change owner532 let old_owner = item.owner.clone();533 item.owner = new_owner.clone();534 <NftItemList<T>>::insert(collection_id, item_id, item);535536 // update index collection537 Self::move_token_index(collection_id, item_id, old_owner, new_owner.clone())?;538539 // reset approved list540 let itm: Vec<T::AccountId> = Vec::new();541 <ApprovedList<T>>::insert(collection_id, item_id, itm);542543 Ok(())544 }545546 fn add_token_index(collection_id: u64, item_index: u64, owner: T::AccountId) -> DispatchResult {547 let list_exists = <AddressTokens<T>>::contains_key(collection_id, owner.clone());548 if list_exists {549 let mut list = <AddressTokens<T>>::get(collection_id, owner.clone());550 let item_contains = list.contains(&item_index.clone());551552 if !item_contains {553 list.push(item_index.clone());554 }555556 <AddressTokens<T>>::insert(collection_id, owner.clone(), list);557 } else {558 let mut itm = Vec::new();559 itm.push(item_index.clone());560 <AddressTokens<T>>::insert(collection_id, owner, itm);561 }562563 Ok(())564 }565566 fn remove_token_index(567 collection_id: u64,568 item_index: u64,569 owner: T::AccountId,570 ) -> DispatchResult {571 let list_exists = <AddressTokens<T>>::contains_key(collection_id, owner.clone());572 if list_exists {573 let mut list = <AddressTokens<T>>::get(collection_id, owner.clone());574 let item_contains = list.contains(&item_index.clone());575576 if item_contains {577 list.retain(|&item| item != item_index);578 <AddressTokens<T>>::insert(collection_id, owner, list);579 }580 }581582 Ok(())583 }584585 fn move_token_index(586 collection_id: u64,587 item_index: u64,588 old_owner: T::AccountId,589 new_owner: T::AccountId,590 ) -> DispatchResult {591 Self::remove_token_index(collection_id, item_index, old_owner)?;592 Self::add_token_index(collection_id, item_index, new_owner)?;593594 Ok(())595 }596}runtime/src/lib.rsdiffbeforeafterboth--- a/runtime/src/lib.rs
+++ b/runtime/src/lib.rs
@@ -14,13 +14,13 @@
use sp_api::impl_runtime_apis;
use sp_consensus_aura::sr25519::AuthorityId as AuraId;
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
-use sp_runtime::traits::{
- BlakeTwo256, Block as BlockT, IdentifyAccount, IdentityLookup, NumberFor, Saturating, Verify,
-};
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys,
transaction_validity::{TransactionSource, TransactionValidity},
ApplyExtrinsicResult, MultiSignature,
+ traits::{
+ BlakeTwo256, Block as BlockT, IdentifyAccount, IdentityLookup, NumberFor, Saturating, Verify,
+ },
};
use sp_std::prelude::*;
#[cfg(feature = "std")]
@@ -32,16 +32,22 @@
pub use contracts::Schedule as ContractsSchedule;
pub use frame_support::{
construct_runtime, parameter_types,
- traits::{KeyOwnerProofSystem, Randomness},
+ traits::{Currency, Get, ExistenceRequirement, KeyOwnerProofSystem, OnUnbalanced, Randomness, WithdrawReason},
weights::{
- constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
- IdentityFee, Weight,
+ DispatchInfo, PostDispatchInfo, constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
+ IdentityFee, Weight, WeightToFeePolynomial, GetDispatchInfo, Pays,
},
StorageValue,
+ dispatch::DispatchResult,
};
+use system::{self as system};
#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
-pub use sp_runtime::{Perbill, Permill};
+use sp_runtime::{
+ Perbill,
+};
+
+
pub use timestamp::Call as TimestampCall;
/// Importing a nft pallet
@@ -228,7 +234,8 @@
}
parameter_types! {
- pub const ExistentialDeposit: u128 = 500;
+ // pub const ExistentialDeposit: u128 = 500;
+ pub const ExistentialDeposit: u128 = 0;
}
impl balances::Trait for Runtime {
@@ -331,7 +338,7 @@
system::CheckEra<Runtime>,
system::CheckNonce<Runtime>,
system::CheckWeight<Runtime>,
- transaction_payment::ChargeTransactionPayment<Runtime>,
+ nft::ChargeTransactionPayment<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
@@ -486,3 +493,4 @@
}
}
}
+