Crates.io | pallet-mandate |
lib.rs | pallet-mandate |
version | 2.0.8 |
source | src |
created_at | 2020-03-23 22:46:58.847304 |
updated_at | 2021-03-05 13:55:29.415096 |
description | A Substrate pallet to help over modules dispatch root calls |
homepage | |
repository | https://github.com/ETeissonniere/pallet-mandate |
max_upload_size | |
id | 221948 |
size | 7,219 |
A Substrate pallet to allow the use of sudo
functions from a runtime module like the collective
.
Edit runtime/Cargo.toml
and add the following:
[dependencies.mandate]
default-features = false
version = '2.0.0'
package = "pallet-mandate"
Then add the mandate/std
to the [features]
section in the std
array, it should
look like this:
[dependencies.mandate]
default-features = false
version = '2.0.0'
package = "pallet-mandate"
[features]
default = ['std']
std = [
# Your substrate modules /std calls here
# ...
'mandate/std',
]
You can use the ExternalOrigin
type to specify who can dispatch calls to the module.
For instance you can use with the collective
:
impl mandate::Trait for Runtime {
type Proposal = Call;
// A majority of the committee can dispatch root calls
type ExternalOrigin =
collective::EnsureProportionAtLeast<_1, _2, AccountId, TechnicalCollective>;
}
In the construct_runtime
macro call just add the Mandate: mandate::{Module, Call}
, it should
look like this:
construct_runtime!(
pub enum Runtime where
Block = Block,
NodeBlock = Block,
UncheckedExtrinsic = UncheckedExtrinsic
{
// Your modules here
// ...
Mandate: mandate::{Module, Call},
}
);