Skip to content

Commit

Permalink
fix test build
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadkaouk committed Nov 29, 2024
1 parent 59bb6d4 commit 328b3d0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pallets/moonbeam-lazy-migrations/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,19 @@ parameter_types! {
pub const AssetAccountDeposit: u128 = 1;
}

// Required for runtime benchmarks
pallet_assets::runtime_benchmarks_enabled! {
pub struct BenchmarkHelper;
impl<AssetIdParameter> pallet_assets::BenchmarkHelper<AssetIdParameter> for BenchmarkHelper
where
AssetIdParameter: From<u128>,
{
fn create_asset_id_parameter(id: u32) -> AssetIdParameter {
(id as u128).into()
}
}
}

impl pallet_assets::Config<()> for Test {
type RuntimeEvent = RuntimeEvent;
type Balance = Balance;
Expand All @@ -192,6 +205,9 @@ impl pallet_assets::Config<()> for Test {
type AssetIdParameter = AssetId;
type CreateOrigin = AsEnsureOriginWithArg<EnsureSigned<AccountId>>;
type CallbackHandle = ();
pallet_assets::runtime_benchmarks_enabled! {
type BenchmarkHelper = BenchmarkHelper;
}
}

#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug, TypeInfo)]
Expand Down

0 comments on commit 328b3d0

Please sign in to comment.