mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 21:01:02 +00:00
Add Collectives Parachain (#1346)
* add new runtime and remove unnecessary pallets * make runtime build * add collectives to collator node * sketch alliance config in runtime * Slash handler was supposed to be commented out (for now) * correct signature * move to impls * add alliance to runtime * rustfmt * IsReserve, remove Ping, update fn deposit * add transaction_payment event * Update parachains/runtimes/collectives/collectives-polkadot/src/lib.rs Co-authored-by: Squirrel <gilescope@gmail.com> * fmt * add genesis config to chain spec * fix merge * local and dev configs only (for now) * remove duplicate imports * Collectives polkadot runtime to cargo workspace members (#1397) * Collectives polkadot runtime: use unit type impl for identity verifier (#1398) * apply fn rename * fmt * one less todo * Less code in magic macros (#1407) * Less code in magic macros * cargo fmt * Bench alliance (#1427) * add benchmarks * call one script from the other * shebang changes so works on nixos too. * bench in parallel as separate jobs * hyphens can turn into underscores * remove workaround to trigger bench Co-authored-by: alvicsam <alvicsam@gmail.com> Co-authored-by: paritytech-ci <paritytech-ci@parity.io> * enable ci jobs * fix publish bench results jobs * chainspecs for collectives-westend (#1441) * initial chainspecs for collections relay chain * plumb in the collectives-westend chainspec * add Runtime::CollectivesWestend * lock * Collectives: teleport slashed assets (#1433) * Collectives: teleport slashed assets * fmt * Cargo.lock > polkadot-parachain 0.9.25 * create temp account for imbalance * treasury acc id from pallet id * move accounts into constants, use here junction for assets * assets location is relay chain, accounts as parameters * fix typos * fix typo * Update parachains/runtimes/collectives/collectives-polkadot/src/constants.rs Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> * Move alliance proposal provider to impls.rs (#1464) * Move to impls alliance proposal provider * rustfmt * Bumping spec version (so that we can redeploy with slashing change.) * cargo lock * slurp collectives digest to make appear in release notes (#1473) * add slurp * Slurp better :) * Bring some order Co-authored-by: Chevdor <chevdor@users.noreply.github.com> Co-authored-by: Wilfried Kopp <wilfried@parity.io> * reorder barrier * Update parachains/runtimes/collectives/collectives-polkadot/src/xcm_config.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> * address review * clean construct runtime * fmt * looks pretty but brings in too much Co-authored-by: Squirrel <gilescope@gmail.com> Co-authored-by: Muharem Ismailov <ismailov.m.h@gmail.com> Co-authored-by: alvicsam <alvicsam@gmail.com> Co-authored-by: paritytech-ci <paritytech-ci@parity.io> Co-authored-by: Chevdor <chevdor@users.noreply.github.com> Co-authored-by: Wilfried Kopp <wilfried@parity.io> Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
+63
@@ -0,0 +1,63 @@
|
||||
// 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! {
|
||||
/// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights
|
||||
/// are available for brave runtime engineers who may want to try this out as default.
|
||||
pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight {
|
||||
read: 8_000 * constants::WEIGHT_PER_NANOS,
|
||||
write: 50_000 * constants::WEIGHT_PER_NANOS,
|
||||
};
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod test_db_weights {
|
||||
use super::constants::ParityDbWeight 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) >= constants::WEIGHT_PER_MICROS,
|
||||
"Read weight should be at least 1 µs."
|
||||
);
|
||||
assert!(
|
||||
W::get().writes(1) >= constants::WEIGHT_PER_MICROS,
|
||||
"Write weight should be at least 1 µs."
|
||||
);
|
||||
// At most 1 ms.
|
||||
assert!(
|
||||
W::get().reads(1) <= constants::WEIGHT_PER_MILLIS,
|
||||
"Read weight should be at most 1 ms."
|
||||
);
|
||||
assert!(
|
||||
W::get().writes(1) <= constants::WEIGHT_PER_MILLIS,
|
||||
"Write weight should be at most 1 ms."
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user