difftreelog
fix unbroke ink contract build substrate v0.9.8
in: master
7 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4935,12 +4935,15 @@
name = "nft-data-structs"
version = "0.9.0"
dependencies = [
+ "derivative",
"frame-support",
"frame-system",
+ "max-encoded-len",
"parity-scale-codec",
"serde",
"sp-core",
"sp-runtime",
+ "sp-std",
]
[[package]]
@@ -4999,6 +5002,7 @@
"cumulus-primitives-core",
"cumulus-primitives-timestamp",
"cumulus-primitives-utility",
+ "derivative",
"fp-rpc",
"frame-benchmarking",
"frame-executive",
@@ -5007,6 +5011,7 @@
"frame-system-benchmarking",
"frame-system-rpc-runtime-api",
"hex-literal",
+ "max-encoded-len",
"nft-data-structs",
"pallet-aura",
"pallet-balances",
pallets/nft/src/lib.rsdiffbeforeafterboth--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -1675,8 +1675,8 @@
CreateItemData::NFT(data) => {
let item = NftItemType {
owner: owner.clone(),
- const_data: data.const_data,
- variable_data: data.variable_data,
+ const_data: data.const_data.into_inner(),
+ variable_data: data.variable_data.into_inner(),
};
Self::add_nft_item(collection, item)?;
@@ -1692,8 +1692,8 @@
let item = ReFungibleItemType {
owner: owner_list,
- const_data: data.const_data,
- variable_data: data.variable_data,
+ const_data: data.const_data.into_inner(),
+ variable_data: data.variable_data.into_inner(),
};
Self::add_refungible_item(collection, item)?;
primitives/nft/Cargo.tomldiffbeforeafterboth--- a/primitives/nft/Cargo.toml
+++ b/primitives/nft/Cargo.toml
@@ -9,20 +9,25 @@
version = '0.9.0'
[dependencies]
-codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ['derive'] }
+codec = { package = "parity-scale-codec", version = "2.2.0", default-features = false, features = ['derive'] }
serde = { version = "1.0.119", features = ['derive'], default-features = false }
+max-encoded-len = { default-features = false, features = ['derive'], version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }
frame-support = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }
frame-system = { default-features = false, version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }
sp-core = { version = "3.0.0", default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }
+sp-std = { version = "3.0.0", default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }
sp-runtime = { version = "3.0.0", default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }
+derivative = "2.2.0"
[features]
default = ["std"]
std = [
"serde/std",
"codec/std",
+ "max-encoded-len/std",
"frame-system/std",
"frame-support/std",
"sp-runtime/std",
"sp-core/std",
+ "sp-std/std",
]
\ No newline at end of file
primitives/nft/src/lib.rsdiffbeforeafterboth--- a/primitives/nft/src/lib.rs
+++ b/primitives/nft/src/lib.rs
@@ -4,8 +4,9 @@
use sp_runtime::sp_std::prelude::Vec;
use codec::{Decode, Encode};
+use max_encoded_len::MaxEncodedLen;
pub use frame_support::{
- construct_runtime, decl_event, decl_module, decl_storage, decl_error,
+ BoundedVec, construct_runtime, decl_event, decl_module, decl_storage, decl_error,
dispatch::DispatchResult,
ensure, fail, parameter_types,
traits::{
@@ -19,18 +20,26 @@
},
StorageValue, transactional,
};
+use derivative::Derivative;
pub const MAX_DECIMAL_POINTS: DecimalPoints = 30;
pub const MAX_REFUNGIBLE_PIECES: u128 = 1_000_000_000_000_000_000_000;
pub const MAX_SPONSOR_TIMEOUT: u32 = 10_368_000;
pub const MAX_TOKEN_OWNERSHIP: u32 = 10_000_000;
+// TODO: Somehow use ChainLimits for BoundedVec len calculation?
+// Do we need ChainLimits anyway, if we can change them via forkless upgrades?
+parameter_types! {
+pub const MaxDataSize: u32 = 2048;
+// TODO: This limit isn't checked for substrate create_multiple_items call
+pub const MaxItemsPerBatch: u32 = 200;
+}
+
pub type CollectionId = u32;
pub type TokenId = u32;
pub type DecimalPoints = u8;
-#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum CollectionMode {
Invalid,
NFT,
@@ -60,8 +69,7 @@
fn resolve(who: &AccountId, call: &Call) -> Option<AccountId>;
}
-#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum AccessMode {
Normal,
WhiteList,
@@ -72,8 +80,7 @@
}
}
-#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SchemaVersion {
ImageURL,
Unique,
@@ -84,15 +91,13 @@
}
}
-#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+#[derive(Encode, Decode, Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Ownership<AccountId> {
pub owner: AccountId,
pub fraction: u128,
}
-#[derive(Encode, Decode, Debug, Clone, PartialEq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+#[derive(Encode, Decode, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SponsorshipState<AccountId> {
/// The fees are applied to the transaction sender
Disabled,
@@ -147,30 +152,26 @@
pub transfers_enabled: bool,
}
-#[derive(Encode, Decode, Debug, Clone, PartialEq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+#[derive(Encode, Decode, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct NftItemType<AccountId> {
pub owner: AccountId,
pub const_data: Vec<u8>,
pub variable_data: Vec<u8>,
}
-#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+#[derive(Encode, Decode, Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct FungibleItemType {
pub value: u128,
}
-#[derive(Encode, Decode, Debug, Clone, PartialEq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+#[derive(Encode, Decode, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ReFungibleItemType<AccountId> {
pub owner: Vec<Ownership<AccountId>>,
pub const_data: Vec<u8>,
pub variable_data: Vec<u8>,
}
-#[derive(Encode, Decode, Debug, Clone, PartialEq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+#[derive(Encode, Decode, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CollectionLimits<BlockNumber: Encode + Decode> {
pub account_token_ownership_limit: u32,
pub sponsored_data_size: u32,
@@ -200,8 +201,7 @@
}
}
-#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+#[derive(Encode, Decode, Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ChainLimits {
pub collection_numbers_limit: u32,
pub account_token_ownership_limit: u32,
@@ -219,29 +219,73 @@
pub const_on_chain_schema_limit: u32,
}
-#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+/// BoundedVec doesn't supports serde
+mod bounded_serde {
+ use core::convert::TryFrom;
+ use frame_support::{BoundedVec, traits::Get};
+ use serde::{
+ ser::{self, Serialize},
+ de::{self, Deserialize, Error},
+ };
+ use sp_std::vec::Vec;
+
+ pub fn serialize<D, V, S>(value: &BoundedVec<V, S>, serializer: D) -> Result<D::Ok, D::Error>
+ where
+ D: ser::Serializer,
+ V: Serialize,
+ {
+ let vec: &Vec<_> = &value;
+ vec.serialize(serializer)
+ }
+
+ pub fn deserialize<'de, D, V, S>(deserializer: D) -> Result<BoundedVec<V, S>, D::Error>
+ where
+ D: de::Deserializer<'de>,
+ V: de::Deserialize<'de>,
+ S: Get<u32>,
+ {
+ // TODO: Implement custom visitor, which will limit vec size at parse time? Will serde only be used by chainspec?
+ let vec = <Vec<V>>::deserialize(deserializer)?;
+ let len = vec.len();
+ TryFrom::try_from(vec).map_err(|_| D::Error::invalid_length(len, &"lesser size"))
+ }
+}
+
+#[derive(
+ Encode, Decode, MaxEncodedLen, Default, Derivative, Clone, PartialEq, Serialize, Deserialize,
+)]
+#[derivative(Debug)]
pub struct CreateNftData {
- pub const_data: Vec<u8>,
- pub variable_data: Vec<u8>,
+ #[serde(with = "bounded_serde")]
+ #[derivative(Debug="ignore")]
+ pub const_data: BoundedVec<u8, MaxDataSize>,
+ #[serde(with = "bounded_serde")]
+ #[derivative(Debug="ignore")]
+ pub variable_data: BoundedVec<u8, MaxDataSize>,
}
-#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+#[derive(
+ Encode, Decode, MaxEncodedLen, Default, Debug, Clone, PartialEq, Serialize, Deserialize,
+)]
pub struct CreateFungibleData {
pub value: u128,
}
-#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+#[derive(
+ Encode, Decode, MaxEncodedLen, Default, Derivative, Clone, PartialEq, Serialize, Deserialize,
+)]
+#[derivative(Debug)]
pub struct CreateReFungibleData {
- pub const_data: Vec<u8>,
- pub variable_data: Vec<u8>,
+ #[serde(with = "bounded_serde")]
+ #[derivative(Debug="ignore")]
+ pub const_data: BoundedVec<u8, MaxDataSize>,
+ #[serde(with = "bounded_serde")]
+ #[derivative(Debug="ignore")]
+ pub variable_data: BoundedVec<u8, MaxDataSize>,
pub pieces: u128,
}
-#[derive(Encode, Decode, Debug, Clone, PartialEq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+#[derive(Encode, Decode, MaxEncodedLen, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum CreateItemData {
NFT(CreateNftData),
Fungible(CreateFungibleData),
runtime/Cargo.tomldiffbeforeafterboth--- a/runtime/Cargo.toml
+++ b/runtime/Cargo.toml
@@ -31,6 +31,7 @@
]
std = [
'codec/std',
+ 'max-encoded-len/std',
'cumulus-pallet-aura-ext/std',
'cumulus-pallet-parachain-system/std',
'cumulus-pallet-xcm/std',
@@ -378,6 +379,8 @@
# local dependencies
[dependencies]
+max-encoded-len = { default-features = false, features = ['derive'], version = '3.0.0', git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.8' }
+derivative = "2.2.0"
pallet-nft = { path = '../pallets/nft', default-features = false, version = '3.0.0' }
pallet-inflation = { path = '../pallets/inflation', default-features = false, version = '3.0.0' }
nft-data-structs = { path = '../primitives/nft', default-features = false, version = '0.9.0' }
runtime/src/chain_extension.rsdiffbeforeafterboth--- a/runtime/src/chain_extension.rs
+++ b/runtime/src/chain_extension.rs
@@ -6,6 +6,8 @@
//
use codec::{Decode, Encode};
+use max_encoded_len::MaxEncodedLen;
+use derivative::Derivative;
pub use pallet_contracts::chain_extension::RetVal;
use pallet_contracts::chain_extension::{
@@ -19,61 +21,63 @@
pub use pallet_nft::*;
use pallet_nft::CrossAccountId;
use nft_data_structs::*;
-
-use crate::Vec;
/// Create item parameters
-#[derive(Debug, PartialEq, Encode, Decode)]
-pub struct NFTExtCreateItem<E: Ext> {
- pub owner: <E::T as SysConfig>::AccountId,
+#[derive(Debug, PartialEq, Encode, Decode, MaxEncodedLen)]
+pub struct NFTExtCreateItem<AccountId> {
+ pub owner: AccountId,
pub collection_id: u32,
pub data: CreateItemData,
}
/// Transfer parameters
-#[derive(Debug, PartialEq, Encode, Decode)]
-pub struct NFTExtTransfer<E: Ext> {
- pub recipient: <E::T as SysConfig>::AccountId,
+#[derive(Debug, PartialEq, Encode, Decode, MaxEncodedLen)]
+pub struct NFTExtTransfer<AccountId> {
+ pub recipient: AccountId,
pub collection_id: u32,
pub token_id: u32,
pub amount: u128,
}
-#[derive(Debug, PartialEq, Encode, Decode)]
-pub struct NFTExtCreateMultipleItems<E: Ext> {
- pub owner: <E::T as SysConfig>::AccountId,
+#[derive(Derivative, PartialEq, Encode, Decode, MaxEncodedLen)]
+#[derivative(Debug)]
+pub struct NFTExtCreateMultipleItems<AccountId> {
+ pub owner: AccountId,
pub collection_id: u32,
- pub data: Vec<CreateItemData>,
+ #[derivative(Debug = "ignore")]
+ pub data: BoundedVec<CreateItemData, MaxItemsPerBatch>,
}
-#[derive(Debug, PartialEq, Encode, Decode)]
-pub struct NFTExtApprove<E: Ext> {
- pub spender: <E::T as SysConfig>::AccountId,
+#[derive(Debug, PartialEq, Encode, Decode, MaxEncodedLen)]
+pub struct NFTExtApprove<AccountId> {
+ pub spender: AccountId,
pub collection_id: u32,
pub item_id: u32,
pub amount: u128,
}
-#[derive(Debug, PartialEq, Encode, Decode)]
-pub struct NFTExtTransferFrom<E: Ext> {
- pub owner: <E::T as SysConfig>::AccountId,
- pub recipient: <E::T as SysConfig>::AccountId,
+#[derive(Debug, PartialEq, Encode, Decode, MaxEncodedLen)]
+pub struct NFTExtTransferFrom<AccountId> {
+ pub owner: AccountId,
+ pub recipient: AccountId,
pub collection_id: u32,
pub item_id: u32,
pub amount: u128,
}
-#[derive(Debug, PartialEq, Encode, Decode)]
+#[derive(Derivative, PartialEq, Encode, Decode, MaxEncodedLen)]
+#[derivative(Debug)]
pub struct NFTExtSetVariableMetaData {
pub collection_id: u32,
pub item_id: u32,
- pub data: Vec<u8>,
+ #[derivative(Debug = "ignore")]
+ pub data: BoundedVec<u8, MaxDataSize>,
}
-#[derive(Debug, PartialEq, Encode, Decode)]
-pub struct NFTExtToggleWhiteList<E: Ext> {
+#[derive(Debug, PartialEq, Encode, Decode, MaxEncodedLen)]
+pub struct NFTExtToggleWhiteList<AccountId> {
pub collection_id: u32,
- pub address: <E::T as SysConfig>::AccountId,
+ pub address: AccountId,
pub whitelisted: bool,
}
@@ -82,6 +86,8 @@
pub type NftWeightInfoOf<C> = <C as pallet_nft::Config>::WeightInfo;
+pub type AccountIdOf<C> = <C as SysConfig>::AccountId;
+
impl<C: Config + pallet_contracts::Config> ChainExtension<C> for NFTExtension {
fn call<E: Ext>(func_id: u32, env: Environment<E, InitState>) -> Result<RetVal, DispatchError>
where
@@ -93,7 +99,7 @@
match func_id {
0 => {
let mut env = env.buf_in_buf_out();
- let input: NFTExtTransfer<E> = env.read_as()?;
+ let input: NFTExtTransfer<AccountIdOf<C>> = env.read_as()?;
env.charge_weight(NftWeightInfoOf::<C>::transfer())?;
let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
@@ -106,13 +112,13 @@
input.amount,
)?;
- pallet_nft::Module::<C>::submit_logs(collection)?;
+ collection.submit_logs()?;
Ok(RetVal::Converging(0))
}
1 => {
// Create Item
let mut env = env.buf_in_buf_out();
- let input: NFTExtCreateItem<E> = env.read_as()?;
+ let input: NFTExtCreateItem<AccountIdOf<C>> = env.read_as()?;
env.charge_weight(NftWeightInfoOf::<C>::create_item(input.data.data_size()))?;
let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
@@ -124,13 +130,13 @@
input.data,
)?;
- pallet_nft::Module::<C>::submit_logs(collection)?;
+ collection.submit_logs()?;
Ok(RetVal::Converging(0))
}
2 => {
// Create multiple items
let mut env = env.buf_in_buf_out();
- let input: NFTExtCreateMultipleItems<E> = env.read_as()?;
+ let input: NFTExtCreateMultipleItems<AccountIdOf<C>> = env.read_as()?;
env.charge_weight(NftWeightInfoOf::<C>::create_item(
input.data.iter().map(|i| i.data_size()).sum(),
))?;
@@ -141,16 +147,16 @@
&C::CrossAccountId::from_sub(env.ext().address().clone()),
&collection,
&C::CrossAccountId::from_sub(input.owner),
- input.data,
+ input.data.into_inner(),
)?;
- pallet_nft::Module::<C>::submit_logs(collection)?;
+ collection.submit_logs()?;
Ok(RetVal::Converging(0))
}
3 => {
// Approve
let mut env = env.buf_in_buf_out();
- let input: NFTExtApprove<E> = env.read_as()?;
+ let input: NFTExtApprove<AccountIdOf<C>> = env.read_as()?;
env.charge_weight(NftWeightInfoOf::<C>::approve())?;
let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
@@ -163,13 +169,13 @@
input.amount,
)?;
- pallet_nft::Module::<C>::submit_logs(collection)?;
+ collection.submit_logs()?;
Ok(RetVal::Converging(0))
}
4 => {
// Transfer from
let mut env = env.buf_in_buf_out();
- let input: NFTExtTransferFrom<E> = env.read_as()?;
+ let input: NFTExtTransferFrom<AccountIdOf<C>> = env.read_as()?;
env.charge_weight(NftWeightInfoOf::<C>::transfer_from())?;
let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
@@ -183,7 +189,7 @@
input.amount,
)?;
- pallet_nft::Module::<C>::submit_logs(collection)?;
+ collection.submit_logs()?;
Ok(RetVal::Converging(0))
}
5 => {
@@ -198,16 +204,16 @@
&C::CrossAccountId::from_sub(env.ext().address().clone()),
&collection,
input.item_id,
- input.data,
+ input.data.into_inner(),
)?;
- pallet_nft::Module::<C>::submit_logs(collection)?;
+ collection.submit_logs()?;
Ok(RetVal::Converging(0))
}
6 => {
// Toggle whitelist
let mut env = env.buf_in_buf_out();
- let input: NFTExtToggleWhiteList<E> = env.read_as()?;
+ let input: NFTExtToggleWhiteList<AccountIdOf<C>> = env.read_as()?;
env.charge_weight(NftWeightInfoOf::<C>::add_to_white_list())?;
let collection = pallet_nft::Module::<C>::get_collection(input.collection_id)?;
@@ -219,7 +225,7 @@
input.whitelisted,
)?;
- pallet_nft::Module::<C>::submit_logs(collection)?;
+ collection.submit_logs()?;
Ok(RetVal::Converging(0))
}
_ => Err(DispatchError::Other("unknown chain_extension func_id")),
runtime/src/lib.rsdiffbeforeafterboth72use sp_runtime::{72use sp_runtime::{73 traits::{Dispatchable},73 traits::{Dispatchable},74};74};75// use pallet_contracts::chain_extension::UncheckedFrom;767577// pub use pallet_timestamp::Call as TimestampCall;76// pub use pallet_timestamp::Call as TimestampCall;78pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;77pub use sp_consensus_aura::sr25519::AuthorityId as AuraId;379 items as Balance * 15 * CENTIUNIQUE + (bytes as Balance) * 6 * CENTIUNIQUE378 items as Balance * 15 * CENTIUNIQUE + (bytes as Balance) * 6 * CENTIUNIQUE380}379}381380382/*381/*383parameter_types! {382parameter_types! {384 pub TombstoneDeposit: Balance = deposit(383 pub TombstoneDeposit: Balance = deposit(385 1,384 1,386 sp_std::mem::size_of::<pallet_contracts::Pallet<Runtime>> as u32,385 sp_std::mem::size_of::<pallet_contracts::Pallet<Runtime>> as u32,387 );386 );388 pub DepositPerContract: Balance = TombstoneDeposit::get();387 pub DepositPerContract: Balance = TombstoneDeposit::get();389 pub const DepositPerStorageByte: Balance = deposit(0, 1);388 pub const DepositPerStorageByte: Balance = deposit(0, 1);390 pub const DepositPerStorageItem: Balance = deposit(1, 0);389 pub const DepositPerStorageItem: Balance = deposit(1, 0);391 pub RentFraction: Perbill = Perbill::from_rational(1u32, 30 * DAYS);390 pub RentFraction: Perbill = Perbill::from_rational(1u32, 30 * DAYS);392 pub const SurchargeReward: Balance = 150 * MILLIUNIQUE;391 pub const SurchargeReward: Balance = 150 * MILLIUNIQUE;393 pub const SignedClaimHandicap: u32 = 2;392 pub const SignedClaimHandicap: u32 = 2;394 pub const MaxDepth: u32 = 32;393 pub const MaxDepth: u32 = 32;395 pub const MaxValueSize: u32 = 16 * 1024;394 pub const MaxValueSize: u32 = 16 * 1024;396 pub const MaxCodeSize: u32 = 1024 * 1024 * 25; // 25 Mb395 pub const MaxCodeSize: u32 = 1024 * 1024 * 25; // 25 Mb397 // The lazy deletion runs inside on_initialize.396 // The lazy deletion runs inside on_initialize.398 pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO *397 pub DeletionWeightLimit: Weight = AVERAGE_ON_INITIALIZE_RATIO *399 RuntimeBlockWeights::get().max_block;398 RuntimeBlockWeights::get().max_block;400 // The weight needed for decoding the queue should be less or equal than a fifth399 // The weight needed for decoding the queue should be less or equal than a fifth401 // of the overall weight dedicated to the lazy deletion.400 // of the overall weight dedicated to the lazy deletion.402 pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / (401 pub DeletionQueueDepth: u32 = ((DeletionWeightLimit::get() / (403 <Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(1) -402 <Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(1) -404 <Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(0)403 <Runtime as pallet_contracts::Config>::WeightInfo::on_initialize_per_queue_item(0)405 )) / 5) as u32;404 )) / 5) as u32;406 pub Schedule: pallet_contracts::Schedule<Runtime> = Default::default();405 pub Schedule: pallet_contracts::Schedule<Runtime> = Default::default();407}406}408407409impl pallet_contracts::Config for Runtime {408impl pallet_contracts::Config for Runtime {410 type Time = Timestamp;409 type Time = Timestamp;411 type Randomness = RandomnessCollectiveFlip;410 type Randomness = RandomnessCollectiveFlip;412 type Currency = Balances;411 type Currency = Balances;413 type Event = Event;412 type Event = Event;414 type RentPayment = ();413 type RentPayment = ();415 type SignedClaimHandicap = SignedClaimHandicap;414 type SignedClaimHandicap = SignedClaimHandicap;416 type TombstoneDeposit = TombstoneDeposit;415 type TombstoneDeposit = TombstoneDeposit;417 type DepositPerContract = DepositPerContract;416 type DepositPerContract = DepositPerContract;418 type DepositPerStorageByte = DepositPerStorageByte;417 type DepositPerStorageByte = DepositPerStorageByte;419 type DepositPerStorageItem = DepositPerStorageItem;418 type DepositPerStorageItem = DepositPerStorageItem;420 type RentFraction = RentFraction;419 type RentFraction = RentFraction;421 type SurchargeReward = SurchargeReward;420 type SurchargeReward = SurchargeReward;422 type WeightPrice = pallet_transaction_payment::Module<Self>;421 type WeightPrice = pallet_transaction_payment::Pallet<Self>;423 type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;422 type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;424 type ChainExtension = NFTExtension;423 type ChainExtension = NFTExtension;425 type DeletionQueueDepth = DeletionQueueDepth;424 type DeletionQueueDepth = DeletionQueueDepth;426 type DeletionWeightLimit = DeletionWeightLimit;425 type DeletionWeightLimit = DeletionWeightLimit;427 type Schedule = Schedule;426 type Schedule = Schedule;428 type CallStack = [pallet_contracts::Frame<Self>; 31];427 type CallStack = [pallet_contracts::Frame<Self>; 31];429}428}430*/429*/431430432parameter_types! {431parameter_types! {433 pub const TransactionByteFee: Balance = 501 * MICROUNIQUE; // Targeting 0.1 Unique per NFT transfer432 pub const TransactionByteFee: Balance = 501 * MICROUNIQUE; // Targeting 0.1 Unique per NFT transfer