mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 16:21:06 +00:00
Use explicit call indices (#12891)
* frame-system: explicit call index Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use explicit call indices Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * pallet-template: explicit call index Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * DNM: Temporarily require call_index Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Revert "DNM: Temporarily require call_index" This reverts commit c4934e312e12af72ca05a8029d7da753a9c99346. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
committed by
GitHub
parent
6e0453a298
commit
31f5119ecd
@@ -549,6 +549,7 @@ pub mod pallet {
|
||||
/// - `value`: The amount of deposit (must be at least `MinimumDeposit`).
|
||||
///
|
||||
/// Emits `Proposed`.
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(T::WeightInfo::propose())]
|
||||
pub fn propose(
|
||||
origin: OriginFor<T>,
|
||||
@@ -591,6 +592,7 @@ pub mod pallet {
|
||||
/// must have funds to cover the deposit, equal to the original deposit.
|
||||
///
|
||||
/// - `proposal`: The index of the proposal to second.
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight(T::WeightInfo::second())]
|
||||
pub fn second(
|
||||
origin: OriginFor<T>,
|
||||
@@ -616,6 +618,7 @@ pub mod pallet {
|
||||
///
|
||||
/// - `ref_index`: The index of the referendum to vote for.
|
||||
/// - `vote`: The vote configuration.
|
||||
#[pallet::call_index(2)]
|
||||
#[pallet::weight(T::WeightInfo::vote_new().max(T::WeightInfo::vote_existing()))]
|
||||
pub fn vote(
|
||||
origin: OriginFor<T>,
|
||||
@@ -634,6 +637,7 @@ pub mod pallet {
|
||||
/// -`ref_index`: The index of the referendum to cancel.
|
||||
///
|
||||
/// Weight: `O(1)`.
|
||||
#[pallet::call_index(3)]
|
||||
#[pallet::weight((T::WeightInfo::emergency_cancel(), DispatchClass::Operational))]
|
||||
pub fn emergency_cancel(
|
||||
origin: OriginFor<T>,
|
||||
@@ -656,6 +660,7 @@ pub mod pallet {
|
||||
/// The dispatch origin of this call must be `ExternalOrigin`.
|
||||
///
|
||||
/// - `proposal_hash`: The preimage hash of the proposal.
|
||||
#[pallet::call_index(4)]
|
||||
#[pallet::weight(T::WeightInfo::external_propose())]
|
||||
pub fn external_propose(
|
||||
origin: OriginFor<T>,
|
||||
@@ -684,6 +689,7 @@ pub mod pallet {
|
||||
/// pre-scheduled `external_propose` call.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(5)]
|
||||
#[pallet::weight(T::WeightInfo::external_propose_majority())]
|
||||
pub fn external_propose_majority(
|
||||
origin: OriginFor<T>,
|
||||
@@ -705,6 +711,7 @@ pub mod pallet {
|
||||
/// pre-scheduled `external_propose` call.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(6)]
|
||||
#[pallet::weight(T::WeightInfo::external_propose_default())]
|
||||
pub fn external_propose_default(
|
||||
origin: OriginFor<T>,
|
||||
@@ -731,6 +738,7 @@ pub mod pallet {
|
||||
/// Emits `Started`.
|
||||
///
|
||||
/// Weight: `O(1)`
|
||||
#[pallet::call_index(7)]
|
||||
#[pallet::weight(T::WeightInfo::fast_track())]
|
||||
pub fn fast_track(
|
||||
origin: OriginFor<T>,
|
||||
@@ -783,6 +791,7 @@ pub mod pallet {
|
||||
/// Emits `Vetoed`.
|
||||
///
|
||||
/// Weight: `O(V + log(V))` where V is number of `existing vetoers`
|
||||
#[pallet::call_index(8)]
|
||||
#[pallet::weight(T::WeightInfo::veto_external())]
|
||||
pub fn veto_external(origin: OriginFor<T>, proposal_hash: H256) -> DispatchResult {
|
||||
let who = T::VetoOrigin::ensure_origin(origin)?;
|
||||
@@ -817,6 +826,7 @@ pub mod pallet {
|
||||
/// - `ref_index`: The index of the referendum to cancel.
|
||||
///
|
||||
/// # Weight: `O(1)`.
|
||||
#[pallet::call_index(9)]
|
||||
#[pallet::weight(T::WeightInfo::cancel_referendum())]
|
||||
pub fn cancel_referendum(
|
||||
origin: OriginFor<T>,
|
||||
@@ -849,6 +859,7 @@ pub mod pallet {
|
||||
/// voted on. Weight is charged as if maximum votes.
|
||||
// NOTE: weight must cover an incorrect voting of origin with max votes, this is ensure
|
||||
// because a valid delegation cover decoding a direct voting with max votes.
|
||||
#[pallet::call_index(10)]
|
||||
#[pallet::weight(T::WeightInfo::delegate(T::MaxVotes::get()))]
|
||||
pub fn delegate(
|
||||
origin: OriginFor<T>,
|
||||
@@ -877,6 +888,7 @@ pub mod pallet {
|
||||
/// voted on. Weight is charged as if maximum votes.
|
||||
// NOTE: weight must cover an incorrect voting of origin with max votes, this is ensure
|
||||
// because a valid delegation cover decoding a direct voting with max votes.
|
||||
#[pallet::call_index(11)]
|
||||
#[pallet::weight(T::WeightInfo::undelegate(T::MaxVotes::get()))]
|
||||
pub fn undelegate(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
|
||||
let who = ensure_signed(origin)?;
|
||||
@@ -889,6 +901,7 @@ pub mod pallet {
|
||||
/// The dispatch origin of this call must be _Root_.
|
||||
///
|
||||
/// Weight: `O(1)`.
|
||||
#[pallet::call_index(12)]
|
||||
#[pallet::weight(T::WeightInfo::clear_public_proposals())]
|
||||
pub fn clear_public_proposals(origin: OriginFor<T>) -> DispatchResult {
|
||||
ensure_root(origin)?;
|
||||
@@ -903,6 +916,7 @@ pub mod pallet {
|
||||
/// - `target`: The account to remove the lock on.
|
||||
///
|
||||
/// Weight: `O(R)` with R number of vote of target.
|
||||
#[pallet::call_index(13)]
|
||||
#[pallet::weight(T::WeightInfo::unlock_set(T::MaxVotes::get()).max(T::WeightInfo::unlock_remove(T::MaxVotes::get())))]
|
||||
pub fn unlock(origin: OriginFor<T>, target: AccountIdLookupOf<T>) -> DispatchResult {
|
||||
ensure_signed(origin)?;
|
||||
@@ -938,6 +952,7 @@ pub mod pallet {
|
||||
///
|
||||
/// Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on.
|
||||
/// Weight is calculated for the maximum number of vote.
|
||||
#[pallet::call_index(14)]
|
||||
#[pallet::weight(T::WeightInfo::remove_vote(T::MaxVotes::get()))]
|
||||
pub fn remove_vote(origin: OriginFor<T>, index: ReferendumIndex) -> DispatchResult {
|
||||
let who = ensure_signed(origin)?;
|
||||
@@ -959,6 +974,7 @@ pub mod pallet {
|
||||
///
|
||||
/// Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on.
|
||||
/// Weight is calculated for the maximum number of vote.
|
||||
#[pallet::call_index(15)]
|
||||
#[pallet::weight(T::WeightInfo::remove_other_vote(T::MaxVotes::get()))]
|
||||
pub fn remove_other_vote(
|
||||
origin: OriginFor<T>,
|
||||
@@ -987,6 +1003,7 @@ pub mod pallet {
|
||||
///
|
||||
/// Weight: `O(p)` (though as this is an high-privilege dispatch, we assume it has a
|
||||
/// reasonable value).
|
||||
#[pallet::call_index(16)]
|
||||
#[pallet::weight((T::WeightInfo::blacklist(), DispatchClass::Operational))]
|
||||
pub fn blacklist(
|
||||
origin: OriginFor<T>,
|
||||
@@ -1036,6 +1053,7 @@ pub mod pallet {
|
||||
/// - `prop_index`: The index of the proposal to cancel.
|
||||
///
|
||||
/// Weight: `O(p)` where `p = PublicProps::<T>::decode_len()`
|
||||
#[pallet::call_index(17)]
|
||||
#[pallet::weight(T::WeightInfo::cancel_proposal())]
|
||||
pub fn cancel_proposal(
|
||||
origin: OriginFor<T>,
|
||||
|
||||
Reference in New Issue
Block a user