Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dudo50 committed Nov 7, 2024
1 parent eb12016 commit 953e62e
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion templates/parachain/pallets/xcnft/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl parachain_info::Config for Test {}

impl crate::Config for Test {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = ();
type WeightInfo = crate::weights::SubstrateWeight<Test>;
type XcmSender = XcmRouter;
type RuntimeCall = RuntimeCall;
type ProposalTimeInBlocks = proposal_time_in_blocks_parameter;
Expand Down
2 changes: 1 addition & 1 deletion templates/parachain/pallets/xcnft/src/tests/testpara.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl pallet_xcm::Config for Runtime {

impl crate::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = ();
type WeightInfo = crate::weights::SubstrateWeight<Runtime>;
type XcmSender = XcmRouter;
type RuntimeCall = RuntimeCall;
type ProposalTimeInBlocks = proposal_time_in_blocks_parameter;
Expand Down
20 changes: 17 additions & 3 deletions templates/parachain/pallets/xcnft/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-11-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `MacBook-Pro-uzivatela-Dudo.local`, CPU: `<UNKNOWN>`
//! HOSTNAME: `MacBook-Pro`, CPU: `ArmM1`
//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024
// Executed Command:
Expand All @@ -31,10 +31,24 @@

use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;
use crate as pallet_parachain_xcnft;

/// Weight functions for `pallet_parachain_xcnft`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_parachain_xcnft::WeightInfo for WeightInfo<T> {
///
///
pub trait WeightInfo {
fn transfer_collection_empty() -> Weight;
fn transfer_collection_same_owner() -> Weight;
fn transfer_collection_other_owners() -> Weight;
fn transfer_nft() -> Weight;
fn parse_empty_col() -> Weight;
fn parse_same_owner_col() -> Weight;
fn parse_diff_owner_col() -> Weight;
fn parse_item() -> Weight;
}

pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Storage: `NftModule::Collection` (r:1 w:0)
/// Proof: `NftModule::Collection` (`max_values`: None, `max_size`: Some(84), added: 2559, mode: `MaxEncodedLen`)
/// Storage: `NftModule::Item` (r:1 w:0)
Expand Down
2 changes: 1 addition & 1 deletion templates/parachain_two/pallets/xcnft/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ pub mod pallet {

/// A type representing the weights required by the dispatchables of this pallet.
type WeightInfo: crate::weights::WeightInfo;

/// Specifies how long should cross-chain proposals last
type ProposalTimeInBlocks: Get<u32>;

Expand Down
2 changes: 1 addition & 1 deletion templates/parachain_two/pallets/xcnft/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ impl parachain_info::Config for Test {}

impl crate::Config for Test {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = ();
type WeightInfo = crate::weights::SubstrateWeight<Test>;
type XcmSender = XcmRouter;
type RuntimeCall = RuntimeCall;
type ProposalTimeInBlocks = proposal_time_in_blocks_parameter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ impl pallet_xcm::Config for Runtime {

impl crate::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = ();
type WeightInfo = crate::weights::SubstrateWeight<Runtime>;
type XcmSender = XcmRouter;
type RuntimeCall = RuntimeCall;
type ProposalTimeInBlocks = proposal_time_in_blocks_parameter;
Expand Down
18 changes: 15 additions & 3 deletions templates/parachain_two/pallets/xcnft/src/weights.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
//! DATE: 2024-11-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `MacBook-Pro-uzivatela-Dudo.local`, CPU: `<UNKNOWN>`
//! HOSTNAME: `MacBook-Pro`, CPU: `ArmM1`
//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024
// Executed Command:
Expand All @@ -31,10 +31,22 @@

use frame_support::{traits::Get, weights::Weight};
use core::marker::PhantomData;
use crate as pallet_parachain_xcnft_two;

/// Weight functions for `pallet_parachain_xcnft_two`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_parachain_xcnft_two::WeightInfo for WeightInfo<T> {
pub trait WeightInfo {
fn transfer_collection_empty() -> Weight;
fn transfer_collection_same_owner() -> Weight;
fn transfer_collection_other_owners() -> Weight;
fn transfer_nft() -> Weight;
fn parse_empty_col() -> Weight;
fn parse_same_owner_col() -> Weight;
fn parse_diff_owner_col() -> Weight;
fn parse_item() -> Weight;
}

pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
/// Storage: `UniquesModule::Class` (r:1 w:0)
/// Proof: `UniquesModule::Class` (`max_values`: None, `max_size`: Some(178), added: 2653, mode: `MaxEncodedLen`)
/// Storage: `UniquesModule::Asset` (r:1 w:0)
Expand Down

0 comments on commit 953e62e

Please sign in to comment.