From b0732f0614a1e5c0bd71b7fc22337e232a211a1c Mon Sep 17 00:00:00 2001 From: Hounsette Date: Mon, 19 Jun 2023 00:52:17 +0900 Subject: [PATCH] bench(pallet_uniques): bring implementation of benchmarkhelper for runtime-benchmark, necessary only for visibility for tests --- pallets/uniques/src/lib.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pallets/uniques/src/lib.rs b/pallets/uniques/src/lib.rs index feb33b7ba51..75c0ceb5849 100644 --- a/pallets/uniques/src/lib.rs +++ b/pallets/uniques/src/lib.rs @@ -61,6 +61,21 @@ pub mod pallet { OptionQuery, >; + #[cfg(feature = "runtime-benchmarks")] + pub trait BenchmarkHelper { + fn collection(i: u16) -> CollectionId; + fn item(i: u16) -> ItemId; + } + #[cfg(feature = "runtime-benchmarks")] + impl, ItemId: From> BenchmarkHelper for () { + fn collection(i: u16) -> CollectionId { + i.into() + } + fn item(i: u16) -> ItemId { + i.into() + } + } + #[pallet::call] impl, I: 'static> Pallet { /// Issue a new collection of non-fungible items from a public origin.