Skip to content

Commit

Permalink
fix: add default pool fees weights
Browse files Browse the repository at this point in the history
  • Loading branch information
wischli committed Mar 4, 2024
1 parent 12566d0 commit c621113
Showing 1 changed file with 144 additions and 0 deletions.
144 changes: 144 additions & 0 deletions pallets/pool-fees/src/weights.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
//! Autogenerated weights for pallet_pool_fees
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION
//! 4.0.0-dev DATE: 2024-03-04, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH
//! RANGE: `[]` WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `runner`, CPU: `AMD EPYC 7763 64-Core Processor`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN:
//! Some("centrifuge-dev"), DB CACHE: 1024
// Executed Command:
// target/release/centrifuge-chain
// benchmark
// pallet
// --chain=development
// --steps=50
// --repeat=20
// --pallet=pallet-pool-fees
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --template=./scripts/frame-weight-template.hbs
// --output=./pallets/pool-fees/src/weights.rs

#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{
traits::Get,
weights::{constants::RocksDbWeight, Weight},
};
use sp_std::marker::PhantomData;

/// Weight functions needed for pallet_pool_fees.
pub trait WeightInfo {
fn propose_new_fee() -> Weight;
fn apply_new_fee(n: u32) -> Weight;
fn remove_fee(n: u32) -> Weight;
fn charge_fee(n: u32) -> Weight;
fn uncharge_fee(n: u32) -> Weight;
fn update_portfolio_valuation(n: u32) -> Weight;
}

/// Weights for pallet_pool_fees using the Substrate node and recommended
/// hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
fn propose_new_fee() -> Weight {
Weight::from_parts(43_301_000, 0)
.saturating_add(Weight::from_parts(0, 4278))
.saturating_add(T::DbWeight::get().reads(4))
.saturating_add(T::DbWeight::get().writes(2))
}

fn apply_new_fee(n: u32) -> Weight {
Weight::from_parts(55_397_177, 0)
.saturating_add(Weight::from_parts(0, 17508))
.saturating_add(Weight::from_parts(289_076, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(4))
}

fn remove_fee(n: u32) -> Weight {
Weight::from_parts(38_370_638, 0)
.saturating_add(Weight::from_parts(0, 17508))
.saturating_add(Weight::from_parts(411_219, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(3))
.saturating_add(T::DbWeight::get().writes(3))
}

fn charge_fee(n: u32) -> Weight {
Weight::from_parts(27_231_143, 0)
.saturating_add(Weight::from_parts(0, 17508))
.saturating_add(Weight::from_parts(259_721, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}

fn uncharge_fee(n: u32) -> Weight {
Weight::from_parts(26_250_765, 0)
.saturating_add(Weight::from_parts(0, 17508))
.saturating_add(Weight::from_parts(260_625, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(2))
.saturating_add(T::DbWeight::get().writes(1))
}

fn update_portfolio_valuation(n: u32) -> Weight {
Weight::from_parts(42_962_181, 0)
.saturating_add(Weight::from_parts(0, 17508))
.saturating_add(Weight::from_parts(5_880_090, 0).saturating_mul(n.into()))
.saturating_add(T::DbWeight::get().reads(5))
.saturating_add(T::DbWeight::get().writes(2))
}
}

// For backwards compatibility and tests
impl WeightInfo for () {
fn propose_new_fee() -> Weight {
Weight::from_parts(43_301_000, 0)
.saturating_add(Weight::from_parts(0, 4278))
.saturating_add(RocksDbWeight::get().reads(4))
.saturating_add(RocksDbWeight::get().writes(2))
}

fn apply_new_fee(n: u32) -> Weight {
Weight::from_parts(55_397_177, 0)
.saturating_add(Weight::from_parts(0, 17508))
.saturating_add(Weight::from_parts(289_076, 0).saturating_mul(n.into()))
.saturating_add(RocksDbWeight::get().reads(5))
.saturating_add(RocksDbWeight::get().writes(4))
}

fn remove_fee(n: u32) -> Weight {
Weight::from_parts(38_370_638, 0)
.saturating_add(Weight::from_parts(0, 17508))
.saturating_add(Weight::from_parts(411_219, 0).saturating_mul(n.into()))
.saturating_add(RocksDbWeight::get().reads(3))
.saturating_add(RocksDbWeight::get().writes(3))
}

fn charge_fee(n: u32) -> Weight {
Weight::from_parts(27_231_143, 0)
.saturating_add(Weight::from_parts(0, 17508))
.saturating_add(Weight::from_parts(259_721, 0).saturating_mul(n.into()))
.saturating_add(RocksDbWeight::get().reads(2))
.saturating_add(RocksDbWeight::get().writes(1))
}

fn uncharge_fee(n: u32) -> Weight {
Weight::from_parts(26_250_765, 0)
.saturating_add(Weight::from_parts(0, 17508))
.saturating_add(Weight::from_parts(260_625, 0).saturating_mul(n.into()))
.saturating_add(RocksDbWeight::get().reads(2))
.saturating_add(RocksDbWeight::get().writes(1))
}

fn update_portfolio_valuation(n: u32) -> Weight {
Weight::from_parts(42_962_181, 0)
.saturating_add(Weight::from_parts(0, 17508))
.saturating_add(Weight::from_parts(5_880_090, 0).saturating_mul(n.into()))
.saturating_add(RocksDbWeight::get().reads(5))
.saturating_add(RocksDbWeight::get().writes(2))
}
}

0 comments on commit c621113

Please sign in to comment.