From 5dec6e5c81bc415da35849a4675bec26e63ed1ae Mon Sep 17 00:00:00 2001 From: Alexander Popiak Date: Sat, 12 Jun 2021 12:43:08 +0200 Subject: [PATCH] make all extrinsics public so they are available from outside (#9078) Co-authored-by: thiolliere --- substrate/frame/assets/src/lib.rs | 46 +++++++++--------- substrate/frame/atomic-swap/src/lib.rs | 6 +-- substrate/frame/balances/src/lib.rs | 2 +- substrate/frame/democracy/src/lib.rs | 48 +++++++++---------- substrate/frame/elections-phragmen/src/lib.rs | 12 ++--- substrate/frame/example/src/lib.rs | 4 +- substrate/frame/grandpa/src/lib.rs | 2 +- substrate/frame/identity/src/lib.rs | 30 ++++++------ substrate/frame/indices/src/lib.rs | 10 ++-- substrate/frame/lottery/src/lib.rs | 8 ++-- substrate/frame/multisig/src/lib.rs | 8 ++-- substrate/frame/nicks/src/lib.rs | 8 ++-- substrate/frame/proxy/src/lib.rs | 20 ++++---- substrate/frame/recovery/src/lib.rs | 18 +++---- substrate/frame/scheduler/src/lib.rs | 12 ++--- substrate/frame/sudo/src/lib.rs | 8 ++-- substrate/frame/support/src/lib.rs | 2 +- substrate/frame/system/src/lib.rs | 14 +++--- substrate/frame/timestamp/src/lib.rs | 2 +- .../frame/transaction-storage/src/lib.rs | 6 +-- substrate/frame/uniques/src/lib.rs | 44 ++++++++--------- 21 files changed, 155 insertions(+), 155 deletions(-) diff --git a/substrate/frame/assets/src/lib.rs b/substrate/frame/assets/src/lib.rs index 333dbad836..afcdb5b054 100644 --- a/substrate/frame/assets/src/lib.rs +++ b/substrate/frame/assets/src/lib.rs @@ -368,7 +368,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::create())] - pub(super) fn create( + pub fn create( origin: OriginFor, #[pallet::compact] id: T::AssetId, admin: ::Source, @@ -424,7 +424,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::force_create())] - pub(super) fn force_create( + pub fn force_create( origin: OriginFor, #[pallet::compact] id: T::AssetId, owner: ::Source, @@ -477,7 +477,7 @@ pub mod pallet { witness.sufficients, witness.approvals, ))] - pub(super) fn destroy( + pub fn destroy( origin: OriginFor, #[pallet::compact] id: T::AssetId, witness: DestroyWitness, @@ -528,7 +528,7 @@ pub mod pallet { /// Weight: `O(1)` /// Modes: Pre-existing balance of `beneficiary`; Account pre-existence of `beneficiary`. #[pallet::weight(T::WeightInfo::mint())] - pub(super) fn mint( + pub fn mint( origin: OriginFor, #[pallet::compact] id: T::AssetId, beneficiary: ::Source, @@ -556,7 +556,7 @@ pub mod pallet { /// Weight: `O(1)` /// Modes: Post-existence of `who`; Pre & post Zombie-status of `who`. #[pallet::weight(T::WeightInfo::burn())] - pub(super) fn burn( + pub fn burn( origin: OriginFor, #[pallet::compact] id: T::AssetId, who: ::Source, @@ -589,7 +589,7 @@ pub mod pallet { /// Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of /// `target`. #[pallet::weight(T::WeightInfo::transfer())] - pub(super) fn transfer( + pub fn transfer( origin: OriginFor, #[pallet::compact] id: T::AssetId, target: ::Source, @@ -625,7 +625,7 @@ pub mod pallet { /// Modes: Pre-existence of `target`; Post-existence of sender; Account pre-existence of /// `target`. #[pallet::weight(T::WeightInfo::transfer_keep_alive())] - pub(super) fn transfer_keep_alive( + pub fn transfer_keep_alive( origin: OriginFor, #[pallet::compact] id: T::AssetId, target: ::Source, @@ -662,7 +662,7 @@ pub mod pallet { /// Modes: Pre-existence of `dest`; Post-existence of `source`; Account pre-existence of /// `dest`. #[pallet::weight(T::WeightInfo::force_transfer())] - pub(super) fn force_transfer( + pub fn force_transfer( origin: OriginFor, #[pallet::compact] id: T::AssetId, source: ::Source, @@ -692,7 +692,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::freeze())] - pub(super) fn freeze( + pub fn freeze( origin: OriginFor, #[pallet::compact] id: T::AssetId, who: ::Source @@ -724,7 +724,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::thaw())] - pub(super) fn thaw( + pub fn thaw( origin: OriginFor, #[pallet::compact] id: T::AssetId, @@ -756,7 +756,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::freeze_asset())] - pub(super) fn freeze_asset( + pub fn freeze_asset( origin: OriginFor, #[pallet::compact] id: T::AssetId ) -> DispatchResult { @@ -783,7 +783,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::thaw_asset())] - pub(super) fn thaw_asset( + pub fn thaw_asset( origin: OriginFor, #[pallet::compact] id: T::AssetId ) -> DispatchResult { @@ -811,7 +811,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::transfer_ownership())] - pub(super) fn transfer_ownership( + pub fn transfer_ownership( origin: OriginFor, #[pallet::compact] id: T::AssetId, owner: ::Source, @@ -852,7 +852,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::set_team())] - pub(super) fn set_team( + pub fn set_team( origin: OriginFor, #[pallet::compact] id: T::AssetId, issuer: ::Source, @@ -894,7 +894,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::set_metadata(name.len() as u32, symbol.len() as u32))] - pub(super) fn set_metadata( + pub fn set_metadata( origin: OriginFor, #[pallet::compact] id: T::AssetId, name: Vec, @@ -957,7 +957,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::clear_metadata())] - pub(super) fn clear_metadata( + pub fn clear_metadata( origin: OriginFor, #[pallet::compact] id: T::AssetId, ) -> DispatchResult { @@ -989,7 +989,7 @@ pub mod pallet { /// /// Weight: `O(N + S)` where N and S are the length of the name and symbol respectively. #[pallet::weight(T::WeightInfo::force_set_metadata(name.len() as u32, symbol.len() as u32))] - pub(super) fn force_set_metadata( + pub fn force_set_metadata( origin: OriginFor, #[pallet::compact] id: T::AssetId, name: Vec, @@ -1037,7 +1037,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::force_clear_metadata())] - pub(super) fn force_clear_metadata( + pub fn force_clear_metadata( origin: OriginFor, #[pallet::compact] id: T::AssetId, ) -> DispatchResult { @@ -1075,7 +1075,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::force_asset_status())] - pub(super) fn force_asset_status( + pub fn force_asset_status( origin: OriginFor, #[pallet::compact] id: T::AssetId, owner: ::Source, @@ -1125,7 +1125,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::approve_transfer())] - pub(super) fn approve_transfer( + pub fn approve_transfer( origin: OriginFor, #[pallet::compact] id: T::AssetId, delegate: ::Source, @@ -1164,7 +1164,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::cancel_approval())] - pub(super) fn cancel_approval( + pub fn cancel_approval( origin: OriginFor, #[pallet::compact] id: T::AssetId, delegate: ::Source, @@ -1192,7 +1192,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::force_cancel_approval())] - pub(super) fn force_cancel_approval( + pub fn force_cancel_approval( origin: OriginFor, #[pallet::compact] id: T::AssetId, owner: ::Source, @@ -1236,7 +1236,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::transfer_approved())] - pub(super) fn transfer_approved( + pub fn transfer_approved( origin: OriginFor, #[pallet::compact] id: T::AssetId, owner: ::Source, diff --git a/substrate/frame/atomic-swap/src/lib.rs b/substrate/frame/atomic-swap/src/lib.rs index afc74dd2a5..4c19a61bb7 100644 --- a/substrate/frame/atomic-swap/src/lib.rs +++ b/substrate/frame/atomic-swap/src/lib.rs @@ -226,7 +226,7 @@ pub mod pallet { /// that the revealer uses a shorter duration than the counterparty, to prevent the /// situation where the revealer reveals the proof too late around the end block. #[pallet::weight(T::DbWeight::get().reads_writes(1, 1).saturating_add(40_000_000))] - pub(crate) fn create_swap( + pub fn create_swap( origin: OriginFor, target: T::AccountId, hashed_proof: HashedProof, @@ -268,7 +268,7 @@ pub mod pallet { .saturating_add((proof.len() as Weight).saturating_mul(100)) .saturating_add(action.weight()) )] - pub(crate) fn claim_swap( + pub fn claim_swap( origin: OriginFor, proof: Vec, action: T::SwapAction, @@ -303,7 +303,7 @@ pub mod pallet { /// - `target`: Target of the original atomic swap. /// - `hashed_proof`: Hashed proof of the original atomic swap. #[pallet::weight(T::DbWeight::get().reads_writes(1, 1).saturating_add(40_000_000))] - pub(crate) fn cancel_swap( + pub fn cancel_swap( origin: OriginFor, target: T::AccountId, hashed_proof: HashedProof, diff --git a/substrate/frame/balances/src/lib.rs b/substrate/frame/balances/src/lib.rs index 105c5d08a6..5dccd7da26 100644 --- a/substrate/frame/balances/src/lib.rs +++ b/substrate/frame/balances/src/lib.rs @@ -291,7 +291,7 @@ pub mod pallet { T::WeightInfo::set_balance_creating() // Creates a new account. .max(T::WeightInfo::set_balance_killing()) // Kills an existing account. )] - pub(super) fn set_balance( + pub fn set_balance( origin: OriginFor, who: ::Source, #[pallet::compact] new_free: T::Balance, diff --git a/substrate/frame/democracy/src/lib.rs b/substrate/frame/democracy/src/lib.rs index 70b943bf00..6ebe917f56 100644 --- a/substrate/frame/democracy/src/lib.rs +++ b/substrate/frame/democracy/src/lib.rs @@ -634,7 +634,7 @@ pub mod pallet { /// /// Weight: `O(p)` #[pallet::weight(T::WeightInfo::propose())] - pub(crate) fn propose( + pub fn propose( origin: OriginFor, proposal_hash: T::Hash, #[pallet::compact] value: BalanceOf, @@ -675,7 +675,7 @@ pub mod pallet { /// /// Weight: `O(S)` where S is the number of seconds a proposal already has. #[pallet::weight(T::WeightInfo::second(*seconds_upper_bound))] - pub(crate) fn second( + pub fn second( origin: OriginFor, #[pallet::compact] proposal: PropIndex, #[pallet::compact] seconds_upper_bound: u32, @@ -706,7 +706,7 @@ pub mod pallet { T::WeightInfo::vote_new(T::MaxVotes::get()) .max(T::WeightInfo::vote_existing(T::MaxVotes::get())) )] - pub(crate) fn vote( + pub fn vote( origin: OriginFor, #[pallet::compact] ref_index: ReferendumIndex, vote: AccountVote>, @@ -724,7 +724,7 @@ pub mod pallet { /// /// Weight: `O(1)`. #[pallet::weight((T::WeightInfo::emergency_cancel(), DispatchClass::Operational))] - pub(crate) fn emergency_cancel(origin: OriginFor, ref_index: ReferendumIndex) -> DispatchResult { + pub fn emergency_cancel(origin: OriginFor, ref_index: ReferendumIndex) -> DispatchResult { T::CancellationOrigin::ensure_origin(origin)?; let status = Self::referendum_status(ref_index)?; @@ -746,7 +746,7 @@ pub mod pallet { /// Weight: `O(V)` with V number of vetoers in the blacklist of proposal. /// Decoding vec of length V. Charged as maximum #[pallet::weight(T::WeightInfo::external_propose(MAX_VETOERS))] - pub(crate) fn external_propose(origin: OriginFor, proposal_hash: T::Hash) -> DispatchResult { + pub fn external_propose(origin: OriginFor, proposal_hash: T::Hash) -> DispatchResult { T::ExternalOrigin::ensure_origin(origin)?; ensure!(!>::exists(), Error::::DuplicateProposal); if let Some((until, _)) = >::get(proposal_hash) { @@ -771,7 +771,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::external_propose_majority())] - pub(crate) fn external_propose_majority( + pub fn external_propose_majority( origin: OriginFor, proposal_hash: T::Hash, ) -> DispatchResult { @@ -792,7 +792,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::external_propose_default())] - pub(crate) fn external_propose_default( + pub fn external_propose_default( origin: OriginFor, proposal_hash: T::Hash, ) -> DispatchResult { @@ -817,7 +817,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::fast_track())] - pub(crate) fn fast_track( + pub fn fast_track( origin: OriginFor, proposal_hash: T::Hash, voting_period: T::BlockNumber, @@ -864,7 +864,7 @@ pub mod pallet { /// /// Weight: `O(V + log(V))` where V is number of `existing vetoers` #[pallet::weight(T::WeightInfo::veto_external(MAX_VETOERS))] - pub(crate) fn veto_external(origin: OriginFor, proposal_hash: T::Hash) -> DispatchResult { + pub fn veto_external(origin: OriginFor, proposal_hash: T::Hash) -> DispatchResult { let who = T::VetoOrigin::ensure_origin(origin)?; if let Some((e_proposal_hash, _)) = >::get() { @@ -896,7 +896,7 @@ pub mod pallet { /// /// # Weight: `O(1)`. #[pallet::weight(T::WeightInfo::cancel_referendum())] - pub(crate) fn cancel_referendum( + pub fn cancel_referendum( origin: OriginFor, #[pallet::compact] ref_index: ReferendumIndex, ) -> DispatchResult { @@ -913,7 +913,7 @@ pub mod pallet { /// /// Weight: `O(D)` where `D` is the items in the dispatch queue. Weighted as `D = 10`. #[pallet::weight((T::WeightInfo::cancel_queued(10), DispatchClass::Operational))] - pub(crate) fn cancel_queued(origin: OriginFor, which: ReferendumIndex) -> DispatchResult { + pub fn cancel_queued(origin: OriginFor, which: ReferendumIndex) -> DispatchResult { ensure_root(origin)?; T::Scheduler::cancel_named((DEMOCRACY_ID, which).encode()) .map_err(|_| Error::::ProposalMissing)?; @@ -970,7 +970,7 @@ pub mod pallet { // 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::weight(T::WeightInfo::undelegate(T::MaxVotes::get().into()))] - pub(crate) fn undelegate(origin: OriginFor) -> DispatchResultWithPostInfo { + pub fn undelegate(origin: OriginFor) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; let votes = Self::try_undelegate(who)?; Ok(Some(T::WeightInfo::undelegate(votes)).into()) @@ -982,7 +982,7 @@ pub mod pallet { /// /// Weight: `O(1)`. #[pallet::weight(T::WeightInfo::clear_public_proposals())] - pub(crate) fn clear_public_proposals(origin: OriginFor) -> DispatchResult { + pub fn clear_public_proposals(origin: OriginFor) -> DispatchResult { ensure_root(origin)?; >::kill(); Ok(()) @@ -999,7 +999,7 @@ pub mod pallet { /// /// Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit). #[pallet::weight(T::WeightInfo::note_preimage(encoded_proposal.len() as u32))] - pub(crate) fn note_preimage(origin: OriginFor, encoded_proposal: Vec) -> DispatchResult { + pub fn note_preimage(origin: OriginFor, encoded_proposal: Vec) -> DispatchResult { Self::note_preimage_inner(ensure_signed(origin)?, encoded_proposal)?; Ok(()) } @@ -1009,7 +1009,7 @@ pub mod pallet { T::WeightInfo::note_preimage(encoded_proposal.len() as u32), DispatchClass::Operational, ))] - pub(crate) fn note_preimage_operational( + pub fn note_preimage_operational( origin: OriginFor, encoded_proposal: Vec, ) -> DispatchResult { @@ -1031,7 +1031,7 @@ pub mod pallet { /// /// Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit). #[pallet::weight(T::WeightInfo::note_imminent_preimage(encoded_proposal.len() as u32))] - pub(crate) fn note_imminent_preimage( + pub fn note_imminent_preimage( origin: OriginFor, encoded_proposal: Vec, ) -> DispatchResultWithPostInfo { @@ -1046,7 +1046,7 @@ pub mod pallet { T::WeightInfo::note_imminent_preimage(encoded_proposal.len() as u32), DispatchClass::Operational, ))] - pub(crate) fn note_imminent_preimage_operational( + pub fn note_imminent_preimage_operational( origin: OriginFor, encoded_proposal: Vec, ) -> DispatchResultWithPostInfo { @@ -1073,7 +1073,7 @@ pub mod pallet { /// /// Weight: `O(D)` where D is length of proposal. #[pallet::weight(T::WeightInfo::reap_preimage(*proposal_len_upper_bound))] - pub(crate) fn reap_preimage( + pub fn reap_preimage( origin: OriginFor, proposal_hash: T::Hash, #[pallet::compact] proposal_len_upper_bound: u32, @@ -1116,7 +1116,7 @@ pub mod pallet { T::WeightInfo::unlock_set(T::MaxVotes::get()) .max(T::WeightInfo::unlock_remove(T::MaxVotes::get())) )] - pub(crate) fn unlock(origin: OriginFor, target: T::AccountId) -> DispatchResult { + pub fn unlock(origin: OriginFor, target: T::AccountId) -> DispatchResult { ensure_signed(origin)?; Self::update_lock(&target); Ok(()) @@ -1150,7 +1150,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::weight(T::WeightInfo::remove_vote(T::MaxVotes::get()))] - pub(crate) fn remove_vote(origin: OriginFor, index: ReferendumIndex) -> DispatchResult { + pub fn remove_vote(origin: OriginFor, index: ReferendumIndex) -> DispatchResult { let who = ensure_signed(origin)?; Self::try_remove_vote(&who, index, UnvoteScope::Any) } @@ -1171,7 +1171,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::weight(T::WeightInfo::remove_other_vote(T::MaxVotes::get()))] - pub(crate) fn remove_other_vote( + pub fn remove_other_vote( origin: OriginFor, target: T::AccountId, index: ReferendumIndex, @@ -1184,7 +1184,7 @@ pub mod pallet { /// Enact a proposal from a referendum. For now we just make the weight be the maximum. #[pallet::weight(T::BlockWeights::get().max_block)] - pub(crate) fn enact_proposal( + pub fn enact_proposal( origin: OriginFor, proposal_hash: T::Hash, index: ReferendumIndex, @@ -1209,7 +1209,7 @@ pub mod pallet { /// Weight: `O(p)` (though as this is an high-privilege dispatch, we assume it has a /// reasonable value). #[pallet::weight((T::WeightInfo::blacklist(T::MaxProposals::get()), DispatchClass::Operational))] - pub(crate) fn blacklist(origin: OriginFor, + pub fn blacklist(origin: OriginFor, proposal_hash: T::Hash, maybe_ref_index: Option, ) -> DispatchResult { @@ -1257,7 +1257,7 @@ pub mod pallet { /// /// Weight: `O(p)` where `p = PublicProps::::decode_len()` #[pallet::weight(T::WeightInfo::cancel_proposal(T::MaxProposals::get()))] - pub(crate) fn cancel_proposal( + pub fn cancel_proposal( origin: OriginFor, #[pallet::compact] prop_index: PropIndex, ) -> DispatchResult { diff --git a/substrate/frame/elections-phragmen/src/lib.rs b/substrate/frame/elections-phragmen/src/lib.rs index 556c57eea5..8a1680633e 100644 --- a/substrate/frame/elections-phragmen/src/lib.rs +++ b/substrate/frame/elections-phragmen/src/lib.rs @@ -286,7 +286,7 @@ pub mod pallet { .max(T::WeightInfo::vote_less(votes.len() as u32)) .max(T::WeightInfo::vote_equal(votes.len() as u32)) )] - pub(crate) fn vote( + pub fn vote( origin: OriginFor, votes: Vec, #[pallet::compact] value: BalanceOf, @@ -349,7 +349,7 @@ pub mod pallet { /// /// The dispatch origin of this call must be signed and be a voter. #[pallet::weight(T::WeightInfo::remove_voter())] - pub(crate) fn remove_voter(origin: OriginFor) -> DispatchResultWithPostInfo { + pub fn remove_voter(origin: OriginFor) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; ensure!(Self::is_voter(&who), Error::::MustBeVoter); Self::do_remove_voter(&who); @@ -372,7 +372,7 @@ pub mod pallet { /// The number of current candidates must be provided as witness data. /// # #[pallet::weight(T::WeightInfo::submit_candidacy(*candidate_count))] - pub(crate) fn submit_candidacy( + pub fn submit_candidacy( origin: OriginFor, #[pallet::compact] candidate_count: u32, ) -> DispatchResultWithPostInfo { @@ -415,7 +415,7 @@ pub mod pallet { Renouncing::Member => T::WeightInfo::renounce_candidacy_members(), Renouncing::RunnerUp => T::WeightInfo::renounce_candidacy_runners_up(), })] - pub(crate) fn renounce_candidacy( + pub fn renounce_candidacy( origin: OriginFor, renouncing: Renouncing, ) -> DispatchResultWithPostInfo { @@ -476,7 +476,7 @@ pub mod pallet { } else { T::BlockWeights::get().max_block })] - pub(crate) fn remove_member( + pub fn remove_member( origin: OriginFor, who: ::Source, has_replacement: bool, @@ -516,7 +516,7 @@ pub mod pallet { /// The total number of voters and those that are defunct must be provided as witness data. /// # #[pallet::weight(T::WeightInfo::clean_defunct_voters(*_num_voters, *_num_defunct))] - pub(crate) fn clean_defunct_voters( + pub fn clean_defunct_voters( origin: OriginFor, _num_voters: u32, _num_defunct: u32, diff --git a/substrate/frame/example/src/lib.rs b/substrate/frame/example/src/lib.rs index fd1bc292ac..f5014b7564 100644 --- a/substrate/frame/example/src/lib.rs +++ b/substrate/frame/example/src/lib.rs @@ -488,7 +488,7 @@ pub mod pallet { #[pallet::weight( ::WeightInfo::accumulate_dummy((*increase_by).saturated_into()) )] - pub(super) fn accumulate_dummy( + pub fn accumulate_dummy( origin: OriginFor, increase_by: T::Balance ) -> DispatchResult { @@ -533,7 +533,7 @@ pub mod pallet { // The weight for this extrinsic we use our own weight object `WeightForSetDummy` to determine // its weight #[pallet::weight(WeightForSetDummy::(>::from(100u32)))] - pub(super) fn set_dummy( + pub fn set_dummy( origin: OriginFor, #[pallet::compact] new_value: T::Balance, ) -> DispatchResult { diff --git a/substrate/frame/grandpa/src/lib.rs b/substrate/frame/grandpa/src/lib.rs index 952e0d6461..28546018a9 100644 --- a/substrate/frame/grandpa/src/lib.rs +++ b/substrate/frame/grandpa/src/lib.rs @@ -214,7 +214,7 @@ pub mod pallet { /// if the block author is defined it will be defined as the equivocation /// reporter. #[pallet::weight(T::WeightInfo::report_equivocation(key_owner_proof.validator_count()))] - pub(super) fn report_equivocation_unsigned( + pub fn report_equivocation_unsigned( origin: OriginFor, equivocation_proof: EquivocationProof, key_owner_proof: T::KeyOwnerProof, diff --git a/substrate/frame/identity/src/lib.rs b/substrate/frame/identity/src/lib.rs index 91b3f3a50f..b71b069ccb 100644 --- a/substrate/frame/identity/src/lib.rs +++ b/substrate/frame/identity/src/lib.rs @@ -549,7 +549,7 @@ pub mod pallet { /// - One event. /// # #[pallet::weight(T::WeightInfo::add_registrar(T::MaxRegistrars::get()))] - pub(super) fn add_registrar(origin: OriginFor, account: T::AccountId) -> DispatchResultWithPostInfo { + pub fn add_registrar(origin: OriginFor, account: T::AccountId) -> DispatchResultWithPostInfo { T::RegistrarOrigin::ensure_origin(origin)?; let (i, registrar_count) = >::try_mutate( @@ -590,7 +590,7 @@ pub mod pallet { T::MaxRegistrars::get().into(), // R T::MaxAdditionalFields::get().into(), // X ))] - pub(super) fn set_identity(origin: OriginFor, info: IdentityInfo) -> DispatchResultWithPostInfo { + pub fn set_identity(origin: OriginFor, info: IdentityInfo) -> DispatchResultWithPostInfo { let sender = ensure_signed(origin)?; let extra_fields = info.additional.len() as u32; ensure!(extra_fields <= T::MaxAdditionalFields::get(), Error::::TooManyFields); @@ -656,7 +656,7 @@ pub mod pallet { #[pallet::weight(T::WeightInfo::set_subs_old(T::MaxSubAccounts::get()) // P: Assume max sub accounts removed. .saturating_add(T::WeightInfo::set_subs_new(subs.len() as u32)) // S: Assume all subs are new. )] - pub(super) fn set_subs(origin: OriginFor, subs: Vec<(T::AccountId, Data)>) -> DispatchResultWithPostInfo { + pub fn set_subs(origin: OriginFor, subs: Vec<(T::AccountId, Data)>) -> DispatchResultWithPostInfo { let sender = ensure_signed(origin)?; ensure!(>::contains_key(&sender), Error::::NotFound); ensure!(subs.len() <= T::MaxSubAccounts::get() as usize, Error::::TooManySubAccounts); @@ -719,7 +719,7 @@ pub mod pallet { T::MaxSubAccounts::get().into(), // S T::MaxAdditionalFields::get().into(), // X ))] - pub(super) fn clear_identity(origin: OriginFor) -> DispatchResultWithPostInfo { + pub fn clear_identity(origin: OriginFor) -> DispatchResultWithPostInfo { let sender = ensure_signed(origin)?; let (subs_deposit, sub_ids) = >::take(&sender); @@ -768,7 +768,7 @@ pub mod pallet { T::MaxRegistrars::get().into(), // R T::MaxAdditionalFields::get().into(), // X ))] - pub(super) fn request_judgement(origin: OriginFor, + pub fn request_judgement(origin: OriginFor, #[pallet::compact] reg_index: RegistrarIndex, #[pallet::compact] max_fee: BalanceOf, ) -> DispatchResultWithPostInfo { @@ -824,7 +824,7 @@ pub mod pallet { T::MaxRegistrars::get().into(), // R T::MaxAdditionalFields::get().into(), // X ))] - pub(super) fn cancel_request(origin: OriginFor, reg_index: RegistrarIndex) -> DispatchResultWithPostInfo { + pub fn cancel_request(origin: OriginFor, reg_index: RegistrarIndex) -> DispatchResultWithPostInfo { let sender = ensure_signed(origin)?; let mut id = >::get(&sender).ok_or(Error::::NoIdentity)?; @@ -864,7 +864,7 @@ pub mod pallet { /// - Benchmark: 7.315 + R * 0.329 µs (min squares analysis) /// # #[pallet::weight(T::WeightInfo::set_fee(T::MaxRegistrars::get()))] // R - pub(super) fn set_fee(origin: OriginFor, + pub fn set_fee(origin: OriginFor, #[pallet::compact] index: RegistrarIndex, #[pallet::compact] fee: BalanceOf, ) -> DispatchResultWithPostInfo { @@ -894,7 +894,7 @@ pub mod pallet { /// - Benchmark: 8.823 + R * 0.32 µs (min squares analysis) /// # #[pallet::weight(T::WeightInfo::set_account_id(T::MaxRegistrars::get()))] // R - pub(super) fn set_account_id(origin: OriginFor, + pub fn set_account_id(origin: OriginFor, #[pallet::compact] index: RegistrarIndex, new: T::AccountId, ) -> DispatchResultWithPostInfo { @@ -924,7 +924,7 @@ pub mod pallet { /// - Benchmark: 7.464 + R * 0.325 µs (min squares analysis) /// # #[pallet::weight(T::WeightInfo::set_fields(T::MaxRegistrars::get()))] // R - pub(super) fn set_fields(origin: OriginFor, + pub fn set_fields(origin: OriginFor, #[pallet::compact] index: RegistrarIndex, fields: IdentityFields, ) -> DispatchResultWithPostInfo { @@ -965,7 +965,7 @@ pub mod pallet { T::MaxRegistrars::get().into(), // R T::MaxAdditionalFields::get().into(), // X ))] - pub(super) fn provide_judgement(origin: OriginFor, + pub fn provide_judgement(origin: OriginFor, #[pallet::compact] reg_index: RegistrarIndex, target: ::Source, judgement: Judgement>, @@ -1026,7 +1026,7 @@ pub mod pallet { T::MaxSubAccounts::get().into(), // S T::MaxAdditionalFields::get().into(), // X ))] - pub(super) fn kill_identity( + pub fn kill_identity( origin: OriginFor, target: ::Source ) -> DispatchResultWithPostInfo { T::ForceOrigin::ensure_origin(origin)?; @@ -1060,7 +1060,7 @@ pub mod pallet { /// The dispatch origin for this call must be _Signed_ and the sender must have a registered /// sub identity of `sub`. #[pallet::weight(T::WeightInfo::add_sub(T::MaxSubAccounts::get()))] - pub(super) fn add_sub(origin: OriginFor, sub: ::Source, data: Data) -> DispatchResult { + pub fn add_sub(origin: OriginFor, sub: ::Source, data: Data) -> DispatchResult { let sender = ensure_signed(origin)?; let sub = T::Lookup::lookup(sub)?; ensure!(IdentityOf::::contains_key(&sender), Error::::NoIdentity); @@ -1088,7 +1088,7 @@ pub mod pallet { /// The dispatch origin for this call must be _Signed_ and the sender must have a registered /// sub identity of `sub`. #[pallet::weight(T::WeightInfo::rename_sub(T::MaxSubAccounts::get()))] - pub(super) fn rename_sub( + pub fn rename_sub( origin: OriginFor, sub: ::Source, data: Data ) -> DispatchResult { let sender = ensure_signed(origin)?; @@ -1107,7 +1107,7 @@ pub mod pallet { /// The dispatch origin for this call must be _Signed_ and the sender must have a registered /// sub identity of `sub`. #[pallet::weight(T::WeightInfo::remove_sub(T::MaxSubAccounts::get()))] - pub(super) fn remove_sub(origin: OriginFor, sub: ::Source) -> DispatchResult { + pub fn remove_sub(origin: OriginFor, sub: ::Source) -> DispatchResult { let sender = ensure_signed(origin)?; ensure!(IdentityOf::::contains_key(&sender), Error::::NoIdentity); let sub = T::Lookup::lookup(sub)?; @@ -1136,7 +1136,7 @@ pub mod pallet { /// NOTE: This should not normally be used, but is provided in the case that the non- /// controller of an account is maliciously registered as a sub-account. #[pallet::weight(T::WeightInfo::quit_sub(T::MaxSubAccounts::get()))] - pub(super) fn quit_sub(origin: OriginFor) -> DispatchResult { + pub fn quit_sub(origin: OriginFor) -> DispatchResult { let sender = ensure_signed(origin)?; let (sup, _) = SuperOf::::take(&sender).ok_or(Error::::NotSub)?; SubsOf::::mutate(&sup, |(ref mut subs_deposit, ref mut sub_ids)| { diff --git a/substrate/frame/indices/src/lib.rs b/substrate/frame/indices/src/lib.rs index 1470e3abe8..778173dbc9 100644 --- a/substrate/frame/indices/src/lib.rs +++ b/substrate/frame/indices/src/lib.rs @@ -90,7 +90,7 @@ pub mod pallet { /// - DB Weight: 1 Read/Write (Accounts) /// # #[pallet::weight(T::WeightInfo::claim())] - pub(crate) fn claim(origin: OriginFor, index: T::AccountIndex) -> DispatchResult { + pub fn claim(origin: OriginFor, index: T::AccountIndex) -> DispatchResult { let who = ensure_signed(origin)?; Accounts::::try_mutate(index, |maybe_value| { @@ -123,7 +123,7 @@ pub mod pallet { /// - Writes: Indices Accounts, System Account (recipient) /// # #[pallet::weight(T::WeightInfo::transfer())] - pub(crate) fn transfer( + pub fn transfer( origin: OriginFor, new: T::AccountId, index: T::AccountIndex, @@ -162,7 +162,7 @@ pub mod pallet { /// - DB Weight: 1 Read/Write (Accounts) /// # #[pallet::weight(T::WeightInfo::free())] - pub(crate) fn free(origin: OriginFor, index: T::AccountIndex) -> DispatchResult { + pub fn free(origin: OriginFor, index: T::AccountIndex) -> DispatchResult { let who = ensure_signed(origin)?; Accounts::::try_mutate(index, |maybe_value| -> DispatchResult { @@ -198,7 +198,7 @@ pub mod pallet { /// - Writes: Indices Accounts, System Account (original owner) /// # #[pallet::weight(T::WeightInfo::force_transfer())] - pub(crate) fn force_transfer( + pub fn force_transfer( origin: OriginFor, new: T::AccountId, index: T::AccountIndex, @@ -234,7 +234,7 @@ pub mod pallet { /// - DB Weight: 1 Read/Write (Accounts) /// # #[pallet::weight(T::WeightInfo::freeze())] - pub(crate) fn freeze(origin: OriginFor, index: T::AccountIndex) -> DispatchResult { + pub fn freeze(origin: OriginFor, index: T::AccountIndex) -> DispatchResult { let who = ensure_signed(origin)?; Accounts::::try_mutate(index, |maybe_value| -> DispatchResult { diff --git a/substrate/frame/lottery/src/lib.rs b/substrate/frame/lottery/src/lib.rs index 5d6940c93b..53cadbf02b 100644 --- a/substrate/frame/lottery/src/lib.rs +++ b/substrate/frame/lottery/src/lib.rs @@ -286,7 +286,7 @@ pub mod pallet { T::WeightInfo::buy_ticket() .saturating_add(call.get_dispatch_info().weight) )] - pub(crate) fn buy_ticket(origin: OriginFor, call: Box<::Call>) -> DispatchResult { + pub fn buy_ticket(origin: OriginFor, call: Box<::Call>) -> DispatchResult { let caller = ensure_signed(origin.clone())?; call.clone().dispatch(origin).map_err(|e| e.error)?; @@ -301,7 +301,7 @@ pub mod pallet { /// /// This extrinsic must be called by the Manager origin. #[pallet::weight(T::WeightInfo::set_calls(calls.len() as u32))] - pub(crate) fn set_calls(origin: OriginFor, calls: Vec<::Call>) -> DispatchResult { + pub fn set_calls(origin: OriginFor, calls: Vec<::Call>) -> DispatchResult { T::ManagerOrigin::ensure_origin(origin)?; ensure!(calls.len() <= T::MaxCalls::get() as usize, Error::::TooManyCalls); if calls.is_empty() { @@ -325,7 +325,7 @@ pub mod pallet { /// * `delay`: How long after the lottery end we should wait before picking a winner. /// * `repeat`: If the lottery should repeat when completed. #[pallet::weight(T::WeightInfo::start_lottery())] - pub(crate) fn start_lottery( + pub fn start_lottery( origin: OriginFor, price: BalanceOf, length: T::BlockNumber, @@ -363,7 +363,7 @@ pub mod pallet { /// /// This extrinsic must be called by the `ManagerOrigin`. #[pallet::weight(T::WeightInfo::stop_repeat())] - pub(crate) fn stop_repeat(origin: OriginFor) -> DispatchResult { + pub fn stop_repeat(origin: OriginFor) -> DispatchResult { T::ManagerOrigin::ensure_origin(origin)?; Lottery::::mutate(|mut lottery| { if let Some(config) = &mut lottery { diff --git a/substrate/frame/multisig/src/lib.rs b/substrate/frame/multisig/src/lib.rs index bbb41e7a92..bc7ce7029a 100644 --- a/substrate/frame/multisig/src/lib.rs +++ b/substrate/frame/multisig/src/lib.rs @@ -245,7 +245,7 @@ pub mod pallet{ dispatch_info.class, ) })] - pub(super) fn as_multi_threshold_1( + pub fn as_multi_threshold_1( origin: OriginFor, other_signatories: Vec, call: Box<::Call>, @@ -335,7 +335,7 @@ pub mod pallet{ .max(T::WeightInfo::as_multi_complete(s, z)) .saturating_add(*max_weight) })] - pub(super) fn as_multi( + pub fn as_multi( origin: OriginFor, threshold: u16, other_signatories: Vec, @@ -392,7 +392,7 @@ pub mod pallet{ .max(T::WeightInfo::approve_as_multi_complete(s)) .saturating_add(*max_weight) })] - pub(super) fn approve_as_multi( + pub fn approve_as_multi( origin: OriginFor, threshold: u16, other_signatories: Vec, @@ -431,7 +431,7 @@ pub mod pallet{ /// - Write: Multisig Storage, [Caller Account], Refund Account, Calls /// # #[pallet::weight(T::WeightInfo::cancel_as_multi(other_signatories.len() as u32))] - pub(super) fn cancel_as_multi( + pub fn cancel_as_multi( origin: OriginFor, threshold: u16, other_signatories: Vec, diff --git a/substrate/frame/nicks/src/lib.rs b/substrate/frame/nicks/src/lib.rs index a76d4506f9..1e0ef90e0a 100644 --- a/substrate/frame/nicks/src/lib.rs +++ b/substrate/frame/nicks/src/lib.rs @@ -138,7 +138,7 @@ pub mod pallet { /// - One event. /// # #[pallet::weight(50_000_000)] - pub(super) fn set_name(origin: OriginFor, name: Vec) -> DispatchResult { + pub fn set_name(origin: OriginFor, name: Vec) -> DispatchResult { let sender = ensure_signed(origin)?; ensure!(name.len() >= T::MinLength::get() as usize, Error::::TooShort); @@ -169,7 +169,7 @@ pub mod pallet { /// - One event. /// # #[pallet::weight(70_000_000)] - pub(super) fn clear_name(origin: OriginFor) -> DispatchResult { + pub fn clear_name(origin: OriginFor) -> DispatchResult { let sender = ensure_signed(origin)?; let deposit = >::take(&sender).ok_or(Error::::Unnamed)?.1; @@ -195,7 +195,7 @@ pub mod pallet { /// - One event. /// # #[pallet::weight(70_000_000)] - pub(super) fn kill_name( + pub fn kill_name( origin: OriginFor, target: ::Source ) -> DispatchResult { @@ -225,7 +225,7 @@ pub mod pallet { /// - One event. /// # #[pallet::weight(70_000_000)] - pub(super) fn force_name( + pub fn force_name( origin: OriginFor, target: ::Source, name: Vec diff --git a/substrate/frame/proxy/src/lib.rs b/substrate/frame/proxy/src/lib.rs index f308dbd289..6e78df2c73 100644 --- a/substrate/frame/proxy/src/lib.rs +++ b/substrate/frame/proxy/src/lib.rs @@ -183,7 +183,7 @@ pub mod pallet { .saturating_add(T::DbWeight::get().reads_writes(1, 1)), di.class) })] - pub(super) fn proxy( + pub fn proxy( origin: OriginFor, real: T::AccountId, force_proxy_type: Option, @@ -212,7 +212,7 @@ pub mod pallet { /// Weight is a function of the number of proxies the user has (P). /// # #[pallet::weight(T::WeightInfo::add_proxy(T::MaxProxies::get().into()))] - pub(super) fn add_proxy( + pub fn add_proxy( origin: OriginFor, delegate: T::AccountId, proxy_type: T::ProxyType, @@ -234,7 +234,7 @@ pub mod pallet { /// Weight is a function of the number of proxies the user has (P). /// # #[pallet::weight(T::WeightInfo::remove_proxy(T::MaxProxies::get().into()))] - pub(super) fn remove_proxy( + pub fn remove_proxy( origin: OriginFor, delegate: T::AccountId, proxy_type: T::ProxyType, @@ -255,7 +255,7 @@ pub mod pallet { /// Weight is a function of the number of proxies the user has (P). /// # #[pallet::weight(T::WeightInfo::remove_proxies(T::MaxProxies::get().into()))] - pub(super) fn remove_proxies(origin: OriginFor) -> DispatchResultWithPostInfo { + pub fn remove_proxies(origin: OriginFor) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; let (_, old_deposit) = Proxies::::take(&who); T::Currency::unreserve(&who, old_deposit); @@ -287,7 +287,7 @@ pub mod pallet { /// # /// TODO: Might be over counting 1 read #[pallet::weight(T::WeightInfo::anonymous(T::MaxProxies::get().into()))] - pub(super) fn anonymous( + pub fn anonymous( origin: OriginFor, proxy_type: T::ProxyType, delay: T::BlockNumber, @@ -337,7 +337,7 @@ pub mod pallet { /// Weight is a function of the number of proxies the user has (P). /// # #[pallet::weight(T::WeightInfo::kill_anonymous(T::MaxProxies::get().into()))] - pub(super) fn kill_anonymous( + pub fn kill_anonymous( origin: OriginFor, spawner: T::AccountId, proxy_type: T::ProxyType, @@ -379,7 +379,7 @@ pub mod pallet { /// - P: the number of proxies the user has. /// # #[pallet::weight(T::WeightInfo::announce(T::MaxPending::get(), T::MaxProxies::get().into()))] - pub(super) fn announce( + pub fn announce( origin: OriginFor, real: T::AccountId, call_hash: CallHashOf @@ -430,7 +430,7 @@ pub mod pallet { #[pallet::weight( T::WeightInfo::remove_announcement(T::MaxPending::get(), T::MaxProxies::get().into()) )] - pub(super) fn remove_announcement( + pub fn remove_announcement( origin: OriginFor, real: T::AccountId, call_hash: CallHashOf @@ -460,7 +460,7 @@ pub mod pallet { #[pallet::weight( T::WeightInfo::reject_announcement(T::MaxPending::get(), T::MaxProxies::get().into()) )] - pub(super) fn reject_announcement( + pub fn reject_announcement( origin: OriginFor, delegate: T::AccountId, call_hash: CallHashOf @@ -496,7 +496,7 @@ pub mod pallet { .saturating_add(T::DbWeight::get().reads_writes(1, 1)), di.class) })] - pub(super) fn proxy_announced( + pub fn proxy_announced( origin: OriginFor, delegate: T::AccountId, real: T::AccountId, diff --git a/substrate/frame/recovery/src/lib.rs b/substrate/frame/recovery/src/lib.rs index 7802f26d1d..6f5c7ebcb6 100644 --- a/substrate/frame/recovery/src/lib.rs +++ b/substrate/frame/recovery/src/lib.rs @@ -362,7 +362,7 @@ pub mod pallet { dispatch_info.class, ) })] - pub(crate) fn as_recovered( + pub fn as_recovered( origin: OriginFor, account: T::AccountId, call: Box<::Call> @@ -389,7 +389,7 @@ pub mod pallet { /// - One event /// # #[pallet::weight(30_000_000)] - pub(crate) fn set_recovered( + pub fn set_recovered( origin: OriginFor, lost: T::AccountId, rescuer: T::AccountId, @@ -429,7 +429,7 @@ pub mod pallet { /// Total Complexity: O(F + X) /// # #[pallet::weight(100_000_000)] - pub(crate) fn create_recovery( + pub fn create_recovery( origin: OriginFor, friends: Vec, threshold: u16, @@ -491,7 +491,7 @@ pub mod pallet { /// Total Complexity: O(F + X) /// # #[pallet::weight(100_000_000)] - pub(crate) fn initiate_recovery(origin: OriginFor, account: T::AccountId) -> DispatchResult { + pub fn initiate_recovery(origin: OriginFor, account: T::AccountId) -> DispatchResult { let who = ensure_signed(origin)?; // Check that the account is recoverable ensure!(>::contains_key(&account), Error::::NotRecoverable); @@ -538,7 +538,7 @@ pub mod pallet { /// Total Complexity: O(F + logF + V + logV) /// # #[pallet::weight(100_000_000)] - pub(crate) fn vouch_recovery( + pub fn vouch_recovery( origin: OriginFor, lost: T::AccountId, rescuer: T::AccountId @@ -582,7 +582,7 @@ pub mod pallet { /// Total Complexity: O(F + V) /// # #[pallet::weight(100_000_000)] - pub(crate) fn claim_recovery(origin: OriginFor, account: T::AccountId) -> DispatchResult { + pub fn claim_recovery(origin: OriginFor, account: T::AccountId) -> DispatchResult { let who = ensure_signed(origin)?; // Get the recovery configuration for the lost account let recovery_config = Self::recovery_config(&account).ok_or(Error::::NotRecoverable)?; @@ -628,7 +628,7 @@ pub mod pallet { /// Total Complexity: O(V + X) /// # #[pallet::weight(30_000_000)] - pub(crate) fn close_recovery(origin: OriginFor, rescuer: T::AccountId) -> DispatchResult { + pub fn close_recovery(origin: OriginFor, rescuer: T::AccountId) -> DispatchResult { let who = ensure_signed(origin)?; // Take the active recovery process started by the rescuer for this account. let active_recovery = >::take(&who, &rescuer).ok_or(Error::::NotStarted)?; @@ -662,7 +662,7 @@ pub mod pallet { /// Total Complexity: O(F + X) /// # #[pallet::weight(30_000_000)] - pub(crate) fn remove_recovery(origin: OriginFor) -> DispatchResult { + pub fn remove_recovery(origin: OriginFor) -> DispatchResult { let who = ensure_signed(origin)?; // Check there are no active recoveries let mut active_recoveries = >::iter_prefix_values(&who); @@ -688,7 +688,7 @@ pub mod pallet { /// - One storage mutation to check account is recovered by `who`. O(1) /// # #[pallet::weight(30_000_000)] - pub(crate) fn cancel_recovered(origin: OriginFor, account: T::AccountId) -> DispatchResult { + pub fn cancel_recovered(origin: OriginFor, account: T::AccountId) -> DispatchResult { let who = ensure_signed(origin)?; // Check `who` is allowed to make a call on behalf of `account` ensure!(Self::proxy(&who) == Some(account), Error::::NotAllowed); diff --git a/substrate/frame/scheduler/src/lib.rs b/substrate/frame/scheduler/src/lib.rs index 006ab5a0f2..950bbde8bc 100644 --- a/substrate/frame/scheduler/src/lib.rs +++ b/substrate/frame/scheduler/src/lib.rs @@ -346,7 +346,7 @@ pub mod pallet { /// - Will use base weight of 25 which should be good for up to 30 scheduled calls /// # #[pallet::weight(::WeightInfo::schedule(T::MaxScheduledPerBlock::get()))] - pub(crate) fn schedule( + pub fn schedule( origin: OriginFor, when: T::BlockNumber, maybe_periodic: Option>, @@ -376,7 +376,7 @@ pub mod pallet { /// - Will use base weight of 100 which should be good for up to 30 scheduled calls /// # #[pallet::weight(::WeightInfo::cancel(T::MaxScheduledPerBlock::get()))] - pub(crate) fn cancel(origin: OriginFor, when: T::BlockNumber, index: u32) -> DispatchResult { + pub fn cancel(origin: OriginFor, when: T::BlockNumber, index: u32) -> DispatchResult { T::ScheduleOrigin::ensure_origin(origin.clone())?; let origin = ::Origin::from(origin); Self::do_cancel(Some(origin.caller().clone()), (when, index))?; @@ -394,7 +394,7 @@ pub mod pallet { /// - Will use base weight of 35 which should be good for more than 30 scheduled calls /// # #[pallet::weight(::WeightInfo::schedule_named(T::MaxScheduledPerBlock::get()))] - pub(crate) fn schedule_named( + pub fn schedule_named( origin: OriginFor, id: Vec, when: T::BlockNumber, @@ -426,7 +426,7 @@ pub mod pallet { /// - Will use base weight of 100 which should be good for up to 30 scheduled calls /// # #[pallet::weight(::WeightInfo::cancel_named(T::MaxScheduledPerBlock::get()))] - pub(crate) fn cancel_named(origin: OriginFor, id: Vec) -> DispatchResult { + pub fn cancel_named(origin: OriginFor, id: Vec) -> DispatchResult { T::ScheduleOrigin::ensure_origin(origin.clone())?; let origin = ::Origin::from(origin); Self::do_cancel_named(Some(origin.caller().clone()), id)?; @@ -439,7 +439,7 @@ pub mod pallet { /// Same as [`schedule`]. /// # #[pallet::weight(::WeightInfo::schedule(T::MaxScheduledPerBlock::get()))] - pub(crate) fn schedule_after( + pub fn schedule_after( origin: OriginFor, after: T::BlockNumber, maybe_periodic: Option>, @@ -464,7 +464,7 @@ pub mod pallet { /// Same as [`schedule_named`]. /// # #[pallet::weight(::WeightInfo::schedule_named(T::MaxScheduledPerBlock::get()))] - pub(crate) fn schedule_named_after( + pub fn schedule_named_after( origin: OriginFor, id: Vec, after: T::BlockNumber, diff --git a/substrate/frame/sudo/src/lib.rs b/substrate/frame/sudo/src/lib.rs index 51cc1df050..6f70ddda99 100644 --- a/substrate/frame/sudo/src/lib.rs +++ b/substrate/frame/sudo/src/lib.rs @@ -144,7 +144,7 @@ pub mod pallet { let dispatch_info = call.get_dispatch_info(); (dispatch_info.weight.saturating_add(10_000), dispatch_info.class) })] - pub(crate) fn sudo( + pub fn sudo( origin: OriginFor, call: Box<::Call>, ) -> DispatchResultWithPostInfo { @@ -169,7 +169,7 @@ pub mod pallet { /// - The weight of this call is defined by the caller. /// # #[pallet::weight((*_weight, call.get_dispatch_info().class))] - pub(crate) fn sudo_unchecked_weight( + pub fn sudo_unchecked_weight( origin: OriginFor, call: Box<::Call>, _weight: Weight, @@ -194,7 +194,7 @@ pub mod pallet { /// - One DB change. /// # #[pallet::weight(0)] - pub(crate) fn set_key( + pub fn set_key( origin: OriginFor, new: ::Source, ) -> DispatchResultWithPostInfo { @@ -230,7 +230,7 @@ pub mod pallet { dispatch_info.class, ) })] - pub(crate) fn sudo_as( + pub fn sudo_as( origin: OriginFor, who: ::Source, call: Box<::Call> diff --git a/substrate/frame/support/src/lib.rs b/substrate/frame/support/src/lib.rs index 4e830c2669..1d4d7e4618 100644 --- a/substrate/frame/support/src/lib.rs +++ b/substrate/frame/support/src/lib.rs @@ -2071,7 +2071,7 @@ pub mod pallet_prelude { /// impl, I: 'static> Pallet { /// /// Doc comment put in metadata /// #[pallet::weight(0)] -/// fn toto(origin: OriginFor, #[pallet::compact] _foo: u32) -> DispatchResultWithPostInfo { +/// pub fn toto(origin: OriginFor, #[pallet::compact] _foo: u32) -> DispatchResultWithPostInfo { /// let _ = origin; /// unimplemented!(); /// } diff --git a/substrate/frame/system/src/lib.rs b/substrate/frame/system/src/lib.rs index f0597ea2fe..e3a110f2e7 100644 --- a/substrate/frame/system/src/lib.rs +++ b/substrate/frame/system/src/lib.rs @@ -301,7 +301,7 @@ pub mod pallet { // TODO: This should only be available for testing, rather than in general usage, but // that's not possible at present (since it's within the pallet macro). #[pallet::weight(*_ratio * T::BlockWeights::get().max_block)] - pub(crate) fn fill_block(origin: OriginFor, _ratio: Perbill) -> DispatchResultWithPostInfo { + pub fn fill_block(origin: OriginFor, _ratio: Perbill) -> DispatchResultWithPostInfo { ensure_root(origin)?; Ok(().into()) } @@ -312,7 +312,7 @@ pub mod pallet { /// - `O(1)` /// # #[pallet::weight(T::SystemWeightInfo::remark(_remark.len() as u32))] - pub(crate) fn remark(origin: OriginFor, _remark: Vec) -> DispatchResultWithPostInfo { + pub fn remark(origin: OriginFor, _remark: Vec) -> DispatchResultWithPostInfo { ensure_signed(origin)?; Ok(().into()) } @@ -326,7 +326,7 @@ pub mod pallet { /// - 1 write to HEAP_PAGES /// # #[pallet::weight((T::SystemWeightInfo::set_heap_pages(), DispatchClass::Operational))] - pub(crate) fn set_heap_pages(origin: OriginFor, pages: u64) -> DispatchResultWithPostInfo { + pub fn set_heap_pages(origin: OriginFor, pages: u64) -> DispatchResultWithPostInfo { ensure_root(origin)?; storage::unhashed::put_raw(well_known_keys::HEAP_PAGES, &pages.encode()); Ok(().into()) @@ -414,7 +414,7 @@ pub mod pallet { T::SystemWeightInfo::set_storage(items.len() as u32), DispatchClass::Operational, ))] - pub(crate) fn set_storage(origin: OriginFor, items: Vec) -> DispatchResultWithPostInfo { + pub fn set_storage(origin: OriginFor, items: Vec) -> DispatchResultWithPostInfo { ensure_root(origin)?; for i in &items { storage::unhashed::put_raw(&i.0, &i.1); @@ -434,7 +434,7 @@ pub mod pallet { T::SystemWeightInfo::kill_storage(keys.len() as u32), DispatchClass::Operational, ))] - pub(crate) fn kill_storage(origin: OriginFor, keys: Vec) -> DispatchResultWithPostInfo { + pub fn kill_storage(origin: OriginFor, keys: Vec) -> DispatchResultWithPostInfo { ensure_root(origin)?; for key in &keys { storage::unhashed::kill(&key); @@ -457,7 +457,7 @@ pub mod pallet { T::SystemWeightInfo::kill_prefix(_subkeys.saturating_add(1)), DispatchClass::Operational, ))] - pub(crate) fn kill_prefix( + pub fn kill_prefix( origin: OriginFor, prefix: Key, _subkeys: u32, @@ -474,7 +474,7 @@ pub mod pallet { /// - 1 event. /// # #[pallet::weight(T::SystemWeightInfo::remark_with_event(remark.len() as u32))] - pub(crate) fn remark_with_event(origin: OriginFor, remark: Vec) -> DispatchResultWithPostInfo { + pub fn remark_with_event(origin: OriginFor, remark: Vec) -> DispatchResultWithPostInfo { let who = ensure_signed(origin)?; let hash = T::Hashing::hash(&remark[..]); Self::deposit_event(Event::Remarked(who, hash)); diff --git a/substrate/frame/timestamp/src/lib.rs b/substrate/frame/timestamp/src/lib.rs index 3315fadb1c..f7dd7378d8 100644 --- a/substrate/frame/timestamp/src/lib.rs +++ b/substrate/frame/timestamp/src/lib.rs @@ -184,7 +184,7 @@ pub mod pallet { T::WeightInfo::set(), DispatchClass::Mandatory ))] - pub(super) fn set(origin: OriginFor, #[pallet::compact] now: T::Moment) -> DispatchResult { + pub fn set(origin: OriginFor, #[pallet::compact] now: T::Moment) -> DispatchResult { ensure_none(origin)?; assert!(!DidUpdate::::exists(), "Timestamp must be updated only once in the block"); let prev = Self::now(); diff --git a/substrate/frame/transaction-storage/src/lib.rs b/substrate/frame/transaction-storage/src/lib.rs index ef824a8399..97dfd76fe6 100644 --- a/substrate/frame/transaction-storage/src/lib.rs +++ b/substrate/frame/transaction-storage/src/lib.rs @@ -174,7 +174,7 @@ pub mod pallet { /// Additionally contains a DB write. /// # #[pallet::weight(T::WeightInfo::store(data.len() as u32))] - pub(super) fn store( + pub fn store( origin: OriginFor, data: Vec, ) -> DispatchResult { @@ -220,7 +220,7 @@ pub mod pallet { /// - Constant. /// # #[pallet::weight(T::WeightInfo::renew())] - pub(super) fn renew( + pub fn renew( origin: OriginFor, block: T::BlockNumber, index: u32, @@ -261,7 +261,7 @@ pub mod pallet { /// Here we assume a maximum of 100 probed transactions. /// # #[pallet::weight((T::WeightInfo::check_proof_max(), DispatchClass::Mandatory))] - pub(super) fn check_proof( + pub fn check_proof( origin: OriginFor, proof: TransactionStorageProof, ) -> DispatchResultWithPostInfo { diff --git a/substrate/frame/uniques/src/lib.rs b/substrate/frame/uniques/src/lib.rs index f4a0228de4..28518843c9 100644 --- a/substrate/frame/uniques/src/lib.rs +++ b/substrate/frame/uniques/src/lib.rs @@ -297,7 +297,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::create())] - pub(super) fn create( + pub fn create( origin: OriginFor, #[pallet::compact] class: T::ClassId, admin: ::Source, @@ -346,7 +346,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::force_create())] - pub(super) fn force_create( + pub fn force_create( origin: OriginFor, #[pallet::compact] class: T::ClassId, owner: ::Source, @@ -396,7 +396,7 @@ pub mod pallet { witness.instance_metadatas, witness.attributes, ))] - pub(super) fn destroy( + pub fn destroy( origin: OriginFor, #[pallet::compact] class: T::ClassId, witness: DestroyWitness, @@ -441,7 +441,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::mint())] - pub(super) fn mint( + pub fn mint( origin: OriginFor, #[pallet::compact] class: T::ClassId, #[pallet::compact] instance: T::InstanceId, @@ -470,7 +470,7 @@ pub mod pallet { /// Weight: `O(1)` /// Modes: `check_owner.is_some()`. #[pallet::weight(T::WeightInfo::burn())] - pub(super) fn burn( + pub fn burn( origin: OriginFor, #[pallet::compact] class: T::ClassId, #[pallet::compact] instance: T::InstanceId, @@ -503,7 +503,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::transfer())] - pub(super) fn transfer( + pub fn transfer( origin: OriginFor, #[pallet::compact] class: T::ClassId, #[pallet::compact] instance: T::InstanceId, @@ -539,7 +539,7 @@ pub mod pallet { /// /// Weight: `O(instances.len())` #[pallet::weight(T::WeightInfo::redeposit(instances.len() as u32))] - pub(super) fn redeposit( + pub fn redeposit( origin: OriginFor, #[pallet::compact] class: T::ClassId, instances: Vec, @@ -595,7 +595,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::freeze())] - pub(super) fn freeze( + pub fn freeze( origin: OriginFor, #[pallet::compact] class: T::ClassId, #[pallet::compact] instance: T::InstanceId, @@ -625,7 +625,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::thaw())] - pub(super) fn thaw( + pub fn thaw( origin: OriginFor, #[pallet::compact] class: T::ClassId, #[pallet::compact] instance: T::InstanceId, @@ -654,7 +654,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::freeze_class())] - pub(super) fn freeze_class( + pub fn freeze_class( origin: OriginFor, #[pallet::compact] class: T::ClassId ) -> DispatchResult { @@ -681,7 +681,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::thaw_class())] - pub(super) fn thaw_class( + pub fn thaw_class( origin: OriginFor, #[pallet::compact] class: T::ClassId ) -> DispatchResult { @@ -709,7 +709,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::transfer_ownership())] - pub(super) fn transfer_ownership( + pub fn transfer_ownership( origin: OriginFor, #[pallet::compact] class: T::ClassId, owner: ::Source, @@ -751,7 +751,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::set_team())] - pub(super) fn set_team( + pub fn set_team( origin: OriginFor, #[pallet::compact] class: T::ClassId, issuer: ::Source, @@ -788,7 +788,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::approve_transfer())] - pub(super) fn approve_transfer( + pub fn approve_transfer( origin: OriginFor, #[pallet::compact] class: T::ClassId, #[pallet::compact] instance: T::InstanceId, @@ -835,7 +835,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::cancel_approval())] - pub(super) fn cancel_approval( + pub fn cancel_approval( origin: OriginFor, #[pallet::compact] class: T::ClassId, #[pallet::compact] instance: T::InstanceId, @@ -882,7 +882,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::force_asset_status())] - pub(super) fn force_asset_status( + pub fn force_asset_status( origin: OriginFor, #[pallet::compact] class: T::ClassId, owner: ::Source, @@ -927,7 +927,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::set_attribute())] - pub(super) fn set_attribute( + pub fn set_attribute( origin: OriginFor, #[pallet::compact] class: T::ClassId, maybe_instance: Option, @@ -992,7 +992,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::clear_attribute())] - pub(super) fn clear_attribute( + pub fn clear_attribute( origin: OriginFor, #[pallet::compact] class: T::ClassId, maybe_instance: Option, @@ -1041,7 +1041,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::set_metadata())] - pub(super) fn set_metadata( + pub fn set_metadata( origin: OriginFor, #[pallet::compact] class: T::ClassId, #[pallet::compact] instance: T::InstanceId, @@ -1107,7 +1107,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::clear_metadata())] - pub(super) fn clear_metadata( + pub fn clear_metadata( origin: OriginFor, #[pallet::compact] class: T::ClassId, #[pallet::compact] instance: T::InstanceId, @@ -1156,7 +1156,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::set_class_metadata())] - pub(super) fn set_class_metadata( + pub fn set_class_metadata( origin: OriginFor, #[pallet::compact] class: T::ClassId, data: BoundedVec, @@ -1216,7 +1216,7 @@ pub mod pallet { /// /// Weight: `O(1)` #[pallet::weight(T::WeightInfo::clear_class_metadata())] - pub(super) fn clear_class_metadata( + pub fn clear_class_metadata( origin: OriginFor, #[pallet::compact] class: T::ClassId, ) -> DispatchResult {