Crate noble_collective[][src]

Collective system: Members of a set of account IDs can make their collective feelings known through dispatched calls from one of two specialized origins.

The membership can be provided in one of two ways: either directly, using the Root-dispatchable function set_members, or indirectly, through implementing the ChangeMembers. The noble assumes that the amount of members stays at or below MaxMembers for its weight calculations, but enforces this neither in set_members nor in change_members_sorted.

A “prime” member may be set to help determine the default vote behavior based on chain config. If PreimDefaultVote is used, the prime vote acts as the default vote in case of any abstentions after the voting period. If MoreThanMajorityThenPrimeDefaultVote is used, then abstentations will first follow the majority of the collective voting, and then the prime member.

Voting happens through motions comprising a proposal (i.e. a curried dispatchable) plus a number of approvals required for it to pass and be called. Motions are open for members to vote on for a minimum period given by MotionDuration. As soon as the needed number of approvals is given, the motion is closed and executed. If the number of approvals is not reached during the voting period, then close may be called by any account in order to force the end the motion explicitly. If a prime member is defined then their vote is used in place of any abstentions and the proposal is executed if there are enough approvals counting the new votes.

If there are not, or if no prime is set, then the motion is dropped without being executed.

Re-exports

pub use weights::WeightInfo;
pub use $crate::traits::GetNobleVersion as _;

Modules

weights

Weights for noble_collective THIS FILE WAS AUTO-GENERATED USING THE TETCORE BENCHMARK CLI VERSION 2.0.0 DATE: 2020-10-27, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: [] EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some(“dev”), DB CACHE: 128

Structs

DefaultInstance

Default module instance

EnsureMember
EnsureMembers
EnsureProportionAtLeast
EnsureProportionMoreThan
GenesisConfig

Genesis config for the module, allow to build genesis storage.

Instance0

Module instance

Instance1

Module instance

Instance2

Module instance

Instance3

Module instance

Instance4

Module instance

Instance5

Module instance

Instance6

Module instance

Instance7

Module instance

Instance8

Module instance

Instance9

Module instance

Instance10

Module instance

Instance11

Module instance

Instance12

Module instance

Instance13

Module instance

Instance14

Module instance

Instance15

Module instance

Members

The current members of the collective. This is stored sorted (just by value).

Module
MoreThanMajorityThenPrimeDefaultVote

First see if yes vote are over majority of the whole collective. If so, set the default vote as yes. Otherwise, use the prime meber’s vote as the default vote.

Prime

The prime member that helps determine the default vote behavior in case of absentations.

PrimeDefaultVote

Set the prime member’s vote as the default vote.

ProposalCount

Proposals so far.

ProposalOf

Actual proposal for a given hash, if it’s current.

Proposals

The hashes of the active proposals.

Votes

Info for keeping track of a motion being voted on.

Voting

Votes on a given proposal, if it is ongoing.

Enums

Call

Dispatchable calls.

Error
RawEvent

Events for this module.

RawOrigin

Origin for the collective module.

Traits

Config
DefaultVote

Default voting strategy when a member is inactive.

Functions

ensure_members

Ensure that the origin o represents at least n members. Returns Ok or an Err otherwise.

Type Definitions

Event

RawEvent specialized for the configuration Config

MemberCount

A number of members.

Origin

Origin for the collective module.

ProposalIndex

Simple index type for proposal counting.