git.delta.rocks / unique-network / refs/commits / d2b5cc3bc7de

difftreelog

source

pallets/foreing-assets/src/weights.rs1.4 KiBsourcehistory
12#![cfg_attr(rustfmt, rustfmt_skip)]3#![allow(unused_parens)]4#![allow(unused_imports)]5#![allow(clippy::unnecessary_cast)]67use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};8use sp_std::marker::PhantomData;910/// Weight functions needed for module_asset_registry.11pub trait WeightInfo {12	fn register_foreign_asset() -> Weight;13	fn update_foreign_asset() -> Weight;14}1516/// Weights for module_asset_registry using the Acala node and recommended hardware.17pub struct AcalaWeight<T>(PhantomData<T>);18impl<T: frame_system::Config> WeightInfo for AcalaWeight<T> {19	fn register_foreign_asset() -> Weight {20		(29_819_000 as Weight)21			.saturating_add(T::DbWeight::get().reads(2 as Weight))22			.saturating_add(T::DbWeight::get().writes(3 as Weight))23	}24	fn update_foreign_asset() -> Weight {25		(25_119_000 as Weight)26			.saturating_add(T::DbWeight::get().reads(1 as Weight))27			.saturating_add(T::DbWeight::get().writes(1 as Weight))28	}29}3031// For backwards compatibility and tests32impl WeightInfo for () {33	fn register_foreign_asset() -> Weight {34		(29_819_000 as Weight)35			.saturating_add(RocksDbWeight::get().reads(2 as Weight))36			.saturating_add(RocksDbWeight::get().writes(3 as Weight))37	}38	fn update_foreign_asset() -> Weight {39		(25_119_000 as Weight)40			.saturating_add(RocksDbWeight::get().reads(1 as Weight))41			.saturating_add(RocksDbWeight::get().writes(1 as Weight))42	}43}