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 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Fixes
  • Loading branch information
gavofyork committed May 31, 2022
commit 3a84fa2d054be928bb1491c90ea64495c20741da
6 changes: 4 additions & 2 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use frame_support::{
};
use frame_system::{
limits::{BlockLength, BlockWeights},
EnsureRoot, EnsureSigned,
EnsureRoot, EnsureSigned, EnsureRootWithSuccess,
};
pub use node_primitives::{AccountId, Signature};
use node_primitives::{AccountIndex, Balance, BlockNumber, Hash, Index, Moment};
Expand Down Expand Up @@ -858,8 +858,10 @@ impl pallet_referenda::Config<pallet_referenda::Instance2> for Runtime {
impl pallet_ranked_collective::Config for Runtime {
type WeightInfo = pallet_ranked_collective::weights::SubstrateWeight<Self>;
type Event = Event;
type AdminOrigin = EnsureRoot<AccountId>;
type PromoteOrigin = EnsureRootWithSuccess<AccountId, ConstU16<65535>>;
type DemoteOrigin = EnsureRootWithSuccess<AccountId, ConstU16<65535>>;
type Polls = RankedPolls;
type MinRankOfClass = traits::Identity;
type VoteWeight = pallet_ranked_collective::Geometric;
}

Expand Down
2 changes: 1 addition & 1 deletion frame/referenda/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pub mod pallet {
/// Handler for the unbalanced reduction when slashing a preimage deposit.
type Slash: OnUnbalanced<NegativeImbalanceOf<Self, I>>;
/// The counting type for votes. Usually just balance.
type Votes: AtLeast32BitUnsigned + Copy + Parameter + Member;
type Votes: AtLeast32BitUnsigned + Copy + Parameter + Member + MaxEncodedLen;
/// The tallying type.
type Tally: VoteTally<Self::Votes, TrackIdOf<Self, I>>
+ Clone
Expand Down
2 changes: 1 addition & 1 deletion frame/referenda/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ pub struct TrackInfo<Balance, Moment> {
/// Information on the voting tracks.
pub trait TracksInfo<Balance, Moment> {
/// The identifier for a track.
type Id: Copy + Parameter + Ord + PartialOrd + Send + Sync + 'static;
type Id: Copy + Parameter + Ord + PartialOrd + Send + Sync + 'static + MaxEncodedLen;

/// The origin type from which a track is implied.
type Origin;
Expand Down
3 changes: 3 additions & 0 deletions frame/support/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2748,6 +2748,9 @@ mod tests {
fn signed(_by: <TraitImpl as system::Config>::AccountId) -> Self {
unimplemented!("Not required in tests!")
}
fn as_signed(self) -> Option<Self::AccountId> {
unimplemented!("Not required in tests!")
}
}

impl system::Config for TraitImpl {
Expand Down
5 changes: 4 additions & 1 deletion test-utils/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,10 @@ impl frame_support::traits::OriginTrait for Origin {
fn root() -> Self {
unimplemented!("Not required in tests!")
}
fn signed(_by: <Runtime as frame_system::Config>::AccountId) -> Self {
fn signed(_by: Self::AccountId) -> Self {
unimplemented!("Not required in tests!")
}
fn as_signed(self) -> Option<Self::AccountId> {
unimplemented!("Not required in tests!")
}
}
Expand Down