-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pallet_parameters. #2898
Closed
TarekkMA
wants to merge
27
commits into
moonbeam-foundation:master
from
TarekkMA:tarekkma/pallet-parameters
Closed
Add pallet_parameters. #2898
Changes from 13 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
8284977
pallet parameters
TarekkMA 2f2ae0b
add pallet parameters
TarekkMA 795609e
remove unused import
TarekkMA 3926815
XcmFeesAccount
TarekkMA c7c54d2
Update runtime/moonbase/src/lib.rs
TarekkMA 806312a
format
TarekkMA fb6e675
Merge branch 'master' into tarekkma/pallet-parameters
TarekkMA 30ef82d
fix
TarekkMA 116732a
fix
TarekkMA bb95d28
fix
TarekkMA e4cb2b8
fix
TarekkMA 921b1dc
add copyrights
TarekkMA 081701b
fix copyright
TarekkMA e296721
testing
TarekkMA a4546e0
remove unused
TarekkMA 150e816
format
TarekkMA d731b40
add FeesTreasuryPercentage
TarekkMA b276f54
fmt
TarekkMA 8b498d4
revert
TarekkMA 8e7c049
fix
TarekkMA 68bb6cc
fix
TarekkMA 77e2ee7
rename to FeesTreasuryProportion
TarekkMA c72509d
Merge branch 'master' into tarekkma/pallet-parameters
TarekkMA efd1804
fix the white list
TarekkMA 2dd13d9
Merge remote-tracking branch 'upstream/master' into tarekkma/pallet-p…
TarekkMA 26b7e7c
fix line
TarekkMA f6ca687
fmt
TarekkMA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,60 @@ | ||
// Copyright 2019-2022 PureStake Inc. | ||
// This file is part of Moonbeam. | ||
|
||
// Moonbeam 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. | ||
|
||
// Moonbeam 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. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Moonbeam. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
//! Autogenerated weights for `pallet_parameters` | ||
//! | ||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 | ||
//! DATE: 2024-08-06, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` | ||
//! WORST CASE MAP SIZE: `1000000` | ||
//! HOSTNAME: `COV0706`, CPU: `AMD Ryzen 9 7950X 16-Core Processor` | ||
//! WASM-EXECUTION: Compiled, CHAIN: Some("moonbase-dev"), DB CACHE: 1024 | ||
|
||
// Executed Command: | ||
// ./target/release/moonbeam | ||
// benchmark | ||
// pallet | ||
// --chain=moonbase-dev | ||
// --steps=50 | ||
// --repeat=20 | ||
// --pallet=pallet_parameters | ||
// --extrinsic=* | ||
// --wasm-execution=compiled | ||
// --header=./file_header.txt | ||
// --template=./benchmarking/frame-weight-template.hbs | ||
// --output=./runtime/common/src/weights/ | ||
|
||
#![cfg_attr(rustfmt, rustfmt_skip)] | ||
#![allow(unused_parens)] | ||
#![allow(unused_imports)] | ||
|
||
use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; | ||
use sp_std::marker::PhantomData; | ||
|
||
/// Weights for `pallet_parameters`. | ||
pub struct WeightInfo<T>(PhantomData<T>); | ||
impl<T: frame_system::Config> pallet_parameters::WeightInfo for WeightInfo<T> { | ||
/// Storage: `Parameters::Parameters` (r:1 w:1) | ||
/// Proof: `Parameters::Parameters` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`) | ||
fn set_parameter() -> Weight { | ||
// Proof Size summary in bytes: | ||
// Measured: `3` | ||
// Estimated: `3501` | ||
// Minimum execution time: 5_480_000 picoseconds. | ||
Weight::from_parts(5_610_000, 3501) | ||
.saturating_add(T::DbWeight::get().reads(1_u64)) | ||
.saturating_add(T::DbWeight::get().writes(1_u64)) | ||
} | ||
} |
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,55 @@ | ||
// Copyright 2024 Moonbeam Foundation. | ||
// This file is part of Moonbeam. | ||
|
||
// Moonbeam 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. | ||
|
||
// Moonbeam 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. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Moonbeam. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
//! Dynamic runtime parametes. | ||
use crate::currency::{SUPPLY_FACTOR, UNIT}; | ||
use crate::{Balance, Runtime}; | ||
use account::AccountId20; | ||
use frame_support::dynamic_params::{dynamic_pallet_params, dynamic_params}; | ||
|
||
#[dynamic_params(RuntimeParameters, pallet_parameters::Parameters::<Runtime>)] | ||
pub mod dynamic_params { | ||
use super::*; | ||
|
||
#[dynamic_pallet_params] | ||
#[codec(index = 0)] | ||
pub mod pallet_referenda { | ||
|
||
#[codec(index = 0)] | ||
pub static SubmissionDeposit: Balance = 10 * UNIT * SUPPLY_FACTOR; | ||
} | ||
|
||
#[dynamic_pallet_params] | ||
#[codec(index = 1)] | ||
pub mod xcm_executor { | ||
|
||
#[codec(index = 0)] | ||
/// Xcm fees will go to the treasury account | ||
pub static XcmFeesAccount: AccountId20 = crate::Treasury::account_id(); | ||
} | ||
} | ||
|
||
#[cfg(feature = "runtime-benchmarks")] | ||
impl Default for RuntimeParameters { | ||
fn default() -> Self { | ||
RuntimeParameters::PalletReferenda( | ||
dynamic_params::pallet_referenda::Parameters::SubmissionDeposit( | ||
dynamic_params::pallet_referenda::SubmissionDeposit, | ||
Some(10 * UNIT * SUPPLY_FACTOR), | ||
), | ||
) | ||
} | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parameters Parameters is a map, not a value.
This whitelist do nothing then, as we can whitelist only full keys
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there no option to whitelist an entire storage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so, we have to edit manually this list each time we add a parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed