Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pallets/local-treasury/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use frame_system::Origin;

benchmarks! {
withdraw {
let local_treasury: <T as frame_system::Config>::AccountId = PalletId(*b"12345678").into_account();
let local_treasury: <T as frame_system::Config>::AccountId = PalletId(*b"Treasury").into_account();
T::Currency::deposit_creating(&local_treasury, 10_000_000_u32.into());
let admin: <T as frame_system::Config>::AccountId = account("admin", 0, 0);
}: _(
Expand Down
31 changes: 17 additions & 14 deletions pallets/saft-registry/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ benchmarks! {
}

convert_to_liquid {
let o in 1 .. MAX_SAFT_RECORDS;

let nav = 1337u32;
let units = 1234u32;
let asset:T::AssetId = T::try_convert(2u8).unwrap();
let asset:T::AssetId = T::try_convert(5u8).unwrap();
let origin = T::AdminOrigin::successful_origin();

assert_ok!(T::AssetRecorderBenchmarks::add_asset(
Expand All @@ -107,22 +109,23 @@ benchmarks! {
1000u32.into()
));

// Create saft records
for i in 0 .. MAX_SAFT_RECORDS {
assert_ok!(SaftRegistry::<T>::add_saft(
origin.clone(),
asset,
nav.into(),
units.into(),
));
}
assert_ok!(SaftRegistry::<T>::add_saft(
origin.clone(),
asset,
nav.into(),
units.into(),
));

assert_ok!(<SAFTCounter<T>>::try_mutate(asset, |counter: &mut u32| -> Result<(), ()> {
*counter = o;
Ok(())
}));

let call = Call::<T>::convert_to_liquid(
asset,
asset,
(Junction::Parent, Junction::Parachain(100)).into()
);
}: {
call.dispatch_bypass_filter(origin)? }
verify {
}: { call.dispatch_bypass_filter(origin)? } verify {
assert_eq!(
SaftRegistry::<T>::saft_counter(asset),
0
Expand Down
110 changes: 75 additions & 35 deletions runtime/common/src/weights/pallet_asset_index.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// Copyright 2021 ChainSafe Systems
// SPDX-License-Identifier: LGPL-3.0-only

//! Autogenerated weights for pallet_asset_index
//! Autogenerated weights for `pallet_asset_index`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-06-16, STEPS: `[]`, REPEAT: 1, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("pint-local"),
//! DB CACHE: 128
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-09-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("pint-local"), DB CACHE: 128

// Executed Command:
// ./target/release/pint
Expand All @@ -16,15 +15,23 @@
// -e
// *
// --execution
// Wasm
// wasm
// --wasm-execution
// Compiled
// compiled
// --raw
// --output
// ./runtime/src/weights/pallet_asset_index.rs
// --chain
// pint-local
// --output
// ./runtime/common/src/weights/pallet_asset_index.rs
// --steps
// 50
// --repeat
// 20
// --heap-pages
// 4096


#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]

Expand All @@ -34,43 +41,76 @@ use sp_std::marker::PhantomData;
/// Weight functions for pallet_asset_index.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_asset_index::WeightInfo for WeightInfo<T> {
// Storage: AssetIndex Assets (r:1 w:1)
// Storage: Tokens Accounts (r:1 w:1)
// Storage: Tokens TotalIssuance (r:1 w:1)
// Storage: System Account (r:2 w:2)
fn add_asset() -> Weight {
(38_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
(85_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(5 as Weight))
}

// Storage: AssetIndex PendingWithdrawals (r:1 w:1)
fn complete_withdraw() -> Weight {
Default::default()
(32_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}

fn remove_asset() -> Weight {
Default::default()
// Storage: AssetIndex Assets (r:2 w:0)
// Storage: Tokens Accounts (r:2 w:2)
// Storage: PriceFeed AssetFeeds (r:1 w:0)
// Storage: ChainlinkFeed Feeds (r:1 w:0)
// Storage: ChainlinkFeed Rounds (r:1 w:0)
// Storage: System Account (r:1 w:1)
// Storage: AssetIndex IndexTokenLocks (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: RemoteAssetManager AssetBalance (r:1 w:1)
// Storage: AssetIndex Deposits (r:1 w:1)
// Storage: AssetIndex LockedIndexToken (r:0 w:1)
fn deposit() -> Weight {
(131_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(12 as Weight))
.saturating_add(T::DbWeight::get().writes(8 as Weight))
}

fn remove_asset() -> Weight {
Default::default()
}
// Storage: AssetIndex Assets (r:1 w:1)
fn register_asset() -> Weight {
(38_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}

fn deposit() -> Weight {
(38_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
(17_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}

// Storage: AssetIndex Metadata (r:1 w:1)
fn set_metadata() -> Weight {
(18_000_000 as Weight)
(16_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}

fn unlock() -> Weight {
Default::default()
}

// Storage: AssetIndex IndexTokenLocks (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
// Storage: AssetIndex Deposits (r:1 w:1)
// Storage: AssetIndex Assets (r:2 w:0)
// Storage: Tokens Accounts (r:1 w:0)
// Storage: PriceFeed AssetFeeds (r:1 w:0)
// Storage: ChainlinkFeed Feeds (r:1 w:0)
// Storage: ChainlinkFeed Rounds (r:1 w:0)
// Storage: RemoteAssetManager AssetBalance (r:1 w:1)
// Storage: AssetIndex PendingWithdrawals (r:1 w:1)
// Storage: AssetIndex LockedIndexToken (r:0 w:1)
fn withdraw() -> Weight {
Default::default()
(155_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(12 as Weight))
.saturating_add(T::DbWeight::get().writes(7 as Weight))
}
// Storage: AssetIndex IndexTokenLocks (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
// Storage: System Account (r:1 w:1)
// Storage: AssetIndex LockedIndexToken (r:0 w:1)
fn unlock() -> Weight {
(32_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
}
47 changes: 34 additions & 13 deletions runtime/common/src/weights/pallet_committee.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
// Copyright 2021 ChainSafe Systems
// SPDX-License-Identifier: LGPL-3.0-only

//! Autogenerated weights for pallet_committee
//! Autogenerated weights for `pallet_committee`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-06-04, STEPS: `[]`, REPEAT: 1, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 128
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-09-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("pint-local"), DB CACHE: 128

// Executed Command:
// ./target/release/pint
// benchmark
// --execution
// wasm
// --wasm-execution
// compiled
// -p
// pallet_committee
// -e
// *
// --execution
// wasm
// --wasm-execution
// compiled
// --raw
// --chain
// pint-local
// --output
// runtime/src/weights/pallet_committee.rs
// ./runtime/common/src/weights/pallet_committee.rs
// --steps
// 50
// --repeat
// 20
// --heap-pages
// 4096


#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]

Expand All @@ -31,23 +41,34 @@ use sp_std::marker::PhantomData;
/// Weight functions for pallet_committee.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_committee::WeightInfo for WeightInfo<T> {
// Storage: Committee ProposalCount (r:1 w:1)
// Storage: Committee ActiveProposals (r:1 w:1)
// Storage: Committee Proposals (r:0 w:1)
// Storage: Committee Votes (r:0 w:1)
fn propose() -> Weight {
(30_000_000 as Weight)
(25_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
// Storage: Committee Members (r:1 w:0)
// Storage: Committee Votes (r:1 w:1)
fn vote() -> Weight {
(28_000_000 as Weight)
(25_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Committee Members (r:1 w:0)
// Storage: Committee ExecutedProposals (r:1 w:1)
// Storage: Committee Votes (r:1 w:0)
// Storage: Committee Proposals (r:1 w:0)
fn close() -> Weight {
(42_000_000 as Weight)
(92_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Committee Members (r:1 w:1)
fn add_constituent() -> Weight {
(16_000_000 as Weight)
(45_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
Expand Down
31 changes: 21 additions & 10 deletions runtime/common/src/weights/pallet_local_treasury.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
// Copyright 2021 ChainSafe Systems
// SPDX-License-Identifier: LGPL-3.0-only

//! Autogenerated weights for pallet_local_treasury
//! Autogenerated weights for `pallet_local_treasury`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-06-03, STEPS: `[]`, REPEAT: 1, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 128
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-09-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("pint-local"), DB CACHE: 128

// Executed Command:
// ./target/release/pint
// benchmark
// --execution
// wasm
// --wasm-execution
// compiled
// -p
// pallet_local_treasury
// -e
// *
// --execution
// wasm
// --wasm-execution
// compiled
// --raw
// --chain
// pint-local
// --output
// runtime/src/weights/pallet_local_treasury.rs
// ./runtime/common/src/weights/pallet_local_treasury.rs
// --steps
// 50
// --repeat
// 20
// --heap-pages
// 4096


#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]

Expand All @@ -31,8 +41,9 @@ use sp_std::marker::PhantomData;
/// Weight functions for pallet_local_treasury.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_local_treasury::WeightInfo for WeightInfo<T> {
// Storage: System Account (r:2 w:2)
fn withdraw() -> Weight {
(52_000_000 as Weight)
(51_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
Expand Down
Loading