Module dock_runtime::master
source · Expand description
Simulates a multisig root account.
Each substrate runtime module declares a “Call” enum. The “Call” enum is created by the
decl_module!
macro. Let’s call that enum module::Call
. Each module::Call
is a reified
invocation of one of the modules methods. The module::Call
for this:
decl_module! {
pub struct Module<T: Config> for enum Call where origin: T::Origin {
#[weight = 100_000]
pub fn frob(origin, foo: Foo) -> DispatchResult { Ok(()) }
#[weight = 100_000]
pub fn unfrob(origin, foo: Foo, bar: Bar) -> DispatchResult { Ok(()) }
}
}
looks something like this:
enum Call {
frob(Foo),
unfrob(Foo, Bar),
}
The construct_runtime!
macro assembles the calls from all the included modules into a
single “super call”. The name of this enum is also “Call”, but let’s refer to it as
runtime::Call
. A runtime::Call
looks something like this:
enum Call {
Module1(module1::Call),
Module2(module2::Call),
Module3(module3::Call),
}
This module allows members of the group called Master to “vote” on a runtime::Call
(a
proposal) using cryptographic signatures. The votes, along with the proposed runtime::Call
are submitted in a single transaction. If enough valid votes endorse the proposal, the proposal
is run as root. If the running the proposal as root succeeds, a new round of voting is started.
Each member of Master is idenitified by their dock DID.
This module implement partial replay protection to prevent unauthorized resubmission of votes from previous rounds.
Modules
- The module that hosts all the FRAME types needed to add this pallet to a runtime.
Structs
- Can be used to configure the genesis state of this pallet.
- Master
DID
. - The pallet implementing the on-chain logic.
Enums
- Contains one variant per dispatchable that can be called by an extrinsic.
- Custom dispatch errors of this pallet.
- The event emitted by this pallet.
Traits
- Configuration trait of this pallet.
Type Definitions
- ModuleDeprecatedType alias to
Pallet
, to be used byconstruct_runtime
.