mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +00:00
XCM Revamp Continued (#2865)
* Introduce plurality XCM locations * Add RelayedFrom * DMP dispatch weight handling. * Add pallet for XCM sending, add routing logic. * Update error types & doc * Fix warnings. * Fixes * Fixes * Fixes * Bump Substrate * Fixes * Docs * Docs * Docs * Fixes * Fixes * Fixes * Update xcm/pallet-xcm/src/lib.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Docs * Fixes * Update lib.rs * Fixes Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -61,12 +61,26 @@ pub enum BodyPart {
|
||||
Voice,
|
||||
/// A given number of members of the body.
|
||||
Members { #[codec(compact)] count: u32 },
|
||||
/// A given number of members of the body, out of some larger caucus.
|
||||
Fraction { #[codec(compact)] nom: u32, #[codec(compact)] denom: u32 },
|
||||
/// No less than the given proportion of members of the body.
|
||||
AtLeastProportion { #[codec(compact)] nom: u32, #[codec(compact)] denom: u32 },
|
||||
/// More than than the given proportion of members of the body.
|
||||
MoreThanProportion { #[codec(compact)] nom: u32, #[codec(compact)] denom: u32 },
|
||||
}
|
||||
|
||||
impl BodyPart {
|
||||
/// Returns `true` if the part represents a strict majority (> 50%) of the body in question.
|
||||
pub fn is_majority(&self) -> bool {
|
||||
match self {
|
||||
BodyPart::Fraction { nom, denom } if *nom * 2 > *denom => true,
|
||||
BodyPart::AtLeastProportion { nom, denom } if *nom * 2 > *denom => true,
|
||||
BodyPart::MoreThanProportion { nom, denom } if *nom * 2 >= *denom => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A single item in a path to describe the relative location of a consensus system.
|
||||
///
|
||||
/// Each item assumes a pre-existing location as its context and is defined in terms of it.
|
||||
|
||||
Reference in New Issue
Block a user