Skip to content

Commit

Permalink
bench(pallet_uniques): bring implementation of benchmarkhelper for ru…
Browse files Browse the repository at this point in the history
…ntime-benchmark, necessary only for visibility for tests
  • Loading branch information
Hounsette committed Jun 18, 2023
1 parent e41b6a5 commit b0732f0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pallets/uniques/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@ pub mod pallet {
OptionQuery,
>;

#[cfg(feature = "runtime-benchmarks")]
pub trait BenchmarkHelper<CollectionId, ItemId> {
fn collection(i: u16) -> CollectionId;
fn item(i: u16) -> ItemId;
}
#[cfg(feature = "runtime-benchmarks")]
impl<CollectionId: From<u16>, ItemId: From<u16>> BenchmarkHelper<CollectionId, ItemId> for () {
fn collection(i: u16) -> CollectionId {
i.into()
}
fn item(i: u16) -> ItemId {
i.into()
}
}

#[pallet::call]
impl<T: Config<I>, I: 'static> Pallet<T, I> {
/// Issue a new collection of non-fungible items from a public origin.
Expand Down

0 comments on commit b0732f0

Please sign in to comment.