Skip to content
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

Contracts: remove kitchensink dynamic parameters #4489

Merged
merged 4 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 6 additions & 20 deletions substrate/bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,9 @@ impl pallet_tips::Config for Runtime {
}

parameter_types! {
pub const DepositPerItem: Balance = deposit(1, 0);
pub const DepositPerByte: Balance = deposit(0, 1);
pub const DefaultDepositLimit: Balance = deposit(1024, 1024 * 1024);
pub Schedule: pallet_contracts::Schedule<Runtime> = Default::default();
pub CodeHashLockupDepositPercent: Perbill = Perbill::from_percent(30);
}
Expand All @@ -1358,9 +1361,9 @@ impl pallet_contracts::Config for Runtime {
/// change because that would break already deployed contracts. The `Call` structure itself
/// is not allowed to change the indices of existing pallets, too.
type CallFilter = Nothing;
type DepositPerItem = dynamic_params::contracts::DepositPerItem;
type DepositPerByte = dynamic_params::contracts::DepositPerByte;
type DefaultDepositLimit = dynamic_params::contracts::DefaultDepositLimit;
type DepositPerItem = DepositPerItem;
type DepositPerByte = DepositPerByte;
type DefaultDepositLimit = DefaultDepositLimit;
type CallStack = [pallet_contracts::Frame<Self>; 5];
type WeightPrice = pallet_transaction_payment::Pallet<Self>;
type WeightInfo = pallet_contracts::weights::SubstrateWeight<Self>;
Expand Down Expand Up @@ -2182,19 +2185,6 @@ pub mod dynamic_params {
#[codec(index = 1)]
pub static ByteDeposit: Balance = 1 * CENTS;
}

#[dynamic_pallet_params]
#[codec(index = 1)]
pub mod contracts {
#[codec(index = 0)]
pub static DepositPerItem: Balance = deposit(1, 0);

#[codec(index = 1)]
pub static DepositPerByte: Balance = deposit(0, 1);

#[codec(index = 2)]
pub static DefaultDepositLimit: Balance = deposit(1024, 1024 * 1024);
}
}

#[cfg(feature = "runtime-benchmarks")]
Expand All @@ -2220,10 +2210,6 @@ impl EnsureOriginWithArg<RuntimeOrigin, RuntimeParametersKey> for DynamicParamet
frame_system::ensure_root(origin.clone()).map_err(|_| origin)?;
return Ok(())
},
RuntimeParametersKey::Contracts(_) => {
frame_system::ensure_root(origin.clone()).map_err(|_| origin)?;
return Ok(())
},
}
}

Expand Down
Loading
Loading