make all extrinsics public so they are available from outside (#9078)

Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
Alexander Popiak
2021-06-12 12:43:08 +02:00
committed by GitHub
parent ad5b8afa6e
commit 5dec6e5c81
21 changed files with 155 additions and 155 deletions
+23 -23
View File
@@ -368,7 +368,7 @@ pub mod pallet {
///
/// Weight: `O(1)`
#[pallet::weight(T::WeightInfo::create())]
pub(super) fn create(
pub fn create(
origin: OriginFor<T>,
#[pallet::compact] id: T::AssetId,
admin: <T::Lookup as StaticLookup>::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<T>,
#[pallet::compact] id: T::AssetId,
owner: <T::Lookup as StaticLookup>::Source,
@@ -477,7 +477,7 @@ pub mod pallet {
witness.sufficients,
witness.approvals,
))]
pub(super) fn destroy(
pub fn destroy(
origin: OriginFor<T>,
#[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<T>,
#[pallet::compact] id: T::AssetId,
beneficiary: <T::Lookup as StaticLookup>::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<T>,
#[pallet::compact] id: T::AssetId,
who: <T::Lookup as StaticLookup>::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<T>,
#[pallet::compact] id: T::AssetId,
target: <T::Lookup as StaticLookup>::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<T>,
#[pallet::compact] id: T::AssetId,
target: <T::Lookup as StaticLookup>::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<T>,
#[pallet::compact] id: T::AssetId,
source: <T::Lookup as StaticLookup>::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<T>,
#[pallet::compact] id: T::AssetId,
who: <T::Lookup as StaticLookup>::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<T>,
#[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<T>,
#[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<T>,
#[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<T>,
#[pallet::compact] id: T::AssetId,
owner: <T::Lookup as StaticLookup>::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<T>,
#[pallet::compact] id: T::AssetId,
issuer: <T::Lookup as StaticLookup>::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<T>,
#[pallet::compact] id: T::AssetId,
name: Vec<u8>,
@@ -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<T>,
#[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<T>,
#[pallet::compact] id: T::AssetId,
name: Vec<u8>,
@@ -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<T>,
#[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<T>,
#[pallet::compact] id: T::AssetId,
owner: <T::Lookup as StaticLookup>::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<T>,
#[pallet::compact] id: T::AssetId,
delegate: <T::Lookup as StaticLookup>::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<T>,
#[pallet::compact] id: T::AssetId,
delegate: <T::Lookup as StaticLookup>::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<T>,
#[pallet::compact] id: T::AssetId,
owner: <T::Lookup as StaticLookup>::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<T>,
#[pallet::compact] id: T::AssetId,
owner: <T::Lookup as StaticLookup>::Source,
+3 -3
View File
@@ -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<T>,
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<T>,
proof: Vec<u8>,
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<T>,
target: T::AccountId,
hashed_proof: HashedProof,
+1 -1
View File
@@ -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<T>,
who: <T::Lookup as StaticLookup>::Source,
#[pallet::compact] new_free: T::Balance,
+24 -24
View File
@@ -634,7 +634,7 @@ pub mod pallet {
///
/// Weight: `O(p)`
#[pallet::weight(T::WeightInfo::propose())]
pub(crate) fn propose(
pub fn propose(
origin: OriginFor<T>,
proposal_hash: T::Hash,
#[pallet::compact] value: BalanceOf<T>,
@@ -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<T>,
#[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<T>,
#[pallet::compact] ref_index: ReferendumIndex,
vote: AccountVote<BalanceOf<T>>,
@@ -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<T>, ref_index: ReferendumIndex) -> DispatchResult {
pub fn emergency_cancel(origin: OriginFor<T>, 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<T>, proposal_hash: T::Hash) -> DispatchResult {
pub fn external_propose(origin: OriginFor<T>, proposal_hash: T::Hash) -> DispatchResult {
T::ExternalOrigin::ensure_origin(origin)?;
ensure!(!<NextExternal<T>>::exists(), Error::<T>::DuplicateProposal);
if let Some((until, _)) = <Blacklist<T>>::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<T>,
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<T>,
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<T>,
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<T>, proposal_hash: T::Hash) -> DispatchResult {
pub fn veto_external(origin: OriginFor<T>, proposal_hash: T::Hash) -> DispatchResult {
let who = T::VetoOrigin::ensure_origin(origin)?;
if let Some((e_proposal_hash, _)) = <NextExternal<T>>::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<T>,
#[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<T>, which: ReferendumIndex) -> DispatchResult {
pub fn cancel_queued(origin: OriginFor<T>, which: ReferendumIndex) -> DispatchResult {
ensure_root(origin)?;
T::Scheduler::cancel_named((DEMOCRACY_ID, which).encode())
.map_err(|_| Error::<T>::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<T>) -> DispatchResultWithPostInfo {
pub fn undelegate(origin: OriginFor<T>) -> 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<T>) -> DispatchResult {
pub fn clear_public_proposals(origin: OriginFor<T>) -> DispatchResult {
ensure_root(origin)?;
<PublicProps<T>>::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<T>, encoded_proposal: Vec<u8>) -> DispatchResult {
pub fn note_preimage(origin: OriginFor<T>, encoded_proposal: Vec<u8>) -> 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<T>,
encoded_proposal: Vec<u8>,
) -> 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<T>,
encoded_proposal: Vec<u8>,
) -> 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<T>,
encoded_proposal: Vec<u8>,
) -> 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<T>,
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<T>, target: T::AccountId) -> DispatchResult {
pub fn unlock(origin: OriginFor<T>, 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<T>, index: ReferendumIndex) -> DispatchResult {
pub fn remove_vote(origin: OriginFor<T>, 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<T>,
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<T>,
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<T>,
pub fn blacklist(origin: OriginFor<T>,
proposal_hash: T::Hash,
maybe_ref_index: Option<ReferendumIndex>,
) -> DispatchResult {
@@ -1257,7 +1257,7 @@ pub mod pallet {
///
/// Weight: `O(p)` where `p = PublicProps::<T>::decode_len()`
#[pallet::weight(T::WeightInfo::cancel_proposal(T::MaxProposals::get()))]
pub(crate) fn cancel_proposal(
pub fn cancel_proposal(
origin: OriginFor<T>,
#[pallet::compact] prop_index: PropIndex,
) -> DispatchResult {
@@ -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<T>,
votes: Vec<T::AccountId>,
#[pallet::compact] value: BalanceOf<T>,
@@ -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<T>) -> DispatchResultWithPostInfo {
pub fn remove_voter(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
let who = ensure_signed(origin)?;
ensure!(Self::is_voter(&who), Error::<T>::MustBeVoter);
Self::do_remove_voter(&who);
@@ -372,7 +372,7 @@ pub mod pallet {
/// The number of current candidates must be provided as witness data.
/// # </weight>
#[pallet::weight(T::WeightInfo::submit_candidacy(*candidate_count))]
pub(crate) fn submit_candidacy(
pub fn submit_candidacy(
origin: OriginFor<T>,
#[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<T>,
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<T>,
who: <T::Lookup as StaticLookup>::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.
/// # </weight>
#[pallet::weight(T::WeightInfo::clean_defunct_voters(*_num_voters, *_num_defunct))]
pub(crate) fn clean_defunct_voters(
pub fn clean_defunct_voters(
origin: OriginFor<T>,
_num_voters: u32,
_num_defunct: u32,
+2 -2
View File
@@ -488,7 +488,7 @@ pub mod pallet {
#[pallet::weight(
<T as pallet::Config>::WeightInfo::accumulate_dummy((*increase_by).saturated_into())
)]
pub(super) fn accumulate_dummy(
pub fn accumulate_dummy(
origin: OriginFor<T>,
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::<T>(<BalanceOf<T>>::from(100u32)))]
pub(super) fn set_dummy(
pub fn set_dummy(
origin: OriginFor<T>,
#[pallet::compact] new_value: T::Balance,
) -> DispatchResult {
+1 -1
View File
@@ -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<T>,
equivocation_proof: EquivocationProof<T::Hash, T::BlockNumber>,
key_owner_proof: T::KeyOwnerProof,
+15 -15
View File
@@ -549,7 +549,7 @@ pub mod pallet {
/// - One event.
/// # </weight>
#[pallet::weight(T::WeightInfo::add_registrar(T::MaxRegistrars::get()))]
pub(super) fn add_registrar(origin: OriginFor<T>, account: T::AccountId) -> DispatchResultWithPostInfo {
pub fn add_registrar(origin: OriginFor<T>, account: T::AccountId) -> DispatchResultWithPostInfo {
T::RegistrarOrigin::ensure_origin(origin)?;
let (i, registrar_count) = <Registrars<T>>::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<T>, info: IdentityInfo) -> DispatchResultWithPostInfo {
pub fn set_identity(origin: OriginFor<T>, info: IdentityInfo) -> DispatchResultWithPostInfo {
let sender = ensure_signed(origin)?;
let extra_fields = info.additional.len() as u32;
ensure!(extra_fields <= T::MaxAdditionalFields::get(), Error::<T>::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<T>, subs: Vec<(T::AccountId, Data)>) -> DispatchResultWithPostInfo {
pub fn set_subs(origin: OriginFor<T>, subs: Vec<(T::AccountId, Data)>) -> DispatchResultWithPostInfo {
let sender = ensure_signed(origin)?;
ensure!(<IdentityOf<T>>::contains_key(&sender), Error::<T>::NotFound);
ensure!(subs.len() <= T::MaxSubAccounts::get() as usize, Error::<T>::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<T>) -> DispatchResultWithPostInfo {
pub fn clear_identity(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
let sender = ensure_signed(origin)?;
let (subs_deposit, sub_ids) = <SubsOf<T>>::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<T>,
pub fn request_judgement(origin: OriginFor<T>,
#[pallet::compact] reg_index: RegistrarIndex,
#[pallet::compact] max_fee: BalanceOf<T>,
) -> 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<T>, reg_index: RegistrarIndex) -> DispatchResultWithPostInfo {
pub fn cancel_request(origin: OriginFor<T>, reg_index: RegistrarIndex) -> DispatchResultWithPostInfo {
let sender = ensure_signed(origin)?;
let mut id = <IdentityOf<T>>::get(&sender).ok_or(Error::<T>::NoIdentity)?;
@@ -864,7 +864,7 @@ pub mod pallet {
/// - Benchmark: 7.315 + R * 0.329 µs (min squares analysis)
/// # </weight>
#[pallet::weight(T::WeightInfo::set_fee(T::MaxRegistrars::get()))] // R
pub(super) fn set_fee(origin: OriginFor<T>,
pub fn set_fee(origin: OriginFor<T>,
#[pallet::compact] index: RegistrarIndex,
#[pallet::compact] fee: BalanceOf<T>,
) -> DispatchResultWithPostInfo {
@@ -894,7 +894,7 @@ pub mod pallet {
/// - Benchmark: 8.823 + R * 0.32 µs (min squares analysis)
/// # </weight>
#[pallet::weight(T::WeightInfo::set_account_id(T::MaxRegistrars::get()))] // R
pub(super) fn set_account_id(origin: OriginFor<T>,
pub fn set_account_id(origin: OriginFor<T>,
#[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)
/// # </weight>
#[pallet::weight(T::WeightInfo::set_fields(T::MaxRegistrars::get()))] // R
pub(super) fn set_fields(origin: OriginFor<T>,
pub fn set_fields(origin: OriginFor<T>,
#[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<T>,
pub fn provide_judgement(origin: OriginFor<T>,
#[pallet::compact] reg_index: RegistrarIndex,
target: <T::Lookup as StaticLookup>::Source,
judgement: Judgement<BalanceOf<T>>,
@@ -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<T>, target: <T::Lookup as StaticLookup>::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<T>, sub: <T::Lookup as StaticLookup>::Source, data: Data) -> DispatchResult {
pub fn add_sub(origin: OriginFor<T>, sub: <T::Lookup as StaticLookup>::Source, data: Data) -> DispatchResult {
let sender = ensure_signed(origin)?;
let sub = T::Lookup::lookup(sub)?;
ensure!(IdentityOf::<T>::contains_key(&sender), Error::<T>::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<T>, sub: <T::Lookup as StaticLookup>::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<T>, sub: <T::Lookup as StaticLookup>::Source) -> DispatchResult {
pub fn remove_sub(origin: OriginFor<T>, sub: <T::Lookup as StaticLookup>::Source) -> DispatchResult {
let sender = ensure_signed(origin)?;
ensure!(IdentityOf::<T>::contains_key(&sender), Error::<T>::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<T>) -> DispatchResult {
pub fn quit_sub(origin: OriginFor<T>) -> DispatchResult {
let sender = ensure_signed(origin)?;
let (sup, _) = SuperOf::<T>::take(&sender).ok_or(Error::<T>::NotSub)?;
SubsOf::<T>::mutate(&sup, |(ref mut subs_deposit, ref mut sub_ids)| {
+5 -5
View File
@@ -90,7 +90,7 @@ pub mod pallet {
/// - DB Weight: 1 Read/Write (Accounts)
/// # </weight>
#[pallet::weight(T::WeightInfo::claim())]
pub(crate) fn claim(origin: OriginFor<T>, index: T::AccountIndex) -> DispatchResult {
pub fn claim(origin: OriginFor<T>, index: T::AccountIndex) -> DispatchResult {
let who = ensure_signed(origin)?;
Accounts::<T>::try_mutate(index, |maybe_value| {
@@ -123,7 +123,7 @@ pub mod pallet {
/// - Writes: Indices Accounts, System Account (recipient)
/// # </weight>
#[pallet::weight(T::WeightInfo::transfer())]
pub(crate) fn transfer(
pub fn transfer(
origin: OriginFor<T>,
new: T::AccountId,
index: T::AccountIndex,
@@ -162,7 +162,7 @@ pub mod pallet {
/// - DB Weight: 1 Read/Write (Accounts)
/// # </weight>
#[pallet::weight(T::WeightInfo::free())]
pub(crate) fn free(origin: OriginFor<T>, index: T::AccountIndex) -> DispatchResult {
pub fn free(origin: OriginFor<T>, index: T::AccountIndex) -> DispatchResult {
let who = ensure_signed(origin)?;
Accounts::<T>::try_mutate(index, |maybe_value| -> DispatchResult {
@@ -198,7 +198,7 @@ pub mod pallet {
/// - Writes: Indices Accounts, System Account (original owner)
/// # </weight>
#[pallet::weight(T::WeightInfo::force_transfer())]
pub(crate) fn force_transfer(
pub fn force_transfer(
origin: OriginFor<T>,
new: T::AccountId,
index: T::AccountIndex,
@@ -234,7 +234,7 @@ pub mod pallet {
/// - DB Weight: 1 Read/Write (Accounts)
/// # </weight>
#[pallet::weight(T::WeightInfo::freeze())]
pub(crate) fn freeze(origin: OriginFor<T>, index: T::AccountIndex) -> DispatchResult {
pub fn freeze(origin: OriginFor<T>, index: T::AccountIndex) -> DispatchResult {
let who = ensure_signed(origin)?;
Accounts::<T>::try_mutate(index, |maybe_value| -> DispatchResult {
+4 -4
View File
@@ -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<T>, call: Box<<T as Config>::Call>) -> DispatchResult {
pub fn buy_ticket(origin: OriginFor<T>, call: Box<<T as Config>::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<T>, calls: Vec<<T as Config>::Call>) -> DispatchResult {
pub fn set_calls(origin: OriginFor<T>, calls: Vec<<T as Config>::Call>) -> DispatchResult {
T::ManagerOrigin::ensure_origin(origin)?;
ensure!(calls.len() <= T::MaxCalls::get() as usize, Error::<T>::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<T>,
price: BalanceOf<T>,
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<T>) -> DispatchResult {
pub fn stop_repeat(origin: OriginFor<T>) -> DispatchResult {
T::ManagerOrigin::ensure_origin(origin)?;
Lottery::<T>::mutate(|mut lottery| {
if let Some(config) = &mut lottery {
+4 -4
View File
@@ -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<T>,
other_signatories: Vec<T::AccountId>,
call: Box<<T as Config>::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<T>,
threshold: u16,
other_signatories: Vec<T::AccountId>,
@@ -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<T>,
threshold: u16,
other_signatories: Vec<T::AccountId>,
@@ -431,7 +431,7 @@ pub mod pallet{
/// - Write: Multisig Storage, [Caller Account], Refund Account, Calls
/// # </weight>
#[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<T>,
threshold: u16,
other_signatories: Vec<T::AccountId>,
+4 -4
View File
@@ -138,7 +138,7 @@ pub mod pallet {
/// - One event.
/// # </weight>
#[pallet::weight(50_000_000)]
pub(super) fn set_name(origin: OriginFor<T>, name: Vec<u8>) -> DispatchResult {
pub fn set_name(origin: OriginFor<T>, name: Vec<u8>) -> DispatchResult {
let sender = ensure_signed(origin)?;
ensure!(name.len() >= T::MinLength::get() as usize, Error::<T>::TooShort);
@@ -169,7 +169,7 @@ pub mod pallet {
/// - One event.
/// # </weight>
#[pallet::weight(70_000_000)]
pub(super) fn clear_name(origin: OriginFor<T>) -> DispatchResult {
pub fn clear_name(origin: OriginFor<T>) -> DispatchResult {
let sender = ensure_signed(origin)?;
let deposit = <NameOf<T>>::take(&sender).ok_or(Error::<T>::Unnamed)?.1;
@@ -195,7 +195,7 @@ pub mod pallet {
/// - One event.
/// # </weight>
#[pallet::weight(70_000_000)]
pub(super) fn kill_name(
pub fn kill_name(
origin: OriginFor<T>,
target: <T::Lookup as StaticLookup>::Source
) -> DispatchResult {
@@ -225,7 +225,7 @@ pub mod pallet {
/// - One event.
/// # </weight>
#[pallet::weight(70_000_000)]
pub(super) fn force_name(
pub fn force_name(
origin: OriginFor<T>,
target: <T::Lookup as StaticLookup>::Source,
name: Vec<u8>
+10 -10
View File
@@ -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<T>,
real: T::AccountId,
force_proxy_type: Option<T::ProxyType>,
@@ -212,7 +212,7 @@ pub mod pallet {
/// Weight is a function of the number of proxies the user has (P).
/// # </weight>
#[pallet::weight(T::WeightInfo::add_proxy(T::MaxProxies::get().into()))]
pub(super) fn add_proxy(
pub fn add_proxy(
origin: OriginFor<T>,
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).
/// # </weight>
#[pallet::weight(T::WeightInfo::remove_proxy(T::MaxProxies::get().into()))]
pub(super) fn remove_proxy(
pub fn remove_proxy(
origin: OriginFor<T>,
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).
/// # </weight>
#[pallet::weight(T::WeightInfo::remove_proxies(T::MaxProxies::get().into()))]
pub(super) fn remove_proxies(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
pub fn remove_proxies(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
let who = ensure_signed(origin)?;
let (_, old_deposit) = Proxies::<T>::take(&who);
T::Currency::unreserve(&who, old_deposit);
@@ -287,7 +287,7 @@ pub mod pallet {
/// # </weight>
/// 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<T>,
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).
/// # </weight>
#[pallet::weight(T::WeightInfo::kill_anonymous(T::MaxProxies::get().into()))]
pub(super) fn kill_anonymous(
pub fn kill_anonymous(
origin: OriginFor<T>,
spawner: T::AccountId,
proxy_type: T::ProxyType,
@@ -379,7 +379,7 @@ pub mod pallet {
/// - P: the number of proxies the user has.
/// # </weight>
#[pallet::weight(T::WeightInfo::announce(T::MaxPending::get(), T::MaxProxies::get().into()))]
pub(super) fn announce(
pub fn announce(
origin: OriginFor<T>,
real: T::AccountId,
call_hash: CallHashOf<T>
@@ -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<T>,
real: T::AccountId,
call_hash: CallHashOf<T>
@@ -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<T>,
delegate: T::AccountId,
call_hash: CallHashOf<T>
@@ -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<T>,
delegate: T::AccountId,
real: T::AccountId,
+9 -9
View File
@@ -362,7 +362,7 @@ pub mod pallet {
dispatch_info.class,
)
})]
pub(crate) fn as_recovered(
pub fn as_recovered(
origin: OriginFor<T>,
account: T::AccountId,
call: Box<<T as Config>::Call>
@@ -389,7 +389,7 @@ pub mod pallet {
/// - One event
/// # </weight>
#[pallet::weight(30_000_000)]
pub(crate) fn set_recovered(
pub fn set_recovered(
origin: OriginFor<T>,
lost: T::AccountId,
rescuer: T::AccountId,
@@ -429,7 +429,7 @@ pub mod pallet {
/// Total Complexity: O(F + X)
/// # </weight>
#[pallet::weight(100_000_000)]
pub(crate) fn create_recovery(
pub fn create_recovery(
origin: OriginFor<T>,
friends: Vec<T::AccountId>,
threshold: u16,
@@ -491,7 +491,7 @@ pub mod pallet {
/// Total Complexity: O(F + X)
/// # </weight>
#[pallet::weight(100_000_000)]
pub(crate) fn initiate_recovery(origin: OriginFor<T>, account: T::AccountId) -> DispatchResult {
pub fn initiate_recovery(origin: OriginFor<T>, account: T::AccountId) -> DispatchResult {
let who = ensure_signed(origin)?;
// Check that the account is recoverable
ensure!(<Recoverable<T>>::contains_key(&account), Error::<T>::NotRecoverable);
@@ -538,7 +538,7 @@ pub mod pallet {
/// Total Complexity: O(F + logF + V + logV)
/// # </weight>
#[pallet::weight(100_000_000)]
pub(crate) fn vouch_recovery(
pub fn vouch_recovery(
origin: OriginFor<T>,
lost: T::AccountId,
rescuer: T::AccountId
@@ -582,7 +582,7 @@ pub mod pallet {
/// Total Complexity: O(F + V)
/// # </weight>
#[pallet::weight(100_000_000)]
pub(crate) fn claim_recovery(origin: OriginFor<T>, account: T::AccountId) -> DispatchResult {
pub fn claim_recovery(origin: OriginFor<T>, 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::<T>::NotRecoverable)?;
@@ -628,7 +628,7 @@ pub mod pallet {
/// Total Complexity: O(V + X)
/// # </weight>
#[pallet::weight(30_000_000)]
pub(crate) fn close_recovery(origin: OriginFor<T>, rescuer: T::AccountId) -> DispatchResult {
pub fn close_recovery(origin: OriginFor<T>, rescuer: T::AccountId) -> DispatchResult {
let who = ensure_signed(origin)?;
// Take the active recovery process started by the rescuer for this account.
let active_recovery = <ActiveRecoveries<T>>::take(&who, &rescuer).ok_or(Error::<T>::NotStarted)?;
@@ -662,7 +662,7 @@ pub mod pallet {
/// Total Complexity: O(F + X)
/// # </weight>
#[pallet::weight(30_000_000)]
pub(crate) fn remove_recovery(origin: OriginFor<T>) -> DispatchResult {
pub fn remove_recovery(origin: OriginFor<T>) -> DispatchResult {
let who = ensure_signed(origin)?;
// Check there are no active recoveries
let mut active_recoveries = <ActiveRecoveries<T>>::iter_prefix_values(&who);
@@ -688,7 +688,7 @@ pub mod pallet {
/// - One storage mutation to check account is recovered by `who`. O(1)
/// # </weight>
#[pallet::weight(30_000_000)]
pub(crate) fn cancel_recovered(origin: OriginFor<T>, account: T::AccountId) -> DispatchResult {
pub fn cancel_recovered(origin: OriginFor<T>, 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::<T>::NotAllowed);
+6 -6
View File
@@ -346,7 +346,7 @@ pub mod pallet {
/// - Will use base weight of 25 which should be good for up to 30 scheduled calls
/// # </weight>
#[pallet::weight(<T as Config>::WeightInfo::schedule(T::MaxScheduledPerBlock::get()))]
pub(crate) fn schedule(
pub fn schedule(
origin: OriginFor<T>,
when: T::BlockNumber,
maybe_periodic: Option<schedule::Period<T::BlockNumber>>,
@@ -376,7 +376,7 @@ pub mod pallet {
/// - Will use base weight of 100 which should be good for up to 30 scheduled calls
/// # </weight>
#[pallet::weight(<T as Config>::WeightInfo::cancel(T::MaxScheduledPerBlock::get()))]
pub(crate) fn cancel(origin: OriginFor<T>, when: T::BlockNumber, index: u32) -> DispatchResult {
pub fn cancel(origin: OriginFor<T>, when: T::BlockNumber, index: u32) -> DispatchResult {
T::ScheduleOrigin::ensure_origin(origin.clone())?;
let origin = <T as Config>::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
/// # </weight>
#[pallet::weight(<T as Config>::WeightInfo::schedule_named(T::MaxScheduledPerBlock::get()))]
pub(crate) fn schedule_named(
pub fn schedule_named(
origin: OriginFor<T>,
id: Vec<u8>,
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
/// # </weight>
#[pallet::weight(<T as Config>::WeightInfo::cancel_named(T::MaxScheduledPerBlock::get()))]
pub(crate) fn cancel_named(origin: OriginFor<T>, id: Vec<u8>) -> DispatchResult {
pub fn cancel_named(origin: OriginFor<T>, id: Vec<u8>) -> DispatchResult {
T::ScheduleOrigin::ensure_origin(origin.clone())?;
let origin = <T as Config>::Origin::from(origin);
Self::do_cancel_named(Some(origin.caller().clone()), id)?;
@@ -439,7 +439,7 @@ pub mod pallet {
/// Same as [`schedule`].
/// # </weight>
#[pallet::weight(<T as Config>::WeightInfo::schedule(T::MaxScheduledPerBlock::get()))]
pub(crate) fn schedule_after(
pub fn schedule_after(
origin: OriginFor<T>,
after: T::BlockNumber,
maybe_periodic: Option<schedule::Period<T::BlockNumber>>,
@@ -464,7 +464,7 @@ pub mod pallet {
/// Same as [`schedule_named`].
/// # </weight>
#[pallet::weight(<T as Config>::WeightInfo::schedule_named(T::MaxScheduledPerBlock::get()))]
pub(crate) fn schedule_named_after(
pub fn schedule_named_after(
origin: OriginFor<T>,
id: Vec<u8>,
after: T::BlockNumber,
+4 -4
View File
@@ -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<T>,
call: Box<<T as Config>::Call>,
) -> DispatchResultWithPostInfo {
@@ -169,7 +169,7 @@ pub mod pallet {
/// - The weight of this call is defined by the caller.
/// # </weight>
#[pallet::weight((*_weight, call.get_dispatch_info().class))]
pub(crate) fn sudo_unchecked_weight(
pub fn sudo_unchecked_weight(
origin: OriginFor<T>,
call: Box<<T as Config>::Call>,
_weight: Weight,
@@ -194,7 +194,7 @@ pub mod pallet {
/// - One DB change.
/// # </weight>
#[pallet::weight(0)]
pub(crate) fn set_key(
pub fn set_key(
origin: OriginFor<T>,
new: <T::Lookup as StaticLookup>::Source,
) -> DispatchResultWithPostInfo {
@@ -230,7 +230,7 @@ pub mod pallet {
dispatch_info.class,
)
})]
pub(crate) fn sudo_as(
pub fn sudo_as(
origin: OriginFor<T>,
who: <T::Lookup as StaticLookup>::Source,
call: Box<<T as Config>::Call>
+1 -1
View File
@@ -2071,7 +2071,7 @@ pub mod pallet_prelude {
/// impl<T: Config<I>, I: 'static> Pallet<T, I> {
/// /// Doc comment put in metadata
/// #[pallet::weight(0)]
/// fn toto(origin: OriginFor<T>, #[pallet::compact] _foo: u32) -> DispatchResultWithPostInfo {
/// pub fn toto(origin: OriginFor<T>, #[pallet::compact] _foo: u32) -> DispatchResultWithPostInfo {
/// let _ = origin;
/// unimplemented!();
/// }
+7 -7
View File
@@ -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<T>, _ratio: Perbill) -> DispatchResultWithPostInfo {
pub fn fill_block(origin: OriginFor<T>, _ratio: Perbill) -> DispatchResultWithPostInfo {
ensure_root(origin)?;
Ok(().into())
}
@@ -312,7 +312,7 @@ pub mod pallet {
/// - `O(1)`
/// # </weight>
#[pallet::weight(T::SystemWeightInfo::remark(_remark.len() as u32))]
pub(crate) fn remark(origin: OriginFor<T>, _remark: Vec<u8>) -> DispatchResultWithPostInfo {
pub fn remark(origin: OriginFor<T>, _remark: Vec<u8>) -> DispatchResultWithPostInfo {
ensure_signed(origin)?;
Ok(().into())
}
@@ -326,7 +326,7 @@ pub mod pallet {
/// - 1 write to HEAP_PAGES
/// # </weight>
#[pallet::weight((T::SystemWeightInfo::set_heap_pages(), DispatchClass::Operational))]
pub(crate) fn set_heap_pages(origin: OriginFor<T>, pages: u64) -> DispatchResultWithPostInfo {
pub fn set_heap_pages(origin: OriginFor<T>, 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<T>, items: Vec<KeyValue>) -> DispatchResultWithPostInfo {
pub fn set_storage(origin: OriginFor<T>, items: Vec<KeyValue>) -> 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<T>, keys: Vec<Key>) -> DispatchResultWithPostInfo {
pub fn kill_storage(origin: OriginFor<T>, keys: Vec<Key>) -> 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<T>,
prefix: Key,
_subkeys: u32,
@@ -474,7 +474,7 @@ pub mod pallet {
/// - 1 event.
/// # </weight>
#[pallet::weight(T::SystemWeightInfo::remark_with_event(remark.len() as u32))]
pub(crate) fn remark_with_event(origin: OriginFor<T>, remark: Vec<u8>) -> DispatchResultWithPostInfo {
pub fn remark_with_event(origin: OriginFor<T>, remark: Vec<u8>) -> DispatchResultWithPostInfo {
let who = ensure_signed(origin)?;
let hash = T::Hashing::hash(&remark[..]);
Self::deposit_event(Event::Remarked(who, hash));
+1 -1
View File
@@ -184,7 +184,7 @@ pub mod pallet {
T::WeightInfo::set(),
DispatchClass::Mandatory
))]
pub(super) fn set(origin: OriginFor<T>, #[pallet::compact] now: T::Moment) -> DispatchResult {
pub fn set(origin: OriginFor<T>, #[pallet::compact] now: T::Moment) -> DispatchResult {
ensure_none(origin)?;
assert!(!DidUpdate::<T>::exists(), "Timestamp must be updated only once in the block");
let prev = Self::now();
@@ -174,7 +174,7 @@ pub mod pallet {
/// Additionally contains a DB write.
/// # </weight>
#[pallet::weight(T::WeightInfo::store(data.len() as u32))]
pub(super) fn store(
pub fn store(
origin: OriginFor<T>,
data: Vec<u8>,
) -> DispatchResult {
@@ -220,7 +220,7 @@ pub mod pallet {
/// - Constant.
/// # </weight>
#[pallet::weight(T::WeightInfo::renew())]
pub(super) fn renew(
pub fn renew(
origin: OriginFor<T>,
block: T::BlockNumber,
index: u32,
@@ -261,7 +261,7 @@ pub mod pallet {
/// Here we assume a maximum of 100 probed transactions.
/// # </weight>
#[pallet::weight((T::WeightInfo::check_proof_max(), DispatchClass::Mandatory))]
pub(super) fn check_proof(
pub fn check_proof(
origin: OriginFor<T>,
proof: TransactionStorageProof,
) -> DispatchResultWithPostInfo {
+22 -22
View File
@@ -297,7 +297,7 @@ pub mod pallet {
///
/// Weight: `O(1)`
#[pallet::weight(T::WeightInfo::create())]
pub(super) fn create(
pub fn create(
origin: OriginFor<T>,
#[pallet::compact] class: T::ClassId,
admin: <T::Lookup as StaticLookup>::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<T>,
#[pallet::compact] class: T::ClassId,
owner: <T::Lookup as StaticLookup>::Source,
@@ -396,7 +396,7 @@ pub mod pallet {
witness.instance_metadatas,
witness.attributes,
))]
pub(super) fn destroy(
pub fn destroy(
origin: OriginFor<T>,
#[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<T>,
#[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<T>,
#[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<T>,
#[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<T>,
#[pallet::compact] class: T::ClassId,
instances: Vec<T::InstanceId>,
@@ -595,7 +595,7 @@ pub mod pallet {
///
/// Weight: `O(1)`
#[pallet::weight(T::WeightInfo::freeze())]
pub(super) fn freeze(
pub fn freeze(
origin: OriginFor<T>,
#[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<T>,
#[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<T>,
#[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<T>,
#[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<T>,
#[pallet::compact] class: T::ClassId,
owner: <T::Lookup as StaticLookup>::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<T>,
#[pallet::compact] class: T::ClassId,
issuer: <T::Lookup as StaticLookup>::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<T>,
#[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<T>,
#[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<T>,
#[pallet::compact] class: T::ClassId,
owner: <T::Lookup as StaticLookup>::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<T>,
#[pallet::compact] class: T::ClassId,
maybe_instance: Option<T::InstanceId>,
@@ -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<T>,
#[pallet::compact] class: T::ClassId,
maybe_instance: Option<T::InstanceId>,
@@ -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<T>,
#[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<T>,
#[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<T>,
#[pallet::compact] class: T::ClassId,
data: BoundedVec<u8, T::StringLimit>,
@@ -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<T>,
#[pallet::compact] class: T::ClassId,
) -> DispatchResult {