mirror of
https://github.com/pezkuwichain/pezkuwi-runtime-templates.git
synced 2026-06-13 10:31:06 +00:00
init
This commit is contained in:
Generated
+1
@@ -7401,6 +7401,7 @@ dependencies = [
|
|||||||
"sp-core",
|
"sp-core",
|
||||||
"sp-genesis-builder",
|
"sp-genesis-builder",
|
||||||
"sp-inherents",
|
"sp-inherents",
|
||||||
|
"sp-io",
|
||||||
"sp-offchain",
|
"sp-offchain",
|
||||||
"sp-runtime",
|
"sp-runtime",
|
||||||
"sp-session",
|
"sp-session",
|
||||||
|
|||||||
@@ -81,6 +81,9 @@ cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk
|
|||||||
pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
|
pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
|
||||||
parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
|
parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0", default-features = false }
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.3.0" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["std"]
|
default = ["std"]
|
||||||
std = [
|
std = [
|
||||||
@@ -99,6 +102,7 @@ std = [
|
|||||||
"frame-system-benchmarking?/std",
|
"frame-system-benchmarking?/std",
|
||||||
"frame-system-rpc-runtime-api/std",
|
"frame-system-rpc-runtime-api/std",
|
||||||
"frame-system/std",
|
"frame-system/std",
|
||||||
|
"pallet-proxy/std",
|
||||||
"frame-try-runtime?/std",
|
"frame-try-runtime?/std",
|
||||||
"log/std",
|
"log/std",
|
||||||
"pallet-aura/std",
|
"pallet-aura/std",
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
// ExtBuilder impl for all runtime integration tests
|
||||||
|
use frame_support::weights::Weight;
|
||||||
|
use parachain_template_runtime::{BuildStorage, Runtime, System};
|
||||||
|
|
||||||
|
pub fn run_with_system_weight<F>(w: Weight, mut assertions: F)
|
||||||
|
where
|
||||||
|
F: FnMut() -> (),
|
||||||
|
{
|
||||||
|
let mut t: sp_io::TestExternalities =
|
||||||
|
frame_system::GenesisConfig::<Runtime>::default().build_storage().unwrap().into();
|
||||||
|
t.execute_with(|| {
|
||||||
|
System::set_block_consumed_resources(w, 0);
|
||||||
|
assertions()
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
// Integration transaction fee tests i.e. adjusts to block saturation
|
||||||
|
mod common;
|
||||||
|
use common::*;
|
||||||
|
use frame_support::pallet_prelude::*;
|
||||||
|
use parachain_template_runtime::{Runtime, RuntimeBlockWeights};
|
||||||
|
use polkadot_runtime_common::MinimumMultiplier;
|
||||||
|
use sp_runtime::{traits::Convert, Perquintill};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn multiplier_can_grow_from_zero() {
|
||||||
|
let minimum_multiplier = MinimumMultiplier::get();
|
||||||
|
let target = Perquintill::from_percent(25)
|
||||||
|
* RuntimeBlockWeights::get().get(DispatchClass::Normal).max_total.unwrap();
|
||||||
|
// if the min is too small, then this will not change, and we are doomed forever.
|
||||||
|
// the weight is 1/100th bigger than target.
|
||||||
|
run_with_system_weight(target * 101 / 100, || {
|
||||||
|
let next = <Runtime as pallet_transaction_payment::Config>::FeeMultiplierUpdate::convert(
|
||||||
|
minimum_multiplier,
|
||||||
|
);
|
||||||
|
assert!(next > minimum_multiplier, "{:?} !>= {:?}", next, minimum_multiplier);
|
||||||
|
})
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user