mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 18:57:57 +00:00
Fix elections-phragmen and proxy issue (#7040)
* Fix elections-phragmen and proxy issue * remove TODO * Update bond to be per-vote * Update frame/elections-phragmen/src/lib.rs * Fix benchmakrs * Fix weight as well. * Add license * Make weight interpreted wasm! 🤦🏻♂️ * Remove a bunch of TODOs * Add migration * Better storage version. * Functionify. * Fix deposit scheme. * remove legacy bond. * Master.into() * better logging. * Fix benchmarking test * Fix confused deposit collection. * Add fine * Better name for storage item * Fix name again. * remove unused * Update frame/elections-phragmen/src/lib.rs Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * Update frame/elections-phragmen/src/lib.rs Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * cargo run --release --features runtime-benchmarks --manifest-path bin/node/cli/Cargo.toml -- benchmark --chain dev --steps 50 --repeat 20 --extrinsic * --execution=wasm --wasm-execution=compiled --output ./bin/node/runtime/src/weights --header ./HEADER --pallet pallet_elections_phragmen * new weight fns * Fix build * Fix line width * fix benchmakrs * fix warning * cargo run --release --features runtime-benchmarks --manifest-path bin/node/cli/Cargo.toml -- benchmark --chain dev --steps 50 --repeat 20 --extrinsic * --execution=wasm --wasm-execution=compiled --output ./bin/node/runtime/src/weights --header ./HEADER --pallet pallet_elections_phragmen * Tune the stake again * cargo run --release --features runtime-benchmarks --manifest-path bin/node/cli/Cargo.toml -- benchmark --chain dev --steps 50 --repeat 20 --extrinsic * --execution=wasm --wasm-execution=compiled --output ./bin/node/runtime/src/weights --header ./HEADER --pallet pallet_elections_phragmen * All tests work again. * A large number of fixes. * more fixes. * Fix node build * Some fixes to benchmarks * Fix some warnings. * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_elections_phragmen --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/elections-phragmen/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_elections_phragmen --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/elections-phragmen/src/weights.rs --template=./.maintain/frame-weight-template.hbs * Update frame/elections-phragmen/src/lib.rs Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> * a batch of review comments. * Fix a test. * Fix some more tests. * do migration with pallet version??? * Final touches. * Remove unused storage. * another rounds of changes and fixes. * Update frame/elections-phragmen/src/lib.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Update frame/elections-phragmen/src/lib.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Review grumbles. * Fix a bit more. * Fix build * Experimental: independent migration. * WIP: isolated migration logics * clean up. * make migration struct private and move migration to own file * add doc * fix StorageInstance new syntax * Update frame/elections-phragmen/src/migrations_3_0_0.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * another round of self-review. * bit better formatting * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_elections_phragmen --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/elections-phragmen/src/weights.rs --template=./.maintain/frame-weight-template.hbs * Fix tests. * Round of self-review * Clean migrations * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_elections_phragmen --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/elections-phragmen/src/weights.rs --template=./.maintain/frame-weight-template.hbs * Revert unwanted change to construct-runtime Co-authored-by: Gavin Wood <gavin@parity.io> Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
This commit is contained in:
@@ -1263,16 +1263,16 @@ pub trait ChangeMembers<AccountId: Clone + Ord> {
|
||||
///
|
||||
/// This resets any previous value of prime.
|
||||
fn set_members_sorted(new_members: &[AccountId], old_members: &[AccountId]) {
|
||||
let (incoming, outgoing) = Self::compute_members_diff(new_members, old_members);
|
||||
let (incoming, outgoing) = Self::compute_members_diff_sorted(new_members, old_members);
|
||||
Self::change_members_sorted(&incoming[..], &outgoing[..], &new_members);
|
||||
}
|
||||
|
||||
/// Compute diff between new and old members; they **must already be sorted**.
|
||||
///
|
||||
/// Returns incoming and outgoing members.
|
||||
fn compute_members_diff(
|
||||
fn compute_members_diff_sorted(
|
||||
new_members: &[AccountId],
|
||||
old_members: &[AccountId]
|
||||
old_members: &[AccountId],
|
||||
) -> (Vec<AccountId>, Vec<AccountId>) {
|
||||
let mut old_iter = old_members.iter();
|
||||
let mut new_iter = new_members.iter();
|
||||
@@ -1306,6 +1306,11 @@ pub trait ChangeMembers<AccountId: Clone + Ord> {
|
||||
|
||||
/// Set the prime member.
|
||||
fn set_prime(_prime: Option<AccountId>) {}
|
||||
|
||||
/// Get the current prime.
|
||||
fn get_prime() -> Option<AccountId> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Clone + Ord> ChangeMembers<T> for () {
|
||||
|
||||
Reference in New Issue
Block a user