git.delta.rocks / unique-network / refs/commits / eb5b53586bb9

difftreelog

Scheduler

str-mv2021-05-27parent: #172f80a.patch.diff
in: master

22 files changed

modifiedCargo.lockdiffbeforeafterboth
3556 "futures 0.3.12",3556 "futures 0.3.12",
3557 "jsonrpc-core",3557 "jsonrpc-core",
3558 "log",3558 "log",
3559 "nft-data-structs",
3559 "nft-runtime",3560 "nft-runtime",
3560 "pallet-contracts-rpc",3561 "pallet-contracts-rpc",
3561 "pallet-transaction-payment-rpc",3562 "pallet-transaction-payment-rpc",
3591 "substrate-frame-rpc-system",3592 "substrate-frame-rpc-system",
3592]3593]
3594
3595[[package]]
3596name = "nft-data-structs"
3597version = "0.9.0"
3598dependencies = [
3599 "frame-support",
3600 "frame-system",
3601 "pallet-contracts",
3602 "parity-scale-codec",
3603 "serde",
3604 "sp-core",
3605 "sp-runtime",
3606]
35933607
3594[[package]]3608[[package]]
3595name = "nft-runtime"3609name = "nft-runtime"
3602 "frame-system-benchmarking",3616 "frame-system-benchmarking",
3603 "frame-system-rpc-runtime-api",3617 "frame-system-rpc-runtime-api",
3604 "hex-literal",3618 "hex-literal",
3619 "nft-data-structs",
3605 "pallet-aura",3620 "pallet-aura",
3606 "pallet-balances",3621 "pallet-balances",
3607 "pallet-contracts",3622 "pallet-contracts",
3610 "pallet-grandpa",3625 "pallet-grandpa",
3611 "pallet-inflation",3626 "pallet-inflation",
3612 "pallet-nft",3627 "pallet-nft",
3628 "pallet-nft-charge-transaction",
3629 "pallet-nft-transaction-payment",
3613 "pallet-randomness-collective-flip",3630 "pallet-randomness-collective-flip",
3631 "pallet-scheduler",
3614 "pallet-sudo",3632 "pallet-sudo",
3615 "pallet-timestamp",3633 "pallet-timestamp",
3616 "pallet-transaction-payment",3634 "pallet-transaction-payment",
3947 "frame-benchmarking",3965 "frame-benchmarking",
3948 "frame-support",3966 "frame-support",
3949 "frame-system",3967 "frame-system",
3968 "nft-data-structs",
3950 "pallet-balances",3969 "pallet-balances",
3951 "pallet-contracts",3970 "pallet-contracts",
3952 "pallet-randomness-collective-flip",3971 "pallet-randomness-collective-flip",
3960 "sp-std",3979 "sp-std",
3961]3980]
3981
3982[[package]]
3983name = "pallet-nft-charge-transaction"
3984version = "3.0.0"
3985dependencies = [
3986 "frame-benchmarking",
3987 "frame-support",
3988 "frame-system",
3989 "nft-data-structs",
3990 "pallet-balances",
3991 "pallet-contracts",
3992 "pallet-nft",
3993 "pallet-nft-transaction-payment",
3994 "pallet-randomness-collective-flip",
3995 "pallet-timestamp",
3996 "pallet-transaction-payment",
3997 "parity-scale-codec",
3998 "serde",
3999 "sp-core",
4000 "sp-io",
4001 "sp-runtime",
4002 "sp-std",
4003]
4004
4005[[package]]
4006name = "pallet-nft-transaction-payment"
4007version = "3.0.0"
4008dependencies = [
4009 "frame-benchmarking",
4010 "frame-support",
4011 "frame-system",
4012 "nft-data-structs",
4013 "pallet-balances",
4014 "pallet-contracts",
4015 "pallet-nft",
4016 "pallet-randomness-collective-flip",
4017 "pallet-timestamp",
4018 "pallet-transaction-payment",
4019 "parity-scale-codec",
4020 "serde",
4021 "sp-core",
4022 "sp-io",
4023 "sp-runtime",
4024 "sp-std",
4025]
39624026
3963[[package]]4027[[package]]
3964name = "pallet-randomness-collective-flip"4028name = "pallet-randomness-collective-flip"
3974 "sp-std",4038 "sp-std",
3975]4039]
4040
4041[[package]]
4042name = "pallet-scheduler"
4043version = "3.0.0"
4044dependencies = [
4045 "frame-benchmarking",
4046 "frame-support",
4047 "frame-system",
4048 "log",
4049 "nft-data-structs",
4050 "pallet-contracts",
4051 "pallet-nft",
4052 "pallet-nft-transaction-payment",
4053 "parity-scale-codec",
4054 "serde",
4055 "sp-core",
4056 "sp-io",
4057 "sp-runtime",
4058 "sp-std",
4059 "substrate-test-utils",
4060]
39764061
3977[[package]]4062[[package]]
3978name = "pallet-session"4063name = "pallet-session"
7315 "tokio 0.2.25",7400 "tokio 0.2.25",
7316]7401]
7402
7403[[package]]
7404name = "substrate-test-utils"
7405version = "3.0.0"
7406source = "registry+https://github.com/rust-lang/crates.io-index"
7407checksum = "6f46809281d923956cdfdb2f95e07fa2437884f2a18096c4371a3fa48f8d082a"
7408dependencies = [
7409 "futures 0.3.12",
7410 "substrate-test-utils-derive",
7411 "tokio 0.2.25",
7412]
7413
7414[[package]]
7415name = "substrate-test-utils-derive"
7416version = "0.9.0"
7417source = "registry+https://github.com/rust-lang/crates.io-index"
7418checksum = "988016ca49cfc763fecf97dfa9dee7dbbff1a2145b003d07681278dddefd1a0e"
7419dependencies = [
7420 "proc-macro-crate",
7421 "quote",
7422 "syn",
7423]
73177424
7318[[package]]7425[[package]]
7319name = "substrate-wasm-builder"7426name = "substrate-wasm-builder"
7550 "pin-project-lite 0.1.11",7657 "pin-project-lite 0.1.11",
7551 "signal-hook-registry",7658 "signal-hook-registry",
7552 "slab",7659 "slab",
7660 "tokio-macros",
7553 "winapi 0.3.9",7661 "winapi 0.3.9",
7554]7662]
75557663
7617 "log",7725 "log",
7618]7726]
7727
7728[[package]]
7729name = "tokio-macros"
7730version = "0.2.6"
7731source = "registry+https://github.com/rust-lang/crates.io-index"
7732checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a"
7733dependencies = [
7734 "proc-macro2",
7735 "quote",
7736 "syn",
7737]
76197738
7620[[package]]7739[[package]]
7621name = "tokio-named-pipes"7740name = "tokio-named-pipes"
modifiedCargo.tomldiffbeforeafterboth
2members = [2members = [
3 'node',3 'node',
4 'pallets/nft',4 'pallets/nft',
5 'pallets/nft-transaction-payment',
6 'primitives',
5 'runtime',7 'runtime',
6]8]
7[profile.release]9[profile.release]
modifiednode/Cargo.tomldiffbeforeafterboth
2828
29# Substrate dependencies29# Substrate dependencies
30nft-runtime = { path = '../runtime', version = '3.0.0' }30nft-runtime = { path = '../runtime', version = '3.0.0' }
31nft-data-structs = { default-features = false, path="../primitives" }
31frame-benchmarking = '3.0.0'32frame-benchmarking = '3.0.0'
32frame-benchmarking-cli = '3.0.0'33frame-benchmarking-cli = '3.0.0'
33pallet-transaction-payment-rpc = '3.0.0'34pallet-transaction-payment-rpc = '3.0.0'
modifiednode/src/chain_spec.rsdiffbeforeafterboth
3// file 'LICENSE', which is part of this source code package.3// file 'LICENSE', which is part of this source code package.
4//4//
55
6// use nft_runtime::{
7// AccountId, AuraConfig, BalancesConfig, GenesisConfig, GrandpaConfig, Signature, SudoConfig,
8// SystemConfig, WASM_BINARY,
9// };
10// use nft_runtime::{ContractsConfig, ContractsSchedule, NftConfig, CollectionType};
11use nft_runtime::*;6use nft_runtime::*;
7use nft_data_structs::*;
12use sc_service::ChainType;8use sc_service::ChainType;
13use sp_consensus_aura::sr25519::AuthorityId as AuraId;9use sp_consensus_aura::sr25519::AuthorityId as AuraId;
14use sp_core::{sr25519, Pair, Public};10use sp_core::{sr25519, Pair, Public};
15use sp_finality_grandpa::AuthorityId as GrandpaId;11use sp_finality_grandpa::AuthorityId as GrandpaId;
16use sp_runtime::traits::{IdentifyAccount, Verify};12use sp_runtime::traits::{IdentifyAccount, Verify};
17use serde_json::map::Map;13use serde_json::map::Map;
18// use crate::chain_spec::api::chain_extension::*;
1914
20// Note this is the URL for the telemetry server15// Note this is the URL for the telemetry server
21//const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";16//const STAGING_TELEMETRY_URL: &str = "wss://telemetry.polkadot.io/submit/";
158 balances: endowed_accounts153 balances: endowed_accounts
159 .iter()154 .iter()
160 .cloned()155 .cloned()
161 .map(|k| (k, 1 << 100))156 .map(|k| (k, 1 << 70))
162 .collect(),157 .collect(),
163 }),158 }),
164 pallet_aura: Some(AuraConfig {159 pallet_aura: Some(AuraConfig {
addedpallets/nft-charge-transaction/Cargo.tomldiffbeforeafterboth

no changes

addedpallets/nft-charge-transaction/src/lib.rsdiffbeforeafterboth

no changes

addedpallets/nft-transaction-payment/Cargo.tomldiffbeforeafterboth

no changes

addedpallets/nft-transaction-payment/src/benchmarking.rsdiffbeforeafterboth

no changes

addedpallets/nft-transaction-payment/src/lib.rsdiffbeforeafterboth

no changes

addedpallets/nft-transaction-payment/src/tests.rsdiffbeforeafterboth

no changes

modifiedpallets/nft/Cargo.tomldiffbeforeafterboth
32sp-runtime = { default-features = false, version = '3.0.0' }32sp-runtime = { default-features = false, version = '3.0.0' }
33pallet-contracts = { default-features = false, version = '3.0.0' }33pallet-contracts = { default-features = false, version = '3.0.0' }
34pallet-transaction-payment = { default-features = false, version = "3.0.0" }34pallet-transaction-payment = { default-features = false, version = "3.0.0" }
35nft-data-structs = { default-features = false, path="../../primitives" }
36
3537
36[features]38[features]
45 'pallet-contracts/std',47 'pallet-contracts/std',
46 'pallet-randomness-collective-flip/std',48 'pallet-randomness-collective-flip/std',
47 'pallet-transaction-payment/std',49 'pallet-transaction-payment/std',
50 'nft-data-structs/std',
48 'sp-std/std',51 'sp-std/std',
49 'sp-runtime/std',52 'sp-runtime/std',
50 'frame-benchmarking/std',53 'frame-benchmarking/std',
modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
13#[cfg(feature = "std")]13#[cfg(feature = "std")]
14pub use serde::*;14pub use serde::*;
1515
16use core::ops::{Deref, DerefMut};
17use codec::{Decode, Encode};
18pub use frame_support::{16pub use frame_support::{
19 construct_runtime, decl_event, decl_module, decl_storage, decl_error,17 construct_runtime, decl_event, decl_module, decl_storage, decl_error,
20 dispatch::DispatchResult,18 dispatch::DispatchResult,
3432
35use frame_system::{self as system, ensure_signed, ensure_root};33use frame_system::{self as system, ensure_signed, ensure_root};
36use sp_runtime::sp_std::prelude::Vec;34use sp_runtime::sp_std::prelude::Vec;
37use sp_runtime::{35use nft_data_structs::{
38 traits::{
39 Hash, DispatchInfoOf, Dispatchable, PostDispatchInfoOf, Saturating, SaturatedConversion, SignedExtension, Zero,36 MAX_DECIMAL_POINTS, MAX_SPONSOR_TIMEOUT, MAX_TOKEN_OWNERSHIP, MAX_REFUNGIBLE_PIECES,
40 },37 AccessMode, ChainLimits, Collection, CreateItemData, CollectionLimits,
41 transaction_validity::{
42 TransactionPriority, InvalidTransaction, TransactionValidity, TransactionValidityError, ValidTransaction,38 CollectionId, CollectionMode, CollectionHandle, TokenId,
43 },39 SchemaVersion, SponsorshipState, Ownership,
44 FixedPointOperand, FixedU128,40 NftItemType, FungibleItemType, ReFungibleItemType
45};41};
46use sp_runtime::traits::StaticLookup;
47use pallet_contracts::chain_extension::UncheckedFrom;
48use pallet_transaction_payment::OnChargeTransaction;
4942
50#[cfg(test)]43#[cfg(test)]
51mod mock;44mod mock;
5548
56mod default_weights;49mod default_weights;
57
58pub const MAX_DECIMAL_POINTS: DecimalPoints = 30;
59pub const MAX_REFUNGIBLE_PIECES: u128 = 1_000_000_000_000_000_000_000;
60pub const MAX_SPONSOR_TIMEOUT: u32 = 10_368_000;
61pub const MAX_TOKEN_OWNERSHIP: u32 = 10_000_000;
62
63// Structs
64// #region
65
66pub type CollectionId = u32;
67pub type TokenId = u32;
68pub type DecimalPoints = u8;
69
70#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq)]
71#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
72pub enum CollectionMode {
73 Invalid,
74 NFT,
75 // decimal points
76 Fungible(DecimalPoints),
77 ReFungible,
78}
79
80impl Default for CollectionMode {
81 fn default() -> Self {
82 Self::Invalid
83 }
84}
85
86impl Into<u8> for CollectionMode {
87 fn into(self) -> u8 {
88 match self {
89 CollectionMode::Invalid => 0,
90 CollectionMode::NFT => 1,
91 CollectionMode::Fungible(_) => 2,
92 CollectionMode::ReFungible => 3,
93 }
94 }
95}
96
97#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq)]
98#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
99pub enum AccessMode {
100 Normal,
101 WhiteList,
102}
103impl Default for AccessMode {
104 fn default() -> Self {
105 Self::Normal
106 }
107}
108
109#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq)]
110#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
111pub enum SchemaVersion {
112 ImageURL,
113 Unique,
114}
115impl Default for SchemaVersion {
116 fn default() -> Self {
117 Self::ImageURL
118 }
119}
120
121#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
122#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
123pub struct Ownership<AccountId> {
124 pub owner: AccountId,
125 pub fraction: u128,
126}
127
128#[derive(Encode, Decode, Debug, Clone, PartialEq)]
129#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
130pub enum SponsorshipState<AccountId> {
131 /// The fees are applied to the transaction sender
132 Disabled,
133 Unconfirmed(AccountId),
134 /// Transactions are sponsored by specified account
135 Confirmed(AccountId),
136}
137
138impl<AccountId> SponsorshipState<AccountId> {
139 fn sponsor(&self) -> Option<&AccountId> {
140 match self {
141 Self::Confirmed(sponsor) => Some(sponsor),
142 _ => None,
143 }
144 }
145
146 fn pending_sponsor(&self) -> Option<&AccountId> {
147 match self {
148 Self::Unconfirmed(sponsor) | Self::Confirmed(sponsor) => Some(sponsor),
149 _ => None,
150 }
151 }
152
153 fn confirmed(&self) -> bool {
154 matches!(self, Self::Confirmed(_))
155 }
156}
157
158impl<T> Default for SponsorshipState<T> {
159 fn default() -> Self {
160 Self::Disabled
161 }
162}
16350
164#[derive(Encode, Decode, Clone, PartialEq)]51#[cfg(feature = "runtime-benchmarks")]
165#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]52mod benchmarking;
166pub struct Collection<T: Config> {
167 pub owner: T::AccountId,
168 pub mode: CollectionMode,
169 pub access: AccessMode,
170 pub decimal_points: DecimalPoints,
171 pub name: Vec<u16>, // 64 include null escape char
172 pub description: Vec<u16>, // 256 include null escape char
173 pub token_prefix: Vec<u8>, // 16 include null escape char
174 pub mint_mode: bool,
175 pub offchain_schema: Vec<u8>,
176 pub schema_version: SchemaVersion,
177 pub sponsorship: SponsorshipState<T::AccountId>,
178 pub limits: CollectionLimits<T::BlockNumber>, // Collection private restrictions
179 pub variable_on_chain_schema: Vec<u8>, //
180 pub const_on_chain_schema: Vec<u8>, //
181}
182
183pub struct CollectionHandle<T: Config> {
184 pub id: CollectionId,
185 collection: Collection<T>,
186}
187
188impl<T: Config> Deref for CollectionHandle<T> {
189 type Target = Collection<T>;
190
191 fn deref(&self) -> &Self::Target {
192 &self.collection
193 }
194}
195
196impl<T: Config> DerefMut for CollectionHandle<T> {
197 fn deref_mut(&mut self) -> &mut Self::Target {
198 &mut self.collection
199 }
200}
201
202#[derive(Encode, Decode, Debug, Clone, PartialEq)]
203#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
204pub struct NftItemType<AccountId> {
205 pub owner: AccountId,
206 pub const_data: Vec<u8>,
207 pub variable_data: Vec<u8>,
208}
209
210#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
211#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
212pub struct FungibleItemType {
213 pub value: u128,
214}
215
216#[derive(Encode, Decode, Debug, Clone, PartialEq)]
217#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
218pub struct ReFungibleItemType<AccountId> {
219 pub owner: Vec<Ownership<AccountId>>,
220 pub const_data: Vec<u8>,
221 pub variable_data: Vec<u8>,
222}
223
224// #[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
225// #[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
226// pub struct VestingItem<AccountId, Moment> {
227// pub sender: AccountId,
228// pub recipient: AccountId,
229// pub collection_id: CollectionId,
230// pub item_id: TokenId,
231// pub amount: u64,
232// pub vesting_date: Moment,
233// }
234
235#[derive(Encode, Decode, Debug, Clone, PartialEq)]
236#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
237pub struct CollectionLimits<BlockNumber: Encode + Decode> {
238 pub account_token_ownership_limit: u32,
239 pub sponsored_data_size: u32,
240 /// None - setVariableMetadata is not sponsored
241 /// Some(v) - setVariableMetadata is sponsored
242 /// if there is v block between txs
243 pub sponsored_data_rate_limit: Option<BlockNumber>,
244 pub token_limit: u32,
245
246 // Timeouts for item types in passed blocks
247 pub sponsor_transfer_timeout: u32,
248 pub owner_can_transfer: bool,
249 pub owner_can_destroy: bool,
250}
251
252impl<BlockNumber: Encode + Decode> Default for CollectionLimits<BlockNumber> {
253 fn default() -> Self {
254 Self {
255 account_token_ownership_limit: 10_000_000,
256 token_limit: u32::max_value(),
257 sponsored_data_size: u32::MAX,
258 sponsored_data_rate_limit: None,
259 sponsor_transfer_timeout: 14400,
260 owner_can_transfer: true,
261 owner_can_destroy: true
262 }
263 }
264}
265
266#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
267#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
268pub struct ChainLimits {
269 pub collection_numbers_limit: u32,
270 pub account_token_ownership_limit: u32,
271 pub collections_admins_limit: u64,
272 pub custom_data_limit: u32,
273
274 // Timeouts for item types in passed blocks
275 pub nft_sponsor_transfer_timeout: u32,
276 pub fungible_sponsor_transfer_timeout: u32,
277 pub refungible_sponsor_transfer_timeout: u32,
278
279 // Schema limits
280 pub offchain_schema_limit: u32,
281 pub variable_on_chain_schema_limit: u32,
282 pub const_on_chain_schema_limit: u32,
283}
28453
285pub trait WeightInfo {54pub trait WeightInfo {
286 fn create_collection() -> Weight;55 fn create_collection() -> Weight;
315 fn set_collection_limits() -> Weight;84 fn set_collection_limits() -> Weight;
316}85}
317
318#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
319#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
320pub struct CreateNftData {
321 pub const_data: Vec<u8>,
322 pub variable_data: Vec<u8>,
323}
324
325#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
326#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
327pub struct CreateFungibleData {
328 pub value: u128,
329}
330
331#[derive(Encode, Decode, Default, Debug, Clone, PartialEq)]
332#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
333pub struct CreateReFungibleData {
334 pub const_data: Vec<u8>,
335 pub variable_data: Vec<u8>,
336 pub pieces: u128,
337}
338
339#[derive(Encode, Decode, Debug, Clone, PartialEq)]
340#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
341pub enum CreateItemData {
342 NFT(CreateNftData),
343 Fungible(CreateFungibleData),
344 ReFungible(CreateReFungibleData),
345}
346
347impl CreateItemData {
348 pub fn len(&self) -> usize {
349 let len = match self {
350 CreateItemData::NFT(data) => data.variable_data.len() + data.const_data.len(),
351 CreateItemData::ReFungible(data) => data.variable_data.len() + data.const_data.len(),
352 _ => 0
353 };
354
355 return len;
356 }
357}
358
359impl From<CreateNftData> for CreateItemData {
360 fn from(item: CreateNftData) -> Self {
361 CreateItemData::NFT(item)
362 }
363}
364
365impl From<CreateReFungibleData> for CreateItemData {
366 fn from(item: CreateReFungibleData) -> Self {
367 CreateItemData::ReFungible(item)
368 }
369}
370
371impl From<CreateFungibleData> for CreateItemData {
372 fn from(item: CreateFungibleData) -> Self {
373 CreateItemData::Fungible(item)
374 }
375}
376
37786
378decl_error! {87decl_error! {
455 }164 }
456}165}
166
167// + pallet_transaction_payment::Config + pallet_nft_transaction_payment::Config + pallet_contracts::Config
168
457169
458pub trait Config: system::Config + Sized + pallet_transaction_payment::Config + pallet_contracts::Config {170pub trait Config: system::Config + Sized {
459 type Event: From<Event<Self>> + Into<<Self as system::Config>::Event>;171 type Event: From<Event<Self>> + Into<<Self as system::Config>::Event>;
460172
461 /// Weight information for extrinsics in this pallet.173 /// Weight information for extrinsics in this pallet.
466 type TreasuryAccountId: Get<Self::AccountId>;178 type TreasuryAccountId: Get<Self::AccountId>;
467}179}
468
469#[cfg(feature = "runtime-benchmarks")]
470mod benchmarking;
471
472// #endregion
473180
474// # Used definitions181// # Used definitions
475//182//
677 fn deposit_event() = default;384 fn deposit_event() = default;
678 type Error = Error<T>;385 type Error = Error<T>;
679386
680 fn on_initialize(now: T::BlockNumber) -> Weight {387 fn on_initialize(_now: T::BlockNumber) -> Weight {
681 0388 0
682 }389 }
683390
2488 }2195 }
2489}2196}
24902197
2491////////////////////////////////////////////////////////////////////////////////////////////////////
2492// Economic models
2493// #region
2494
2495/// Fee multiplier.
2496pub type Multiplier = FixedU128;
2497
2498type BalanceOf<T> = <<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::Balance;
2499
2500/// Require the transactor pay for themselves and maybe include a tip to gain additional priority
2501/// in the queue.
2502#[derive(Encode, Decode, Clone, Eq, PartialEq)]
2503pub struct ChargeTransactionPayment<T: Config>(#[codec(compact)] BalanceOf<T>);
2504
2505impl<T: Config + Send + Sync> sp_std::fmt::Debug
2506 for ChargeTransactionPayment<T>
2507{
2508 #[cfg(feature = "std")]
2509 fn fmt(&self, f: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
2510 write!(f, "ChargeTransactionPayment<{:?}>", self.0)
2511 }
2512 #[cfg(not(feature = "std"))]
2513 fn fmt(&self, _: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
2514 Ok(())
2515 }
2516}
2517
2518impl<T: Config> ChargeTransactionPayment<T>
2519where
2520 T::Call: Dispatchable<Info=DispatchInfo, PostInfo=PostDispatchInfo> + IsSubType<Call<T>> + IsSubType<pallet_contracts::Call<T>>,
2521 BalanceOf<T>: Send + Sync + From<u64> + FixedPointOperand,
2522 T::AccountId: AsRef<[u8]>,
2523 T::AccountId: UncheckedFrom<T::Hash>,
2524{
2525 fn traditional_fee(
2526 len: usize,
2527 info: &DispatchInfoOf<T::Call>,
2528 tip: BalanceOf<T>,
2529 ) -> BalanceOf<T>
2530 where
2531 T::Call: Dispatchable<Info = DispatchInfo>,
2532 {
2533 <pallet_transaction_payment::Module<T>>::compute_fee(len as u32, info, tip)
2534 }
2535
2536 fn get_priority(len: usize, info: &DispatchInfoOf<T::Call>, final_fee: BalanceOf<T>) -> TransactionPriority {
2537 let weight_saturation = T::BlockWeights::get().max_block / info.weight.max(1);
2538 let max_block_length = *T::BlockLength::get().max.get(DispatchClass::Normal);
2539 let len_saturation = max_block_length as u64 / (len as u64).max(1);
2540 let coefficient: BalanceOf<T> = weight_saturation
2541 .min(len_saturation)
2542 .saturated_into::<BalanceOf<T>>();
2543 final_fee
2544 .saturating_mul(coefficient)
2545 .saturated_into::<TransactionPriority>()
2546 }
2547
2548 fn withdraw_fee(
2549 &self,
2550 who: &T::AccountId,
2551 call: &T::Call,
2552 info: &DispatchInfoOf<T::Call>,
2553 len: usize,
2554 ) -> Result<
2555 (
2556 BalanceOf<T>,
2557 <<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::LiquidityInfo,
2558 ),
2559 TransactionValidityError,
2560 > {
2561 let tip = self.0;
2562
2563 let fee = Self::traditional_fee(len, info, tip);
2564
2565 // Only mess with balances if fee is not zero.
2566 if fee.is_zero() {
2567 return <<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::withdraw_fee(who, call, info, fee, tip)
2568 .map(|i| (fee, i));
2569 }
2570
2571 // Determine who is paying transaction fee based on ecnomic model
2572 // Parse call to extract collection ID and access collection sponsor
2573 let mut sponsor: Option<T::AccountId> = (|| match IsSubType::<Call<T>>::is_sub_type(call) {
2574 Some(Call::create_item(collection_id, _owner, _properties)) => {
2575 let collection = <CollectionById<T>>::get(collection_id)?;
2576
2577 // sponsor timeout
2578 let block_number = <system::Module<T>>::block_number() as T::BlockNumber;
2579
2580 let limit = collection.limits.sponsor_transfer_timeout;
2581 if <CreateItemBasket<T>>::contains_key((collection_id, &who)) {
2582 let last_tx_block = <CreateItemBasket<T>>::get((collection_id, &who));
2583 let limit_time = last_tx_block + limit.into();
2584 if block_number <= limit_time {
2585 return None;
2586 }
2587 }
2588 <CreateItemBasket<T>>::insert((collection_id, who.clone()), block_number);
2589
2590 // check free create limit
2591 if collection.limits.sponsored_data_size >= (_properties.len() as u32) {
2592 collection.sponsorship.sponsor()
2593 .cloned()
2594 } else {
2595 None
2596 }
2597 }
2598 Some(Call::transfer(_new_owner, collection_id, item_id, _value)) => {
2599 let collection = <CollectionById<T>>::get(collection_id)?;
2600
2601 let mut sponsor_transfer = false;
2602 if collection.sponsorship.confirmed() {
2603
2604 let collection_limits = collection.limits;
2605 let collection_mode = collection.mode;
2606
2607 // sponsor timeout
2608 let block_number = <system::Module<T>>::block_number() as T::BlockNumber;
2609 sponsor_transfer = match collection_mode {
2610 CollectionMode::NFT => {
2611
2612 // get correct limit
2613 let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
2614 collection_limits.sponsor_transfer_timeout
2615 } else {
2616 ChainLimit::get().nft_sponsor_transfer_timeout
2617 };
2618
2619 let mut sponsored = true;
2620 if <NftTransferBasket<T>>::contains_key(collection_id, item_id) {
2621 let last_tx_block = <NftTransferBasket<T>>::get(collection_id, item_id);
2622 let limit_time = last_tx_block + limit.into();
2623 if block_number <= limit_time {
2624 sponsored = false;
2625 }
2626 }
2627 if sponsored {
2628 <NftTransferBasket<T>>::insert(collection_id, item_id, block_number);
2629 }
2630
2631 sponsored
2632 }
2633 CollectionMode::Fungible(_) => {
2634
2635 // get correct limit
2636 let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
2637 collection_limits.sponsor_transfer_timeout
2638 } else {
2639 ChainLimit::get().fungible_sponsor_transfer_timeout
2640 };
2641
2642 let block_number = <system::Module<T>>::block_number() as T::BlockNumber;
2643 let mut sponsored = true;
2644 if <FungibleTransferBasket<T>>::contains_key(collection_id, who) {
2645 let last_tx_block = <FungibleTransferBasket<T>>::get(collection_id, who);
2646 let limit_time = last_tx_block + limit.into();
2647 if block_number <= limit_time {
2648 sponsored = false;
2649 }
2650 }
2651 if sponsored {
2652 <FungibleTransferBasket<T>>::insert(collection_id, who, block_number);
2653 }
2654
2655 sponsored
2656 }
2657 CollectionMode::ReFungible => {
2658
2659 // get correct limit
2660 let limit: u32 = if collection_limits.sponsor_transfer_timeout > 0 {
2661 collection_limits.sponsor_transfer_timeout
2662 } else {
2663 ChainLimit::get().refungible_sponsor_transfer_timeout
2664 };
2665
2666 let mut sponsored = true;
2667 if <ReFungibleTransferBasket<T>>::contains_key(collection_id, item_id) {
2668 let last_tx_block = <ReFungibleTransferBasket<T>>::get(collection_id, item_id);
2669 let limit_time = last_tx_block + limit.into();
2670 if block_number <= limit_time {
2671 sponsored = false;
2672 }
2673 }
2674 if sponsored {
2675 <ReFungibleTransferBasket<T>>::insert(collection_id, item_id, block_number);
2676 }
2677
2678 sponsored
2679 }
2680 _ => {
2681 false
2682 },
2683 };
2684 }
2685
2686 if !sponsor_transfer {
2687 None
2688 } else {
2689 collection.sponsorship.sponsor()
2690 .cloned()
2691 }
2692 }
2693
2694 Some(Call::set_variable_meta_data(collection_id, item_id, data)) => {
2695 let mut sponsor_metadata_changes = false;
2696
2697 let collection = <CollectionById<T>>::get(collection_id)?;
2698
2699 if
2700 collection.sponsorship.confirmed() &&
2701 // Can't sponsor fungible collection, this tx will be rejected
2702 // as invalid
2703 !matches!(collection.mode, CollectionMode::Fungible(_)) &&
2704 data.len() <= collection.limits.sponsored_data_size as usize
2705 {
2706 if let Some(rate_limit) = collection.limits.sponsored_data_rate_limit {
2707 let block_number = <system::Module<T>>::block_number() as T::BlockNumber;
2708
2709 if <VariableMetaDataBasket<T>>::get(collection_id, item_id)
2710 .map(|last_block| block_number - last_block > rate_limit)
2711 .unwrap_or(true)
2712 {
2713 sponsor_metadata_changes = true;
2714 <VariableMetaDataBasket<T>>::insert(collection_id, item_id, block_number);
2715 }
2716 }
2717 }
2718
2719 if !sponsor_metadata_changes {
2720 None
2721 } else {
2722 collection.sponsorship.sponsor().cloned()
2723 }
2724 }
2725
2726 _ => None,
2727 })();
2728
2729 match IsSubType::<pallet_contracts::Call<T>>::is_sub_type(call) {
2730 Some(pallet_contracts::Call::call(dest, _value, _gas_limit, _data)) => {
2731
2732 let called_contract: T::AccountId = T::Lookup::lookup((*dest).clone()).unwrap_or(T::AccountId::default());
2733
2734 let owned_contract = <ContractOwner<T>>::get(called_contract.clone()).as_ref() == Some(who);
2735 let white_list_enabled = <ContractWhiteListEnabled<T>>::contains_key(called_contract.clone());
2736
2737 if !owned_contract && white_list_enabled {
2738 if !<ContractWhiteList<T>>::contains_key(called_contract.clone(), who) {
2739 return Err(InvalidTransaction::Call.into());
2740 }
2741 }
2742 },
2743 _ => {},
2744 }
2745
2746 // Sponsor smart contracts
2747 sponsor = sponsor.or_else(|| match IsSubType::<pallet_contracts::Call<T>>::is_sub_type(call) {
2748
2749 // On instantiation: set the contract owner
2750 Some(pallet_contracts::Call::instantiate(_endowment, _gas_limit, code_hash, _data, salt)) => {
2751
2752 let new_contract_address = <pallet_contracts::Module<T>>::contract_address(
2753 &who,
2754 code_hash,
2755 salt,
2756 );
2757 <ContractOwner<T>>::insert(new_contract_address.clone(), who.clone());
2758
2759 None
2760 },
2761
2762 // On instantiation with code: set the contract owner
2763 Some(pallet_contracts::Call::instantiate_with_code(_endowment, _gas_limit, _code, _data, _salt)) => {
2764
2765 let new_contract_address = <pallet_contracts::Module<T>>::contract_address(
2766 &who,
2767 &T::Hashing::hash(&_code),
2768 _salt,
2769 );
2770
2771 <ContractOwner<T>>::insert(new_contract_address.clone(), who.clone());
2772
2773 None
2774 }
2775
2776 // When the contract is called, check if the sponsoring is enabled and pay fees from contract endowment if it is
2777 Some(pallet_contracts::Call::call(dest, _value, _gas_limit, _data)) => {
2778
2779 let called_contract: T::AccountId = T::Lookup::lookup((*dest).clone()).unwrap_or(T::AccountId::default());
2780
2781 let mut sponsor_transfer = false;
2782 if <ContractSponsoringRateLimit<T>>::contains_key(called_contract.clone()) {
2783 let last_tx_block = <ContractSponsorBasket<T>>::get((&called_contract, &who));
2784 let block_number = <system::Module<T>>::block_number() as T::BlockNumber;
2785 let rate_limit = <ContractSponsoringRateLimit<T>>::get(&called_contract);
2786 let limit_time = last_tx_block + rate_limit;
2787
2788 if block_number >= limit_time {
2789 <ContractSponsorBasket<T>>::insert((called_contract.clone(), who.clone()), block_number);
2790 sponsor_transfer = true;
2791 }
2792 } else {
2793 sponsor_transfer = false;
2794 }
2795
2796 if sponsor_transfer {
2797 if <ContractSelfSponsoring<T>>::contains_key(called_contract.clone()) {
2798 if <ContractSelfSponsoring<T>>::get(called_contract.clone()) {
2799 return Some(called_contract);
2800 }
2801 }
2802 }
2803
2804 None
2805 },
2806
2807 _ => None,
2808 });
2809
2810 let who_pays_fee = sponsor.unwrap_or_else(|| who.clone());
2811
2812 <<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::withdraw_fee(&who_pays_fee, call, info, fee, tip)
2813 .map(|i| (fee, i))
2814 }
2815}
2816
2817
2818impl<T: Config + Send + Sync> SignedExtension
2819 for ChargeTransactionPayment<T>
2820where
2821 BalanceOf<T>: Send + Sync + From<u64> + FixedPointOperand,
2822 T::Call: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo> + IsSubType<Call<T>> + IsSubType<pallet_contracts::Call<T>>,
2823 T::AccountId: AsRef<[u8]>,
2824 T::AccountId: UncheckedFrom<T::Hash>,
2825{
2826 const IDENTIFIER: &'static str = "ChargeTransactionPayment";
2827 type AccountId = T::AccountId;
2828 type Call = T::Call;
2829 type AdditionalSigned = ();
2830 type Pre = (
2831 // tip
2832 BalanceOf<T>,
2833 // who pays fee
2834 Self::AccountId,
2835 // imbalance resulting from withdrawing the fee
2836 <<T as pallet_transaction_payment::Config>::OnChargeTransaction as pallet_transaction_payment::OnChargeTransaction<T>>::LiquidityInfo,
2837 );
2838 fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> {
2839 Ok(())
2840 }
2841
2842 fn validate(
2843 &self,
2844 who: &Self::AccountId,
2845 call: &Self::Call,
2846 info: &DispatchInfoOf<Self::Call>,
2847 len: usize,
2848 ) -> TransactionValidity {
2849 let (fee, _) = self.withdraw_fee(who, call, info, len)?;
2850 Ok(ValidTransaction {
2851 priority: Self::get_priority(len, info, fee),
2852 ..Default::default()
2853 })
2854 }
2855
2856 fn pre_dispatch(
2857 self,
2858 who: &Self::AccountId,
2859 call: &Self::Call,
2860 info: &DispatchInfoOf<Self::Call>,
2861 len: usize,
2862 ) -> Result<Self::Pre, TransactionValidityError> {
2863 let (_fee, imbalance) = self.withdraw_fee(who, call, info, len)?;
2864 Ok((self.0, who.clone(), imbalance))
2865 }
2866
2867 fn post_dispatch(
2868 pre: Self::Pre,
2869 info: &DispatchInfoOf<Self::Call>,
2870 post_info: &PostDispatchInfoOf<Self::Call>,
2871 len: usize,
2872 _result: &DispatchResult,
2873 ) -> Result<(), TransactionValidityError> {
2874 let (tip, who, imbalance) = pre;
2875 let actual_fee = pallet_transaction_payment::Module::<T>::compute_actual_fee(
2876 len as u32,
2877 info,
2878 post_info,
2879 tip,
2880 );
2881 <T as pallet_transaction_payment::Config>::OnChargeTransaction::correct_and_deposit_fee(&who, info, post_info, actual_fee, tip, imbalance)?;
2882 Ok(())
2883 }
2884}
2885
2886// #endregion
addedpallets/scheduler/Cargo.tomldiffbeforeafterboth

