difftreelog
feat benchmark rmrk proxy equip
in: master
9 files changed
Makefilediffbeforeafterboth101bench-rmrk-core:101bench-rmrk-core:102 make _bench PALLET=proxy-rmrk-core102 make _bench PALLET=proxy-rmrk-core103104.PHONY: bench-rmrk-equip105bench-rmrk-equip:106 make _bench PALLET=proxy-rmrk-equip103107104.PHONY: bench108.PHONY: bench105bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-scheduler bench-rmrk-core109bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-scheduler bench-rmrk-core bench-rmrk-equip106110pallets/proxy-rmrk-equip/src/benchmarking.rsdiffbeforeafterbothno changes
pallets/proxy-rmrk-equip/src/lib.rsdiffbeforeafterboth28};28};29use pallet_nonfungible::{Pallet as PalletNft, NonfungibleHandle};29use pallet_nonfungible::{Pallet as PalletNft, NonfungibleHandle};30use pallet_evm::account::CrossAccountId;30use pallet_evm::account::CrossAccountId;31use weights::WeightInfo;313232pub use pallet::*;33pub use pallet::*;3435#[cfg(feature = "runtime-benchmarks")]36pub mod benchmarking;37pub mod weights;3839pub type SelfWeightOf<T> = <T as Config>::WeightInfo;334034#[frame_support::pallet]41#[frame_support::pallet]35pub mod pallet {42pub mod pallet {38 #[pallet::config]45 #[pallet::config]39 pub trait Config: frame_system::Config + pallet_rmrk_core::Config {46 pub trait Config: frame_system::Config + pallet_rmrk_core::Config {40 type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;47 type Event: From<Event<Self>> + IsType<<Self as frame_system::Config>::Event>;48 type WeightInfo: WeightInfo;41 }49 }425043 #[pallet::storage]51 #[pallet::storage]83 /// - symbol: arbitrary client-chosen symbol91 /// - symbol: arbitrary client-chosen symbol84 /// - parts: array of Fixed and Slot parts composing the base, confined in length by92 /// - parts: array of Fixed and Slot parts composing the base, confined in length by85 /// RmrkPartsLimit93 /// RmrkPartsLimit94 #[transactional]86 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]95 #[pallet::weight(<SelfWeightOf<T>>::create_base(parts.len() as u32))]87 #[transactional]88 pub fn create_base(96 pub fn create_base(89 origin: OriginFor<T>,97 origin: OriginFor<T>,90 base_type: RmrkString,98 base_type: RmrkString,91 symbol: RmrkString,99 symbol: RmrkBaseSymbol,92 parts: BoundedVec<RmrkPartType, RmrkPartsLimit>,100 parts: BoundedVec<RmrkPartType, RmrkPartsLimit>,93 ) -> DispatchResult {101 ) -> DispatchResult {94 let sender = ensure_signed(origin)?;102 let sender = ensure_signed(origin)?;159 /// - key: arbitrary BoundedString, defined by client167 /// - key: arbitrary BoundedString, defined by client160 /// - value: arbitrary BoundedString, defined by client168 /// - value: arbitrary BoundedString, defined by client161 /// - inherit: optional bool169 /// - inherit: optional bool170 #[transactional]162 #[pallet::weight(10_000 + T::DbWeight::get().reads_writes(1,1))]171 #[pallet::weight(<SelfWeightOf<T>>::theme_add(theme.properties.len() as u32))]163 #[transactional]164 pub fn theme_add(172 pub fn theme_add(165 origin: OriginFor<T>,173 origin: OriginFor<T>,166 base_id: RmrkBaseId,174 base_id: RmrkBaseId,167 theme: RmrkTheme,175 theme: RmrkBoundedTheme,168 ) -> DispatchResult {176 ) -> DispatchResult {169 let sender = ensure_signed(origin)?;177 let sender = ensure_signed(origin)?;170178pallets/proxy-rmrk-equip/src/weights.rsdiffbeforeafterbothno changes
primitives/data-structs/src/lib.rsdiffbeforeafterboth950 #[derive(PartialEq)]950 #[derive(PartialEq)]951 pub const RmrkCollectionSymbolLimit: u32 = MAX_TOKEN_PREFIX_LENGTH;951 pub const RmrkCollectionSymbolLimit: u32 = MAX_TOKEN_PREFIX_LENGTH;952 #[derive(PartialEq)]952 #[derive(PartialEq)]953 pub const RmrkResourceSymbolLimit: u32 = MAX_TOKEN_PREFIX_LENGTH;953 pub const RmrkResourceSymbolLimit: u32 = 10;954 #[derive(PartialEq)]955 pub const RmrkBaseSymbolLimit: u32 = MAX_TOKEN_PREFIX_LENGTH;954 #[derive(PartialEq)]956 #[derive(PartialEq)]955 pub const RmrkKeyLimit: u32 = 32;957 pub const RmrkKeyLimit: u32 = 32;956 #[derive(PartialEq)]958 #[derive(PartialEq)]957 pub const RmrkValueLimit: u32 = 256;959 pub const RmrkValueLimit: u32 = 256;958 #[derive(PartialEq)]960 #[derive(PartialEq)]959 pub const RmrkMaxCollectionsEquippablePerPart: u32 = 100;961 pub const RmrkMaxCollectionsEquippablePerPart: u32 = 100;962 #[derive(PartialEq)]963 pub const MaxPropertiesPerTheme: u32 = 5;960 #[derive(PartialEq)]964 #[derive(PartialEq)]961 pub const RmrkPartsLimit: u32 = 25;965 pub const RmrkPartsLimit: u32 = 25;962 #[derive(PartialEq)]966 #[derive(PartialEq)]987 PartType<RmrkString, BoundedVec<RmrkCollectionId, RmrkMaxCollectionsEquippablePerPart>>;991 PartType<RmrkString, BoundedVec<RmrkCollectionId, RmrkMaxCollectionsEquippablePerPart>>;988pub type RmrkThemeProperty = ThemeProperty<RmrkString>;992pub type RmrkThemeProperty = ThemeProperty<RmrkString>;989pub type RmrkTheme = Theme<RmrkString, Vec<RmrkThemeProperty>>;993pub type RmrkTheme = Theme<RmrkString, Vec<RmrkThemeProperty>>;994pub type RmrkBoundedTheme = Theme<RmrkString, BoundedVec<RmrkThemeProperty, MaxPropertiesPerTheme>>;990pub type RmrkResourceTypes = ResourceTypes<RmrkString, RmrkBoundedParts>;995pub type RmrkResourceTypes = ResourceTypes<RmrkString, RmrkBoundedParts>;991996992pub type RmrkBasicResource = BasicResource<RmrkString>;997pub type RmrkBasicResource = BasicResource<RmrkString>;9951000996pub type RmrkString = BoundedVec<u8, RmrkStringLimit>;1001pub type RmrkString = BoundedVec<u8, RmrkStringLimit>;997pub type RmrkCollectionSymbol = BoundedVec<u8, RmrkCollectionSymbolLimit>;1002pub type RmrkCollectionSymbol = BoundedVec<u8, RmrkCollectionSymbolLimit>;1003pub type RmrkBaseSymbol = BoundedVec<u8, RmrkBaseSymbolLimit>;998pub type RmrkKeyString = BoundedVec<u8, RmrkKeyLimit>;1004pub type RmrkKeyString = BoundedVec<u8, RmrkKeyLimit>;999pub type RmrkValueString = BoundedVec<u8, RmrkValueLimit>;1005pub type RmrkValueString = BoundedVec<u8, RmrkValueLimit>;1000pub type RmrkBoundedResource = BoundedVec<u8, RmrkResourceSymbolLimit>;1006pub type RmrkBoundedResource = BoundedVec<u8, RmrkResourceSymbolLimit>;runtime/common/src/runtime_apis.rsdiffbeforeafterboth458 #[cfg(not(feature = "unique-runtime"))]458 #[cfg(not(feature = "unique-runtime"))]459 list_benchmark!(list, extra, pallet_proxy_rmrk_core, RmrkCore);459 list_benchmark!(list, extra, pallet_proxy_rmrk_core, RmrkCore);460461 #[cfg(not(feature = "unique-runtime"))]462 list_benchmark!(list, extra, pallet_proxy_rmrk_equip, RmrkEquip);460463461 // list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate);464 // list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate);462465506 #[cfg(not(feature = "unique-runtime"))]509 #[cfg(not(feature = "unique-runtime"))]507 add_benchmark!(params, batches, pallet_proxy_rmrk_core, RmrkCore);510 add_benchmark!(params, batches, pallet_proxy_rmrk_core, RmrkCore);511512 #[cfg(not(feature = "unique-runtime"))]513 add_benchmark!(params, batches, pallet_proxy_rmrk_equip, RmrkEquip);508514509 // add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate);515 // add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate);510516runtime/opal/Cargo.tomldiffbeforeafterboth34 'pallet-refungible/runtime-benchmarks',34 'pallet-refungible/runtime-benchmarks',35 'pallet-nonfungible/runtime-benchmarks',35 'pallet-nonfungible/runtime-benchmarks',36 'pallet-proxy-rmrk-core/runtime-benchmarks',36 'pallet-proxy-rmrk-core/runtime-benchmarks',37 'pallet-proxy-rmrk-equip/runtime-benchmarks',37 'pallet-unique/runtime-benchmarks',38 'pallet-unique/runtime-benchmarks',38 'pallet-inflation/runtime-benchmarks',39 'pallet-inflation/runtime-benchmarks',39 'pallet-unique-scheduler/runtime-benchmarks',40 'pallet-unique-scheduler/runtime-benchmarks',runtime/opal/src/lib.rsdiffbeforeafterboth923}923}924924925impl pallet_proxy_rmrk_equip::Config for Runtime {925impl pallet_proxy_rmrk_equip::Config for Runtime {926 type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;926 type Event = Event;927 type Event = Event;927}928}928929runtime/quartz/src/lib.rsdiffbeforeafterboth922}922}923923924impl pallet_proxy_rmrk_equip::Config for Runtime {924impl pallet_proxy_rmrk_equip::Config for Runtime {925 type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;925 type Event = Event;926 type Event = Event;926}927}927928