Function pallet_multisig::pallet::dispatchables::as_multi
source · pub fn as_multi<T: Config>(
threshold: u16,
other_signatories: Vec<T::AccountId>,
maybe_timepoint: Option<Timepoint<BlockNumberFor<T>>>,
call: Box<<T as Config>::RuntimeCall>,
max_weight: Weight,
)
Expand description
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.
§Complexity
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
.
§Warning: Doc-Only
This function is an automatically generated, and is doc-only, uncallable
stub. See the real version in
Pallet::as_multi
.