mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 00:31:07 +00:00
Decouple Staking and Election - Part 2 Unsigned Phase (#7909)
* Base features and traits. * pallet and unsigned phase * Undo bad formattings. * some formatting cleanup. * Small self-cleanup. * Make it all build * self-review * Some doc tests. * Some changes from other PR * Fix session test * Update Cargo.lock * Update frame/election-provider-multi-phase/src/lib.rs Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * Some review comments * Rename + make encode/decode * Do an assert as well, just in case. * Fix build * Update frame/election-provider-multi-phase/src/unsigned.rs Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * Las comment * fix staking fuzzer. * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_election_provider_multi_phase --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/election-provider-multi-phase/src/weights.rs --template=./.maintain/frame-weight-template.hbs * Add one last layer of feasibility check as well. * Last fixes to benchmarks * Some more docs. * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_election_provider_multi_phase --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/election-provider-multi-phase/src/weights.rs --template=./.maintain/frame-weight-template.hbs * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_election_provider_multi_phase --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/election-provider-multi-phase/src/weights.rs --template=./.maintain/frame-weight-template.hbs * Some nits * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_staking --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/staking/src/weights.rs --template=./.maintain/frame-weight-template.hbs * Fix doc * Mkae ci green Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
This commit is contained in:
@@ -13,9 +13,9 @@ readme = "README.md"
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
sp-std = { version = "3.0.0", default-features = false, path = "../../../primitives/std" }
|
||||
sp-session = { version = "3.0.0", default-features = false, path = "../../../primitives/session" }
|
||||
sp-runtime = { version = "3.0.0", default-features = false, path = "../../../primitives/runtime" }
|
||||
sp-std = { version = "3.0.0", default-features = false, path = "../../../primitives/std" }
|
||||
frame-system = { version = "3.0.0", default-features = false, path = "../../system" }
|
||||
frame-benchmarking = { version = "3.0.0", default-features = false, path = "../../benchmarking" }
|
||||
frame-support = { version = "3.0.0", default-features = false, path = "../../support" }
|
||||
@@ -31,12 +31,14 @@ pallet-staking-reward-curve = { version = "3.0.0", path = "../../staking/reward-
|
||||
sp-io ={ version = "3.0.0", path = "../../../primitives/io" }
|
||||
pallet-timestamp = { version = "3.0.0", path = "../../timestamp" }
|
||||
pallet-balances = { version = "3.0.0", path = "../../balances" }
|
||||
sp-election-providers = { version = "3.0.0", path = "../../../primitives/election-providers" }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = [
|
||||
"sp-std/std",
|
||||
"sp-session/std",
|
||||
"sp-election-providers/std",
|
||||
"sp-runtime/std",
|
||||
"frame-system/std",
|
||||
"frame-benchmarking/std",
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#![cfg(test)]
|
||||
|
||||
use sp_runtime::traits::IdentityLookup;
|
||||
use sp_election_providers::onchain;
|
||||
use frame_support::parameter_types;
|
||||
|
||||
type AccountId = u64;
|
||||
@@ -145,13 +146,21 @@ parameter_types! {
|
||||
|
||||
pub type Extrinsic = sp_runtime::testing::TestXt<Call, ()>;
|
||||
|
||||
impl<C> frame_system::offchain::SendTransactionTypes<C> for Test where
|
||||
impl<C> frame_system::offchain::SendTransactionTypes<C> for Test
|
||||
where
|
||||
Call: From<C>,
|
||||
{
|
||||
type OverarchingCall = Call;
|
||||
type Extrinsic = Extrinsic;
|
||||
}
|
||||
|
||||
impl onchain::Config for Test {
|
||||
type AccountId = AccountId;
|
||||
type BlockNumber = BlockNumber;
|
||||
type Accuracy = sp_runtime::Perbill;
|
||||
type DataProvider = Staking;
|
||||
}
|
||||
|
||||
impl pallet_staking::Config for Test {
|
||||
type Currency = Balances;
|
||||
type UnixTime = pallet_timestamp::Module<Self>;
|
||||
@@ -174,6 +183,7 @@ impl pallet_staking::Config for Test {
|
||||
type MaxIterations = ();
|
||||
type MinSolutionScoreBump = ();
|
||||
type OffchainSolutionWeightLimit = ();
|
||||
type ElectionProvider = onchain::OnChainSequentialPhragmen<Self>;
|
||||
type WeightInfo = ();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user