no changes

addedpallets/scheduler/README.mddiffbeforeafterboth

no changes

addedpallets/scheduler/src/benchmarking.rsdiffbeforeafterboth

no changes

addedpallets/scheduler/src/lib.rsdiffbeforeafterboth

no changes

addedpallets/scheduler/src/weights.rsdiffbeforeafterboth

no changes

addedprimitives/Cargo.tomldiffbeforeafterboth

no changes

addedprimitives/src/lib.rsdiffbeforeafterboth

no changes

modifiedruntime/Cargo.tomldiffbeforeafterboth
2626
27# local dependencies27# local dependencies
28pallet-nft = { path = '../pallets/nft', default-features = false, version = '3.0.0' }28pallet-nft = { path = '../pallets/nft', default-features = false, version = '3.0.0' }
29nft-data-structs = { path = '../primitives', default-features = false }
29pallet-inflation = { path = '../pallets/inflation', default-features = false, version = '3.0.0' }30pallet-inflation = { path = '../pallets/inflation', default-features = false, version = '3.0.0' }
31pallet-scheduler = { path = '../pallets/scheduler', default-features = false, version = '3.0.0' }
32pallet-nft-transaction-payment = { path = '../pallets/nft-transaction-payment', default-features = false, version = '3.0.0' }
33pallet-nft-charge-transaction = { path = '../pallets/nft-charge-transaction', default-features = false, version = '3.0.0' }
3034
31# Substrate dependencies35# Substrate dependencies
32frame-benchmarking = { default-features = false, optional = true, version = '3.0.0' }36frame-benchmarking = { default-features = false, optional = true, version = '3.0.0' }
99
100 'pallet-inflation/std',103 'pallet-inflation/std',
101 'pallet-nft/std',104 'pallet-nft/std',
105 'pallet-scheduler/std',
106 'pallet-nft-charge-transaction/std',
107 'pallet-nft-transaction-payment/std',
108 'nft-data-structs/std',
102 'sp-api/std',109 'sp-api/std',
103 'sp-block-builder/std',110 'sp-block-builder/std',
104 'sp-consensus-aura/std',111 'sp-consensus-aura/std',
modifiedruntime/src/chain_extension.rsdiffbeforeafterboth
1717
18extern crate pallet_nft;18extern crate pallet_nft;
19pub use pallet_nft::*;19pub use pallet_nft::*;
20use crate::Runtime;20use nft_data_structs::*;
21// use crate::Runtime;
21use sp_runtime::AccountId32;22use sp_runtime::AccountId32;
22use crate::Vec;23use crate::Vec;
2324
41/// The chain Extension of NFT pallet42/// The chain Extension of NFT pallet
42pub struct NFTExtension;43pub struct NFTExtension;
4344
44impl<C: Config> ChainExtension<C> for NFTExtension {45impl<C: Config + pallet_contracts::Config> ChainExtension<C> for NFTExtension {
45 fn call<E: Ext>(func_id: u32, env: Environment<E, InitState>) -> Result<RetVal, DispatchError>46 fn call<E: Ext>(func_id: u32, env: Environment<E, InitState>) -> Result<RetVal, DispatchError>
46 where47 where
47 E: Ext<T = C>,48 E: Ext<T = C>,
modifiedruntime/src/lib.rsdiffbeforeafterboth
51 WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients51 WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients
52 },52 },
53};53};
54use pallet_nft_transaction_payment::*;
55use pallet_nft_charge_transaction::*;
56use nft_data_structs::*;
54use pallet_contracts::weights::WeightInfo;57use pallet_contracts::weights::WeightInfo;
55// #[cfg(any(feature = "std", test))]58// #[cfg(any(feature = "std", test))]
56use frame_system::{59use frame_system::{
57 self as system,60 self as system,
58 EnsureRoot, 61 EnsureRoot, EnsureSigned,
59 limits::{BlockWeights, BlockLength},62 limits::{BlockWeights, BlockLength},
60};63};
61use sp_std::{prelude::*, marker::PhantomData};64use sp_std::{prelude::*, marker::PhantomData};
62use sp_arithmetic::{traits::{BaseArithmetic, Unsigned}};65use sp_arithmetic::{traits::{BaseArithmetic, Unsigned}};
63use smallvec::smallvec;66use smallvec::smallvec;
67
68use sp_runtime::{
69 traits::{
70 Dispatchable,
71 },
72};
73use pallet_contracts::chain_extension::UncheckedFrom;
74
6475
65pub use pallet_timestamp::Call as TimestampCall;76pub use pallet_timestamp::Call as TimestampCall;
175 }186 }
176}187}
177
178/// Provides a membership set with only the configured aura users
179pub struct ValiudatorsOnly<Runtime: pallet_aura::Config>(PhantomData<Runtime>);
180impl frame_support::traits::Contains<AccountId> for ValiudatorsOnly<Runtime> {
181 fn contains(t: &AccountId) -> bool {
182 let arr: [u8; 32] = *t.as_ref();
183 let raw_key: Vec<u8> = Vec::from(arr);
184
185 match pallet_aura::Module::<Runtime>::authorities().iter().find(|auth| auth.to_raw_vec() == raw_key) {
186 Some(_) => true,
187 None => false,
188 }
189 }
190 fn sorted_members() -> Vec<AccountId> {
191 let mut members: Vec<AccountId> = Vec::new();
192 for auth in pallet_aura::Module::<Runtime>::authorities() {
193 let mut arr: [u8; 32] = Default::default();
194 let bor_arr = auth.clone().to_raw_vec();
195 let slice = bor_arr.as_slice();
196 arr.copy_from_slice(slice);
197 members.push(AccountId::from(arr));
198 }
199 members
200 }
201 fn count() -> usize {
202 pallet_aura::Module::<Runtime>::authorities().len()
203 }
204}
205
206impl frame_support::traits::ContainsLengthBound for ValiudatorsOnly<Runtime> {
207 fn min_len() -> usize {
208 1
209 }
210 fn max_len() -> usize {
211 100
212 }
213}
214188
215type NegativeImbalance = <Balances as Currency<AccountId>>::NegativeImbalance;189type NegativeImbalance = <Balances as Currency<AccountId>>::NegativeImbalance;
216190
230 }204 }
231}205}
232
233// impl OnUnbalanced<NegativeImbalance> for DealWithFees {
234// fn on_unbalanceds<B>(mut fees_then_tips: impl Iterator<Item=NegativeImbalance>) {
235// if let Some(fees) = fees_then_tips.next() {
236// // for fees, 100% to treasury
237// let mut split = fees.ration(100, 0);
238// if let Some(tips) = fees_then_tips.next() {
239// // for tips, if any, 100% to treasury
240// tips.ration_merge_into(100, 0, &mut split);
241// }
242// Treasury::on_unbalanced(split.0);
243// // Author::on_unbalanced(split.1);
244// }
245// }
246// }
247206
248/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers.207/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers.
249/// This is used to limit the maximal weight of a single extrinsic.208/// This is used to limit the maximal weight of a single extrinsic.
550}509}
510
511
512parameter_types! {
513 pub MaximumSchedulerWeight: Weight = Perbill::from_percent(50) *
514 RuntimeBlockWeights::get().max_block;
515 pub const MaxScheduledPerBlock: u32 = 50;
516}
517
518pub struct Sponsoring;
519impl SponsoringResolve<AccountId, Call> for Sponsoring {
520
521 fn resolve(who: &AccountId, call: &Call) -> Option<AccountId>
522 where
523 Call: Dispatchable<Info=DispatchInfo>,
524 Call: IsSubType<pallet_nft::Call<Runtime>>,
525 Call: IsSubType<pallet_contracts::Call<Runtime>>,
526 AccountId: AsRef<[u8]>,
527 AccountId: UncheckedFrom<Hash>
528 {
529 pallet_nft_transaction_payment::Module::<Runtime>::withdraw_type(who, call)
530 }
531}
532
533impl pallet_scheduler::Config for Runtime {
534 type Event = Event;
535 type Origin = Origin;
536 type PalletsOrigin = OriginCaller;
537 type Call = Call;
538 type MaximumWeight = MaximumSchedulerWeight;
539 type ScheduleOrigin = EnsureSigned<AccountId>;
540 type MaxScheduledPerBlock = MaxScheduledPerBlock;
541 type Sponsoring = Sponsoring;
542 type WeightInfo = ();
543}
544
545impl pallet_nft_transaction_payment::Config for Runtime {
546}
547
548impl pallet_nft_charge_transaction::Config for Runtime {
549}
551550
552construct_runtime!(551construct_runtime!(
553 pub enum Runtime where552 pub enum Runtime where
565 TransactionPayment: pallet_transaction_payment::{Module, Storage},564 TransactionPayment: pallet_transaction_payment::{Module, Storage},
566 Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>},565 Sudo: pallet_sudo::{Module, Call, Config<T>, Storage, Event<T>},
567 Inflation: pallet_inflation::{Module, Call, Storage},566 Inflation: pallet_inflation::{Module, Call, Storage},
567 Scheduler: pallet_scheduler::{Module, Call, Storage, Event<T>},
568 Nft: pallet_nft::{Module, Call, Config<T>, Storage, Event<T>},568 Nft: pallet_nft::{Module, Call, Config<T>, Storage, Event<T>},
569 Treasury: pallet_treasury::{Module, Call, Storage, Config, Event<T>},569 Treasury: pallet_treasury::{Module, Call, Storage, Config, Event<T>},
570 Vesting: pallet_vesting::{Module, Call, Config<T>, Storage, Event<T>},570 Vesting: pallet_vesting::{Module, Call, Config<T>, Storage, Event<T>},
571 NftPayment: pallet_nft_transaction_payment::{Module, Call, Storage},
572 Charging: pallet_nft_charge_transaction::{Module, Call, Storage },
571 }573 }
572);574);
573575
589 system::CheckEra<Runtime>,591 system::CheckEra<Runtime>,
590 system::CheckNonce<Runtime>,592 system::CheckNonce<Runtime>,
591 system::CheckWeight<Runtime>,593 system::CheckWeight<Runtime>,
592 pallet_nft::ChargeTransactionPayment<Runtime>,594 pallet_nft_charge_transaction::ChargeTransactionPayment<Runtime>,
593);595);
594/// Unchecked extrinsic type as expected by this runtime.596/// Unchecked extrinsic type as expected by this runtime.
595pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;597pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;