Struct pallet_multisig::pallet::Pallet [−][src]
pub struct Pallet<T>(_);
Expand description
The pallet implementing the on-chain logic.
Implementations
pub fn as_multi_threshold_1(
origin: OriginFor<T>,
other_signatories: Vec<T::AccountId>,
call: Box<<T as Config>::Call>
) -> DispatchResultWithPostInfo
pub fn as_multi_threshold_1(
origin: OriginFor<T>,
other_signatories: Vec<T::AccountId>,
call: Box<<T as Config>::Call>
) -> DispatchResultWithPostInfo
Immediately dispatch a multi-signature call using a single approval from the caller.
The dispatch origin for this call must be Signed.
other_signatories
: The accounts (other than the sender) who are part of the multi-signature, but do not participate in the approval process.call
: The call to be executed.
Result is equivalent to the dispatched result.
O(Z + C) where Z is the length of the call and C its execution weight.
- DB Weight: None
- Plus Call Weight
pub fn as_multi(
origin: OriginFor<T>,
threshold: u16,
other_signatories: Vec<T::AccountId>,
maybe_timepoint: Option<Timepoint<T::BlockNumber>>,
call: OpaqueCall,
store_call: bool,
max_weight: Weight
) -> DispatchResultWithPostInfo
pub fn as_multi(
origin: OriginFor<T>,
threshold: u16,
other_signatories: Vec<T::AccountId>,
maybe_timepoint: Option<Timepoint<T::BlockNumber>>,
call: OpaqueCall,
store_call: bool,
max_weight: Weight
) -> DispatchResultWithPostInfo
Register approval for a dispatch to be made from a deterministic composite account if
approved by a total of threshold - 1
of other_signatories
.
If there are enough, then dispatch the call.
Payment: DepositBase
will be reserved if this is the first approval, plus
threshold
times DepositFactor
. It is returned once this dispatch happens or
is cancelled.
The dispatch origin for this call must be Signed.
threshold
: The total number of approvals for this dispatch before it is executed.other_signatories
: The accounts (other than the sender) who can approve this dispatch. May not be empty.maybe_timepoint
: If this is the first approval, then this must beNone
. If it is not the first approval, then it must beSome
, with the timepoint (block number and transaction index) of the first approval transaction.call
: The call to be executed.
NOTE: Unless this is the final approval, you will generally want to use
approve_as_multi
instead, since it only requires a hash of the call.
Result is equivalent to the dispatched result if threshold
is exactly 1
. Otherwise
on success, result is Ok
and the result from the interior call, if it was executed,
may be found in the deposited MultisigExecuted
event.
O(S + Z + Call)
.- Up to one balance-reserve or unreserve operation.
- One passthrough operation, one insert, both
O(S)
whereS
is the number of signatories.S
is capped byMaxSignatories
, with weight being proportional. - One call encode & hash, both of complexity
O(Z)
whereZ
is tx-len. - One encode & hash, both of complexity
O(S)
. - Up to one binary search and insert (
O(logS + S)
). - I/O: 1 read
O(S)
, up to 1 mutateO(S)
. Up to one remove. - One event.
- The weight of the
call
. - Storage: inserts one item, value size bounded by
MaxSignatories
, with a deposit taken for its lifetime ofDepositBase + threshold * DepositFactor
.
- DB Weight:
- Reads: Multisig Storage, [Caller Account], Calls (if
store_call
) - Writes: Multisig Storage, [Caller Account], Calls (if
store_call
)
- Reads: Multisig Storage, [Caller Account], Calls (if
- Plus Call Weight
pub fn approve_as_multi(
origin: OriginFor<T>,
threshold: u16,
other_signatories: Vec<T::AccountId>,
maybe_timepoint: Option<Timepoint<T::BlockNumber>>,
call_hash: [u8; 32],
max_weight: Weight
) -> DispatchResultWithPostInfo
pub fn approve_as_multi(
origin: OriginFor<T>,
threshold: u16,
other_signatories: Vec<T::AccountId>,
maybe_timepoint: Option<Timepoint<T::BlockNumber>>,
call_hash: [u8; 32],
max_weight: Weight
) -> DispatchResultWithPostInfo
Register approval for a dispatch to be made from a deterministic composite account if
approved by a total of threshold - 1
of other_signatories
.
Payment: DepositBase
will be reserved if this is the first approval, plus
threshold
times DepositFactor
. It is returned once this dispatch happens or
is cancelled.
The dispatch origin for this call must be Signed.
threshold
: The total number of approvals for this dispatch before it is executed.other_signatories
: The accounts (other than the sender) who can approve this dispatch. May not be empty.maybe_timepoint
: If this is the first approval, then this must beNone
. If it is not the first approval, then it must beSome
, with the timepoint (block number and transaction index) of the first approval transaction.call_hash
: The hash of the call to be executed.
NOTE: If this is the final approval, you will want to use as_multi
instead.
O(S)
.- Up to one balance-reserve or unreserve operation.
- One passthrough operation, one insert, both
O(S)
whereS
is the number of signatories.S
is capped byMaxSignatories
, with weight being proportional. - One encode & hash, both of complexity
O(S)
. - Up to one binary search and insert (
O(logS + S)
). - I/O: 1 read
O(S)
, up to 1 mutateO(S)
. Up to one remove. - One event.
- Storage: inserts one item, value size bounded by
MaxSignatories
, with a deposit taken for its lifetime ofDepositBase + threshold * DepositFactor
.
- DB Weight:
- Read: Multisig Storage, [Caller Account]
- Write: Multisig Storage, [Caller Account]
pub fn cancel_as_multi(
origin: OriginFor<T>,
threshold: u16,
other_signatories: Vec<T::AccountId>,
timepoint: Timepoint<T::BlockNumber>,
call_hash: [u8; 32]
) -> DispatchResult
pub fn cancel_as_multi(
origin: OriginFor<T>,
threshold: u16,
other_signatories: Vec<T::AccountId>,
timepoint: Timepoint<T::BlockNumber>,
call_hash: [u8; 32]
) -> DispatchResult
Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously for this operation will be unreserved on success.
The dispatch origin for this call must be Signed.
threshold
: The total number of approvals for this dispatch before it is executed.other_signatories
: The accounts (other than the sender) who can approve this dispatch. May not be empty.timepoint
: The timepoint (block number and transaction index) of the first approval transaction for this dispatch.call_hash
: The hash of the call to be executed.
O(S)
.- Up to one balance-reserve or unreserve operation.
- One passthrough operation, one insert, both
O(S)
whereS
is the number of signatories.S
is capped byMaxSignatories
, with weight being proportional. - One encode & hash, both of complexity
O(S)
. - One event.
- I/O: 1 read
O(S)
, one remove. - Storage: removes one item.
- DB Weight:
- Read: Multisig Storage, [Caller Account], Refund Account, Calls
- Write: Multisig Storage, [Caller Account], Refund Account, Calls
Derive a multi-account ID from the sorted list of accounts and the threshold that are required.
NOTE: who
must be sorted. If it is not, then you’ll get the wrong answer.
The current Timepoint
.
Trait Implementations
Get the benchmarks available for this pallet. Generally there is one benchmark per extrinsic, so these are sometimes just called “extrinsics”. Read more
fn run_benchmark(
extrinsic: &[u8],
c: &[(BenchmarkParameter, u32)],
whitelist: &[TrackedStorageKey],
verify: bool,
internal_repeats: u32
) -> Result<Vec<BenchmarkResults>, &'static str>
fn run_benchmark(
extrinsic: &[u8],
c: &[(BenchmarkParameter, u32)],
whitelist: &[TrackedStorageKey],
verify: bool,
internal_repeats: u32
) -> Result<Vec<BenchmarkResults>, &'static str>
Run the benchmarks for this pallet.
Returns the current storage version as supported by the pallet.
Returns the on-chain storage version of the pallet as stored in the storage.
The block is being finalized. Implement to have something happen.
This will be run when the block is being finalized (before on_finalize
).
Implement to have something happen using the remaining weight.
Will not fire if the remaining weight is 0.
Return the weight used, the hook will subtract it from current weight used
and pass the result to the next on_idle
hook if it exists. Read more
The block is being initialized. Implement to have something happen. Read more
Perform a module upgrade. Read more
Execute some pre-checks prior to a runtime upgrade. Read more
Execute some post-checks after a runtime upgrade. Read more
Implementing this function on a module allows you to perform long-running tasks that make (by default) validators generate transactions that feed results of those long-running computations back on chain. Read more
Run integrity test. Read more
Run integrity test. Read more
This function is being called after every block import (when fully synced). Read more
The block is being finalized. Implement to have something happen. Read more
Something that should happen at genesis.
The block is being finalized.
Implement to have something happen in case there is leftover weight.
Check the passed remaining_weight
to make sure it is high enough to allow for
your pallet’s extra computation. Read more
The block is being initialized. Implement to have something happen. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Pallet<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Pallet<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Generate a storage key unique to this runtime upgrade. Read more
Get temporary storage data written by Self::set_temp_storage
. Read more
Write some temporary data to a specific storage that can be read (potentially in
post-upgrade hook) via Self::get_temp_storage
. Read more
impl<T> PalletVersionToStorageVersionHelper for T where
T: GetStorageVersion + PalletInfoAccess,
impl<T> PalletVersionToStorageVersionHelper for T where
T: GetStorageVersion + PalletInfoAccess,
type Output = T
type Output = T
Should always be Self
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
impl<T> MaybeDebug for T where
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,