diff --git a/nodes/parachain/src/command.rs b/nodes/parachain/src/command.rs index e7afa9198..9c8635b74 100644 --- a/nodes/parachain/src/command.rs +++ b/nodes/parachain/src/command.rs @@ -341,8 +341,7 @@ pub fn run() -> Result<()> { "Compile with --features=runtime-benchmarks \ to enable storage benchmarks." .into(), - ) - .into()), + )), #[cfg(feature = "runtime-benchmarks")] (BenchmarkCmd::Storage(cmd), "spiritnet") => runner.sync_run(|config| { let partials = new_partial::( diff --git a/nodes/parachain/src/service.rs b/nodes/parachain/src/service.rs index 49911826a..173cf9aef 100644 --- a/nodes/parachain/src/service.rs +++ b/nodes/parachain/src/service.rs @@ -222,7 +222,7 @@ async fn build_relay_chain_interface( collator_options: CollatorOptions, hwbench: Option, ) -> RelayChainResult<(Arc<(dyn RelayChainInterface + 'static)>, Option)> { - if collator_options.relay_chain_rpc_urls.len() > 0 { + if !collator_options.relay_chain_rpc_urls.is_empty() { build_minimal_relay_chain_node(polkadot_config, task_manager, collator_options.relay_chain_rpc_urls).await } else { build_inprocess_relay_chain( diff --git a/pallets/attestation/src/lib.rs b/pallets/attestation/src/lib.rs index e4fd04995..7d89ea55c 100644 --- a/pallets/attestation/src/lib.rs +++ b/pallets/attestation/src/lib.rs @@ -230,6 +230,7 @@ pub mod pallet { /// DelegatedAttestations /// - Writes: Attestations, (DelegatedAttestations) /// # + #[pallet::call_index(0)] #[pallet::weight( ::WeightInfo::add() .saturating_add(authorization.as_ref().map(|ac| ac.can_attest_weight()).unwrap_or(Weight::zero())) @@ -303,6 +304,7 @@ pub mod pallet { /// - Reads per delegation step P: delegation::Delegations /// - Writes: Attestations, DelegatedAttestations /// # + #[pallet::call_index(1)] #[pallet::weight( ::WeightInfo::revoke() .saturating_add(authorization.as_ref().map(|ac| ac.can_revoke_weight()).unwrap_or(Weight::zero())) @@ -362,6 +364,7 @@ pub mod pallet { /// - Reads per delegation step P: delegation::Delegations /// - Writes: Attestations, DelegatedAttestations /// # + #[pallet::call_index(2)] #[pallet::weight( ::WeightInfo::remove() .saturating_add(authorization.as_ref().map(|ac| ac.can_remove_weight()).unwrap_or(Weight::zero())) @@ -405,6 +408,7 @@ pub mod pallet { /// - Reads: [Origin Account], Attestations, DelegatedAttestations /// - Writes: Attestations, DelegatedAttestations /// # + #[pallet::call_index(3)] #[pallet::weight(::WeightInfo::reclaim_deposit())] pub fn reclaim_deposit(origin: OriginFor, claim_hash: ClaimHashOf) -> DispatchResult { let who = ensure_signed(origin)?; @@ -429,6 +433,7 @@ pub mod pallet { /// /// The subject of the call must be the attester who issues the /// attestation. The sender of the call will be the new deposit owner. + #[pallet::call_index(4)] #[pallet::weight(::WeightInfo::change_deposit_owner())] pub fn change_deposit_owner(origin: OriginFor, claim_hash: ClaimHashOf) -> DispatchResult { let source = ::EnsureOrigin::ensure_origin(origin)?; @@ -446,6 +451,7 @@ pub mod pallet { /// Updates the deposit amount to the current deposit rate. /// /// The sender must be the deposit owner. + #[pallet::call_index(5)] #[pallet::weight(::WeightInfo::update_deposit())] pub fn update_deposit(origin: OriginFor, claim_hash: ClaimHashOf) -> DispatchResult { let sender = ensure_signed(origin)?; diff --git a/pallets/ctype/src/lib.rs b/pallets/ctype/src/lib.rs index 05c898563..4328e6e96 100644 --- a/pallets/ctype/src/lib.rs +++ b/pallets/ctype/src/lib.rs @@ -142,6 +142,7 @@ pub mod pallet { /// - Reads: Ctypes, Balance /// - Writes: Ctypes, Balance /// # + #[pallet::call_index(0)] #[pallet::weight(::WeightInfo::add(ctype.len().saturated_into()))] pub fn add(origin: OriginFor, ctype: Vec) -> DispatchResult { let source = ::EnsureOrigin::ensure_origin(origin)?; diff --git a/pallets/delegation/src/lib.rs b/pallets/delegation/src/lib.rs index 5a6f91234..1c5848501 100644 --- a/pallets/delegation/src/lib.rs +++ b/pallets/delegation/src/lib.rs @@ -313,6 +313,7 @@ pub mod pallet { /// - Reads: [Origin Account], Roots, CTypes /// - Writes: Roots /// # + #[pallet::call_index(0)] #[pallet::weight(::WeightInfo::create_hierarchy())] pub fn create_hierarchy( origin: OriginFor, @@ -380,6 +381,7 @@ pub mod pallet { /// - Reads: [Origin Account], Roots, Delegations /// - Writes: Delegations /// # + #[pallet::call_index(1)] #[pallet::weight( ::WeightInfo::add_delegation() .saturating_add(DelegationSignatureVerificationOf::::weight(T::Hash::max_encoded_len())) @@ -489,6 +491,7 @@ pub mod pallet { /// - Reads: [Origin Account], Roots, C * Delegations, C * Children. /// - Writes: Roots, C * Delegations /// # + #[pallet::call_index(2)] #[pallet::weight( ::WeightInfo::revoke_delegation_root_child(*max_revocations, *max_parent_checks) .max(::WeightInfo::revoke_delegation_leaf(*max_revocations, *max_parent_checks)))] @@ -565,6 +568,7 @@ pub mod pallet { /// - Reads: [Origin Account], Roots, C * Delegations, C * Children. /// - Writes: Roots, 2 * C * Delegations /// # + #[pallet::call_index(3)] #[pallet::weight(::WeightInfo::remove_delegation(*max_removals))] pub fn remove_delegation( origin: OriginFor, @@ -620,6 +624,7 @@ pub mod pallet { /// - Reads: [Origin Account], Roots, C * Delegations, C * Children. /// - Writes: Roots, 2 * C * Delegations /// # + #[pallet::call_index(4)] #[pallet::weight(::WeightInfo::reclaim_deposit(*max_removals))] pub fn reclaim_deposit( origin: OriginFor, @@ -658,6 +663,7 @@ pub mod pallet { /// /// The subject of the call must be the owner of the delegation node. /// The sender of the call will be the new deposit owner. + #[pallet::call_index(5)] #[pallet::weight(::WeightInfo::change_deposit_owner())] pub fn change_deposit_owner(origin: OriginFor, delegation_id: DelegationNodeIdOf) -> DispatchResult { let source = ::EnsureOrigin::ensure_origin(origin)?; @@ -674,6 +680,7 @@ pub mod pallet { /// Updates the deposit amount to the current deposit rate. /// /// The sender must be the deposit owner. + #[pallet::call_index(6)] #[pallet::weight(::WeightInfo::update_deposit())] pub fn update_deposit(origin: OriginFor, delegation_id: DelegationNodeIdOf) -> DispatchResult { let sender = ensure_signed(origin)?; diff --git a/pallets/did/src/lib.rs b/pallets/did/src/lib.rs index fd210d64a..54a60f852 100644 --- a/pallets/did/src/lib.rs +++ b/pallets/did/src/lib.rs @@ -495,6 +495,7 @@ pub mod pallet { /// - Writes: Did (with K new key agreement keys), ServiceEndpoints /// (with N new service endpoints), DidEndpointsCount /// # + #[pallet::call_index(0)] #[pallet::weight({ let new_key_agreement_keys = details.new_key_agreement_keys.len().saturated_into::(); // We only consider the number of new endpoints. @@ -601,6 +602,7 @@ pub mod pallet { /// - Reads: [Origin Account], Did /// - Writes: Did /// # + #[pallet::call_index(1)] #[pallet::weight(::WeightInfo::set_ed25519_authentication_key().max(::WeightInfo::set_sr25519_authentication_key()).max(::WeightInfo::set_ecdsa_authentication_key()))] pub fn set_authentication_key(origin: OriginFor, new_key: DidVerificationKey) -> DispatchResult { let did_subject = T::EnsureOrigin::ensure_origin(origin)?.subject(); @@ -641,6 +643,7 @@ pub mod pallet { /// - Reads: [Origin Account], Did /// - Writes: Did /// # + #[pallet::call_index(2)] #[pallet::weight(::WeightInfo::set_ed25519_delegation_key().max(::WeightInfo::set_sr25519_delegation_key()).max(::WeightInfo::set_ecdsa_delegation_key()))] pub fn set_delegation_key(origin: OriginFor, new_key: DidVerificationKey) -> DispatchResult { let did_subject = T::EnsureOrigin::ensure_origin(origin)?.subject(); @@ -675,6 +678,7 @@ pub mod pallet { /// - Reads: [Origin Account], Did /// - Writes: Did /// # + #[pallet::call_index(3)] #[pallet::weight(::WeightInfo::remove_ed25519_delegation_key().max(::WeightInfo::remove_sr25519_delegation_key()).max(::WeightInfo::remove_ecdsa_delegation_key()))] pub fn remove_delegation_key(origin: OriginFor) -> DispatchResult { let did_subject = T::EnsureOrigin::ensure_origin(origin)?.subject(); @@ -708,6 +712,7 @@ pub mod pallet { /// - Reads: [Origin Account], Did /// - Writes: Did /// # + #[pallet::call_index(4)] #[pallet::weight(::WeightInfo::set_ed25519_attestation_key().max(::WeightInfo::set_sr25519_attestation_key()).max(::WeightInfo::set_ecdsa_attestation_key()))] pub fn set_attestation_key(origin: OriginFor, new_key: DidVerificationKey) -> DispatchResult { let did_subject = T::EnsureOrigin::ensure_origin(origin)?.subject(); @@ -742,6 +747,7 @@ pub mod pallet { /// - Reads: [Origin Account], Did /// - Writes: Did /// # + #[pallet::call_index(5)] #[pallet::weight(::WeightInfo::remove_ed25519_attestation_key().max(::WeightInfo::remove_sr25519_attestation_key()).max(::WeightInfo::remove_ecdsa_attestation_key()))] pub fn remove_attestation_key(origin: OriginFor) -> DispatchResult { let did_subject = T::EnsureOrigin::ensure_origin(origin)?.subject(); @@ -773,6 +779,7 @@ pub mod pallet { /// - Reads: [Origin Account], Did /// - Writes: Did /// # + #[pallet::call_index(6)] #[pallet::weight(::WeightInfo::add_ed25519_key_agreement_key().max(::WeightInfo::add_sr25519_key_agreement_key()).max(::WeightInfo::add_ecdsa_key_agreement_key()))] pub fn add_key_agreement_key(origin: OriginFor, new_key: DidEncryptionKey) -> DispatchResult { let did_subject = T::EnsureOrigin::ensure_origin(origin)?.subject(); @@ -805,6 +812,7 @@ pub mod pallet { /// - Reads: [Origin Account], Did /// - Writes: Did /// # + #[pallet::call_index(7)] #[pallet::weight(::WeightInfo::remove_ed25519_key_agreement_key().max(::WeightInfo::remove_sr25519_key_agreement_key()).max(::WeightInfo::remove_ecdsa_key_agreement_key()))] pub fn remove_key_agreement_key(origin: OriginFor, key_id: KeyIdOf) -> DispatchResult { let did_subject = T::EnsureOrigin::ensure_origin(origin)?.subject(); @@ -834,6 +842,7 @@ pub mod pallet { /// - Reads: [Origin Account], Did, ServiceEndpoints, DidEndpointsCount /// - Writes: Did, ServiceEndpoints, DidEndpointsCount /// # + #[pallet::call_index(8)] #[pallet::weight(::WeightInfo::add_service_endpoint())] pub fn add_service_endpoint(origin: OriginFor, service_endpoint: DidEndpoint) -> DispatchResult { let did_subject = T::EnsureOrigin::ensure_origin(origin)?.subject(); @@ -883,6 +892,7 @@ pub mod pallet { /// - Reads: [Origin Account], ServiceEndpoints, DidEndpointsCount /// - Writes: Did, ServiceEndpoints, DidEndpointsCount /// # + #[pallet::call_index(9)] #[pallet::weight(::WeightInfo::remove_service_endpoint())] pub fn remove_service_endpoint(origin: OriginFor, service_id: ServiceEndpointId) -> DispatchResult { let did_subject = T::EnsureOrigin::ensure_origin(origin)?.subject(); @@ -933,6 +943,7 @@ pub mod pallet { /// - Reads: [Origin Account], Did /// - Kills: Did entry associated to the DID identifier /// # + #[pallet::call_index(10)] #[pallet::weight(::WeightInfo::delete(*endpoints_to_remove))] pub fn delete(origin: OriginFor, endpoints_to_remove: u32) -> DispatchResult { let source = T::EnsureOrigin::ensure_origin(origin)?; @@ -962,6 +973,7 @@ pub mod pallet { /// - Reads: [Origin Account], Did /// - Kills: Did entry associated to the DID identifier /// # + #[pallet::call_index(11)] #[pallet::weight(::WeightInfo::reclaim_deposit(*endpoints_to_remove))] pub fn reclaim_deposit( origin: OriginFor, @@ -1012,6 +1024,7 @@ pub mod pallet { /// - Writes: Did /// # #[allow(clippy::boxed_local)] + #[pallet::call_index(12)] #[pallet::weight({ let di = did_call.call.get_dispatch_info(); let max_sig_weight = ::WeightInfo::submit_did_call_ed25519_key() @@ -1078,6 +1091,7 @@ pub mod pallet { /// /// The subject of the call must be the did owner. /// The sender of the call will be the new deposit owner. + #[pallet::call_index(13)] #[pallet::weight(::WeightInfo::change_deposit_owner())] pub fn change_deposit_owner(origin: OriginFor) -> DispatchResult { let source = ::EnsureOrigin::ensure_origin(origin)?; @@ -1092,6 +1106,7 @@ pub mod pallet { /// Updates the deposit amount to the current deposit rate. /// /// The sender must be the deposit owner. + #[pallet::call_index(14)] #[pallet::weight(::WeightInfo::update_deposit())] pub fn update_deposit(origin: OriginFor, did: DidIdentifierOf) -> DispatchResult { let sender = ensure_signed(origin)?; diff --git a/pallets/pallet-did-lookup/src/lib.rs b/pallets/pallet-did-lookup/src/lib.rs index aedbf57ad..9d2b85bbf 100644 --- a/pallets/pallet-did-lookup/src/lib.rs +++ b/pallets/pallet-did-lookup/src/lib.rs @@ -174,6 +174,7 @@ pub mod pallet { /// - Reads: ConnectedDids + ConnectedAccounts + DID Origin Check /// - Writes: ConnectedDids + ConnectedAccounts /// # + #[pallet::call_index(0)] #[pallet::weight( ::WeightInfo::associate_account_multisig_sr25519().max( ::WeightInfo::associate_account_multisig_ed25519().max( @@ -223,6 +224,7 @@ pub mod pallet { /// - Reads: ConnectedDids + ConnectedAccounts + DID Origin Check /// - Writes: ConnectedDids + ConnectedAccounts /// # + #[pallet::call_index(1)] #[pallet::weight(::WeightInfo::associate_sender())] pub fn associate_sender(origin: OriginFor) -> DispatchResult { let source = ::EnsureOrigin::ensure_origin(origin)?; @@ -249,6 +251,7 @@ pub mod pallet { /// - Reads: ConnectedDids + ConnectedAccounts + DID Origin Check /// - Writes: ConnectedDids + ConnectedAccounts /// # + #[pallet::call_index(2)] #[pallet::weight(::WeightInfo::remove_sender_association())] pub fn remove_sender_association(origin: OriginFor) -> DispatchResult { let who = ensure_signed(origin)?; @@ -267,6 +270,7 @@ pub mod pallet { /// - Reads: ConnectedDids + ConnectedAccounts + DID Origin Check /// - Writes: ConnectedDids + ConnectedAccounts /// # + #[pallet::call_index(3)] #[pallet::weight(::WeightInfo::remove_account_association())] pub fn remove_account_association(origin: OriginFor, account: LinkableAccountId) -> DispatchResult { let source = ::EnsureOrigin::ensure_origin(origin)?; @@ -288,6 +292,7 @@ pub mod pallet { /// - Reads: ConnectedDids /// - Writes: ConnectedDids /// # + #[pallet::call_index(4)] #[pallet::weight(::WeightInfo::remove_sender_association())] pub fn reclaim_deposit(origin: OriginFor, account: LinkableAccountId) -> DispatchResult { let who = ensure_signed(origin)?; @@ -304,6 +309,7 @@ pub mod pallet { /// /// The subject of the call must be linked to the account. /// The sender of the call will be the new deposit owner. + #[pallet::call_index(5)] #[pallet::weight(::WeightInfo::change_deposit_owner())] pub fn change_deposit_owner(origin: OriginFor, account: LinkableAccountId) -> DispatchResult { let source = ::EnsureOrigin::ensure_origin(origin)?; @@ -318,6 +324,7 @@ pub mod pallet { /// Updates the deposit amount to the current deposit rate. /// /// The sender must be the deposit owner. + #[pallet::call_index(6)] #[pallet::weight(::WeightInfo::update_deposit())] pub fn update_deposit(origin: OriginFor, account: LinkableAccountId) -> DispatchResult { let source = ensure_signed(origin)?; diff --git a/pallets/pallet-web3-names/src/lib.rs b/pallets/pallet-web3-names/src/lib.rs index 447d7205c..f6792a90e 100644 --- a/pallets/pallet-web3-names/src/lib.rs +++ b/pallets/pallet-web3-names/src/lib.rs @@ -196,6 +196,7 @@ pub mod pallet { /// check + origin check /// - Writes: Names, Owner storage entries + currency deposit reserve /// # + #[pallet::call_index(0)] #[pallet::weight(::WeightInfo::claim(name.len().saturated_into()))] pub fn claim(origin: OriginFor, name: Web3NameInput) -> DispatchResult { let origin = T::OwnerOrigin::ensure_origin(origin)?; @@ -227,6 +228,7 @@ pub mod pallet { /// - Reads: Names storage entry + origin check /// - Writes: Names, Owner storage entries + currency deposit release /// # + #[pallet::call_index(1)] #[pallet::weight(::WeightInfo::release_by_owner())] pub fn release_by_owner(origin: OriginFor) -> DispatchResult { let origin = T::OwnerOrigin::ensure_origin(origin)?; @@ -257,6 +259,7 @@ pub mod pallet { /// - Reads: Owner storage entry + origin check /// - Writes: Names, Owner storage entries + currency deposit release /// # + #[pallet::call_index(2)] #[pallet::weight(::WeightInfo::reclaim_deposit(name.len().saturated_into()))] pub fn reclaim_deposit(origin: OriginFor, name: Web3NameInput) -> DispatchResult { let caller = ensure_signed(origin)?; @@ -290,6 +293,7 @@ pub mod pallet { /// - Writes: Names, Owner, Banned storage entries + currency deposit /// release /// # + #[pallet::call_index(3)] #[pallet::weight(::WeightInfo::ban(name.len().saturated_into()))] pub fn ban(origin: OriginFor, name: Web3NameInput) -> DispatchResult { T::BanOrigin::ensure_origin(origin)?; @@ -322,6 +326,7 @@ pub mod pallet { /// - Reads: Banned storage entry + origin check /// - Writes: Banned storage entry deposit release /// # + #[pallet::call_index(4)] #[pallet::weight(::WeightInfo::unban(name.len().saturated_into()))] pub fn unban(origin: OriginFor, name: Web3NameInput) -> DispatchResult { T::BanOrigin::ensure_origin(origin)?; @@ -343,6 +348,7 @@ pub mod pallet { /// /// The subject of the call must be the owner of the web3name. /// The sender of the call will be the new deposit owner. + #[pallet::call_index(5)] #[pallet::weight(::WeightInfo::change_deposit_owner())] pub fn change_deposit_owner(origin: OriginFor) -> DispatchResult { let source = ::OwnerOrigin::ensure_origin(origin)?; @@ -356,6 +362,7 @@ pub mod pallet { /// Updates the deposit amount to the current deposit rate. /// /// The sender must be the deposit owner. + #[pallet::call_index(6)] #[pallet::weight(::WeightInfo::update_deposit())] pub fn update_deposit(origin: OriginFor, name_input: Web3NameInput) -> DispatchResult { let source = ensure_signed(origin)?; diff --git a/pallets/parachain-staking/src/lib.rs b/pallets/parachain-staking/src/lib.rs index 64e401af3..950a0038c 100644 --- a/pallets/parachain-staking/src/lib.rs +++ b/pallets/parachain-staking/src/lib.rs @@ -715,6 +715,7 @@ pub mod pallet { /// ShouldEndSession<_>>::should_end_session. /// /// The dispatch origin must be Root. + #[pallet::call_index(0)] #[pallet::weight(::WeightInfo::force_new_round())] pub fn force_new_round(origin: OriginFor) -> DispatchResult { ensure_root(origin)?; @@ -742,6 +743,7 @@ pub mod pallet { /// The dispatch origin must be Root. /// /// Emits `RoundInflationSet`. + #[pallet::call_index(1)] #[pallet::weight(::WeightInfo::set_inflation(T::MaxTopCandidates::get(), T::MaxDelegatorsPerCollator::get()))] pub fn set_inflation( origin: OriginFor, @@ -775,6 +777,7 @@ pub mod pallet { /// The dispatch origin must be Root. /// /// Emits `MaxSelectedCandidatesSet`. + #[pallet::call_index(2)] #[pallet::weight(::WeightInfo::set_max_selected_candidates( *new, T::MaxDelegatorsPerCollator::get() @@ -843,6 +846,7 @@ pub mod pallet { /// The dispatch origin must be Root. /// /// Emits `BlocksPerRoundSet`. + #[pallet::call_index(3)] #[pallet::weight(::WeightInfo::set_blocks_per_round())] pub fn set_blocks_per_round(origin: OriginFor, new: T::BlockNumber) -> DispatchResult { ensure_root(origin)?; @@ -872,6 +876,7 @@ pub mod pallet { /// The dispatch origin must be Root. /// /// Emits `MaxCandidateStakeChanged`. + #[pallet::call_index(4)] #[pallet::weight(::WeightInfo::set_max_candidate_stake())] pub fn set_max_candidate_stake(origin: OriginFor, new: BalanceOf) -> DispatchResult { ensure_root(origin)?; @@ -900,6 +905,7 @@ pub mod pallet { /// Increments rewards of candidate and their delegators. /// /// Emits `CandidateRemoved`. + #[pallet::call_index(5)] #[pallet::weight(::WeightInfo::force_remove_candidate( T::MaxTopCandidates::get(), T::MaxDelegatorsPerCollator::get() @@ -965,6 +971,7 @@ pub mod pallet { /// candidates nor of the delegators set. /// /// Emits `JoinedCollatorCandidates`. + #[pallet::call_index(6)] #[pallet::weight(::WeightInfo::join_candidates( T::MaxTopCandidates::get(), T::MaxDelegatorsPerCollator::get() @@ -1038,6 +1045,7 @@ pub mod pallet { /// rewards, until the end of the next session. /// /// Emits `CollatorScheduledExit`. + #[pallet::call_index(7)] #[pallet::weight(::WeightInfo::init_leave_candidates( T::MaxTopCandidates::get(), T::MaxTopCandidates::get().saturating_mul(T::MaxDelegatorsPerCollator::get()) @@ -1100,6 +1108,7 @@ pub mod pallet { /// `MaxTopCandidates`. /// /// Emits `CollatorLeft`. + #[pallet::call_index(8)] #[pallet::weight(::WeightInfo::execute_leave_candidates( T::MaxTopCandidates::get(), T::MaxDelegatorsPerCollator::get(), @@ -1139,6 +1148,7 @@ pub mod pallet { /// `init_leave_candidates`. /// /// Emits `CollatorCanceledExit`. + #[pallet::call_index(9)] #[pallet::weight(::WeightInfo::cancel_leave_candidates( T::MaxTopCandidates::get(), T::MaxDelegatorsPerCollator::get(), @@ -1186,6 +1196,7 @@ pub mod pallet { /// allowed range as set in the pallet's configuration. /// /// Emits `CollatorStakedMore`. + #[pallet::call_index(10)] #[pallet::weight(::WeightInfo::candidate_stake_more( T::MaxTopCandidates::get(), T::MaxDelegatorsPerCollator::get(), @@ -1255,6 +1266,7 @@ pub mod pallet { /// allowed range as set in the pallet's configuration. /// /// Emits `CollatorStakedLess`. + #[pallet::call_index(11)] #[pallet::weight(::WeightInfo::candidate_stake_less( T::MaxTopCandidates::get(), T::MaxDelegatorsPerCollator::get() @@ -1329,6 +1341,7 @@ pub mod pallet { /// Emits `DelegationReplaced` if the candidate has /// `MaxDelegatorsPerCollator` many delegations but this delegator /// staked more than one of the other delegators of this candidate. + #[pallet::call_index(12)] #[pallet::weight(::WeightInfo::join_delegators( T::MaxTopCandidates::get(), T::MaxDelegatorsPerCollator::get() @@ -1454,6 +1467,7 @@ pub mod pallet { /// the current delegation. /// /// Emits `DelegatorLeft`. + #[pallet::call_index(13)] #[pallet::weight(::WeightInfo::leave_delegators( T::MaxTopCandidates::get(), T::MaxDelegatorsPerCollator::get() @@ -1482,6 +1496,7 @@ pub mod pallet { /// collator candidate to be added to it. /// /// Emits `DelegatorStakedMore`. + #[pallet::call_index(14)] #[pallet::weight(::WeightInfo::delegator_stake_more( T::MaxTopCandidates::get(), T::MaxDelegatorsPerCollator::get(), @@ -1557,6 +1572,7 @@ pub mod pallet { /// allowed range as set in the pallet's configuration. /// /// Emits `DelegatorStakedLess`. + #[pallet::call_index(15)] #[pallet::weight(::WeightInfo::delegator_stake_less( T::MaxTopCandidates::get(), T::MaxDelegatorsPerCollator::get() @@ -1629,6 +1645,7 @@ pub mod pallet { /// - Writes: Unstaking, Locks /// - Kills: Unstaking & Locks if no balance is locked anymore /// # + #[pallet::call_index(16)] #[pallet::weight(::WeightInfo::unlock_unstaked( T::MaxUnstakeRequests::get().saturated_into::() ))] @@ -1659,6 +1676,7 @@ pub mod pallet { /// for anyone. /// /// Emits `Rewarded`. + #[pallet::call_index(17)] #[pallet::weight(::WeightInfo::claim_rewards())] pub fn claim_rewards(origin: OriginFor) -> DispatchResult { let target = ensure_signed(origin)?; @@ -1681,6 +1699,7 @@ pub mod pallet { /// network. /// /// The dispatch origin must be a collator. + #[pallet::call_index(18)] #[pallet::weight(::WeightInfo::increment_collator_rewards())] pub fn increment_collator_rewards(origin: OriginFor) -> DispatchResult { let collator = ensure_signed(origin)?; @@ -1698,6 +1717,7 @@ pub mod pallet { /// delegations. /// /// The dispatch origin must be a delegator. + #[pallet::call_index(19)] #[pallet::weight(::WeightInfo::increment_delegator_rewards())] pub fn increment_delegator_rewards(origin: OriginFor) -> DispatchResult { let delegator = ensure_signed(origin)?; @@ -1720,6 +1740,7 @@ pub mod pallet { /// too early. /// /// Emits `RoundInflationSet`. + #[pallet::call_index(20)] #[pallet::weight(::WeightInfo::execute_scheduled_reward_change(T::MaxTopCandidates::get(), T::MaxDelegatorsPerCollator::get()))] pub fn execute_scheduled_reward_change(origin: OriginFor) -> DispatchResultWithPostInfo { ensure_signed(origin)?; diff --git a/pallets/public-credentials/src/lib.rs b/pallets/public-credentials/src/lib.rs index 33796119b..226269d5a 100644 --- a/pallets/public-credentials/src/lib.rs +++ b/pallets/public-credentials/src/lib.rs @@ -238,6 +238,7 @@ pub mod pallet { /// /// Emits `CredentialStored`. #[allow(clippy::boxed_local)] + #[pallet::call_index(0)] #[pallet::weight({ let xt_weight = ::WeightInfo::add(credential.claims.len().saturated_into::()); let ac_weight = credential.authorization.as_ref().map(|ac| ac.can_issue_weight()).unwrap_or(Weight::zero()); @@ -325,6 +326,7 @@ pub mod pallet { /// The dispatch origin must be authorized to revoke the credential. /// /// Emits `CredentialRevoked`. + #[pallet::call_index(1)] #[pallet::weight({ let xt_weight = ::WeightInfo::revoke(); let ac_weight = authorization.as_ref().map(|ac| ac.can_revoke_weight()).unwrap_or(Weight::zero()); @@ -363,6 +365,7 @@ pub mod pallet { /// credential. /// /// Emits `CredentialUnrevoked`. + #[pallet::call_index(2)] #[pallet::weight({ let xt_weight = ::WeightInfo::unrevoke(); let ac_weight = authorization.as_ref().map(|ac| ac.can_unrevoke_weight()).unwrap_or(Weight::zero()); @@ -409,6 +412,7 @@ pub mod pallet { /// The dispatch origin must be authorized to remove the credential. /// /// Emits `CredentialRemoved`. + #[pallet::call_index(3)] #[pallet::weight({ let xt_weight = ::WeightInfo::remove(); let ac_weight = authorization.as_ref().map(|ac| ac.can_remove_weight()).unwrap_or(Weight::zero()); @@ -467,6 +471,7 @@ pub mod pallet { /// credential's attester. /// /// Emits `CredentialRemoved`. + #[pallet::call_index(4)] #[pallet::weight(::WeightInfo::reclaim_deposit())] pub fn reclaim_deposit(origin: OriginFor, credential_id: CredentialIdOf) -> DispatchResult { let submitter = ensure_signed(origin)?; @@ -489,6 +494,7 @@ pub mod pallet { /// /// The subject of the call must be the owner of the credential. /// The sender of the call will be the new deposit owner. + #[pallet::call_index(5)] #[pallet::weight(::WeightInfo::change_deposit_owner())] pub fn change_deposit_owner(origin: OriginFor, credential_id: CredentialIdOf) -> DispatchResult { let source = ::EnsureOrigin::ensure_origin(origin)?; @@ -506,6 +512,7 @@ pub mod pallet { /// Updates the deposit amount to the current deposit rate. /// /// The sender must be the deposit owner. + #[pallet::call_index(6)] #[pallet::weight(::WeightInfo::update_deposit())] pub fn update_deposit(origin: OriginFor, credential_id: CredentialIdOf) -> DispatchResult { let source = ensure_signed(origin)?;