difftreelog
test remove ChainLimits leftovers
in: master
8 files changed
pallets/nft/Cargo.tomldiffbeforeafterboth--- a/pallets/nft/Cargo.toml
+++ b/pallets/nft/Cargo.toml
@@ -41,6 +41,7 @@
'evm-coder/std',
'pallet-evm-coder-substrate/std',
]
+limit-testing = ["nft-data-structs/limit-testing"]
################################################################################
# Substrate Dependencies
pallets/nft/src/default_weights.rsdiffbeforeafterboth--- a/pallets/nft/src/default_weights.rs
+++ b/pallets/nft/src/default_weights.rs
@@ -117,11 +117,6 @@
.saturating_add(DbWeight::get().reads(2_u64))
.saturating_add(DbWeight::get().writes(1_u64))
}
- fn set_chain_limits() -> Weight {
- 1_300_000_u64
- .saturating_add(DbWeight::get().reads(0_u64))
- .saturating_add(DbWeight::get().writes(1_u64))
- }
fn set_contract_sponsoring_rate_limit() -> Weight {
3_500_000_u64
.saturating_add(DbWeight::get().reads(0_u64))
pallets/nft/src/lib.rsdiffbeforeafterboth--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -88,7 +88,6 @@
fn set_variable_meta_data() -> Weight;
fn enable_contract_sponsoring() -> Weight;
fn set_schema_version() -> Weight;
- fn set_chain_limits() -> Weight;
fn set_contract_sponsoring_rate_limit() -> Weight;
fn set_variable_meta_data_sponsoring_rate_limit() -> Weight;
fn toggle_contract_white_list() -> Weight;
@@ -1596,38 +1595,17 @@
) -> DispatchResult {
match target_collection.mode {
CollectionMode::NFT => {
- if let CreateItemData::NFT(data) = data {
- // check sizes
- ensure!(
- CUSTOM_DATA_LIMIT >= data.const_data.len() as u32,
- Error::<T>::TokenConstDataLimitExceeded
- );
- ensure!(
- CUSTOM_DATA_LIMIT >= data.variable_data.len() as u32,
- Error::<T>::TokenVariableDataLimitExceeded
- );
- } else {
+ if !matches!(data, CreateItemData::NFT(_)) {
fail!(Error::<T>::NotNftDataUsedToMintNftCollectionToken);
}
}
CollectionMode::Fungible(_) => {
- if let CreateItemData::Fungible(_) = data {
- } else {
+ if !matches!(data, CreateItemData::Fungible(_)) {
fail!(Error::<T>::NotFungibleDataUsedToMintFungibleCollectionToken);
}
}
CollectionMode::ReFungible => {
if let CreateItemData::ReFungible(data) = data {
- // check sizes
- ensure!(
- CUSTOM_DATA_LIMIT >= data.const_data.len() as u32,
- Error::<T>::TokenConstDataLimitExceeded
- );
- ensure!(
- CUSTOM_DATA_LIMIT >= data.variable_data.len() as u32,
- Error::<T>::TokenVariableDataLimitExceeded
- );
-
// Check refungibility limits
ensure!(
data.pieces <= MAX_REFUNGIBLE_PIECES,
pallets/nft/src/tests.rsdiffbeforeafterboth--- a/pallets/nft/src/tests.rs
+++ b/pallets/nft/src/tests.rs
@@ -1,40 +1,18 @@
// Tests to be written here
use super::*;
use crate::mock::*;
-use crate::{AccessMode, CollectionMode, Ownership, ChainLimits, CreateItemData};
+use crate::{AccessMode, CollectionMode, Ownership, CreateItemData};
use nft_data_structs::{
CreateNftData, CreateFungibleData, CreateReFungibleData, CollectionId, TokenId,
MAX_DECIMAL_POINTS,
};
use frame_support::{assert_noop, assert_ok};
-use frame_system::{RawOrigin};
-
-fn default_collection_numbers_limit() -> u32 {
- 10
-}
-
-fn default_limits() {
- assert_ok!(TemplateModule::set_chain_limits(
- RawOrigin::Root.into(),
- ChainLimits {
- collection_numbers_limit: default_collection_numbers_limit(),
- account_token_ownership_limit: 10,
- collections_admins_limit: 5,
- custom_data_limit: 2048,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }
- ));
-}
+use sp_std::convert::TryInto;
fn default_nft_data() -> CreateNftData {
CreateNftData {
- const_data: vec![1, 2, 3],
- variable_data: vec![3, 2, 1],
+ const_data: vec![1, 2, 3].try_into().unwrap(),
+ variable_data: vec![3, 2, 1].try_into().unwrap(),
}
}
@@ -44,8 +22,8 @@
fn default_re_fungible_data() -> CreateReFungibleData {
CreateReFungibleData {
- const_data: vec![1, 2, 3],
- variable_data: vec![3, 2, 1],
+ const_data: vec![1, 2, 3].try_into().unwrap(),
+ variable_data: vec![3, 2, 1].try_into().unwrap(),
pieces: 1023,
}
}
@@ -112,7 +90,6 @@
#[test]
fn set_version_schema() {
new_test_ext().execute_with(|| {
- default_limits();
let origin1 = Origin::signed(1);
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
@@ -133,8 +110,6 @@
#[test]
fn create_fungible_collection_fails_with_large_decimal_numbers() {
new_test_ext().execute_with(|| {
- default_limits();
-
let col_name1: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
let col_desc1: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();
let token_prefix1: Vec<u8> = b"token_prefix1\0".to_vec();
@@ -156,14 +131,13 @@
#[test]
fn create_nft_item() {
new_test_ext().execute_with(|| {
- default_limits();
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let data = default_nft_data();
create_test_item(collection_id, &data.clone().into());
let item = TemplateModule::nft_item_id(collection_id, 1).unwrap();
- assert_eq!(item.const_data, data.const_data);
- assert_eq!(item.variable_data, data.variable_data);
+ assert_eq!(item.const_data, data.const_data.into_inner());
+ assert_eq!(item.variable_data, data.variable_data.into_inner());
});
}
@@ -172,8 +146,6 @@
#[test]
fn create_nft_multiple_items() {
new_test_ext().execute_with(|| {
- default_limits();
-
create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -190,10 +162,10 @@
.map(|d| { d.into() })
.collect()
));
- for (index, data) in items_data.iter().enumerate() {
+ for (index, data) in items_data.into_iter().enumerate() {
let item = TemplateModule::nft_item_id(1, (index + 1) as TokenId).unwrap();
- assert_eq!(item.const_data.to_vec(), data.const_data);
- assert_eq!(item.variable_data.to_vec(), data.variable_data);
+ assert_eq!(item.const_data.to_vec(), data.const_data.into_inner());
+ assert_eq!(item.variable_data.to_vec(), data.variable_data.into_inner());
}
});
}
@@ -201,14 +173,13 @@
#[test]
fn create_refungible_item() {
new_test_ext().execute_with(|| {
- default_limits();
let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
let data = default_re_fungible_data();
create_test_item(collection_id, &data.clone().into());
let item = TemplateModule::refungible_item_id(collection_id, 1).unwrap();
- assert_eq!(item.const_data, data.const_data);
- assert_eq!(item.variable_data, data.variable_data);
+ assert_eq!(item.const_data, data.const_data.into_inner());
+ assert_eq!(item.variable_data, data.variable_data.into_inner());
assert_eq!(
item.owner[0],
Ownership {
@@ -222,8 +193,6 @@
#[test]
fn create_multiple_refungible_items() {
new_test_ext().execute_with(|| {
- default_limits();
-
create_test_collection(&CollectionMode::ReFungible, 1);
let origin1 = Origin::signed(1);
@@ -244,10 +213,10 @@
.map(|d| { d.into() })
.collect()
));
- for (index, data) in items_data.iter().enumerate() {
+ for (index, data) in items_data.into_iter().enumerate() {
let item = TemplateModule::refungible_item_id(1, (index + 1) as TokenId).unwrap();
- assert_eq!(item.const_data.to_vec(), data.const_data);
- assert_eq!(item.variable_data.to_vec(), data.variable_data);
+ assert_eq!(item.const_data.to_vec(), data.const_data.into_inner());
+ assert_eq!(item.variable_data.to_vec(), data.variable_data.into_inner());
assert_eq!(
item.owner[0],
Ownership {
@@ -262,8 +231,6 @@
#[test]
fn create_fungible_item() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
let data = default_fungible_data();
@@ -302,8 +269,6 @@
#[test]
fn transfer_fungible_item() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
let origin1 = Origin::signed(1);
@@ -344,8 +309,6 @@
#[test]
fn transfer_refungible_item() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
let data = default_re_fungible_data();
@@ -355,8 +318,8 @@
let origin2 = Origin::signed(2);
{
let item = TemplateModule::refungible_item_id(collection_id, 1).unwrap();
- assert_eq!(item.const_data, data.const_data);
- assert_eq!(item.variable_data, data.variable_data);
+ assert_eq!(item.const_data, data.const_data.into_inner());
+ assert_eq!(item.variable_data, data.variable_data.into_inner());
assert_eq!(
item.owner[0],
Ownership {
@@ -441,8 +404,6 @@
#[test]
fn transfer_nft_item() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let data = default_nft_data();
@@ -464,8 +425,6 @@
#[test]
fn nft_approve_and_transfer_from() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let data = default_nft_data();
@@ -503,8 +462,6 @@
#[test]
fn nft_approve_and_transfer_from_white_list() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -514,8 +471,8 @@
create_test_item(collection_id, &data.clone().into());
assert_eq!(
- TemplateModule::nft_item_id(1, 1).unwrap().const_data,
- data.const_data
+ &TemplateModule::nft_item_id(1, 1).unwrap().const_data,
+ &data.const_data.into_inner()
);
assert_eq!(TemplateModule::balance_count(1, 1), 1);
assert_eq!(TemplateModule::address_tokens(1, 1), [1]);
@@ -573,8 +530,6 @@
#[test]
fn refungible_approve_and_transfer_from() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
let origin1 = Origin::signed(1);
@@ -636,8 +591,6 @@
#[test]
fn fungible_approve_and_transfer_from() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
let data = default_fungible_data();
@@ -710,8 +663,6 @@
#[test]
fn change_collection_owner() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -730,8 +681,6 @@
#[test]
fn destroy_collection() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -742,8 +691,6 @@
#[test]
fn burn_nft_item() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -773,8 +720,6 @@
#[test]
fn burn_fungible_item() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
let origin1 = Origin::signed(1);
@@ -804,8 +749,6 @@
#[test]
fn burn_refungible_item() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
let origin1 = Origin::signed(1);
@@ -851,8 +794,6 @@
#[test]
fn add_collection_admin() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection1_id = create_test_collection_for_owner(&CollectionMode::NFT, 1, 1);
create_test_collection_for_owner(&CollectionMode::NFT, 2, 2);
create_test_collection_for_owner(&CollectionMode::NFT, 3, 3);
@@ -879,8 +820,6 @@
#[test]
fn remove_collection_admin() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection1_id = create_test_collection_for_owner(&CollectionMode::NFT, 1, 1);
create_test_collection_for_owner(&CollectionMode::NFT, 2, 2);
create_test_collection_for_owner(&CollectionMode::NFT, 3, 3);
@@ -916,8 +855,6 @@
#[test]
fn balance_of() {
new_test_ext().execute_with(|| {
- default_limits();
-
let nft_collection_id = create_test_collection(&CollectionMode::NFT, 1);
let fungible_collection_id = create_test_collection(&CollectionMode::Fungible(3), 2);
let re_fungible_collection_id = create_test_collection(&CollectionMode::ReFungible, 3);
@@ -969,8 +906,6 @@
#[test]
fn approve() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let data = default_nft_data();
@@ -987,8 +922,6 @@
#[test]
fn transfer_from() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
let origin2 = Origin::signed(2);
@@ -1051,8 +984,6 @@
#[test]
fn owner_can_add_address_to_white_list() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1068,8 +999,6 @@
#[test]
fn admin_can_add_address_to_white_list() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
let origin2 = Origin::signed(2);
@@ -1091,8 +1020,6 @@
#[test]
fn nonprivileged_user_cannot_add_address_to_white_list() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin2 = Origin::signed(2);
@@ -1106,8 +1033,6 @@
#[test]
fn nobody_can_add_address_to_white_list_of_nonexisting_collection() {
new_test_ext().execute_with(|| {
- default_limits();
-
let origin1 = Origin::signed(1);
assert_noop!(
@@ -1120,8 +1045,6 @@
#[test]
fn nobody_can_add_address_to_white_list_of_deleted_collection() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1140,8 +1063,6 @@
#[test]
fn address_is_already_added_to_white_list() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1162,8 +1083,6 @@
#[test]
fn owner_can_remove_address_from_white_list() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1184,8 +1103,6 @@
#[test]
fn admin_can_remove_address_from_white_list() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
let origin2 = Origin::signed(2);
@@ -1213,8 +1130,6 @@
#[test]
fn nonprivileged_user_cannot_remove_address_from_white_list() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
let origin2 = Origin::signed(2);
@@ -1235,7 +1150,6 @@
#[test]
fn nobody_can_remove_address_from_white_list_of_nonexisting_collection() {
new_test_ext().execute_with(|| {
- default_limits();
let origin1 = Origin::signed(1);
assert_noop!(
@@ -1248,8 +1162,6 @@
#[test]
fn nobody_can_remove_address_from_white_list_of_deleted_collection() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
let origin2 = Origin::signed(2);
@@ -1272,8 +1184,6 @@
#[test]
fn address_is_already_removed_from_white_list() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1300,8 +1210,6 @@
#[test]
fn white_list_test_1() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1330,8 +1238,6 @@
#[test]
fn white_list_test_2() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1381,8 +1287,6 @@
#[test]
fn white_list_test_3() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1411,8 +1315,6 @@
#[test]
fn white_list_test_4() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1463,8 +1365,6 @@
#[test]
fn white_list_test_5() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1488,8 +1388,6 @@
#[test]
fn white_list_test_6() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1516,8 +1414,6 @@
#[test]
fn white_list_test_7() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let data = default_nft_data();
@@ -1548,8 +1444,6 @@
#[test]
fn white_list_test_8() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let data = default_nft_data();
@@ -1598,8 +1492,6 @@
#[test]
fn white_list_test_9() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1623,8 +1515,6 @@
#[test]
fn white_list_test_10() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1660,8 +1550,6 @@
#[test]
fn white_list_test_11() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1694,8 +1582,6 @@
#[test]
fn white_list_test_12() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1723,8 +1609,6 @@
#[test]
fn white_list_test_13() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1749,8 +1633,6 @@
#[test]
fn white_list_test_14() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1786,8 +1668,6 @@
#[test]
fn white_list_test_15() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1815,8 +1695,6 @@
#[test]
fn white_list_test_16() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1851,8 +1729,6 @@
#[test]
fn total_number_collections_bound() {
new_test_ext().execute_with(|| {
- default_limits();
-
create_test_collection(&CollectionMode::NFT, 1);
});
}
@@ -1861,11 +1737,9 @@
#[test]
fn total_number_collections_bound_neg() {
new_test_ext().execute_with(|| {
- default_limits();
-
let origin1 = Origin::signed(1);
- for i in 0..default_collection_numbers_limit() {
+ for i in 0..COLLECTION_NUMBER_LIMIT {
create_test_collection(&CollectionMode::NFT, i + 1);
}
@@ -1891,8 +1765,6 @@
#[test]
fn owned_tokens_bound() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let data = default_nft_data();
@@ -1905,28 +1777,16 @@
#[test]
fn owned_tokens_bound_neg() {
new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(
- RawOrigin::Root.into(),
- ChainLimits {
- collection_numbers_limit: 10,
- account_token_ownership_limit: 1,
- collections_admins_limit: 5,
- custom_data_limit: 2048,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }
- ));
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
- let data = default_nft_data();
- create_test_item(collection_id, &data.clone().into());
+ for _ in 0..ACCOUNT_TOKEN_OWNERSHIP_LIMIT {
+ let data = default_nft_data();
+ create_test_item(collection_id, &data.clone().into());
+ }
+
+ let data = default_nft_data();
assert_noop!(
TemplateModule::create_item(origin1, 1, account(1), data.into()),
Error::<Test>::AddressOwnershipLimitExceeded
@@ -1938,22 +1798,6 @@
#[test]
fn collection_admins_bound() {
new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(
- RawOrigin::Root.into(),
- ChainLimits {
- collection_numbers_limit: 10,
- account_token_ownership_limit: 10,
- collections_admins_limit: 2,
- custom_data_limit: 2048,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }
- ));
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -1975,174 +1819,20 @@
#[test]
fn collection_admins_bound_neg() {
new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(
- RawOrigin::Root.into(),
- ChainLimits {
- collection_numbers_limit: 10,
- account_token_ownership_limit: 1,
- collections_admins_limit: 1,
- custom_data_limit: 2048,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }
- ));
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
- assert_ok!(TemplateModule::add_collection_admin(
- origin1.clone(),
- collection_id,
- account(2)
- ));
+ for i in 0..COLLECTION_ADMINS_LIMIT {
+ assert_ok!(TemplateModule::add_collection_admin(
+ origin1.clone(),
+ collection_id,
+ account(2 + i)
+ ));
+ }
assert_noop!(
- TemplateModule::add_collection_admin(origin1, collection_id, account(3)),
+ TemplateModule::add_collection_admin(origin1, collection_id, account(3 + COLLECTION_ADMINS_LIMIT)),
Error::<Test>::CollectionAdminsLimitExceeded
- );
- });
-}
-
-// NFT custom data size. Negative test const_data.
-#[test]
-fn custom_data_size_nft_const_data_bound_neg() {
- new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(
- RawOrigin::Root.into(),
- ChainLimits {
- collection_numbers_limit: 10,
- account_token_ownership_limit: 10,
- collections_admins_limit: 5,
- custom_data_limit: 2,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }
- ));
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-
- let origin1 = Origin::signed(1);
- let too_big_const_data = CreateItemData::NFT(CreateNftData {
- const_data: vec![1, 2, 3, 4],
- variable_data: vec![],
- });
-
- assert_noop!(
- TemplateModule::create_item(origin1, collection_id, account(1), too_big_const_data),
- Error::<Test>::TokenConstDataLimitExceeded
- );
- });
-}
-
-// NFT custom data size. Negative test variable_data.
-#[test]
-fn custom_data_size_nft_variable_data_bound_neg() {
- new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(
- RawOrigin::Root.into(),
- ChainLimits {
- collection_numbers_limit: 10,
- account_token_ownership_limit: 10,
- collections_admins_limit: 5,
- custom_data_limit: 2,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }
- ));
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-
- let origin1 = Origin::signed(1);
- let too_big_const_data = CreateItemData::NFT(CreateNftData {
- const_data: vec![],
- variable_data: vec![1, 2, 3, 4],
- });
-
- assert_noop!(
- TemplateModule::create_item(origin1, collection_id, account(1), too_big_const_data),
- Error::<Test>::TokenVariableDataLimitExceeded
- );
- });
-}
-
-// Re fungible custom data size. Negative test const_data.
-#[test]
-fn custom_data_size_re_fungible_const_data_bound_neg() {
- new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(
- RawOrigin::Root.into(),
- ChainLimits {
- collection_numbers_limit: 10,
- account_token_ownership_limit: 10,
- collections_admins_limit: 5,
- custom_data_limit: 2,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }
- ));
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-
- let origin1 = Origin::signed(1);
- let too_big_const_data = CreateItemData::NFT(CreateNftData {
- const_data: vec![1, 2, 3, 4],
- variable_data: vec![],
- });
-
- assert_noop!(
- TemplateModule::create_item(origin1, collection_id, account(1), too_big_const_data),
- Error::<Test>::TokenConstDataLimitExceeded
- );
- });
-}
-
-// Re fungible custom data size. Negative test variable_data.
-#[test]
-fn custom_data_size_re_fungible_variable_data_bound_neg() {
- new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(
- RawOrigin::Root.into(),
- ChainLimits {
- collection_numbers_limit: 10,
- account_token_ownership_limit: 10,
- collections_admins_limit: 5,
- custom_data_limit: 2,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }
- ));
-
- let collection_id = create_test_collection(&CollectionMode::NFT, 1);
-
- let origin1 = Origin::signed(1);
- let too_big_const_data = CreateItemData::NFT(CreateNftData {
- const_data: vec![],
- variable_data: vec![1, 2, 3, 4],
- });
-
- assert_noop!(
- TemplateModule::create_item(origin1, collection_id, account(1), too_big_const_data),
- Error::<Test>::TokenVariableDataLimitExceeded
);
});
}
@@ -2151,8 +1841,6 @@
#[test]
fn set_const_on_chain_schema() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -2180,8 +1868,6 @@
#[test]
fn set_variable_on_chain_schema() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -2209,8 +1895,6 @@
#[test]
fn set_variable_meta_data_on_nft_token_stores_variable_meta_data() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -2218,7 +1902,7 @@
let data = default_nft_data();
create_test_item(1, &data.into());
- let variable_data = b"test set_variable_meta_data method.".to_vec();
+ let variable_data = b"test data".to_vec();
assert_ok!(TemplateModule::set_variable_meta_data(
origin1,
collection_id,
@@ -2238,8 +1922,6 @@
#[test]
fn set_variable_meta_data_on_re_fungible_token_stores_variable_meta_data() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
let origin1 = Origin::signed(1);
@@ -2247,7 +1929,7 @@
let data = default_re_fungible_data();
create_test_item(1, &data.into());
- let variable_data = b"test set_variable_meta_data method.".to_vec();
+ let variable_data = b"test data".to_vec();
assert_ok!(TemplateModule::set_variable_meta_data(
origin1,
collection_id,
@@ -2267,8 +1949,6 @@
#[test]
fn set_variable_meta_data_on_fungible_token_fails() {
new_test_ext().execute_with(|| {
- default_limits();
-
let collection_id = create_test_collection(&CollectionMode::Fungible(3), 1);
let origin1 = Origin::signed(1);
@@ -2276,7 +1956,7 @@
let data = default_fungible_data();
create_test_item(1, &data.into());
- let variable_data = b"test set_variable_meta_data method.".to_vec();
+ let variable_data = b"test data".to_vec();
assert_noop!(
TemplateModule::set_variable_meta_data(origin1, collection_id, 1, variable_data),
Error::<Test>::CantStoreMetadataInFungibleTokens
@@ -2287,22 +1967,6 @@
#[test]
fn set_variable_meta_data_on_nft_token_fails_for_big_data() {
new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(
- RawOrigin::Root.into(),
- ChainLimits {
- collection_numbers_limit: default_collection_numbers_limit(),
- account_token_ownership_limit: 10,
- collections_admins_limit: 5,
- custom_data_limit: 10,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }
- ));
-
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
let origin1 = Origin::signed(1);
@@ -2321,22 +1985,6 @@
#[test]
fn set_variable_meta_data_on_re_fungible_token_fails_for_big_data() {
new_test_ext().execute_with(|| {
- assert_ok!(TemplateModule::set_chain_limits(
- RawOrigin::Root.into(),
- ChainLimits {
- collection_numbers_limit: default_collection_numbers_limit(),
- account_token_ownership_limit: 10,
- collections_admins_limit: 5,
- custom_data_limit: 10,
- nft_sponsor_transfer_timeout: 15,
- fungible_sponsor_transfer_timeout: 15,
- refungible_sponsor_transfer_timeout: 15,
- const_on_chain_schema_limit: 1024,
- offchain_schema_limit: 1024,
- variable_on_chain_schema_limit: 1024,
- }
- ));
-
let collection_id = create_test_collection(&CollectionMode::ReFungible, 1);
let origin1 = Origin::signed(1);
@@ -2355,8 +2003,6 @@
#[test]
fn collection_transfer_flag_works() {
new_test_ext().execute_with(|| {
- default_limits();
-
let origin1 = Origin::signed(1);
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
@@ -2382,8 +2028,6 @@
#[test]
fn collection_transfer_flag_works_neg() {
new_test_ext().execute_with(|| {
- default_limits();
-
let origin1 = Origin::signed(1);
let collection_id = create_test_collection(&CollectionMode::NFT, 1);
primitives/nft/Cargo.tomldiffbeforeafterboth--- a/primitives/nft/Cargo.toml
+++ b/primitives/nft/Cargo.toml
@@ -32,4 +32,5 @@
"sp-core/std",
"sp-std/std",
]
-serde1 = ["serde"]
\ No newline at end of file
+serde1 = ["serde"]
+limit-testing = []
\ No newline at end of file
primitives/nft/src/lib.rsdiffbeforeafterboth--- a/primitives/nft/src/lib.rs
+++ b/primitives/nft/src/lib.rs
@@ -28,10 +28,10 @@
pub const MAX_SPONSOR_TIMEOUT: u32 = 10_368_000;
pub const MAX_TOKEN_OWNERSHIP: u32 = 10_000_000;
-pub const COLLECTION_NUMBER_LIMIT: u32 = 100000;
-pub const CUSTOM_DATA_LIMIT: u32 = 2048;
+pub const COLLECTION_NUMBER_LIMIT: u32 = if cfg!(not(feature = "limit-testing")) { 100000 } else { 10 };
+pub const CUSTOM_DATA_LIMIT: u32 = if cfg!(not(feature = "limit-testing")) { 2048 } else { 10 };
pub const COLLECTION_ADMINS_LIMIT: u64 = 5;
-pub const ACCOUNT_TOKEN_OWNERSHIP_LIMIT: u32 = 1000000;
+pub const ACCOUNT_TOKEN_OWNERSHIP_LIMIT: u32 = if cfg!(not(feature = "limit-testing")) { 1000000 } else { 10 };
// Timeouts for item types in passed blocks
pub const NFT_SPONSOR_TRANSFER_TIMEOUT: u32 = 5;
runtime/Cargo.tomldiffbeforeafterboth1################################################################################2# Package 34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Substrate node nft'8edition = '2018'9homepage = 'https://unique.network'10license = 'All Rights Reserved'11name = 'nft-runtime'12repository = 'https://github.com/usetech-llc/nft_private/'13version = '3.0.0'1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19default = ['std']20runtime-benchmarks = [21 'hex-literal',22 'frame-benchmarking',23 'frame-support/runtime-benchmarks',24 'frame-system-benchmarking',25 'frame-system/runtime-benchmarks',26 'pallet-balances/runtime-benchmarks',27 'pallet-timestamp/runtime-benchmarks',28 'pallet-nft/runtime-benchmarks',29 'pallet-inflation/runtime-benchmarks',30 'sp-runtime/runtime-benchmarks',31]32std = [33 'codec/std',34 'max-encoded-len/std',35 'cumulus-pallet-aura-ext/std',36 'cumulus-pallet-parachain-system/std',37 'cumulus-pallet-xcm/std',38 'cumulus-pallet-xcmp-queue/std',39 'cumulus-primitives-core/std',40 'cumulus-primitives-utility/std',41 'frame-executive/std',42 'frame-support/std',43 'frame-system/std',44 'frame-system-rpc-runtime-api/std',45 'pallet-aura/std',46 'pallet-balances/std',47 # 'pallet-contracts/std',48 # 'pallet-contracts-primitives/std',49 # 'pallet-contracts-rpc-runtime-api/std',50 # 'pallet-contract-helpers/std',51 'pallet-randomness-collective-flip/std',52 'pallet-sudo/std',53 'pallet-timestamp/std',54 'pallet-transaction-payment/std',55 'pallet-transaction-payment-rpc-runtime-api/std',56 'pallet-treasury/std',57 'pallet-vesting/std',58 'pallet-evm/std',59 'pallet-evm-contract-helpers/std',60 'pallet-evm-transaction-payment/std',61 'pallet-evm-coder-substrate/std',62 'pallet-ethereum/std',63 'fp-rpc/std',64 'parachain-info/std',65 'serde',66 'pallet-inflation/std',67 'pallet-nft/std',68 'pallet-scheduler/std',69 'pallet-nft-charge-transaction/std',70 'pallet-nft-transaction-payment/std',71 'nft-data-structs/std',72 'sp-api/std',73 'sp-block-builder/std',74 "sp-consensus-aura/std",75 'sp-core/std',76 'sp-inherents/std',77 'sp-io/std',78 'sp-offchain/std',79 'sp-runtime/std',80 'sp-session/std',81 'sp-std/std',82 'sp-transaction-pool/std',83 'sp-version/std',84 'xcm/std',85 'xcm-builder/std',86 'xcm-executor/std',87]8889################################################################################90# Substrate Dependencies9192[dependencies.codec]93default-features = false94features = ['derive']95package = 'parity-scale-codec'96version = '2.0.0'9798[dependencies.frame-benchmarking]99default-features = false100git = 'https://github.com/paritytech/substrate.git'101optional = true102branch = 'polkadot-v0.9.8'103version = '3.0.0'104105[dependencies.frame-executive]106default-features = false107git = 'https://github.com/paritytech/substrate.git'108branch = 'polkadot-v0.9.8'109version = '3.0.0'110111[dependencies.frame-support]112default-features = false113git = 'https://github.com/paritytech/substrate.git'114branch = 'polkadot-v0.9.8'115version = '3.0.0'116117[dependencies.frame-system]118default-features = false119git = 'https://github.com/paritytech/substrate.git'120branch = 'polkadot-v0.9.8'121version = '3.0.0'122123[dependencies.frame-system-benchmarking]124default-features = false125git = 'https://github.com/paritytech/substrate.git'126optional = true127branch = 'polkadot-v0.9.8'128version = '3.0.0'129130[dependencies.frame-system-rpc-runtime-api]131default-features = false132git = 'https://github.com/paritytech/substrate.git'133branch = 'polkadot-v0.9.8'134version = '3.0.0'135136[dependencies.hex-literal]137optional = true138version = '0.3.1'139140[dependencies.serde]141default-features = false142features = ['derive']143optional = true144version = '1.0.119'145146[dependencies.pallet-aura]147default-features = false148git = 'https://github.com/paritytech/substrate.git'149branch = 'polkadot-v0.9.8'150version = '3.0.0'151152[dependencies.pallet-balances]153default-features = false154git = 'https://github.com/paritytech/substrate.git'155branch = 'polkadot-v0.9.8'156version = '3.0.0'157158# Contracts specific packages159# [dependencies.pallet-contracts]160# git = 'https://github.com/paritytech/substrate.git'161# default-features = false162# branch = 'polkadot-v0.9.8'163# version = '3.0.0'164165# [dependencies.pallet-contracts-primitives]166# git = 'https://github.com/paritytech/substrate.git'167# default-features = false168# branch = 'polkadot-v0.9.8'169# version = '3.0.0'170171# [dependencies.pallet-contracts-rpc-runtime-api]172# git = 'https://github.com/paritytech/substrate.git'173# default-features = false174# branch = 'polkadot-v0.9.8'175# version = '3.0.0'176177[dependencies.pallet-randomness-collective-flip]178default-features = false179git = 'https://github.com/paritytech/substrate.git'180branch = 'polkadot-v0.9.8'181version = '3.0.0'182183[dependencies.pallet-sudo]184default-features = false185git = 'https://github.com/paritytech/substrate.git'186branch = 'polkadot-v0.9.8'187version = '3.0.0'188189[dependencies.pallet-timestamp]190default-features = false191git = 'https://github.com/paritytech/substrate.git'192branch = 'polkadot-v0.9.8'193version = '3.0.0'194195[dependencies.pallet-transaction-payment]196default-features = false197git = 'https://github.com/paritytech/substrate.git'198branch = 'polkadot-v0.9.8'199version = '3.0.0'200201[dependencies.pallet-transaction-payment-rpc-runtime-api]202default-features = false203git = 'https://github.com/paritytech/substrate.git'204branch = 'polkadot-v0.9.8'205version = '3.0.0'206207[dependencies.pallet-treasury]208default-features = false209git = 'https://github.com/paritytech/substrate.git'210branch = 'polkadot-v0.9.8'211version = '3.0.0'212213[dependencies.pallet-vesting]214default-features = false215git = 'https://github.com/paritytech/substrate.git'216branch = 'polkadot-v0.9.8'217version = '3.0.0'218219[dependencies.sp-arithmetic]220default-features = false221git = 'https://github.com/paritytech/substrate.git'222branch = 'polkadot-v0.9.8'223version = '3.0.0'224225[dependencies.sp-api]226default-features = false227git = 'https://github.com/paritytech/substrate.git'228branch = 'polkadot-v0.9.8'229version = '3.0.0'230231[dependencies.sp-block-builder]232default-features = false233git = 'https://github.com/paritytech/substrate.git'234branch = 'polkadot-v0.9.8'235version = '3.0.0'236237[dependencies.sp-core]238default-features = false239git = 'https://github.com/paritytech/substrate.git'240branch = 'polkadot-v0.9.8'241version = '3.0.0'242243[dependencies.sp-consensus-aura]244default-features = false245git = 'https://github.com/paritytech/substrate.git'246branch = 'polkadot-v0.9.8'247version = '0.9.0'248249[dependencies.sp-inherents]250default-features = false251git = 'https://github.com/paritytech/substrate.git'252branch = 'polkadot-v0.9.8'253version = '3.0.0'254255[dependencies.sp-io]256default-features = false257git = 'https://github.com/paritytech/substrate.git'258branch = 'polkadot-v0.9.8'259version = '3.0.0'260261[dependencies.sp-offchain]262default-features = false263git = 'https://github.com/paritytech/substrate.git'264branch = 'polkadot-v0.9.8'265version = '3.0.0'266267[dependencies.sp-runtime]268default-features = false269git = 'https://github.com/paritytech/substrate.git'270branch = 'polkadot-v0.9.8'271version = '3.0.0'272273[dependencies.sp-session]274default-features = false275git = 'https://github.com/paritytech/substrate.git'276branch = 'polkadot-v0.9.8'277version = '3.0.0'278279[dependencies.sp-std]280default-features = false281git = 'https://github.com/paritytech/substrate.git'282branch = 'polkadot-v0.9.8'283version = '3.0.0'284285[dependencies.sp-transaction-pool]286default-features = false287git = 'https://github.com/paritytech/substrate.git'288branch = 'polkadot-v0.9.8'289version = '3.0.0'290291[dependencies.sp-version]292default-features = false293git = 'https://github.com/paritytech/substrate.git'294branch = 'polkadot-v0.9.8'295version = '3.0.0'296297[dependencies.smallvec]298version = '1.4.1'299300################################################################################301# Cumulus dependencies302303[dependencies.parachain-info]304default-features = false305git = 'https://github.com/paritytech/cumulus.git'306branch = 'polkadot-v0.9.8'307version = '0.1.0'308309[dependencies.cumulus-pallet-aura-ext]310git = 'https://github.com/paritytech/cumulus.git'311branch = 'polkadot-v0.9.8'312default-features = false313314[dependencies.cumulus-pallet-parachain-system]315git = 'https://github.com/paritytech/cumulus.git'316branch = 'polkadot-v0.9.8'317default-features = false318319[dependencies.cumulus-primitives-core]320git = 'https://github.com/paritytech/cumulus.git'321branch = 'polkadot-v0.9.8'322default-features = false323324[dependencies.cumulus-pallet-xcm]325git = 'https://github.com/paritytech/cumulus.git'326branch = 'polkadot-v0.9.8'327default-features = false328329[dependencies.cumulus-pallet-dmp-queue]330git = 'https://github.com/paritytech/cumulus.git'331branch = 'polkadot-v0.9.8'332default-features = false333334[dependencies.cumulus-pallet-xcmp-queue]335git = 'https://github.com/paritytech/cumulus.git'336branch = 'polkadot-v0.9.8'337default-features = false338339[dependencies.cumulus-primitives-utility]340git = 'https://github.com/paritytech/cumulus.git'341branch = 'polkadot-v0.9.8'342default-features = false343344[dependencies.cumulus-primitives-timestamp]345git = 'https://github.com/paritytech/cumulus.git'346branch = 'polkadot-v0.9.8'347default-features = false348349################################################################################350# Polkadot dependencies351352[dependencies.polkadot-parachain]353git = 'https://github.com/paritytech/polkadot'354branch = 'release-v0.9.8'355default-features = false356357[dependencies.xcm]358git = 'https://github.com/paritytech/polkadot'359branch = 'release-v0.9.8'360default-features = false361362[dependencies.xcm-builder]363git = 'https://github.com/paritytech/polkadot'364branch = 'release-v0.9.8'365default-features = false366367[dependencies.xcm-executor]368git = 'https://github.com/paritytech/polkadot'369branch = 'release-v0.9.8'370default-features = false371372[dependencies.pallet-xcm]373git = 'https://github.com/paritytech/polkadot'374branch = 'release-v0.9.8'375default-features = false376377378################################################################################379# local dependencies380381[dependencies]382max-encoded-len = { default-features = false, features = ['derive'], version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }383derivative = "2.2.0"384pallet-nft = { path = '../pallets/nft', default-features = false, version = '3.0.0' }385pallet-inflation = { path = '../pallets/inflation', default-features = false, version = '3.0.0' }386nft-data-structs = { path = '../primitives/nft', default-features = false, version = '0.9.0' }387pallet-scheduler = { path = '../pallets/scheduler', default-features = false, version = '3.0.0' }388# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }389pallet-nft-transaction-payment = { path = '../pallets/nft-transaction-payment', default-features = false, version = '3.0.0' }390pallet-nft-charge-transaction = { path = '../pallets/nft-charge-transaction', default-features = false, version = '3.0.0' }391pallet-evm-contract-helpers = { path = '../pallets/evm-contract-helpers', default-features = false }392pallet-evm-transaction-payment = { path = '../pallets/evm-transaction-payment', default-features = false }393pallet-evm-coder-substrate = { default-features = false, path = "../pallets/evm-coder-substrate" }394395pallet-evm = { default-features = false, version = "5.0.0-dev", git = "https://github.com/uniquenetwork/frontier.git", branch = "injected-transactions-parachain" }396pallet-ethereum = { default-features = false, version = "3.0.0-dev", git = "https://github.com/uniquenetwork/frontier.git", branch = "injected-transactions-parachain" }397fp-rpc = { default-features = false, version = "2.0.0", git = "https://github.com/uniquenetwork/frontier.git", branch = "injected-transactions-parachain" }398399################################################################################400# Build Dependencies401402[build-dependencies]403substrate-wasm-builder = '4.0.0'1################################################################################2# Package 34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Substrate node nft'8edition = '2018'9homepage = 'https://unique.network'10license = 'All Rights Reserved'11name = 'nft-runtime'12repository = 'https://github.com/usetech-llc/nft_private/'13version = '3.0.0'1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19default = ['std']20runtime-benchmarks = [21 'hex-literal',22 'frame-benchmarking',23 'frame-support/runtime-benchmarks',24 'frame-system-benchmarking',25 'frame-system/runtime-benchmarks',26 'pallet-balances/runtime-benchmarks',27 'pallet-timestamp/runtime-benchmarks',28 'pallet-nft/runtime-benchmarks',29 'pallet-inflation/runtime-benchmarks',30 'sp-runtime/runtime-benchmarks',31]32std = [33 'codec/std',34 'max-encoded-len/std',35 'cumulus-pallet-aura-ext/std',36 'cumulus-pallet-parachain-system/std',37 'cumulus-pallet-xcm/std',38 'cumulus-pallet-xcmp-queue/std',39 'cumulus-primitives-core/std',40 'cumulus-primitives-utility/std',41 'frame-executive/std',42 'frame-support/std',43 'frame-system/std',44 'frame-system-rpc-runtime-api/std',45 'pallet-aura/std',46 'pallet-balances/std',47 # 'pallet-contracts/std',48 # 'pallet-contracts-primitives/std',49 # 'pallet-contracts-rpc-runtime-api/std',50 # 'pallet-contract-helpers/std',51 'pallet-randomness-collective-flip/std',52 'pallet-sudo/std',53 'pallet-timestamp/std',54 'pallet-transaction-payment/std',55 'pallet-transaction-payment-rpc-runtime-api/std',56 'pallet-treasury/std',57 'pallet-vesting/std',58 'pallet-evm/std',59 'pallet-evm-contract-helpers/std',60 'pallet-evm-transaction-payment/std',61 'pallet-evm-coder-substrate/std',62 'pallet-ethereum/std',63 'fp-rpc/std',64 'parachain-info/std',65 'serde',66 'pallet-inflation/std',67 'pallet-nft/std',68 'pallet-scheduler/std',69 'pallet-nft-charge-transaction/std',70 'pallet-nft-transaction-payment/std',71 'nft-data-structs/std',72 'sp-api/std',73 'sp-block-builder/std',74 "sp-consensus-aura/std",75 'sp-core/std',76 'sp-inherents/std',77 'sp-io/std',78 'sp-offchain/std',79 'sp-runtime/std',80 'sp-session/std',81 'sp-std/std',82 'sp-transaction-pool/std',83 'sp-version/std',84 'xcm/std',85 'xcm-builder/std',86 'xcm-executor/std',87]88limit-testing = [89 'pallet-nft/limit-testing',90 'nft-data-structs/limit-testing',91]9293################################################################################94# Substrate Dependencies9596[dependencies.codec]97default-features = false98features = ['derive']99package = 'parity-scale-codec'100version = '2.0.0'101102[dependencies.frame-benchmarking]103default-features = false104git = 'https://github.com/paritytech/substrate.git'105optional = true106branch = 'polkadot-v0.9.8'107version = '3.0.0'108109[dependencies.frame-executive]110default-features = false111git = 'https://github.com/paritytech/substrate.git'112branch = 'polkadot-v0.9.8'113version = '3.0.0'114115[dependencies.frame-support]116default-features = false117git = 'https://github.com/paritytech/substrate.git'118branch = 'polkadot-v0.9.8'119version = '3.0.0'120121[dependencies.frame-system]122default-features = false123git = 'https://github.com/paritytech/substrate.git'124branch = 'polkadot-v0.9.8'125version = '3.0.0'126127[dependencies.frame-system-benchmarking]128default-features = false129git = 'https://github.com/paritytech/substrate.git'130optional = true131branch = 'polkadot-v0.9.8'132version = '3.0.0'133134[dependencies.frame-system-rpc-runtime-api]135default-features = false136git = 'https://github.com/paritytech/substrate.git'137branch = 'polkadot-v0.9.8'138version = '3.0.0'139140[dependencies.hex-literal]141optional = true142version = '0.3.1'143144[dependencies.serde]145default-features = false146features = ['derive']147optional = true148version = '1.0.119'149150[dependencies.pallet-aura]151default-features = false152git = 'https://github.com/paritytech/substrate.git'153branch = 'polkadot-v0.9.8'154version = '3.0.0'155156[dependencies.pallet-balances]157default-features = false158git = 'https://github.com/paritytech/substrate.git'159branch = 'polkadot-v0.9.8'160version = '3.0.0'161162# Contracts specific packages163# [dependencies.pallet-contracts]164# git = 'https://github.com/paritytech/substrate.git'165# default-features = false166# branch = 'polkadot-v0.9.8'167# version = '3.0.0'168169# [dependencies.pallet-contracts-primitives]170# git = 'https://github.com/paritytech/substrate.git'171# default-features = false172# branch = 'polkadot-v0.9.8'173# version = '3.0.0'174175# [dependencies.pallet-contracts-rpc-runtime-api]176# git = 'https://github.com/paritytech/substrate.git'177# default-features = false178# branch = 'polkadot-v0.9.8'179# version = '3.0.0'180181[dependencies.pallet-randomness-collective-flip]182default-features = false183git = 'https://github.com/paritytech/substrate.git'184branch = 'polkadot-v0.9.8'185version = '3.0.0'186187[dependencies.pallet-sudo]188default-features = false189git = 'https://github.com/paritytech/substrate.git'190branch = 'polkadot-v0.9.8'191version = '3.0.0'192193[dependencies.pallet-timestamp]194default-features = false195git = 'https://github.com/paritytech/substrate.git'196branch = 'polkadot-v0.9.8'197version = '3.0.0'198199[dependencies.pallet-transaction-payment]200default-features = false201git = 'https://github.com/paritytech/substrate.git'202branch = 'polkadot-v0.9.8'203version = '3.0.0'204205[dependencies.pallet-transaction-payment-rpc-runtime-api]206default-features = false207git = 'https://github.com/paritytech/substrate.git'208branch = 'polkadot-v0.9.8'209version = '3.0.0'210211[dependencies.pallet-treasury]212default-features = false213git = 'https://github.com/paritytech/substrate.git'214branch = 'polkadot-v0.9.8'215version = '3.0.0'216217[dependencies.pallet-vesting]218default-features = false219git = 'https://github.com/paritytech/substrate.git'220branch = 'polkadot-v0.9.8'221version = '3.0.0'222223[dependencies.sp-arithmetic]224default-features = false225git = 'https://github.com/paritytech/substrate.git'226branch = 'polkadot-v0.9.8'227version = '3.0.0'228229[dependencies.sp-api]230default-features = false231git = 'https://github.com/paritytech/substrate.git'232branch = 'polkadot-v0.9.8'233version = '3.0.0'234235[dependencies.sp-block-builder]236default-features = false237git = 'https://github.com/paritytech/substrate.git'238branch = 'polkadot-v0.9.8'239version = '3.0.0'240241[dependencies.sp-core]242default-features = false243git = 'https://github.com/paritytech/substrate.git'244branch = 'polkadot-v0.9.8'245version = '3.0.0'246247[dependencies.sp-consensus-aura]248default-features = false249git = 'https://github.com/paritytech/substrate.git'250branch = 'polkadot-v0.9.8'251version = '0.9.0'252253[dependencies.sp-inherents]254default-features = false255git = 'https://github.com/paritytech/substrate.git'256branch = 'polkadot-v0.9.8'257version = '3.0.0'258259[dependencies.sp-io]260default-features = false261git = 'https://github.com/paritytech/substrate.git'262branch = 'polkadot-v0.9.8'263version = '3.0.0'264265[dependencies.sp-offchain]266default-features = false267git = 'https://github.com/paritytech/substrate.git'268branch = 'polkadot-v0.9.8'269version = '3.0.0'270271[dependencies.sp-runtime]272default-features = false273git = 'https://github.com/paritytech/substrate.git'274branch = 'polkadot-v0.9.8'275version = '3.0.0'276277[dependencies.sp-session]278default-features = false279git = 'https://github.com/paritytech/substrate.git'280branch = 'polkadot-v0.9.8'281version = '3.0.0'282283[dependencies.sp-std]284default-features = false285git = 'https://github.com/paritytech/substrate.git'286branch = 'polkadot-v0.9.8'287version = '3.0.0'288289[dependencies.sp-transaction-pool]290default-features = false291git = 'https://github.com/paritytech/substrate.git'292branch = 'polkadot-v0.9.8'293version = '3.0.0'294295[dependencies.sp-version]296default-features = false297git = 'https://github.com/paritytech/substrate.git'298branch = 'polkadot-v0.9.8'299version = '3.0.0'300301[dependencies.smallvec]302version = '1.4.1'303304################################################################################305# Cumulus dependencies306307[dependencies.parachain-info]308default-features = false309git = 'https://github.com/paritytech/cumulus.git'310branch = 'polkadot-v0.9.8'311version = '0.1.0'312313[dependencies.cumulus-pallet-aura-ext]314git = 'https://github.com/paritytech/cumulus.git'315branch = 'polkadot-v0.9.8'316default-features = false317318[dependencies.cumulus-pallet-parachain-system]319git = 'https://github.com/paritytech/cumulus.git'320branch = 'polkadot-v0.9.8'321default-features = false322323[dependencies.cumulus-primitives-core]324git = 'https://github.com/paritytech/cumulus.git'325branch = 'polkadot-v0.9.8'326default-features = false327328[dependencies.cumulus-pallet-xcm]329git = 'https://github.com/paritytech/cumulus.git'330branch = 'polkadot-v0.9.8'331default-features = false332333[dependencies.cumulus-pallet-dmp-queue]334git = 'https://github.com/paritytech/cumulus.git'335branch = 'polkadot-v0.9.8'336default-features = false337338[dependencies.cumulus-pallet-xcmp-queue]339git = 'https://github.com/paritytech/cumulus.git'340branch = 'polkadot-v0.9.8'341default-features = false342343[dependencies.cumulus-primitives-utility]344git = 'https://github.com/paritytech/cumulus.git'345branch = 'polkadot-v0.9.8'346default-features = false347348[dependencies.cumulus-primitives-timestamp]349git = 'https://github.com/paritytech/cumulus.git'350branch = 'polkadot-v0.9.8'351default-features = false352353################################################################################354# Polkadot dependencies355356[dependencies.polkadot-parachain]357git = 'https://github.com/paritytech/polkadot'358branch = 'release-v0.9.8'359default-features = false360361[dependencies.xcm]362git = 'https://github.com/paritytech/polkadot'363branch = 'release-v0.9.8'364default-features = false365366[dependencies.xcm-builder]367git = 'https://github.com/paritytech/polkadot'368branch = 'release-v0.9.8'369default-features = false370371[dependencies.xcm-executor]372git = 'https://github.com/paritytech/polkadot'373branch = 'release-v0.9.8'374default-features = false375376[dependencies.pallet-xcm]377git = 'https://github.com/paritytech/polkadot'378branch = 'release-v0.9.8'379default-features = false380381382################################################################################383# local dependencies384385[dependencies]386max-encoded-len = { default-features = false, features = ['derive'], version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }387derivative = "2.2.0"388pallet-nft = { path = '../pallets/nft', default-features = false, version = '3.0.0' }389pallet-inflation = { path = '../pallets/inflation', default-features = false, version = '3.0.0' }390nft-data-structs = { path = '../primitives/nft', default-features = false, version = '0.9.0' }391pallet-scheduler = { path = '../pallets/scheduler', default-features = false, version = '3.0.0' }392# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }393pallet-nft-transaction-payment = { path = '../pallets/nft-transaction-payment', default-features = false, version = '3.0.0' }394pallet-nft-charge-transaction = { path = '../pallets/nft-charge-transaction', default-features = false, version = '3.0.0' }395pallet-evm-contract-helpers = { path = '../pallets/evm-contract-helpers', default-features = false }396pallet-evm-transaction-payment = { path = '../pallets/evm-transaction-payment', default-features = false }397pallet-evm-coder-substrate = { default-features = false, path = "../pallets/evm-coder-substrate" }398399pallet-evm = { default-features = false, version = "5.0.0-dev", git = "https://github.com/uniquenetwork/frontier.git", branch = "injected-transactions-parachain" }400pallet-ethereum = { default-features = false, version = "3.0.0-dev", git = "https://github.com/uniquenetwork/frontier.git", branch = "injected-transactions-parachain" }401fp-rpc = { default-features = false, version = "2.0.0", git = "https://github.com/uniquenetwork/frontier.git", branch = "injected-transactions-parachain" }402403################################################################################404# Build Dependencies405406[build-dependencies]407substrate-wasm-builder = '4.0.0'runtime/src/nft_weights.rsdiffbeforeafterboth--- a/runtime/src/nft_weights.rs
+++ b/runtime/src/nft_weights.rs
@@ -123,11 +123,6 @@
.saturating_add(DbWeight::get().reads(2_u64))
.saturating_add(DbWeight::get().writes(1_u64))
}
- fn set_chain_limits() -> Weight {
- 1_300_000_u64
- .saturating_add(DbWeight::get().reads(0_u64))
- .saturating_add(DbWeight::get().writes(1_u64))
- }
fn set_contract_sponsoring_rate_limit() -> Weight {
3_500_000_u64
.saturating_add(DbWeight::get().reads(0_u64))