Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
325 changes: 163 additions & 162 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions bridges/bin/rialto-parachain/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use sp_version::RuntimeVersion;

// A few exports that help ease life for downstream crates.
pub use frame_support::{
construct_runtime, match_type, parameter_types,
construct_runtime, match_types, parameter_types,
traits::{Everything, IsInVec, Randomness},
weights::{
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND},
Expand Down Expand Up @@ -349,7 +349,7 @@ parameter_types! {
pub const MaxAuthorities: u32 = 100_000;
}

match_type! {
match_types! {
pub type ParentOrParentsUnitPlurality: impl Contains<MultiLocation> = {
MultiLocation { parents: 1, interior: Here } |
MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) }
Expand Down
14 changes: 5 additions & 9 deletions runtime/common/src/elections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! Code for elections.

use super::{BlockExecutionWeight, BlockLength, BlockWeights};
use frame_election_provider_support::{SortedListProvider, VoteWeight};
use frame_election_provider_support::SortedListProvider;
use frame_support::{
parameter_types,
weights::{DispatchClass, Weight},
Expand Down Expand Up @@ -76,6 +76,7 @@ impl<T: pallet_bags_list::Config + pallet_staking::Config> SortedListProvider<T:
for UseNominatorsAndUpdateBagsList<T>
{
type Error = pallet_bags_list::Error;
type Score = <T as pallet_bags_list::Config>::Score;

fn iter() -> Box<dyn Iterator<Item = T::AccountId>> {
Box::new(pallet_staking::Nominators::<T>::iter().map(|(n, _)| n))
Expand All @@ -89,11 +90,11 @@ impl<T: pallet_bags_list::Config + pallet_staking::Config> SortedListProvider<T:
pallet_bags_list::Pallet::<T>::contains(id)
}

fn on_insert(id: T::AccountId, weight: VoteWeight) -> Result<(), Self::Error> {
fn on_insert(id: T::AccountId, weight: Self::Score) -> Result<(), Self::Error> {
pallet_bags_list::Pallet::<T>::on_insert(id, weight)
}

fn on_update(id: &T::AccountId, new_weight: VoteWeight) {
fn on_update(id: &T::AccountId, new_weight: Self::Score) {
pallet_bags_list::Pallet::<T>::on_update(id, new_weight);
}

Expand All @@ -103,7 +104,7 @@ impl<T: pallet_bags_list::Config + pallet_staking::Config> SortedListProvider<T:

fn unsafe_regenerate(
all: impl IntoIterator<Item = T::AccountId>,
weight_of: Box<dyn Fn(&T::AccountId) -> VoteWeight>,
weight_of: Box<dyn Fn(&T::AccountId) -> Self::Score>,
) -> u32 {
pallet_bags_list::Pallet::<T>::unsafe_regenerate(all, weight_of)
}
Expand All @@ -115,9 +116,4 @@ impl<T: pallet_bags_list::Config + pallet_staking::Config> SortedListProvider<T:
fn unsafe_clear() {
pallet_bags_list::Pallet::<T>::unsafe_clear()
}

#[cfg(feature = "runtime-benchmarks")]
fn weight_update_worst_case(who: &T::AccountId, is_increase: bool) -> VoteWeight {
pallet_bags_list::Pallet::<T>::weight_update_worst_case(who, is_increase)
}
}
3 changes: 2 additions & 1 deletion runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,10 @@ parameter_types! {

impl pallet_bags_list::Config for Runtime {
type Event = Event;
type VoteWeightProvider = Staking;
type ScoreProvider = Staking;
type WeightInfo = weights::pallet_bags_list::WeightInfo<Runtime>;
type BagThresholds = BagThresholds;
type Score = sp_npos_elections::VoteWeight;
}

fn era_payout(
Expand Down
4 changes: 2 additions & 2 deletions runtime/kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use super::{
Runtime, WeightToFee, XcmPallet,
};
use frame_support::{
match_type, parameter_types,
match_types, parameter_types,
traits::{Everything, Nothing},
weights::Weight,
};
Expand Down Expand Up @@ -111,7 +111,7 @@ parameter_types! {
pub type TrustedTeleporters =
(xcm_builder::Case<KusamaForStatemine>, xcm_builder::Case<KusamaForEncointer>);

match_type! {
match_types! {
pub type OnlyParachains: impl Contains<MultiLocation> = {
MultiLocation { parents: 0, interior: X1(Parachain(_)) }
};
Expand Down
3 changes: 2 additions & 1 deletion runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,10 @@ parameter_types! {

impl pallet_bags_list::Config for Runtime {
type Event = Event;
type VoteWeightProvider = Staking;
type ScoreProvider = Staking;
type WeightInfo = weights::pallet_bags_list::WeightInfo<Runtime>;
type BagThresholds = BagThresholds;
type Score = sp_npos_elections::VoteWeight;
}

// TODO #6469: This shouldn't be static, but a lazily cached value, not built unless needed, and
Expand Down
4 changes: 2 additions & 2 deletions runtime/polkadot/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use super::{
Runtime, WeightToFee, XcmPallet,
};
use frame_support::{
match_type, parameter_types,
match_types, parameter_types,
traits::{Everything, Nothing},
weights::Weight,
};
Expand Down Expand Up @@ -107,7 +107,7 @@ parameter_types! {

pub type TrustedTeleporters = (xcm_builder::Case<PolkadotForStatemint>,);

match_type! {
match_types! {
pub type OnlyParachains: impl Contains<MultiLocation> = {
MultiLocation { parents: 0, interior: X1(Parachain(_)) }
};
Expand Down
3 changes: 2 additions & 1 deletion runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,10 @@ parameter_types! {

impl pallet_bags_list::Config for Runtime {
type Event = Event;
type VoteWeightProvider = Staking;
type ScoreProvider = Staking;
type WeightInfo = weights::pallet_bags_list::WeightInfo<Runtime>;
type BagThresholds = BagThresholds;
type Score = sp_npos_elections::VoteWeight;
}

pallet_staking_reward_curve::build! {
Expand Down