Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Companion for #9085 (pub calls) #3214

Merged
merged 7 commits into from
Jun 12, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions runtime/common/src/mmr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,6 @@ pub mod pallet {
BeefyNextAuthoritySet<MerkleRootOf<T>>,
ValueQuery,
>;

#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}

#[pallet::call]
impl<T: Config> Pallet<T> {}
}

impl<T: Config> LeafDataProvider for Pallet<T> where
Expand Down
2 changes: 1 addition & 1 deletion runtime/common/src/paras_registrar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ pub mod pallet {
///
/// Can only be called by the Root origin.
#[pallet::weight(T::DbWeight::get().reads_writes(1, 1))]
fn force_remove_lock(origin: OriginFor<T>, para: ParaId) -> DispatchResult {
pub fn force_remove_lock(origin: OriginFor<T>, para: ParaId) -> DispatchResult {
ensure_root(origin)?;
Self::remove_lock(para);
Ok(())
Expand Down
14 changes: 7 additions & 7 deletions runtime/common/src/purchase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ pub mod pallet {
///
/// Origin must match the `ValidityOrigin`.
#[pallet::weight(200_000_000 + T::DbWeight::get().reads_writes(4, 1))]
pub(super) fn create_account(
pub fn create_account(
origin: OriginFor<T>,
who: T::AccountId,
signature: Vec<u8>
Expand Down Expand Up @@ -230,7 +230,7 @@ pub mod pallet {
///
/// Origin must match the `ValidityOrigin`.
#[pallet::weight(T::DbWeight::get().reads_writes(1, 1))]
pub(super) fn update_validity_status(
pub fn update_validity_status(
origin: OriginFor<T>,
who: T::AccountId,
validity: AccountValidity
Expand All @@ -252,7 +252,7 @@ pub mod pallet {
///
/// Origin must match the `ValidityOrigin`.
#[pallet::weight(T::DbWeight::get().reads_writes(2, 1))]
pub(super) fn update_balance(
pub fn update_balance(
origin: OriginFor<T>,
who: T::AccountId,
free_balance: BalanceOf<T>,
Expand Down Expand Up @@ -281,7 +281,7 @@ pub mod pallet {
///
/// Origin must match the configured `PaymentAccount`.
#[pallet::weight(T::DbWeight::get().reads_writes(4, 2))]
pub(super) fn payout(origin: OriginFor<T>, who: T::AccountId) -> DispatchResult {
pub fn payout(origin: OriginFor<T>, who: T::AccountId) -> DispatchResult {
// Payments must be made directly by the `PaymentAccount`.
let payment_account = ensure_signed(origin)?;
ensure!(payment_account == PaymentAccount::<T>::get(), DispatchError::BadOrigin);
Expand Down Expand Up @@ -334,7 +334,7 @@ pub mod pallet {
///
/// Origin must match the `ConfigurationOrigin`
#[pallet::weight(T::DbWeight::get().writes(1))]
pub(super) fn set_payment_account(origin: OriginFor<T>, who: T::AccountId) -> DispatchResult {
pub fn set_payment_account(origin: OriginFor<T>, who: T::AccountId) -> DispatchResult {
T::ConfigurationOrigin::ensure_origin(origin)?;
// Possibly this is worse than having the caller account be the payment account?
PaymentAccount::<T>::set(who.clone());
Expand All @@ -346,7 +346,7 @@ pub mod pallet {
///
/// Origin must match the `ConfigurationOrigin`
#[pallet::weight(T::DbWeight::get().writes(1))]
pub(super) fn set_statement(origin: OriginFor<T>, statement: Vec<u8>) -> DispatchResult {
pub fn set_statement(origin: OriginFor<T>, statement: Vec<u8>) -> DispatchResult {
T::ConfigurationOrigin::ensure_origin(origin)?;
ensure!((statement.len() as u32) < T::MaxStatementLength::get(), Error::<T>::InvalidStatement);
// Possibly this is worse than having the caller account be the payment account?
Expand All @@ -359,7 +359,7 @@ pub mod pallet {
///
/// Origin must match the `ConfigurationOrigin`
#[pallet::weight(T::DbWeight::get().writes(1))]
pub(super) fn set_unlock_block(origin: OriginFor<T>, unlock_block: T::BlockNumber) -> DispatchResult {
pub fn set_unlock_block(origin: OriginFor<T>, unlock_block: T::BlockNumber) -> DispatchResult {
T::ConfigurationOrigin::ensure_origin(origin)?;
ensure!(unlock_block > frame_system::Pallet::<T>::block_number(), Error::<T>::InvalidUnlockBlock);
// Possibly this is worse than having the caller account be the payment account?
Expand Down
6 changes: 3 additions & 3 deletions runtime/common/src/slots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ decl_module! {
///
/// Can only be called by the Root origin.
#[weight = T::WeightInfo::force_lease()]
fn force_lease(origin,
pub fn force_lease(origin,
para: ParaId,
leaser: T::AccountId,
amount: BalanceOf<T>,
Expand All @@ -157,7 +157,7 @@ decl_module! {
///
/// Can only be called by the Root origin.
#[weight = T::WeightInfo::clear_all_leases()]
fn clear_all_leases(origin, para: ParaId) -> DispatchResult {
pub fn clear_all_leases(origin, para: ParaId) -> DispatchResult {
ensure_root(origin)?;
let deposits = Self::all_deposits_held(para);

Expand All @@ -179,7 +179,7 @@ decl_module! {
///
/// Origin must be signed, but can be called by anyone.
#[weight = T::WeightInfo::trigger_onboard()]
fn trigger_onboard(origin, para: ParaId) -> DispatchResult {
pub fn trigger_onboard(origin, para: ParaId) -> DispatchResult {
let _ = ensure_signed(origin)?;
let leases = Leases::<T>::get(para);
match leases.first() {
Expand Down
8 changes: 4 additions & 4 deletions xcm/pallet-xcm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub mod pallet {
#[pallet::call]
impl<T: Config> Pallet<T> {
#[pallet::weight(100_000_000)]
fn send(origin: OriginFor<T>, dest: MultiLocation, message: Xcm<()>) -> DispatchResult {
pub fn send(origin: OriginFor<T>, dest: MultiLocation, message: Xcm<()>) -> DispatchResult {
let origin_location = T::SendXcmOrigin::ensure_origin(origin)?;
Self::send_xcm(origin_location.clone(), dest.clone(), message.clone())
.map_err(|e| match e {
Expand Down Expand Up @@ -130,7 +130,7 @@ pub mod pallet {
};
T::Weigher::weight(&mut message).map_or(Weight::max_value(), |w| 100_000_000 + w)
})]
fn teleport_assets(
pub fn teleport_assets(
origin: OriginFor<T>,
dest: MultiLocation,
beneficiary: MultiLocation,
Expand Down Expand Up @@ -188,7 +188,7 @@ pub mod pallet {
};
T::Weigher::weight(&mut message).map_or(Weight::max_value(), |w| 100_000_000 + w)
})]
fn reserve_transfer_assets(
pub fn reserve_transfer_assets(
origin: OriginFor<T>,
dest: MultiLocation,
beneficiary: MultiLocation,
Expand Down Expand Up @@ -233,7 +233,7 @@ pub mod pallet {
/// NOTE: A successful return to this does *not* imply that the `msg` was executed successfully
/// to completion; only that *some* of it was executed.
#[pallet::weight(max_weight.saturating_add(100_000_000u64))]
fn execute(origin: OriginFor<T>, message: Box<Xcm<T::Call>>, max_weight: Weight)
pub fn execute(origin: OriginFor<T>, message: Box<Xcm<T::Call>>, max_weight: Weight)
-> DispatchResult
{
let origin_location = T::ExecuteXcmOrigin::ensure_origin(origin)?;
Expand Down