Unverified Commit 8bf6cc87 authored by Shawn Tabrizi's avatar Shawn Tabrizi Committed by GitHub
Browse files

Companion for #9085 (pub calls) (#3214)

* update to use pub dispatchables

* update Substrate

* Update claims.rs

* remove warning

Co-authored-by: parity-processbot <>
parent 390e58de
Pipeline #141975 passed with stages
in 41 minutes and 17 seconds
This diff is collapsed.
......@@ -281,7 +281,7 @@ pub mod pallet {
/// Total Complexity: O(1)
/// </weight>
#[pallet::weight(T::WeightInfo::claim())]
pub(super) fn claim(
pub fn claim(
origin: OriginFor<T>,
dest: T::AccountId,
ethereum_signature: EcdsaSignature
......@@ -313,7 +313,7 @@ pub mod pallet {
/// Total Complexity: O(1)
/// </weight>
#[pallet::weight(T::WeightInfo::mint_claim())]
pub(super) fn mint_claim(
pub fn mint_claim(
origin: OriginFor<T>,
who: EthereumAddress,
value: BalanceOf<T>,
......@@ -360,7 +360,7 @@ pub mod pallet {
/// Total Complexity: O(1)
/// </weight>
#[pallet::weight(T::WeightInfo::claim_attest())]
pub(super) fn claim_attest(
pub fn claim_attest(
origin: OriginFor<T>,
dest: T::AccountId,
ethereum_signature: EcdsaSignature,
......@@ -400,7 +400,7 @@ pub mod pallet {
DispatchClass::Normal,
Pays::No
))]
pub(super) fn attest(origin: OriginFor<T>, statement: Vec<u8>) -> DispatchResult {
pub fn attest(origin: OriginFor<T>, statement: Vec<u8>) -> DispatchResult {
let who = ensure_signed(origin)?;
let signer = Preclaims::<T>::get(&who).ok_or(Error::<T>::SenderHasNoClaim)?;
if let Some(s) = Signing::<T>::get(signer) {
......@@ -412,7 +412,7 @@ pub mod pallet {
}
#[pallet::weight(T::WeightInfo::move_claim())]
pub(super) fn move_claim(
pub fn move_claim(
origin: OriginFor<T>,
old: EthereumAddress,
new: EthereumAddress,
......
......@@ -122,7 +122,6 @@ impl<T: Config + paras::Config> ParachainHeadsProvider for paras::Pallet<T> {
#[frame_support::pallet]
pub mod pallet {
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;
use super::*;
#[pallet::pallet]
......@@ -158,12 +157,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
......
......@@ -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(())
......
......@@ -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>
......@@ -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
......@@ -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>,
......@@ -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);
......@@ -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());
......@@ -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?
......@@ -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?
......
......@@ -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>,
......@@ -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);
......@@ -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() {
......
......@@ -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 {
......@@ -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,
......@@ -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,
......@@ -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)?;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment