-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* remarks: Add remarks pallet * development: Add weights for remarks pallet * centrifuge: Add weights for remarks pallet
- Loading branch information
Showing
12 changed files
with
195 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,46 @@ | ||
|
||
//! Autogenerated weights for `pallet_remarks` | ||
//! | ||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev | ||
//! DATE: 2024-01-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=centrifuge-dev | ||
// --steps=50 | ||
// --repeat=20 | ||
// --pallet=pallet_remarks | ||
// --extrinsic=* | ||
// --execution=wasm | ||
// --wasm-execution=compiled | ||
// --heap-pages=4096 | ||
// --output=/tmp/runtime/centrifuge/src/weights/pallet_remarks.rs | ||
|
||
#![cfg_attr(rustfmt, rustfmt_skip)] | ||
#![allow(unused_parens)] | ||
#![allow(unused_imports)] | ||
#![allow(missing_docs)] | ||
|
||
use frame_support::{traits::Get, weights::Weight}; | ||
use core::marker::PhantomData; | ||
|
||
/// Weight functions for `pallet_remarks`. | ||
pub struct WeightInfo<T>(PhantomData<T>); | ||
impl<T: frame_system::Config> pallet_remarks::WeightInfo for WeightInfo<T> { | ||
/// The range of component `n` is `[1, 10]`. | ||
fn remark(n: u32, ) -> Weight { | ||
// Proof Size summary in bytes: | ||
// Measured: `0` | ||
// Estimated: `0` | ||
// Minimum execution time: 16_792_000 picoseconds. | ||
Weight::from_parts(17_287_221, 0) | ||
.saturating_add(Weight::from_parts(0, 0)) | ||
// Standard Error: 2_915 | ||
.saturating_add(Weight::from_parts(145_247, 0).saturating_mul(n.into())) | ||
} | ||
} |
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,39 @@ | ||
// Copyright 2023 Centrifuge Foundation (centrifuge.io). | ||
// | ||
// This file is part of the Centrifuge chain project. | ||
// Centrifuge is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version (see http://www.gnu.org/licenses). | ||
// Centrifuge is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
use cfg_primitives::LoanId; | ||
use frame_support::{dispatch::TypeInfo, parameter_types, BoundedVec}; | ||
use sp_runtime::codec::{Decode, Encode}; | ||
use sp_std::vec; | ||
|
||
parameter_types! { | ||
pub const IpfsHashLength: u32 = 64; | ||
pub const MaxNamedRemark: u32 = 1024; | ||
} | ||
|
||
#[derive(Clone, Debug, Eq, PartialEq, Encode, Decode, TypeInfo)] | ||
pub enum Remark { | ||
/// IPFS hash | ||
IpfsHash(BoundedVec<u8, IpfsHashLength>), | ||
|
||
/// UTF-8 encoded string | ||
Named(BoundedVec<u8, MaxNamedRemark>), | ||
|
||
/// Association with a loan | ||
Loan(LoanId), | ||
} | ||
|
||
impl Default for Remark { | ||
fn default() -> Self { | ||
Remark::Named(BoundedVec::try_from(vec![]).unwrap()) | ||
} | ||
} |
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
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,46 @@ | ||
|
||
//! Autogenerated weights for `pallet_remarks` | ||
//! | ||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev | ||
//! DATE: 2024-01-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("development-local"), DB CACHE: 1024 | ||
// Executed Command: | ||
// target/release/centrifuge-chain | ||
// benchmark | ||
// pallet | ||
// --chain=development-local | ||
// --steps=50 | ||
// --repeat=20 | ||
// --pallet=pallet_remarks | ||
// --extrinsic=* | ||
// --execution=wasm | ||
// --wasm-execution=compiled | ||
// --heap-pages=4096 | ||
// --output=/tmp/runtime/development/src/weights/pallet_remarks.rs | ||
|
||
#![cfg_attr(rustfmt, rustfmt_skip)] | ||
#![allow(unused_parens)] | ||
#![allow(unused_imports)] | ||
#![allow(missing_docs)] | ||
|
||
use frame_support::{traits::Get, weights::Weight}; | ||
use core::marker::PhantomData; | ||
|
||
/// Weight functions for `pallet_remarks`. | ||
pub struct WeightInfo<T>(PhantomData<T>); | ||
impl<T: frame_system::Config> pallet_remarks::WeightInfo for WeightInfo<T> { | ||
/// The range of component `n` is `[1, 10]`. | ||
fn remark(n: u32, ) -> Weight { | ||
// Proof Size summary in bytes: | ||
// Measured: `0` | ||
// Estimated: `0` | ||
// Minimum execution time: 16_390_000 picoseconds. | ||
Weight::from_parts(16_943_014, 0) | ||
.saturating_add(Weight::from_parts(0, 0)) | ||
// Standard Error: 3_395 | ||
.saturating_add(Weight::from_parts(155_924, 0).saturating_mul(n.into())) | ||
} | ||
} |