Backing/GetBacking: Abstraction over pluralistic origins for XCM. (#8579)

* Backing/GetBacking: Abstraction over pluralistic origins for XCM.

* Update frame/support/src/traits/misc.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update frame/support/src/traits/misc.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
Gavin Wood
2021-04-09 11:38:03 +02:00
committed by GitHub
parent d6f0ce0551
commit 9fa684f2a4
3 changed files with 26 additions and 2 deletions
@@ -269,3 +269,18 @@ pub trait OffchainWorker<BlockNumber> {
fn offchain_worker(_n: BlockNumber) {}
}
/// Some amount of backing from a group. The precise defintion of what it means to "back" something
/// is left flexible.
pub struct Backing {
/// The number of members of the group that back some motion.
pub approvals: u32,
/// The total count of group members.
pub eligible: u32,
}
/// Retrieve the backing from an object's ref.
pub trait GetBacking {
/// Returns `Some` `Backing` if `self` represents a fractional/groupwise backing of some
/// implicit motion. `None` if it does not.
fn get_backing(&self) -> Option<Backing>;
}