mirror of
https://github.com/pezkuwichain/pezkuwi-runtime-templates.git
synced 2026-04-22 03:17:56 +00:00
Fix MaxLockers (#248)
* Fix MaxLockers * fix constants * fix toolchains --------- Co-authored-by: Özgün Özerk <ozgunozerk.elo@gmail.com>
This commit is contained in:
@@ -36,7 +36,7 @@ impl pallet_conviction_voting::Config for Runtime {
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const MaxBalance: Balance = Balance::max_value();
|
||||
pub const MaxBalance: Balance = Balance::MAX;
|
||||
}
|
||||
pub type TreasurySpender = EitherOf<EnsureRootWithSuccess<AccountId, MaxBalance>, Spender>;
|
||||
|
||||
|
||||
@@ -196,8 +196,7 @@ pub type XcmRouter = WithUniqueTopic<(
|
||||
)>;
|
||||
|
||||
parameter_types! {
|
||||
pub const MaxLockers: u32 = 8;
|
||||
pub const MaxRemoteLockConsumers: u32 = 0;
|
||||
pub const MaxLockers: u32 = 0;
|
||||
}
|
||||
|
||||
impl pallet_xcm::Config for Runtime {
|
||||
|
||||
@@ -233,8 +233,7 @@ mod xcm_tests {
|
||||
|
||||
#[test]
|
||||
fn pallet_xcm_constants() {
|
||||
assert_eq!(MaxLockers::get(), 8);
|
||||
assert_eq!(MaxRemoteLockConsumers::get(), 0);
|
||||
assert_eq!(MaxLockers::get(), 0);
|
||||
assert_eq!(<parachain_template_runtime::Runtime as pallet_xcm::Config>::VERSION_DISCOVERY_QUEUE_SIZE, 100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[toolchain]
|
||||
channel = "nightly-2024-02-17"
|
||||
channel = "nightly-2024-06-12"
|
||||
targets = ["wasm32-unknown-unknown"]
|
||||
components = ["rustfmt", "clippy", "rust-src"]
|
||||
|
||||
@@ -89,7 +89,6 @@ fn main() {
|
||||
let mut elapsed: Duration = Duration::ZERO;
|
||||
|
||||
let start_block = |block: u32, lapse: u32| {
|
||||
#[cfg(not(fuzzing))]
|
||||
println!("\ninitializing block {}", block + lapse);
|
||||
|
||||
let next_block = block + lapse;
|
||||
@@ -190,20 +189,17 @@ fn main() {
|
||||
|
||||
current_weight = current_weight.saturating_add(call_weight);
|
||||
if current_weight.ref_time() >= max_weight.ref_time() {
|
||||
#[cfg(not(fuzzing))]
|
||||
println!("Skipping because of max weight {max_weight}");
|
||||
continue;
|
||||
}
|
||||
|
||||
externalities.execute_with(|| {
|
||||
let origin_account = endowed_accounts[origin % endowed_accounts.len()].clone();
|
||||
#[cfg(not(fuzzing))]
|
||||
{
|
||||
println!("\n origin: {origin_account:?}");
|
||||
println!(" call: {extrinsic:?}");
|
||||
}
|
||||
let _res = extrinsic.clone().dispatch(RuntimeOrigin::signed(origin_account));
|
||||
#[cfg(not(fuzzing))]
|
||||
println!(" result: {_res:?}");
|
||||
|
||||
// Uncomment to print events for debugging purposes
|
||||
@@ -221,7 +217,6 @@ fn main() {
|
||||
elapsed += now.elapsed();
|
||||
}
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
println!("\n time spent: {elapsed:?}");
|
||||
assert!(elapsed.as_secs() <= MAX_TIME_FOR_BLOCK, "block execution took too much time");
|
||||
|
||||
@@ -230,7 +225,6 @@ fn main() {
|
||||
// Finilization
|
||||
Executive::finalize_block();
|
||||
// Invariants
|
||||
#[cfg(not(fuzzing))]
|
||||
println!("\ntesting invariants for block {current_block}");
|
||||
<AllPalletsWithSystem as TryState<BlockNumber>>::try_state(
|
||||
current_block,
|
||||
@@ -280,7 +274,6 @@ fn main() {
|
||||
"Inconsistent total issuance: {total_issuance} but counted {counted_issuance}"
|
||||
);
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
println!("running integrity tests");
|
||||
// We run all developer-defined integrity tests
|
||||
<AllPalletsWithSystem as IntegrityTest>::integrity_test();
|
||||
|
||||
Reference in New Issue
Block a user