Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge branch 'main' into upgrade_0926 and replace use of depricated t…
…raits and functions with suggested ones.
  • Loading branch information
vivekvpandya committed Oct 31, 2022
commit f93fc24da3a4753c0b3d5635329184aa161e7a75
71 changes: 36 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion runtime/battery-station/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub use crate::parachain_params::*;
pub use crate::parameters::*;
use alloc::vec;
use frame_support::{
traits::{ConstU16, ConstU32, Contains, EnsureOneOf, EqualPrivilegeOnly, InstanceFilter},
traits::{ConstU16, ConstU32, Contains, EitherOfDiverse, EqualPrivilegeOnly, InstanceFilter},
weights::{constants::RocksDbWeight, ConstantMultiplier, IdentityFee},
};
use frame_system::EnsureRoot;
Expand Down
22 changes: 11 additions & 11 deletions runtime/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,56 +98,56 @@ macro_rules! decl_common_types {
// Council vote proportions
// At least 50%
type EnsureRootOrHalfCouncil =
EnsureOneOf<EnsureRoot<AccountId>, EnsureProportionAtLeast<AccountId, CouncilInstance, 1, 2>>;
EitherOfDiverse<EnsureRoot<AccountId>, EnsureProportionAtLeast<AccountId, CouncilInstance, 1, 2>>;

// At least 66%
type EnsureRootOrTwoThirdsCouncil =
EnsureOneOf<EnsureRoot<AccountId>, EnsureProportionAtLeast<AccountId, CouncilInstance, 2, 3>>;
EitherOfDiverse<EnsureRoot<AccountId>, EnsureProportionAtLeast<AccountId, CouncilInstance, 2, 3>>;

// At least 75%
type EnsureRootOrThreeFourthsCouncil =
EnsureOneOf<EnsureRoot<AccountId>, EnsureProportionAtLeast<AccountId, CouncilInstance, 3, 4>>;
EitherOfDiverse<EnsureRoot<AccountId>, EnsureProportionAtLeast<AccountId, CouncilInstance, 3, 4>>;

// At least 100%
type EnsureRootOrAllCouncil =
EnsureOneOf<EnsureRoot<AccountId>, EnsureProportionAtLeast<AccountId, CouncilInstance, 1, 1>>;
EitherOfDiverse<EnsureRoot<AccountId>, EnsureProportionAtLeast<AccountId, CouncilInstance, 1, 1>>;

// Technical committee vote proportions
// At least 50%
#[cfg(feature = "parachain")]
type EnsureRootOrHalfTechnicalCommittee = EnsureOneOf<
type EnsureRootOrHalfTechnicalCommittee = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionAtLeast<AccountId, TechnicalCommitteeInstance, 1, 2>,
>;

// At least 66%
type EnsureRootOrTwoThirdsTechnicalCommittee = EnsureOneOf<
type EnsureRootOrTwoThirdsTechnicalCommittee = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionAtLeast<AccountId, TechnicalCommitteeInstance, 2, 3>,
>;

// At least 100%
type EnsureRootOrAllTechnicalCommittee = EnsureOneOf<
type EnsureRootOrAllTechnicalCommittee = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionAtLeast<AccountId, TechnicalCommitteeInstance, 1, 1>,
>;

// Advisory committee vote proportions
// At least 50%
type EnsureRootOrHalfAdvisoryCommittee = EnsureOneOf<
type EnsureRootOrHalfAdvisoryCommittee = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionAtLeast<AccountId, AdvisoryCommitteeInstance, 1, 2>,
>;

// Technical committee vote proportions
// At least 66%
type EnsureRootOrTwoThirdsAdvisoryCommittee = EnsureOneOf<
type EnsureRootOrTwoThirdsAdvisoryCommittee = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionAtLeast<AccountId, AdvisoryCommitteeInstance, 2, 3>,
>;

// At least 100%
type EnsureRootOrAllAdvisoryCommittee = EnsureOneOf<
type EnsureRootOrAllAdvisoryCommittee = EitherOfDiverse<
EnsureRoot<AccountId>,
EnsureProportionAtLeast<AccountId, AdvisoryCommitteeInstance, 1, 1>,
>;
Expand Down Expand Up @@ -923,7 +923,7 @@ macro_rules! impl_config_traits {
impl zrml_prediction_markets::Config for Runtime {
type AdvisoryBond = AdvisoryBond;
type AdvisoryBondSlashPercentage = AdvisoryBondSlashPercentage;
type ApproveOrigin = EnsureOneOf<
type ApproveOrigin = EitherOfDiverse<
EnsureRoot<AccountId>,
pallet_collective::EnsureMember<AccountId, AdvisoryCommitteeInstance>
>;
Expand Down
2 changes: 1 addition & 1 deletion runtime/zeitgeist/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub use crate::parachain_params::*;
pub use crate::parameters::*;
use alloc::vec;
use frame_support::{
traits::{ConstU16, ConstU32, Contains, EnsureOneOf, EqualPrivilegeOnly, InstanceFilter},
traits::{ConstU16, ConstU32, Contains, EitherOfDiverse, EqualPrivilegeOnly, InstanceFilter},
weights::{constants::RocksDbWeight, ConstantMultiplier, IdentityFee},
};
use frame_system::EnsureRoot;
Expand Down
4 changes: 2 additions & 2 deletions zrml/court/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,8 @@ mod pallet {
Self::manage_tardy_jurors(&requested_jurors, |_| false)?
};
Self::slash_losers_to_award_winners(&valid_winners_and_losers, &first)?;
Votes::<T>::remove_prefix(market_id, None);
RequestedJurors::<T>::remove_prefix(market_id, None);
let _ = Votes::<T>::clear_prefix(market_id, u32::max_value(), None);
let _ = RequestedJurors::<T>::clear_prefix(market_id, u32::max_value(), None);
Ok(Some(first))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ where
}
}

<BlockBoughtShares<T>>::remove_all(None);
let _ = <BlockBoughtShares<T>>::clear(u32::max_value(), None);
Some(market_incentives_len)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ where
});
counter = counter.saturating_add(1);
}
<BlockSoldShares<T>>::remove_all(None);
let _ = <BlockSoldShares<T>>::clear(u32::max_value(), None);
counter
}
}
You are viewing a condensed version of this merge commit. You can view the full changes here.