mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 03:31:10 +00:00
Mandate weight annotation (#5357)
* Disallow default weight * Fix build and test * Fix tests * Fix another beloved ui test. * fix beloved trybuild tests * fix treasury? * Final test fix * Fix build * Fix another one * Fix * More doctest fix
This commit is contained in:
@@ -360,12 +360,14 @@ decl_module! {
|
||||
fn deposit_event() = default;
|
||||
|
||||
/// Create a new kind of asset.
|
||||
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
|
||||
fn create(origin, options: AssetOptions<T::Balance, T::AccountId>) -> DispatchResult {
|
||||
let origin = ensure_signed(origin)?;
|
||||
Self::create_asset(None, Some(origin), options)
|
||||
}
|
||||
|
||||
/// Transfer some liquid free balance to another account.
|
||||
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
|
||||
pub fn transfer(origin, #[compact] asset_id: T::AssetId, to: T::AccountId, #[compact] amount: T::Balance) {
|
||||
let origin = ensure_signed(origin)?;
|
||||
ensure!(!amount.is_zero(), Error::<T>::ZeroAmount);
|
||||
@@ -375,6 +377,7 @@ decl_module! {
|
||||
/// Updates permission for a given `asset_id` and an account.
|
||||
///
|
||||
/// The `origin` must have `update` permission.
|
||||
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
|
||||
fn update_permission(
|
||||
origin,
|
||||
#[compact] asset_id: T::AssetId,
|
||||
@@ -397,6 +400,7 @@ decl_module! {
|
||||
|
||||
/// Mints an asset, increases its total issuance.
|
||||
/// The origin must have `mint` permissions.
|
||||
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
|
||||
fn mint(origin, #[compact] asset_id: T::AssetId, to: T::AccountId, amount: T::Balance) -> DispatchResult {
|
||||
let who = ensure_signed(origin)?;
|
||||
Self::mint_free(&asset_id, &who, &to, &amount)?;
|
||||
@@ -406,6 +410,7 @@ decl_module! {
|
||||
|
||||
/// Burns an asset, decreases its total issuance.
|
||||
/// The `origin` must have `burn` permissions.
|
||||
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
|
||||
fn burn(origin, #[compact] asset_id: T::AssetId, to: T::AccountId, amount: T::Balance) -> DispatchResult {
|
||||
let who = ensure_signed(origin)?;
|
||||
Self::burn_free(&asset_id, &who, &to, &amount)?;
|
||||
@@ -415,6 +420,7 @@ decl_module! {
|
||||
|
||||
/// Can be used to create reserved tokens.
|
||||
/// Requires Root call.
|
||||
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
|
||||
fn create_reserved(
|
||||
origin,
|
||||
asset_id: T::AssetId,
|
||||
|
||||
Reference in New Issue
Block a user