Add Uniques to Westmint and Statemint (#493)

* Add uniques to westmint and statemint

* update cargo

* Update Cargo.lock

* Update lib.rs

* fix merge

* Apply suggestions from code review

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>

* fix build

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: joepetrowski <joe@parity.io>
This commit is contained in:
Shawn Tabrizi
2021-07-15 10:51:31 -04:00
committed by GitHub
parent c905b56303
commit 954f85a85c
9 changed files with 465 additions and 8 deletions
Generated
+2
View File
@@ -10917,6 +10917,7 @@ dependencies = [
"pallet-timestamp",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
"pallet-uniques",
"pallet-utility",
"pallet-xcm",
"parachain-info",
@@ -12613,6 +12614,7 @@ dependencies = [
"pallet-timestamp",
"pallet-transaction-payment",
"pallet-transaction-payment-rpc-runtime-api",
"pallet-uniques",
"pallet-utility",
"pallet-xcm",
"parachain-info",
+4 -1
View File
@@ -45,6 +45,7 @@ pallet-sudo = { git = "https://github.com/paritytech/substrate", default-feature
pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-uniques = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
node-primitives = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
@@ -81,6 +82,7 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran
[features]
default = [ "std" ]
runtime-benchmarks = [
'cumulus-pallet-session-benchmarking/runtime-benchmarks',
'hex-literal',
'sp-runtime/runtime-benchmarks',
'xcm-builder/runtime-benchmarks',
@@ -92,7 +94,7 @@ runtime-benchmarks = [
'pallet-balances/runtime-benchmarks',
'pallet-multisig/runtime-benchmarks',
'pallet-proxy/runtime-benchmarks',
'cumulus-pallet-session-benchmarking/runtime-benchmarks',
'pallet-uniques/runtime-benchmarks',
'pallet-utility/runtime-benchmarks',
'pallet-timestamp/runtime-benchmarks',
'pallet-xcm/runtime-benchmarks',
@@ -129,6 +131,7 @@ std = [
"pallet-timestamp/std",
"pallet-transaction-payment/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-uniques/std",
"pallet-utility/std",
"parachain-info/std",
"cumulus-pallet-aura-ext/std",
+53 -2
View File
@@ -327,14 +327,20 @@ impl InstanceFilter<Call> for ProxyType {
fn filter(&self, c: &Call) -> bool {
match self {
ProxyType::Any => true,
ProxyType::NonTransfer => !matches!(c, Call::Balances(..) | Call::Assets(..)),
ProxyType::NonTransfer => !matches!(
c,
Call::Balances(..) | Call::Assets(..) | Call::Uniques(..)
),
ProxyType::CancelProxy => matches!(
c,
Call::Proxy(pallet_proxy::Call::reject_announcement(..))
| Call::Utility(..) | Call::Multisig(..)
),
ProxyType::Assets => {
matches!(c, Call::Assets(..) | Call::Utility(..) | Call::Multisig(..))
matches!(
c,
Call::Assets(..) | Call::Utility(..) | Call::Multisig(..) | Call::Uniques(..)
)
}
ProxyType::AssetOwner => matches!(
c,
@@ -344,6 +350,16 @@ impl InstanceFilter<Call> for ProxyType {
| Call::Assets(pallet_assets::Call::set_team(..))
| Call::Assets(pallet_assets::Call::set_metadata(..))
| Call::Assets(pallet_assets::Call::clear_metadata(..))
| Call::Uniques(pallet_uniques::Call::create(..))
| Call::Uniques(pallet_uniques::Call::destroy(..))
| Call::Uniques(pallet_uniques::Call::transfer_ownership(..))
| Call::Uniques(pallet_uniques::Call::set_team(..))
| Call::Uniques(pallet_uniques::Call::set_metadata(..))
| Call::Uniques(pallet_uniques::Call::set_attribute(..))
| Call::Uniques(pallet_uniques::Call::set_class_metadata(..))
| Call::Uniques(pallet_uniques::Call::clear_metadata(..))
| Call::Uniques(pallet_uniques::Call::clear_attribute(..))
| Call::Uniques(pallet_uniques::Call::clear_class_metadata(..))
| Call::Utility(..) | Call::Multisig(..)
),
ProxyType::AssetManager => matches!(
@@ -354,6 +370,12 @@ impl InstanceFilter<Call> for ProxyType {
| Call::Assets(pallet_assets::Call::thaw(..))
| Call::Assets(pallet_assets::Call::freeze_asset(..))
| Call::Assets(pallet_assets::Call::thaw_asset(..))
| Call::Uniques(pallet_uniques::Call::mint(..))
| Call::Uniques(pallet_uniques::Call::burn(..))
| Call::Uniques(pallet_uniques::Call::freeze(..))
| Call::Uniques(pallet_uniques::Call::thaw(..))
| Call::Uniques(pallet_uniques::Call::freeze_class(..))
| Call::Uniques(pallet_uniques::Call::thaw_class(..))
| Call::Utility(..) | Call::Multisig(..)
),
ProxyType::Collator => matches!(
@@ -603,6 +625,34 @@ impl pallet_collator_selection::Config for Runtime {
type WeightInfo = weights::pallet_collator_selection::WeightInfo<Runtime>;
}
parameter_types! {
pub const ClassDeposit: Balance = UNITS; // 1 UNIT deposit to create asset class
pub const InstanceDeposit: Balance = UNITS / 100; // 1/100 UNIT deposit to create asset instance
pub const KeyLimit: u32 = 32; // Max 32 bytes per key
pub const ValueLimit: u32 = 64; // Max 64 bytes per value
pub const UniquesMetadataDepositBase: Balance = deposit(1, 129);
pub const AttributeDepositBase: Balance = deposit(1, 0);
pub const DepositPerByte: Balance = deposit(0, 1);
pub const UniquesStringLimit: u32 = 128;
}
impl pallet_uniques::Config for Runtime {
type Event = Event;
type ClassId = u32;
type InstanceId = u32;
type Currency = Balances;
type ForceOrigin = AssetsForceOrigin;
type ClassDeposit = ClassDeposit;
type InstanceDeposit = InstanceDeposit;
type MetadataDepositBase = UniquesMetadataDepositBase;
type AttributeDepositBase = AttributeDepositBase;
type DepositPerByte = DepositPerByte;
type StringLimit = UniquesStringLimit;
type KeyLimit = KeyLimit;
type ValueLimit = ValueLimit;
type WeightInfo = weights::pallet_uniques::WeightInfo<Runtime>;
}
// Create the runtime by composing the FRAME pallets that were previously configured.
construct_runtime!(
pub enum Runtime where
@@ -643,6 +693,7 @@ construct_runtime!(
// The main stage. To include pallet-assets-freezer and pallet-uniques.
Assets: pallet_assets::{Pallet, Call, Storage, Event<T>} = 50,
Uniques: pallet_uniques::{Pallet, Call, Storage, Event<T>} = 51,
}
);
@@ -5,4 +5,5 @@ pub mod pallet_collator_selection;
pub mod pallet_proxy;
pub mod pallet_session;
pub mod pallet_timestamp;
pub mod pallet_uniques;
pub mod pallet_utility;
@@ -0,0 +1,171 @@
// Copyright 2021 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for pallet_uniques
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-06-02, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 128
// Executed Command:
// ./target/release/polkadot-collator
// benchmark
// --chain=statemine-dev
// --steps=50
// --repeat=20
// --pallet=pallet_uniques
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --header=./file_header.txt
// --output=./polkadot-parachains/statemine-runtime/src/weights/
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weight functions for pallet_uniques.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_uniques::WeightInfo for WeightInfo<T> {
fn create() -> Weight {
(42_199_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn force_create() -> Weight {
(21_030_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn destroy(n: u32, m: u32, a: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 14_000
.saturating_add((16_814_000 as Weight).saturating_mul(n as Weight))
// Standard Error: 14_000
.saturating_add((1_026_000 as Weight).saturating_mul(m as Weight))
// Standard Error: 14_000
.saturating_add((952_000 as Weight).saturating_mul(a as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(n as Weight)))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(n as Weight)))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(m as Weight)))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(a as Weight)))
}
fn mint() -> Weight {
(57_236_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn burn() -> Weight {
(58_129_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn transfer() -> Weight {
(42_980_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn redeposit(i: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 11_000
.saturating_add((26_921_000 as Weight).saturating_mul(i as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight)))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
}
fn freeze() -> Weight {
(30_427_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn thaw() -> Weight {
(29_789_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn freeze_class() -> Weight {
(21_380_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn thaw_class() -> Weight {
(21_430_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn transfer_ownership() -> Weight {
(49_331_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn set_team() -> Weight {
(22_305_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn force_asset_status() -> Weight {
(21_965_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn set_attribute() -> Weight {
(70_386_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn clear_attribute() -> Weight {
(63_932_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn set_metadata() -> Weight {
(53_647_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn clear_metadata() -> Weight {
(52_353_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn set_class_metadata() -> Weight {
(51_900_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn clear_class_metadata() -> Weight {
(46_929_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn approve_transfer() -> Weight {
(32_693_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn cancel_approval() -> Weight {
(32_418_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
}
+4 -1
View File
@@ -45,6 +45,7 @@ pallet-sudo = { git = "https://github.com/paritytech/substrate", default-feature
pallet-timestamp = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-uniques = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
node-primitives = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
@@ -81,6 +82,7 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran
[features]
default = [ "std" ]
runtime-benchmarks = [
'cumulus-pallet-session-benchmarking/runtime-benchmarks',
'hex-literal',
'sp-runtime/runtime-benchmarks',
'xcm-builder/runtime-benchmarks',
@@ -92,7 +94,7 @@ runtime-benchmarks = [
'pallet-balances/runtime-benchmarks',
'pallet-multisig/runtime-benchmarks',
'pallet-proxy/runtime-benchmarks',
'cumulus-pallet-session-benchmarking/runtime-benchmarks',
'pallet-uniques/runtime-benchmarks',
'pallet-utility/runtime-benchmarks',
'pallet-timestamp/runtime-benchmarks',
'pallet-xcm/runtime-benchmarks',
@@ -129,6 +131,7 @@ std = [
"pallet-timestamp/std",
"pallet-transaction-payment/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-uniques/std",
"pallet-utility/std",
"parachain-info/std",
"cumulus-pallet-aura-ext/std",
+58 -4
View File
@@ -144,7 +144,6 @@ parameter_types! {
}
// Configure FRAME pallets to include in runtime.
impl frame_system::Config for Runtime {
type BaseCallFilter = ();
type BlockWeights = RuntimeBlockWeights;
@@ -234,6 +233,8 @@ impl pallet_sudo::Config for Runtime {
type Call = Call;
}
pub type AssetsForceOrigin = EnsureRoot<AccountId>;
parameter_types! {
pub const AssetDeposit: Balance = 100 * UNITS; // 100 WND deposit to create asset
pub const ApprovalDeposit: Balance = EXISTENTIAL_DEPOSIT;
@@ -249,7 +250,7 @@ impl pallet_assets::Config for Runtime {
type Balance = Balance;
type AssetId = u32;
type Currency = Balances;
type ForceOrigin = EnsureRoot<AccountId>;
type ForceOrigin = AssetsForceOrigin;
type AssetDeposit = AssetDeposit;
type MetadataDepositBase = MetadataDepositBase;
type MetadataDepositPerByte = MetadataDepositPerByte;
@@ -325,14 +326,20 @@ impl InstanceFilter<Call> for ProxyType {
fn filter(&self, c: &Call) -> bool {
match self {
ProxyType::Any => true,
ProxyType::NonTransfer => !matches!(c, Call::Balances(..) | Call::Assets(..)),
ProxyType::NonTransfer => !matches!(
c,
Call::Balances(..) | Call::Assets(..) | Call::Uniques(..)
),
ProxyType::CancelProxy => matches!(
c,
Call::Proxy(pallet_proxy::Call::reject_announcement(..))
| Call::Utility(..) | Call::Multisig(..)
),
ProxyType::Assets => {
matches!(c, Call::Assets(..) | Call::Utility(..) | Call::Multisig(..))
matches!(
c,
Call::Assets(..) | Call::Utility(..) | Call::Multisig(..) | Call::Uniques(..)
)
}
ProxyType::AssetOwner => matches!(
c,
@@ -342,6 +349,16 @@ impl InstanceFilter<Call> for ProxyType {
| Call::Assets(pallet_assets::Call::set_team(..))
| Call::Assets(pallet_assets::Call::set_metadata(..))
| Call::Assets(pallet_assets::Call::clear_metadata(..))
| Call::Uniques(pallet_uniques::Call::create(..))
| Call::Uniques(pallet_uniques::Call::destroy(..))
| Call::Uniques(pallet_uniques::Call::transfer_ownership(..))
| Call::Uniques(pallet_uniques::Call::set_team(..))
| Call::Uniques(pallet_uniques::Call::set_metadata(..))
| Call::Uniques(pallet_uniques::Call::set_attribute(..))
| Call::Uniques(pallet_uniques::Call::set_class_metadata(..))
| Call::Uniques(pallet_uniques::Call::clear_metadata(..))
| Call::Uniques(pallet_uniques::Call::clear_attribute(..))
| Call::Uniques(pallet_uniques::Call::clear_class_metadata(..))
| Call::Utility(..) | Call::Multisig(..)
),
ProxyType::AssetManager => matches!(
@@ -352,6 +369,12 @@ impl InstanceFilter<Call> for ProxyType {
| Call::Assets(pallet_assets::Call::thaw(..))
| Call::Assets(pallet_assets::Call::freeze_asset(..))
| Call::Assets(pallet_assets::Call::thaw_asset(..))
| Call::Uniques(pallet_uniques::Call::mint(..))
| Call::Uniques(pallet_uniques::Call::burn(..))
| Call::Uniques(pallet_uniques::Call::freeze(..))
| Call::Uniques(pallet_uniques::Call::thaw(..))
| Call::Uniques(pallet_uniques::Call::freeze_class(..))
| Call::Uniques(pallet_uniques::Call::thaw_class(..))
| Call::Utility(..) | Call::Multisig(..)
),
ProxyType::Collator => matches!(
@@ -593,6 +616,34 @@ impl pallet_collator_selection::Config for Runtime {
type WeightInfo = weights::pallet_collator_selection::WeightInfo<Runtime>;
}
parameter_types! {
pub const ClassDeposit: Balance = UNITS; // 1 UNIT deposit to create asset class
pub const InstanceDeposit: Balance = UNITS / 100; // 1/100 UNIT deposit to create asset instance
pub const KeyLimit: u32 = 32; // Max 32 bytes per key
pub const ValueLimit: u32 = 64; // Max 64 bytes per value
pub const UniquesMetadataDepositBase: Balance = deposit(1, 129);
pub const AttributeDepositBase: Balance = deposit(1, 0);
pub const DepositPerByte: Balance = deposit(0, 1);
pub const UniquesStringLimit: u32 = 128;
}
impl pallet_uniques::Config for Runtime {
type Event = Event;
type ClassId = u32;
type InstanceId = u32;
type Currency = Balances;
type ForceOrigin = AssetsForceOrigin;
type ClassDeposit = ClassDeposit;
type InstanceDeposit = InstanceDeposit;
type MetadataDepositBase = UniquesMetadataDepositBase;
type AttributeDepositBase = AttributeDepositBase;
type DepositPerByte = DepositPerByte;
type StringLimit = UniquesStringLimit;
type KeyLimit = KeyLimit;
type ValueLimit = ValueLimit;
type WeightInfo = weights::pallet_uniques::WeightInfo<Runtime>;
}
// Create the runtime by composing the FRAME pallets that were previously configured.
construct_runtime!(
pub enum Runtime where
@@ -632,6 +683,9 @@ construct_runtime!(
PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin},
CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin},
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>},
// More things for the main stage
Uniques: pallet_uniques::{Pallet, Call, Storage, Event<T>},
}
);
@@ -5,4 +5,5 @@ pub mod pallet_collator_selection;
pub mod pallet_proxy;
pub mod pallet_session;
pub mod pallet_timestamp;
pub mod pallet_uniques;
pub mod pallet_utility;
@@ -0,0 +1,171 @@
// Copyright 2021 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Cumulus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for pallet_uniques
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-06-02, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("statemine-dev"), DB CACHE: 128
// Executed Command:
// ./target/release/polkadot-collator
// benchmark
// --chain=statemine-dev
// --steps=50
// --repeat=20
// --pallet=pallet_uniques
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --header=./file_header.txt
// --output=./polkadot-parachains/statemine-runtime/src/weights/
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weight functions for pallet_uniques.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_uniques::WeightInfo for WeightInfo<T> {
fn create() -> Weight {
(42_199_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn force_create() -> Weight {
(21_030_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn destroy(n: u32, m: u32, a: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 14_000
.saturating_add((16_814_000 as Weight).saturating_mul(n as Weight))
// Standard Error: 14_000
.saturating_add((1_026_000 as Weight).saturating_mul(m as Weight))
// Standard Error: 14_000
.saturating_add((952_000 as Weight).saturating_mul(a as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(n as Weight)))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(n as Weight)))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(m as Weight)))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(a as Weight)))
}
fn mint() -> Weight {
(57_236_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn burn() -> Weight {
(58_129_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn transfer() -> Weight {
(42_980_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn redeposit(i: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 11_000
.saturating_add((26_921_000 as Weight).saturating_mul(i as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(i as Weight)))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
}
fn freeze() -> Weight {
(30_427_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn thaw() -> Weight {
(29_789_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn freeze_class() -> Weight {
(21_380_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn thaw_class() -> Weight {
(21_430_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn transfer_ownership() -> Weight {
(49_331_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn set_team() -> Weight {
(22_305_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn force_asset_status() -> Weight {
(21_965_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn set_attribute() -> Weight {
(70_386_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn clear_attribute() -> Weight {
(63_932_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn set_metadata() -> Weight {
(53_647_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn clear_metadata() -> Weight {
(52_353_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn set_class_metadata() -> Weight {
(51_900_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn clear_class_metadata() -> Weight {
(46_929_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn approve_transfer() -> Weight {
(32_693_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
fn cancel_approval() -> Weight {
(32_418_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
}