mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +00:00
c3df7db394
* [BridgeHub] Setup Rococo backbone parachain * [BridgeHub] Setup Wococo parachain backbone (reused from Rococo) [Bridge-Backport] Rebase-fix BridgeHub] Added zombienet startup tomls for Rococo/Wococo Fix typo * [BridgeHub] Added chain_spec for live Rococo/Wococo * [BridgeHub] Clean bridge-hub-rococo runtime * [BridgeHub] Add bridge-hub-rococo to CI pipelines * [BridgeHub] Added bridge-hub-kusama - empty runtime/chain_spec setup * Fixes * Fixes for BH * Fixes for other runtimes - align all * Fixes - const * Fixes const * Fixes * Fix kusama-local * Sample zombienet runs * Fixes * Fixes for benchmarking * Fixes CI * Fixes * ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs frame_system * ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_collator_selection * ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_balances * ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_session * Fixes name * Fixes readme * ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_timestamp * ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs cumulus_pallet_xcmp_queue * ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_collator_selection * Fixes * Fixes * rustfmt * Fixes * Added pallet_utility/pallet_multisig * Blind try for regex pr-custom-review.yml (added bridge-hub-kusama + collectives-polkadot) * Fixes * Fixes * ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_utility * ".git/.scripts/bench-bot.sh" pallet bridge-hub-kusama bridge-hubs pallet_multisig * Trying to fix sed expression? * Added license headers + correct "DAG:" desc Co-authored-by: command-bot <>
64 lines
2.0 KiB
Rust
64 lines
2.0 KiB
Rust
// This file is part of Substrate.
|
|
|
|
// Copyright (C) 2022 Parity Technologies (UK) Ltd.
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
pub mod constants {
|
|
use frame_support::{
|
|
parameter_types,
|
|
weights::{constants, RuntimeDbWeight},
|
|
};
|
|
|
|
parameter_types! {
|
|
/// By default, Substrate uses `RocksDB`, so this will be the weight used throughout
|
|
/// the runtime.
|
|
pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight {
|
|
read: 25_000 * constants::WEIGHT_PER_NANOS.ref_time(),
|
|
write: 100_000 * constants::WEIGHT_PER_NANOS.ref_time(),
|
|
};
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod test_db_weights {
|
|
use super::constants::RocksDbWeight as W;
|
|
use frame_support::weights::constants;
|
|
|
|
/// Checks that all weights exist and have sane values.
|
|
// NOTE: If this test fails but you are sure that the generated values are fine,
|
|
// you can delete it.
|
|
#[test]
|
|
fn sane() {
|
|
// At least 1 µs.
|
|
assert!(
|
|
W::get().reads(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
|
|
"Read weight should be at least 1 µs."
|
|
);
|
|
assert!(
|
|
W::get().writes(1).ref_time() >= constants::WEIGHT_PER_MICROS.ref_time(),
|
|
"Write weight should be at least 1 µs."
|
|
);
|
|
// At most 1 ms.
|
|
assert!(
|
|
W::get().reads(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
|
|
"Read weight should be at most 1 ms."
|
|
);
|
|
assert!(
|
|
W::get().writes(1).ref_time() <= constants::WEIGHT_PER_MILLIS.ref_time(),
|
|
"Write weight should be at most 1 ms."
|
|
);
|
|
}
|
|
}
|
|
}
|