-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CU-200y9ka - Auction: generate a file with weights
- Loading branch information
Showing
6 changed files
with
148 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,83 @@ | ||
use frame_support::dispatch::Weight; | ||
use frame_support::{pallet_prelude::Weight, traits::Get, weights::constants::RocksDbWeight}; | ||
use sp_std::marker::PhantomData; | ||
|
||
pub trait WeightInfo { | ||
fn ask() -> Weight; | ||
fn take() -> Weight; | ||
fn take(_x: u32) -> Weight; | ||
fn liquidate() -> Weight; | ||
fn known_overhead_for_on_finalize() -> Weight; | ||
} | ||
|
||
/// no weight | ||
impl WeightInfo for () { | ||
/// Weight functions for `dutch_auction`. | ||
pub struct SubstrateWeight<T>(PhantomData<T>); | ||
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> { | ||
// Storage: DutchAuction OrdersIndex (r:1 w:1) | ||
// Storage: Timestamp Now (r:1 w:0) | ||
// Storage: Tokens Accounts (r:1 w:1) | ||
// Storage: DutchAuction SellOrders (r:0 w:1) | ||
fn ask() -> Weight { | ||
0 | ||
(164_004_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(3 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(3 as Weight)) | ||
} | ||
|
||
fn take() -> Weight { | ||
0 | ||
// Storage: DutchAuction SellOrders (r:1 w:0) | ||
// Storage: Timestamp Now (r:1 w:0) | ||
// Storage: Tokens Accounts (r:1 w:1) | ||
// Storage: DutchAuction Takes (r:1 w:1) | ||
fn take(_x: u32) -> Weight { | ||
(158_860_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(4 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(2 as Weight)) | ||
} | ||
|
||
// Storage: DutchAuction SellOrders (r:1 w:1) | ||
// Storage: Tokens Accounts (r:1 w:1) | ||
fn liquidate() -> Weight { | ||
0 | ||
(105_812_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(2 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(2 as Weight)) | ||
} | ||
// Storage: DutchAuction Takes (r:2 w:1) | ||
// Storage: DutchAuction SellOrders (r:1 w:1) | ||
// Storage: Tokens Accounts (r:2 w:2) | ||
fn known_overhead_for_on_finalize() -> Weight { | ||
(287_359_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(5 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(4 as Weight)) | ||
} | ||
} | ||
|
||
impl WeightInfo for () { | ||
// Storage: DutchAuction OrdersIndex (r:1 w:1) | ||
// Storage: Timestamp Now (r:1 w:0) | ||
// Storage: Tokens Accounts (r:1 w:1) | ||
// Storage: DutchAuction SellOrders (r:0 w:1) | ||
fn ask() -> Weight { | ||
(164_004_000 as Weight) | ||
.saturating_add(RocksDbWeight::get().reads(3 as Weight)) | ||
.saturating_add(RocksDbWeight::get().writes(3 as Weight)) | ||
} | ||
// Storage: DutchAuction SellOrders (r:1 w:0) | ||
// Storage: Timestamp Now (r:1 w:0) | ||
// Storage: Tokens Accounts (r:1 w:1) | ||
// Storage: DutchAuction Takes (r:1 w:1) | ||
fn take(_x: u32) -> Weight { | ||
(158_860_000 as Weight) | ||
.saturating_add(RocksDbWeight::get().reads(4 as Weight)) | ||
.saturating_add(RocksDbWeight::get().writes(2 as Weight)) | ||
} | ||
// Storage: DutchAuction SellOrders (r:1 w:1) | ||
// Storage: Tokens Accounts (r:1 w:1) | ||
fn liquidate() -> Weight { | ||
(105_812_000 as Weight) | ||
.saturating_add(RocksDbWeight::get().reads(2 as Weight)) | ||
.saturating_add(RocksDbWeight::get().writes(2 as Weight)) | ||
} | ||
// Storage: DutchAuction Takes (r:2 w:1) | ||
// Storage: DutchAuction SellOrders (r:1 w:1) | ||
// Storage: Tokens Accounts (r:2 w:2) | ||
fn known_overhead_for_on_finalize() -> Weight { | ||
0 | ||
(287_359_000 as Weight) | ||
.saturating_add(RocksDbWeight::get().reads(5 as Weight)) | ||
.saturating_add(RocksDbWeight::get().writes(4 as Weight)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
//! Autogenerated weights for `dutch_auction` | ||
//! | ||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev | ||
//! DATE: 2022-01-11, STEPS: `5`, REPEAT: 2, LOW RANGE: `[]`, HIGH RANGE: `[]` | ||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dali-dev"), DB CACHE: 128 | ||
// Executed Command: | ||
// ./target/release/composable | ||
// benchmark | ||
// --chain=dali-dev | ||
// --execution=wasm | ||
// --wasm-execution=compiled | ||
// --pallet=dutch_auction | ||
// --extrinsic=* | ||
// --steps=5 | ||
// --repeat=2 | ||
// --raw | ||
// --output=./runtime/dali/src/weights | ||
|
||
#![cfg_attr(rustfmt, rustfmt_skip)] | ||
#![allow(unused_parens)] | ||
#![allow(unused_imports)] | ||
|
||
use sp_std::marker::PhantomData; | ||
use support::{traits::Get, weights::Weight}; | ||
|
||
/// Weight functions for `dutch_auction`. | ||
pub struct WeightInfo<T>(PhantomData<T>); | ||
impl<T: frame_system::Config> dutch_auction::WeightInfo for WeightInfo<T> { | ||
// Storage: DutchAuction OrdersIndex (r:1 w:1) | ||
// Storage: Timestamp Now (r:1 w:0) | ||
// Storage: Tokens Accounts (r:1 w:1) | ||
// Storage: DutchAuction SellOrders (r:0 w:1) | ||
fn ask() -> Weight { | ||
(164_004_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(3 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(3 as Weight)) | ||
} | ||
// Storage: DutchAuction SellOrders (r:1 w:0) | ||
// Storage: Timestamp Now (r:1 w:0) | ||
// Storage: Tokens Accounts (r:1 w:1) | ||
// Storage: DutchAuction Takes (r:1 w:1) | ||
fn take(_x: u32, ) -> Weight { | ||
(158_860_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(4 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(2 as Weight)) | ||
} | ||
// Storage: DutchAuction SellOrders (r:1 w:1) | ||
// Storage: Tokens Accounts (r:1 w:1) | ||
fn liquidate() -> Weight { | ||
(105_812_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(2 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(2 as Weight)) | ||
} | ||
// Storage: DutchAuction Takes (r:2 w:1) | ||
// Storage: DutchAuction SellOrders (r:1 w:1) | ||
// Storage: Tokens Accounts (r:2 w:2) | ||
fn known_overhead_for_on_finalize() -> Weight { | ||
(287_359_000 as Weight) | ||
.saturating_add(T::DbWeight::get().reads(5 as Weight)) | ||
.saturating_add(T::DbWeight::get().writes(4 as Weight)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters