difftreelog
feat benchmark rmrk proxy equip
in: master
9 files changed
Makefilediffbeforeafterboth1.PHONY: _help2_help:3 @echo "regenerate_solidity - generate stubs/interfaces for contracts defined in native (via evm-coder)"4 @echo "evm_stubs - recompile contract stubs and ABI"5 @echo "bench - run frame-benchmarking"6 @echo " bench-evm-migration"7 @echo " bench-unique"89FUNGIBLE_EVM_STUBS=./pallets/fungible/src/stubs10FUNGIBLE_EVM_ABI=./tests/src/eth/fungibleAbi.json1112NONFUNGIBLE_EVM_STUBS=./pallets/nonfungible/src/stubs13NONFUNGIBLE_EVM_ABI=./tests/src/eth/nonFungibleAbi.json1415CONTRACT_HELPERS_STUBS=./pallets/evm-contract-helpers/src/stubs/16CONTRACT_HELPERS_ABI=./tests/src/eth/util/contractHelpersAbi.json1718COLLECTION_HELPER_STUBS=./pallets/unique/src/eth/stubs/19COLLECTION_HELPER_ABI=./tests/src/eth/collectionHelpersAbi.json2021TESTS_API=./tests/src/eth/api/2223.PHONY: regenerate_solidity24regenerate_solidity: UniqueFungible.sol UniqueNFT.sol ContractHelpers.sol CollectionHelpers.sol2526UniqueFungible.sol:27 PACKAGE=pallet-fungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh28 PACKAGE=pallet-fungible NAME=erc::gen_impl OUTPUT=$(FUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh2930UniqueNFT.sol:31 PACKAGE=pallet-nonfungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh32 PACKAGE=pallet-nonfungible NAME=erc::gen_impl OUTPUT=$(NONFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh3334ContractHelpers.sol:35 PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh36 PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_impl OUTPUT=$(CONTRACT_HELPERS_STUBS)/$@ ./.maintain/scripts/generate_sol.sh3738CollectionHelpers.sol:39 PACKAGE=pallet-unique NAME=eth::collection_helper_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh40 PACKAGE=pallet-unique NAME=eth::collection_helper_impl OUTPUT=$(COLLECTION_HELPER_STUBS)/$@ ./.maintain/scripts/generate_sol.sh4142UniqueFungible: UniqueFungible.sol43 INPUT=$(FUNGIBLE_EVM_STUBS)/$< OUTPUT=$(FUNGIBLE_EVM_STUBS)/UniqueFungible.raw ./.maintain/scripts/compile_stub.sh44 INPUT=$(FUNGIBLE_EVM_STUBS)/$< OUTPUT=$(FUNGIBLE_EVM_ABI) ./.maintain/scripts/generate_abi.sh4546UniqueNFT: UniqueNFT.sol47 INPUT=$(NONFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(NONFUNGIBLE_EVM_STUBS)/UniqueNFT.raw ./.maintain/scripts/compile_stub.sh48 INPUT=$(NONFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(NONFUNGIBLE_EVM_ABI) ./.maintain/scripts/generate_abi.sh4950ContractHelpers: ContractHelpers.sol51 INPUT=$(CONTRACT_HELPERS_STUBS)/$< OUTPUT=$(CONTRACT_HELPERS_STUBS)/ContractHelpers.raw ./.maintain/scripts/compile_stub.sh52 INPUT=$(CONTRACT_HELPERS_STUBS)/$< OUTPUT=$(CONTRACT_HELPERS_ABI) ./.maintain/scripts/generate_abi.sh5354CollectionHelpers: CollectionHelpers.sol55 INPUT=$(COLLECTION_HELPER_STUBS)/$< OUTPUT=$(COLLECTION_HELPER_STUBS)/CollectionHelpers.raw ./.maintain/scripts/compile_stub.sh56 INPUT=$(COLLECTION_HELPER_STUBS)/$< OUTPUT=$(COLLECTION_HELPER_ABI) ./.maintain/scripts/generate_abi.sh5758evm_stubs: UniqueFungible UniqueNFT ContractHelpers CollectionHelpers5960.PHONY: _bench61_bench:62 cargo run --release --features runtime-benchmarks,$(RUNTIME) -- \63 benchmark pallet --pallet pallet-$(if $(PALLET),$(PALLET),$(error Must set PALLET)) \64 --wasm-execution compiled --extrinsic '*' \65 --template .maintain/frame-weight-template.hbs --steps=50 --repeat=80 --heap-pages=4096 \66 --output=./pallets/$(if $(PALLET_DIR),$(PALLET_DIR),$(PALLET))/src/weights.rs6768.PHONY: bench-evm-migration69bench-evm-migration:70 make _bench PALLET=evm-migration7172.PHONY: bench-common73bench-common:74 make _bench PALLET=common7576.PHONY: bench-unique77bench-unique:78 make _bench PALLET=unique7980.PHONY: bench-fungible81bench-fungible:82 make _bench PALLET=fungible8384.PHONY: bench-refungible85bench-refungible:86 make _bench PALLET=refungible8788.PHONY: bench-nonfungible89bench-nonfungible:90 make _bench PALLET=nonfungible9192.PHONY: bench-structure93bench-structure:94 make _bench PALLET=structure9596.PHONY: bench-scheduler97bench-scheduler:98 make _bench PALLET=unique-scheduler PALLET_DIR=scheduler99100.PHONY: bench-rmrk-core101bench-rmrk-core:102 make _bench PALLET=proxy-rmrk-core103104.PHONY: bench105bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-scheduler bench-rmrk-core1.PHONY: _help2_help:3 @echo "regenerate_solidity - generate stubs/interfaces for contracts defined in native (via evm-coder)"4 @echo "evm_stubs - recompile contract stubs and ABI"5 @echo "bench - run frame-benchmarking"6 @echo " bench-evm-migration"7 @echo " bench-unique"89FUNGIBLE_EVM_STUBS=./pallets/fungible/src/stubs10FUNGIBLE_EVM_ABI=./tests/src/eth/fungibleAbi.json1112NONFUNGIBLE_EVM_STUBS=./pallets/nonfungible/src/stubs13NONFUNGIBLE_EVM_ABI=./tests/src/eth/nonFungibleAbi.json1415CONTRACT_HELPERS_STUBS=./pallets/evm-contract-helpers/src/stubs/16CONTRACT_HELPERS_ABI=./tests/src/eth/util/contractHelpersAbi.json1718COLLECTION_HELPER_STUBS=./pallets/unique/src/eth/stubs/19COLLECTION_HELPER_ABI=./tests/src/eth/collectionHelpersAbi.json2021TESTS_API=./tests/src/eth/api/2223.PHONY: regenerate_solidity24regenerate_solidity: UniqueFungible.sol UniqueNFT.sol ContractHelpers.sol CollectionHelpers.sol2526UniqueFungible.sol:27 PACKAGE=pallet-fungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh28 PACKAGE=pallet-fungible NAME=erc::gen_impl OUTPUT=$(FUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh2930UniqueNFT.sol:31 PACKAGE=pallet-nonfungible NAME=erc::gen_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh32 PACKAGE=pallet-nonfungible NAME=erc::gen_impl OUTPUT=$(NONFUNGIBLE_EVM_STUBS)/$@ ./.maintain/scripts/generate_sol.sh3334ContractHelpers.sol:35 PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh36 PACKAGE=pallet-evm-contract-helpers NAME=eth::contract_helpers_impl OUTPUT=$(CONTRACT_HELPERS_STUBS)/$@ ./.maintain/scripts/generate_sol.sh3738CollectionHelpers.sol:39 PACKAGE=pallet-unique NAME=eth::collection_helper_iface OUTPUT=$(TESTS_API)/$@ ./.maintain/scripts/generate_sol.sh40 PACKAGE=pallet-unique NAME=eth::collection_helper_impl OUTPUT=$(COLLECTION_HELPER_STUBS)/$@ ./.maintain/scripts/generate_sol.sh4142UniqueFungible: UniqueFungible.sol43 INPUT=$(FUNGIBLE_EVM_STUBS)/$< OUTPUT=$(FUNGIBLE_EVM_STUBS)/UniqueFungible.raw ./.maintain/scripts/compile_stub.sh44 INPUT=$(FUNGIBLE_EVM_STUBS)/$< OUTPUT=$(FUNGIBLE_EVM_ABI) ./.maintain/scripts/generate_abi.sh4546UniqueNFT: UniqueNFT.sol47 INPUT=$(NONFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(NONFUNGIBLE_EVM_STUBS)/UniqueNFT.raw ./.maintain/scripts/compile_stub.sh48 INPUT=$(NONFUNGIBLE_EVM_STUBS)/$< OUTPUT=$(NONFUNGIBLE_EVM_ABI) ./.maintain/scripts/generate_abi.sh4950ContractHelpers: ContractHelpers.sol51 INPUT=$(CONTRACT_HELPERS_STUBS)/$< OUTPUT=$(CONTRACT_HELPERS_STUBS)/ContractHelpers.raw ./.maintain/scripts/compile_stub.sh52 INPUT=$(CONTRACT_HELPERS_STUBS)/$< OUTPUT=$(CONTRACT_HELPERS_ABI) ./.maintain/scripts/generate_abi.sh5354CollectionHelpers: CollectionHelpers.sol55 INPUT=$(COLLECTION_HELPER_STUBS)/$< OUTPUT=$(COLLECTION_HELPER_STUBS)/CollectionHelpers.raw ./.maintain/scripts/compile_stub.sh56 INPUT=$(COLLECTION_HELPER_STUBS)/$< OUTPUT=$(COLLECTION_HELPER_ABI) ./.maintain/scripts/generate_abi.sh5758evm_stubs: UniqueFungible UniqueNFT ContractHelpers CollectionHelpers5960.PHONY: _bench61_bench:62 cargo run --release --features runtime-benchmarks,$(RUNTIME) -- \63 benchmark pallet --pallet pallet-$(if $(PALLET),$(PALLET),$(error Must set PALLET)) \64 --wasm-execution compiled --extrinsic '*' \65 --template .maintain/frame-weight-template.hbs --steps=50 --repeat=80 --heap-pages=4096 \66 --output=./pallets/$(if $(PALLET_DIR),$(PALLET_DIR),$(PALLET))/src/weights.rs6768.PHONY: bench-evm-migration69bench-evm-migration:70 make _bench PALLET=evm-migration7172.PHONY: bench-common73bench-common:74 make _bench PALLET=common7576.PHONY: bench-unique77bench-unique:78 make _bench PALLET=unique7980.PHONY: bench-fungible81bench-fungible:82 make _bench PALLET=fungible8384.PHONY: bench-refungible85bench-refungible:86 make _bench PALLET=refungible8788.PHONY: bench-nonfungible89bench-nonfungible:90 make _bench PALLET=nonfungible9192.PHONY: bench-structure93bench-structure:94 make _bench PALLET=structure9596.PHONY: bench-scheduler97bench-scheduler:98 make _bench PALLET=unique-scheduler PALLET_DIR=scheduler99100.PHONY: bench-rmrk-core101bench-rmrk-core:102 make _bench PALLET=proxy-rmrk-core103104.PHONY: bench-rmrk-equip105bench-rmrk-equip:106 make _bench PALLET=proxy-rmrk-equip107108.PHONY: bench109bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-scheduler bench-rmrk-core bench-rmrk-equippallets/proxy-rmrk-equip/src/benchmarking.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/proxy-rmrk-equip/src/benchmarking.rs
@@ -0,0 +1,91 @@
+use sp_std::vec;
+
+use frame_benchmarking::{benchmarks, account};
+use frame_system::RawOrigin;
+use frame_support::{
+ traits::{Currency, Get},
+ BoundedVec,
+};
+
+use up_data_structs::*;
+
+use super::*;
+
+const SEED: u32 = 1;
+
+fn create_data<S: Get<u32>>() -> BoundedVec<u8, S> {
+ vec![b'A'; S::get() as usize].try_into().expect("size == S")
+}
+
+fn create_u32_array<S: Get<u32>>() -> BoundedVec<u32, S> {
+ vec![0; S::get() as usize].try_into().expect("size == S")
+}
+
+fn create_max_part() -> RmrkPartType {
+ RmrkPartType::SlotPart(
+ RmrkSlotPart {
+ id: 42,
+ equippable: RmrkEquippableList::Custom(create_u32_array()),
+ src: create_data(),
+ z: 1,
+ }
+ )
+}
+
+fn create_parts_array<S: Get<u32>>(num: u32) -> BoundedVec<RmrkPartType, S> {
+ vec![create_max_part(); num as usize].try_into().expect("num <= S")
+}
+
+fn create_max_theme_property() -> RmrkThemeProperty {
+ RmrkThemeProperty {
+ key: create_data(),
+ value: create_data(),
+ }
+}
+
+fn create_theme_properties_array<S: Get<u32>>(num: u32) -> BoundedVec<RmrkThemeProperty, S> {
+ vec![create_max_theme_property(); num as usize].try_into().expect("num <= S")
+}
+
+fn create_max_theme(name: RmrkString, props_num: u32) -> RmrkBoundedTheme {
+ RmrkBoundedTheme {
+ name,
+ properties: create_theme_properties_array(props_num),
+ inherit: false,
+ }
+}
+
+benchmarks! {
+ create_base {
+ let b in 0..RmrkPartsLimit::get();
+
+ let caller = account("caller", 0, SEED);
+ <T as pallet_common::Config>::Currency::deposit_creating(&caller, T::CollectionCreationPrice::get());
+
+ let base_type = create_data();
+ let symbol = create_data();
+ let parts = create_parts_array(b);
+ }: _(RawOrigin::Signed(caller), base_type, symbol, parts)
+
+ theme_add {
+ let b in 0..MaxPropertiesPerTheme::get();
+
+ let caller = account("caller", 0, SEED);
+ <T as pallet_common::Config>::Currency::deposit_creating(&caller, T::CollectionCreationPrice::get());
+
+ let base_type = create_data();
+ let symbol = create_data();
+ let parts = create_parts_array(0);
+
+ <Pallet<T>>::create_base(RawOrigin::Signed(caller.clone()).into(), base_type, symbol, parts)?;
+ let base_id = 1;
+
+
+ let default_theme_name = b"default".to_vec().try_into().expect("default is a valid name; qed");
+ let default_theme = create_max_theme(default_theme_name, 0);
+
+ <Pallet<T>>::theme_add(RawOrigin::Signed(caller.clone()).into(), base_id, default_theme)?;
+
+ let theme = create_max_theme(create_data(), b);
+ }: _(RawOrigin::Signed(caller), base_id, theme)
+}
pallets/proxy-rmrk-equip/src/lib.rsdiffbeforeafterboth--- a/pallets/proxy-rmrk-equip/src/lib.rs
+++ b/pallets/proxy-rmrk-equip/src/lib.rs
@@ -28,9 +28,16 @@
};
use pallet_nonfungible::{Pallet as PalletNft, NonfungibleHandle};
use pallet_evm::account::CrossAccountId;
+use weights::WeightInfo;
pub use pallet::*;
+#[cfg(feature = "runtime-benchmarks")]
+pub mod benchmarking;
+pub mod weights;
+
+pub type SelfWeightOf<T> = <T as Config>::WeightInfo;
+
#[frame_support::pallet]
pub mod pallet {
use super::*;
@@ -38,6 +45,7 @@
#[pallet::config]
pub trait Config: frame_system::Config + pallet_rmrk_core::Config {
type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;
+ type WeightInfo: WeightInfo;
}
#[pallet::storage]
@@ -83,12 +91,12 @@
/// - symbol: arbitrary client-chosen symbol
/// - parts: array of Fixed and Slot parts composing the base, confined in length by
/// RmrkPartsLimit
- #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]
#[transactional]
+ #[pallet::weight(<SelfWeightOf<T>>::create_base(parts.len() as u32))]
pub fn create_base(
origin: OriginFor<T>,
base_type: RmrkString,
- symbol: RmrkString,
+ symbol: RmrkBaseSymbol,
parts: BoundedVec<RmrkPartType, RmrkPartsLimit>,
) -> DispatchResult {
let sender = ensure_signed(origin)?;
@@ -159,12 +167,12 @@
/// - key: arbitrary BoundedString, defined by client
/// - value: arbitrary BoundedString, defined by client
/// - inherit: optional bool
- #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]
#[transactional]
+ #[pallet::weight(<SelfWeightOf<T>>::theme_add(theme.properties.len() as u32))]
pub fn theme_add(
origin: OriginFor<T>,
base_id: RmrkBaseId,
- theme: RmrkTheme,
+ theme: RmrkBoundedTheme,
) -> DispatchResult {
let sender = ensure_signed(origin)?;
pallets/proxy-rmrk-equip/src/weights.rsdiffbeforeafterboth--- /dev/null
+++ b/pallets/proxy-rmrk-equip/src/weights.rs
@@ -0,0 +1,119 @@
+// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs
+
+//! Autogenerated weights for pallet_proxy_rmrk_equip
+//!
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
+//! DATE: 2022-06-16, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
+
+// Executed Command:
+// target/release/unique-collator
+// benchmark
+// pallet
+// --pallet
+// pallet-proxy-rmrk-equip
+// --wasm-execution
+// compiled
+// --extrinsic
+// *
+// --template
+// .maintain/frame-weight-template.hbs
+// --steps=50
+// --repeat=80
+// --heap-pages=4096
+// --output=./pallets/proxy-rmrk-equip/src/weights.rs
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+#![allow(clippy::unnecessary_cast)]
+
+use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
+use sp_std::marker::PhantomData;
+
+/// Weight functions needed for pallet_proxy_rmrk_equip.
+pub trait WeightInfo {
+ fn create_base(b: u32, ) -> Weight;
+ fn theme_add(b: u32, ) -> Weight;
+}
+
+/// Weights for pallet_proxy_rmrk_equip using the Substrate node and recommended hardware.
+pub struct SubstrateWeight<T>(PhantomData<T>);
+impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
+ // Storage: Common CreatedCollectionCount (r:1 w:1)
+ // Storage: Common DestroyedCollectionCount (r:1 w:0)
+ // Storage: System Account (r:2 w:2)
+ // Storage: Common CollectionPropertyPermissions (r:0 w:1)
+ // Storage: Common CollectionProperties (r:0 w:1)
+ // Storage: Common CollectionById (r:0 w:1)
+ // Storage: Nonfungible TokensMinted (r:1 w:1)
+ // Storage: Nonfungible AccountBalance (r:1 w:1)
+ // Storage: Nonfungible TokenProperties (r:1 w:1)
+ // Storage: Nonfungible TokenData (r:0 w:1)
+ // Storage: Nonfungible Owned (r:0 w:1)
+ // Storage: RmrkEquip InernalPartId (r:0 w:1)
+ fn create_base(b: u32, ) -> Weight {
+ (43_216_000 as Weight)
+ // Standard Error: 10_000
+ .saturating_add((16_253_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(T::DbWeight::get().reads(6 as Weight))
+ .saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))
+ .saturating_add(T::DbWeight::get().writes(9 as Weight))
+ .saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(b as Weight)))
+ }
+ // Storage: Common CollectionProperties (r:1 w:0)
+ // Storage: Common CollectionById (r:1 w:0)
+ // Storage: RmrkEquip BaseHasDefaultTheme (r:1 w:0)
+ // Storage: Nonfungible TokensMinted (r:1 w:1)
+ // Storage: Nonfungible AccountBalance (r:1 w:1)
+ // Storage: Nonfungible TokenProperties (r:1 w:1)
+ // Storage: Nonfungible TokenData (r:0 w:1)
+ // Storage: Nonfungible Owned (r:0 w:1)
+ fn theme_add(b: u32, ) -> Weight {
+ (39_467_000 as Weight)
+ // Standard Error: 15_000
+ .saturating_add((2_332_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(T::DbWeight::get().reads(6 as Weight))
+ .saturating_add(T::DbWeight::get().writes(5 as Weight))
+ }
+}
+
+// For backwards compatibility and tests
+impl WeightInfo for () {
+ // Storage: Common CreatedCollectionCount (r:1 w:1)
+ // Storage: Common DestroyedCollectionCount (r:1 w:0)
+ // Storage: System Account (r:2 w:2)
+ // Storage: Common CollectionPropertyPermissions (r:0 w:1)
+ // Storage: Common CollectionProperties (r:0 w:1)
+ // Storage: Common CollectionById (r:0 w:1)
+ // Storage: Nonfungible TokensMinted (r:1 w:1)
+ // Storage: Nonfungible AccountBalance (r:1 w:1)
+ // Storage: Nonfungible TokenProperties (r:1 w:1)
+ // Storage: Nonfungible TokenData (r:0 w:1)
+ // Storage: Nonfungible Owned (r:0 w:1)
+ // Storage: RmrkEquip InernalPartId (r:0 w:1)
+ fn create_base(b: u32, ) -> Weight {
+ (43_216_000 as Weight)
+ // Standard Error: 10_000
+ .saturating_add((16_253_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(RocksDbWeight::get().reads(6 as Weight))
+ .saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(b as Weight)))
+ .saturating_add(RocksDbWeight::get().writes(9 as Weight))
+ .saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(b as Weight)))
+ }
+ // Storage: Common CollectionProperties (r:1 w:0)
+ // Storage: Common CollectionById (r:1 w:0)
+ // Storage: RmrkEquip BaseHasDefaultTheme (r:1 w:0)
+ // Storage: Nonfungible TokensMinted (r:1 w:1)
+ // Storage: Nonfungible AccountBalance (r:1 w:1)
+ // Storage: Nonfungible TokenProperties (r:1 w:1)
+ // Storage: Nonfungible TokenData (r:0 w:1)
+ // Storage: Nonfungible Owned (r:0 w:1)
+ fn theme_add(b: u32, ) -> Weight {
+ (39_467_000 as Weight)
+ // Standard Error: 15_000
+ .saturating_add((2_332_000 as Weight).saturating_mul(b as Weight))
+ .saturating_add(RocksDbWeight::get().reads(6 as Weight))
+ .saturating_add(RocksDbWeight::get().writes(5 as Weight))
+ }
+}
primitives/data-structs/src/lib.rsdiffbeforeafterboth--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -950,7 +950,9 @@
#[derive(PartialEq)]
pub const RmrkCollectionSymbolLimit: u32 = MAX_TOKEN_PREFIX_LENGTH;
#[derive(PartialEq)]
- pub const RmrkResourceSymbolLimit: u32 = MAX_TOKEN_PREFIX_LENGTH;
+ pub const RmrkResourceSymbolLimit: u32 = 10;
+ #[derive(PartialEq)]
+ pub const RmrkBaseSymbolLimit: u32 = MAX_TOKEN_PREFIX_LENGTH;
#[derive(PartialEq)]
pub const RmrkKeyLimit: u32 = 32;
#[derive(PartialEq)]
@@ -958,6 +960,8 @@
#[derive(PartialEq)]
pub const RmrkMaxCollectionsEquippablePerPart: u32 = 100;
#[derive(PartialEq)]
+ pub const MaxPropertiesPerTheme: u32 = 5;
+ #[derive(PartialEq)]
pub const RmrkPartsLimit: u32 = 25;
#[derive(PartialEq)]
pub const RmrkMaxPriorities: u32 = 25;
@@ -987,6 +991,7 @@
PartType<RmrkString, BoundedVec<RmrkCollectionId, RmrkMaxCollectionsEquippablePerPart>>;
pub type RmrkThemeProperty = ThemeProperty<RmrkString>;
pub type RmrkTheme = Theme<RmrkString, Vec<RmrkThemeProperty>>;
+pub type RmrkBoundedTheme = Theme<RmrkString, BoundedVec<RmrkThemeProperty, MaxPropertiesPerTheme>>;
pub type RmrkResourceTypes = ResourceTypes<RmrkString, RmrkBoundedParts>;
pub type RmrkBasicResource = BasicResource<RmrkString>;
@@ -995,6 +1000,7 @@
pub type RmrkString = BoundedVec<u8, RmrkStringLimit>;
pub type RmrkCollectionSymbol = BoundedVec<u8, RmrkCollectionSymbolLimit>;
+pub type RmrkBaseSymbol = BoundedVec<u8, RmrkBaseSymbolLimit>;
pub type RmrkKeyString = BoundedVec<u8, RmrkKeyLimit>;
pub type RmrkValueString = BoundedVec<u8, RmrkValueLimit>;
pub type RmrkBoundedResource = BoundedVec<u8, RmrkResourceSymbolLimit>;
runtime/common/src/runtime_apis.rsdiffbeforeafterboth--- a/runtime/common/src/runtime_apis.rs
+++ b/runtime/common/src/runtime_apis.rs
@@ -458,6 +458,9 @@
#[cfg(not(feature = "unique-runtime"))]
list_benchmark!(list, extra, pallet_proxy_rmrk_core, RmrkCore);
+ #[cfg(not(feature = "unique-runtime"))]
+ list_benchmark!(list, extra, pallet_proxy_rmrk_equip, RmrkEquip);
+
// list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate);
let storage_info = AllPalletsReversedWithSystemFirst::storage_info();
@@ -506,6 +509,9 @@
#[cfg(not(feature = "unique-runtime"))]
add_benchmark!(params, batches, pallet_proxy_rmrk_core, RmrkCore);
+ #[cfg(not(feature = "unique-runtime"))]
+ add_benchmark!(params, batches, pallet_proxy_rmrk_equip, RmrkEquip);
+
// add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate);
if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }
runtime/opal/Cargo.tomldiffbeforeafterboth--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -34,6 +34,7 @@
'pallet-refungible/runtime-benchmarks',
'pallet-nonfungible/runtime-benchmarks',
'pallet-proxy-rmrk-core/runtime-benchmarks',
+ 'pallet-proxy-rmrk-equip/runtime-benchmarks',
'pallet-unique/runtime-benchmarks',
'pallet-inflation/runtime-benchmarks',
'pallet-unique-scheduler/runtime-benchmarks',
runtime/opal/src/lib.rsdiffbeforeafterboth--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -923,6 +923,7 @@
}
impl pallet_proxy_rmrk_equip::Config for Runtime {
+ type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;
type Event = Event;
}
runtime/quartz/src/lib.rsdiffbeforeafterboth--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -922,6 +922,7 @@
}
impl pallet_proxy_rmrk_equip::Config for Runtime {
+ type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;
type Event = Event;
}