Skip to content

Commit

Permalink
use weights
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo committed May 26, 2024
1 parent 1d6d125 commit 46f05e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pallets/market/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use super::*;

use frame_benchmarking::v2::*;
use frame_support::traits::{fungible::Mutate, nonfungible::Mutate as NonFungibleMutate};
use frame_support::traits::fungible::Mutate;
use frame_system::RawOrigin;
use pallet_broker::{CoreMask, RegionId, RegionRecord};

Expand Down
13 changes: 8 additions & 5 deletions pallets/market/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ mod mock;
#[cfg(test)]
mod tests;

pub mod weights;
pub use weights::WeightInfo;

#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;

Expand All @@ -49,7 +52,7 @@ pub mod pallet {
tokens::Balance,
},
};
use frame_system::{pallet_prelude::*, WeightInfo};
use frame_system::pallet_prelude::*;

/// The module configuration trait.
#[pallet::config]
Expand Down Expand Up @@ -158,7 +161,7 @@ pub mod pallet {
/// - `sale_recipient`: The `AccountId` receiving the payment from the sale. If not
/// specified this will be the caller.
#[pallet::call_index(0)]
#[pallet::weight(10_000)] // TODO
#[pallet::weight(T::WeightInfo::list_region())]
pub fn list_region(
origin: OriginFor<T>,
region_id: RegionId,
Expand Down Expand Up @@ -201,7 +204,7 @@ pub mod pallet {
/// ## Arguments:
/// - `region_id`: The region that the caller intends to unlist from sale.
#[pallet::call_index(1)]
#[pallet::weight(10_000)] // TODO
#[pallet::weight(T::WeightInfo::unlist_region())]
pub fn unlist_region(origin: OriginFor<T>, region_id: RegionId) -> DispatchResult {
let who = ensure_signed(origin)?;

Expand All @@ -222,7 +225,7 @@ pub mod pallet {
}

#[pallet::call_index(2)]
#[pallet::weight(10_000)] // TODO
#[pallet::weight(T::WeightInfo::update_region_price())]
pub fn update_region_price(
origin: OriginFor<T>,
region_id: RegionId,
Expand All @@ -247,7 +250,7 @@ pub mod pallet {
}

#[pallet::call_index(3)]
#[pallet::weight(10_000)] // TODO
#[pallet::weight(T::WeightInfo::purchase_region())]
pub fn purchase_region(
origin: OriginFor<T>,
region_id: RegionId,
Expand Down

0 comments on commit 46f05e8

Please sign in to comment.