diff --git a/pallets/pallet-bonded-coins/src/benchmarking.rs b/pallets/pallet-bonded-coins/src/benchmarking.rs index ecfca447d..9bb68b93b 100644 --- a/pallets/pallet-bonded-coins/src/benchmarking.rs +++ b/pallets/pallet-bonded-coins/src/benchmarking.rs @@ -42,6 +42,8 @@ pub trait BenchmarkHelper { /// Calculate the asset id for the bonded asset. fn calculate_bonded_asset_id(seed: u32) -> FungiblesAssetIdOf; + + fn set_native_balance(account: &T::AccountId, amount: u128); } impl BenchmarkHelper for () @@ -57,6 +59,8 @@ where fn calculate_bonded_asset_id(seed: u32) -> FungiblesAssetIdOf { seed.into() } + + fn set_native_balance(_account: &::AccountId, _amount: u128) {} } fn get_square_root_curve() -> Curve { @@ -87,13 +91,12 @@ fn get_lmsr_curve_input() -> CurveInput { FungiblesBalanceOf: Into + TryFrom, T::Collaterals: Create , T::Fungibles: InspectRoles + AccountTouch, AccountIdOf>, - T::DepositCurrency: Mutate, T::Collaterals: MutateFungibles, AccountIdLookupOf: From, )] mod benchmarks { use frame_support::traits::{ - fungible::{Inspect, Mutate, MutateHold}, + fungible::{Inspect, MutateHold}, fungibles::{Create, Destroy, Inspect as InspectFungibles, Mutate as MutateFungibles}, AccountTouch, EnsureOrigin, Get, OriginTrait, }; @@ -104,8 +107,7 @@ mod benchmarks { curves::Curve, mock::*, types::{Locks, PoolManagingTeam, PoolStatus}, - AccountIdLookupOf, AccountIdOf, CollateralAssetIdOf, CurveParameterInputOf, HoldReason, PoolDetailsOf, Pools, - TokenMetaOf, + AccountIdLookupOf, AccountIdOf, CollateralAssetIdOf, CurveParameterInputOf, PoolDetailsOf, Pools, TokenMetaOf, }; use super::*; @@ -178,21 +180,15 @@ mod benchmarks { // native currency - fn make_free_for_deposit(account: &AccountIdOf) - where - T::DepositCurrency: Mutate, - { + fn make_free_for_deposit(account: &AccountIdOf) { let balance = >>::minimum_balance() + T::BaseDeposit::get().mul(1000u32.into()) + T::DepositPerCurrency::get().mul(T::MaxCurrenciesPerPool::get().into()); set_native_balance::(account, balance.saturated_into()); } - fn set_native_balance(account: &AccountIdOf, amount: u128) - where - T::DepositCurrency: Mutate, - { - >>::set_balance(account, amount.saturated_into()); + fn set_native_balance(account: &AccountIdOf, amount: u128) { + T::BenchmarkHelper::set_native_balance(account, amount.saturated_into()); let balance = >>::balance(account); assert_eq!(balance, amount.saturated_into()); } @@ -795,8 +791,10 @@ mod benchmarks { make_free_for_deposit::(&owner); + let hold_reason = Pallet::::calculate_hold_reason(&pool_id).expect("Generating HoldReason should not fail"); + T::DepositCurrency::hold( - &T::RuntimeHoldReason::from(HoldReason::Deposit), + &hold_reason, &owner, Pallet::::calculate_pool_deposit(bonded_currencies.len()), ) diff --git a/pallets/pallet-bonded-coins/src/lib.rs b/pallets/pallet-bonded-coins/src/lib.rs index 6358a5cc1..a4a63b659 100644 --- a/pallets/pallet-bonded-coins/src/lib.rs +++ b/pallets/pallet-bonded-coins/src/lib.rs @@ -198,7 +198,8 @@ pub mod pallet { /// The type used for pool ids type PoolId: Parameter + MaxEncodedLen + From<[u8; 32]> + Into; - type RuntimeHoldReason: From; + type RuntimeHoldReason: From; + type HoldReason: TryFrom; /// The type used for the curve parameters. This is the type used in the /// calculation steps and stored in the pool details. @@ -316,11 +317,6 @@ pub mod pallet { ZeroCollateral, } - #[pallet::composite_enum] - pub enum HoldReason { - Deposit, - } - #[pallet::call] impl Pallet where @@ -399,7 +395,8 @@ pub mod pallet { let deposit_amount = Self::calculate_pool_deposit(currency_length); - T::DepositCurrency::hold(&T::RuntimeHoldReason::from(HoldReason::Deposit), &who, deposit_amount)?; + let hold_reason = Self::calculate_hold_reason(&pool_id)?; + T::DepositCurrency::hold(&hold_reason, &who, deposit_amount)?; let pool_account = &pool_id.clone().into(); @@ -1280,8 +1277,9 @@ pub mod pallet { Pools::::remove(&pool_id); + let hold_reason = Self::calculate_hold_reason(&pool_id)?; T::DepositCurrency::release( - &T::RuntimeHoldReason::from(HoldReason::Deposit), + &hold_reason, &pool_details.owner, pool_details.deposit, WithdrawalPrecision::Exact, @@ -1562,5 +1560,15 @@ pub mod pallet { T::BaseDeposit::get() .saturating_add(T::DepositPerCurrency::get().saturating_mul(n_currencies.saturated_into())) } + + /// Calculates the hold reason for a pool. + pub(crate) fn calculate_hold_reason(pool_id: &T::PoolId) -> Result> { + let hold_reason = T::HoldReason::try_from(pool_id.to_owned()).map_err(|_| { + log::error!(target: LOG_TARGET, "Failed to convert pool ID into a valid hold reason."); + Error::::Internal + })?; + + Ok(T::RuntimeHoldReason::from(hold_reason)) + } } } diff --git a/pallets/pallet-bonded-coins/src/mock.rs b/pallets/pallet-bonded-coins/src/mock.rs index d17509259..1588a0b91 100644 --- a/pallets/pallet-bonded-coins/src/mock.rs +++ b/pallets/pallet-bonded-coins/src/mock.rs @@ -54,14 +54,14 @@ pub mod runtime { use frame_support::{ pallet_prelude::*, parameter_types, storage_alias, - traits::{fungible::hold::Mutate, ConstU128, ConstU32, PalletInfoAccess}, + traits::{fungible::hold::Mutate as MutateHold, ConstU128, ConstU32, PalletInfoAccess, VariantCount}, weights::constants::RocksDbWeight, }; use frame_system::{EnsureRoot, EnsureSigned}; use sp_core::U256; use sp_runtime::{ traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Verify}, - ArithmeticError, BoundedVec, BuildStorage, DispatchError, MultiSignature, Permill, + AccountId32, ArithmeticError, BoundedVec, BuildStorage, DispatchError, MultiSignature, Permill, }; use substrate_fixed::types::{I75F53, U75F53}; @@ -69,7 +69,7 @@ pub mod runtime { self as pallet_bonded_coins, traits::NextAssetIds, types::{Locks, PoolStatus}, - Config, DepositBalanceOf, FungiblesAssetIdOf, HoldReason, PoolDetailsOf, + Config, DepositBalanceOf, FungiblesAssetIdOf, PoolDetailsOf, }; pub type Hash = sp_core::H256; @@ -200,6 +200,15 @@ pub mod runtime { } ); + #[derive(Default, Clone, Copy, Encode, Decode, MaxEncodedLen, TypeInfo, Debug, PartialEq, Eq, PartialOrd, Ord)] + pub enum TestRuntimeHoldReason { + #[default] + Deposit, + } + impl VariantCount for TestRuntimeHoldReason { + const VARIANT_COUNT: u32 = 1; + } + parameter_types! { pub const SS58Prefix: u8 = 38; pub const BlockHashCount: u64 = 250; @@ -250,7 +259,7 @@ pub mod runtime { type ReserveIdentifier = [u8; 8]; type RuntimeEvent = RuntimeEvent; type RuntimeFreezeReason = (); - type RuntimeHoldReason = RuntimeHoldReason; + type RuntimeHoldReason = TestRuntimeHoldReason; type WeightInfo = (); } @@ -288,6 +297,32 @@ pub mod runtime { pub const MaxDenomination: u8 = 15; } + impl From for TestRuntimeHoldReason { + fn from(_value: AccountId32) -> Self { + Self::Deposit + } + } + + #[cfg(feature = "runtime-benchmarks")] + struct BenchmarkHelper; + + #[cfg(feature = "runtime-benchmarks")] + impl crate::BenchmarkHelper for BenchmarkHelper { + fn calculate_bonded_asset_id(seed: u32) -> FungiblesAssetIdOf { + seed + } + + fn calculate_collateral_asset_id(seed: u32) -> crate::CollateralAssetIdOf { + seed + } + + fn set_native_balance(who: &AccountId, amount: DepositBalanceOf) { + use frame_support::traits::fungible::Mutate; + + Balances::set_balance(who, amount); + } + } + impl pallet_bonded_coins::Config for Test { type BaseDeposit = ExistentialDeposit; type Collaterals = Assets; @@ -298,6 +333,7 @@ pub mod runtime { type DepositPerCurrency = CurrencyDeposit; type ForceOrigin = EnsureRoot; type Fungibles = Assets; + type HoldReason = Self::PoolId; type MaxCurrenciesPerPool = MaxCurrenciesPerPool; type MaxDenomination = MaxDenomination; type MaxStringInputLength = StringLimit; @@ -305,7 +341,7 @@ pub mod runtime { type PoolCreateOrigin = EnsureSigned; type PoolId = AccountId; type RuntimeEvent = RuntimeEvent; - type RuntimeHoldReason = RuntimeHoldReason; + type RuntimeHoldReason = TestRuntimeHoldReason; type WeightInfo = (); #[cfg(feature = "runtime-benchmarks")] @@ -400,8 +436,10 @@ pub mod runtime { System::set_block_number(System::block_number() + 1); self.pools.into_iter().for_each(|(pool_id, pool)| { + let hold_reason = + BondingPallet::calculate_hold_reason(&pool_id).expect("Creating hold reason should not fail."); ::DepositCurrency::hold( - &HoldReason::Deposit.into(), + &hold_reason, &pool.owner, BondingPallet::calculate_pool_deposit(pool.bonded_currencies.len()), ) diff --git a/pallets/pallet-bonded-coins/src/try_state.rs b/pallets/pallet-bonded-coins/src/try_state.rs index 580baa55f..b1407bf44 100644 --- a/pallets/pallet-bonded-coins/src/try_state.rs +++ b/pallets/pallet-bonded-coins/src/try_state.rs @@ -5,7 +5,7 @@ use frame_support::traits::{ use sp_runtime::{traits::Zero, TryRuntimeError}; use sp_std::vec::Vec; -use crate::{types::PoolDetails, Config, FungiblesAssetIdOf, HoldReason, Pools}; +use crate::{types::PoolDetails, Config, FungiblesAssetIdOf, Pools}; pub(crate) fn do_try_state() -> Result<(), TryRuntimeError> { // checked currency ids. Each Currency should only be associated with one pool. @@ -22,10 +22,14 @@ pub(crate) fn do_try_state() -> Result<(), TryRuntimeError> { .. } = pool_details; - let pool_account = pool_id.into(); + let pool_account = pool_id.clone().into(); + + let hold_reason = T::HoldReason::try_from(pool_id) + .map_err(|_| TryRuntimeError::Other("Failed to convert pool_id to HoldReason")) + .map(T::RuntimeHoldReason::from)?; // Deposit checks - let balance_on_hold_user = T::DepositCurrency::balance_on_hold(&HoldReason::Deposit.into(), &owner); + let balance_on_hold_user = T::DepositCurrency::balance_on_hold(&hold_reason, &owner); assert!(balance_on_hold_user >= deposit); // Collateral checks diff --git a/pallets/pallet-deposit-storage/src/fungible/mod.rs b/pallets/pallet-deposit-storage/src/fungible/mod.rs index fa6a53e4e..3f8781985 100644 --- a/pallets/pallet-deposit-storage/src/fungible/mod.rs +++ b/pallets/pallet-deposit-storage/src/fungible/mod.rs @@ -87,6 +87,12 @@ pub struct PalletDepositStorageReason { pub(crate) key: Key, } +impl PalletDepositStorageReason { + pub const fn new(namespace: Namespace, key: Key) -> Self { + Self { namespace, key } + } +} + impl From> for HoldReason { fn from(_value: PalletDepositStorageReason) -> Self { // All the deposits ever taken like this will count towards the same hold diff --git a/runtimes/common/src/deposits.rs b/runtimes/common/src/deposits.rs new file mode 100644 index 000000000..01ff92714 --- /dev/null +++ b/runtimes/common/src/deposits.rs @@ -0,0 +1,53 @@ +// KILT Blockchain – https://botlabs.org +// Copyright (C) 2019-2024 BOTLabs GmbH + +// The KILT Blockchain is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// The KILT Blockchain is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +// If you feel like getting in touch with us, you can do so at info@botlabs.org + +// The `RuntimeDebug` macro uses these internally. +#![allow(clippy::ref_patterns)] + +use pallet_dip_provider::IdentityCommitmentVersion; +use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; +use scale_info::TypeInfo; +use sp_core::RuntimeDebug; + +use crate::DidIdentifier; + +#[derive(Encode, Decode, MaxEncodedLen, TypeInfo, Clone, PartialEq, Eq, RuntimeDebug)] +pub enum DepositNamespace { + DipProvider, + BondedTokens, +} + +#[cfg(feature = "runtime-benchmarks")] +impl Default for DepositNamespace { + fn default() -> Self { + Self::DipProvider + } +} + +/// The various different keys that can be stored in the storage-tracking +/// pallet. +/// Although the namespace is used to distinguish between keys, it is useful to +/// group all keys under the same enum to calculate the maximum length that a +/// key can take. +#[derive(Encode, Decode, MaxEncodedLen, TypeInfo, Clone, PartialEq, Eq, RuntimeDebug)] +pub enum DepositKey { + DipProvider { + identifier: DidIdentifier, + version: IdentityCommitmentVersion, + }, +} diff --git a/runtimes/common/src/dip/deposit/mod.rs b/runtimes/common/src/dip/deposit/mod.rs index 1326eae1d..3e8d1fe63 100644 --- a/runtimes/common/src/dip/deposit/mod.rs +++ b/runtimes/common/src/dip/deposit/mod.rs @@ -16,37 +16,25 @@ // If you feel like getting in touch with us, you can do so at info@botlabs.org -// The `RuntimeDebug` macro uses these internally. -#![allow(clippy::ref_patterns)] - use frame_support::traits::Get; use pallet_deposit_storage::{ traits::DepositStorageHooks, DepositEntryOf, DepositKeyOf, FixedDepositCollectorViaDepositsPallet, }; use pallet_dip_provider::IdentityCommitmentVersion; -use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; -use sp_core::{ConstU128, RuntimeDebug}; +use parity_scale_codec::Decode; +use sp_core::ConstU128; -use crate::{constants::dip_provider::COMMITMENT_DEPOSIT, AccountId, DidIdentifier}; +pub use crate::{ + constants::dip_provider::COMMITMENT_DEPOSIT, + deposits::{DepositKey, DepositNamespace}, + AccountId, DidIdentifier, +}; #[cfg(test)] mod mock; #[cfg(test)] mod tests; -#[derive(Encode, Decode, MaxEncodedLen, TypeInfo, Clone, PartialEq, Eq, RuntimeDebug)] -pub enum DepositNamespace { - DipProvider, -} - -#[cfg(feature = "runtime-benchmarks")] -impl Default for DepositNamespace { - fn default() -> Self { - Self::DipProvider - } -} - /// The namespace to use in the [`pallet_deposit_storage::Pallet`] to store /// all deposits related to DIP commitments. pub struct DipProviderDepositNamespace; @@ -57,19 +45,6 @@ impl Get for DipProviderDepositNamespace { } } -/// The various different keys that can be stored in the storage-tracking -/// pallet. -/// Although the namespace is used to distinguish between keys, it is useful to -/// group all keys under the same enum to calculate the maximum length that a -/// key can take. -#[derive(Encode, Decode, MaxEncodedLen, TypeInfo, Clone, PartialEq, Eq, RuntimeDebug)] -pub enum DepositKey { - DipProvider { - identifier: DidIdentifier, - version: IdentityCommitmentVersion, - }, -} - impl From<(DidIdentifier, AccountId, IdentityCommitmentVersion)> for DepositKey { fn from((identifier, _, version): (DidIdentifier, AccountId, IdentityCommitmentVersion)) -> Self { Self::DipProvider { identifier, version } @@ -157,6 +132,8 @@ where ::Namespace, sp_runtime::BoundedVec::MaxKeyLength>, ) { + use parity_scale_codec::Encode; + let submitter = AccountId::from([100u8; 32]); let namespace = DepositNamespace::DipProvider; let did_identifier = DidIdentifier::from([200u8; 32]); diff --git a/runtimes/common/src/lib.rs b/runtimes/common/src/lib.rs index 7d1e77422..841cead22 100644 --- a/runtimes/common/src/lib.rs +++ b/runtimes/common/src/lib.rs @@ -48,6 +48,7 @@ pub mod assets; pub mod authorization; pub mod bonded_coins; pub mod constants; +pub mod deposits; pub mod dip; pub mod dot_names; pub use dot_names::DotName; diff --git a/runtimes/peregrine/src/benchmarks/bonded_coins.rs b/runtimes/peregrine/src/benchmarks/bonded_coins.rs index d6c9e9537..233e3bc9d 100644 --- a/runtimes/peregrine/src/benchmarks/bonded_coins.rs +++ b/runtimes/peregrine/src/benchmarks/bonded_coins.rs @@ -16,14 +16,16 @@ // If you feel like getting in touch with us, you can do so at info@botlabs.org +use frame_support::traits::fungible::Mutate; use pallet_bonded_coins::{BenchmarkHelper, CollateralAssetIdOf, Config, FungiblesAssetIdOf}; +use sp_runtime::SaturatedConversion; use xcm::v4::{Junction, Junctions, Location}; use crate::kilt::BondedFungiblesInstance; pub struct BondedFungiblesBenchmarkHelper(sp_std::marker::PhantomData); -impl> BenchmarkHelper - for BondedFungiblesBenchmarkHelper +impl + pallet_balances::Config> + BenchmarkHelper for BondedFungiblesBenchmarkHelper where FungiblesAssetIdOf: From, CollateralAssetIdOf: From, @@ -38,4 +40,8 @@ where interior: Junctions::X1([Junction::GeneralIndex(seed.into())].into()), }) } + + fn set_native_balance(who: &::AccountId, amount: u128) { + pallet_balances::Pallet::::set_balance(who, amount.saturated_into()); + } } diff --git a/runtimes/peregrine/src/kilt/dip/mod.rs b/runtimes/peregrine/src/kilt/dip/mod.rs index cd0757ecc..c9dfc286f 100644 --- a/runtimes/peregrine/src/kilt/dip/mod.rs +++ b/runtimes/peregrine/src/kilt/dip/mod.rs @@ -20,8 +20,9 @@ use did::{DidRawOrigin, EnsureDidOrigin}; use frame_system::EnsureSigned; use runtime_common::{ constants::{deposit_storage::MAX_DEPOSIT_PALLET_KEY_LENGTH, dip_provider::MAX_LINKED_ACCOUNTS}, + deposits::DepositNamespace, dip::{ - deposit::{DepositCollectorHooks, DepositHooks, DepositNamespace}, + deposit::{DepositCollectorHooks, DepositHooks}, did::LinkedDidInfoProvider, merkle::DidMerkleRootGenerator, }, diff --git a/runtimes/peregrine/src/kilt/mod.rs b/runtimes/peregrine/src/kilt/mod.rs index 876bd41c5..1c4a5b934 100644 --- a/runtimes/peregrine/src/kilt/mod.rs +++ b/runtimes/peregrine/src/kilt/mod.rs @@ -20,15 +20,18 @@ use frame_support::{parameter_types, traits::AsEnsureOriginWithArg}; use frame_system::{pallet_prelude::BlockNumberFor, EnsureRoot, EnsureSigned}; use kilt_support::traits::InspectMetadata; use pallet_asset_switch::xcm::{AccountId32ToAccountId32JunctionConverter, MatchesSwitchPairXcmFeeFungibleAsset}; +use pallet_deposit_storage::{DepositKeyOf, PalletDepositStorageReason}; use runtime_common::{ asset_switch::{hooks::RestrictSwitchDestinationToSelf, EnsureRootAsTreasury}, bonded_coins::{ hooks::NextAssetIdGenerator, AssetId, FixedPoint, FixedPointInput, NativeAndForeignAssets as NativeAndForeignAssetsType, TargetFromLeft, }, + deposits::DepositNamespace, AccountId, Balance, SendDustAndFeesToTreasury, }; -use sp_core::{ConstU128, ConstU32, ConstU8}; +use sp_core::{crypto::ByteArray, ConstU128, ConstU32, ConstU8}; +use sp_runtime::AccountId32; use sp_std::vec::Vec; use xcm::v4::{Junctions, Location}; use xcm_builder::{FungiblesAdapter, NoChecking}; @@ -36,8 +39,8 @@ use xcm_builder::{FungiblesAdapter, NoChecking}; use crate::{ constants, weights, xcm::{LocationToAccountIdConverter, UniversalLocation, XcmRouter}, - Balances, BondedCurrencies, BondedFungibles, Fungibles, PolkadotXcm, Runtime, RuntimeEvent, RuntimeFreezeReason, - RuntimeHoldReason, + Balances, BondedCurrencies, BondedFungibles, DepositStorage, Fungibles, PolkadotXcm, Runtime, RuntimeEvent, + RuntimeFreezeReason, RuntimeHoldReason, }; pub(crate) mod credential; @@ -131,13 +134,48 @@ impl InspectMetadata for MetadataProvider { pub type NativeAndForeignAssets = NativeAndForeignAssetsType, Location, AccountId, MetadataProvider>; +/// Wrapper around the `PalletDepositStorageReason` that returns a specific +/// `DepositNamespace` for the bonded coins deposits. +#[derive(Debug, Clone)] +pub struct BondedCoinsHoldReason(PalletDepositStorageReason); + +impl From for BondedCoinsHoldReason { + fn from(value: AccountId32) -> Self { + Self(PalletDepositStorageReason::new(DepositNamespace::BondedTokens, value)) + } +} + +impl From for RuntimeHoldReason { + fn from(value: BondedCoinsHoldReason) -> Self { + pallet_deposit_storage::HoldReason::from(value.0).into() + } +} + +pub struct LocalHoldReason(DepositKeyOf); + +impl TryFrom for LocalHoldReason { + type Error = (); + + fn try_from(value: AccountId32) -> Result { + DepositKeyOf::::try_from(value.to_raw_vec()) + .map(Self) + .map_err(|_| ()) + } +} + +impl From for PalletDepositStorageReason> { + fn from(value: LocalHoldReason) -> Self { + Self::new(DepositNamespace::BondedTokens, value.0) + } +} + impl pallet_bonded_coins::Config for Runtime { type BaseDeposit = ConstU128<{ constants::bonded_coins::BASE_DEPOSIT }>; type Collaterals = NativeAndForeignAssets; type CurveParameterInput = FixedPointInput; type CurveParameterType = FixedPoint; type DefaultOrigin = EnsureSigned; - type DepositCurrency = Balances; + type DepositCurrency = DepositStorage; type DepositPerCurrency = ConstU128<{ constants::bonded_coins::DEPOSIT_PER_CURRENCY }>; type ForceOrigin = EnsureRoot; type Fungibles = BondedFungibles; @@ -148,7 +186,8 @@ impl pallet_bonded_coins::Config for Runtime { type PoolCreateOrigin = EnsureSigned; type PoolId = AccountId; type RuntimeEvent = RuntimeEvent; - type RuntimeHoldReason = RuntimeHoldReason; + type HoldReason = LocalHoldReason; + type RuntimeHoldReason = PalletDepositStorageReason>; type WeightInfo = weights::pallet_bonded_coins::WeightInfo; #[cfg(feature = "runtime-benchmarks")] diff --git a/runtimes/peregrine/src/tests.rs b/runtimes/peregrine/src/tests.rs index 7d125a5d4..b9b7f4e95 100644 --- a/runtimes/peregrine/src/tests.rs +++ b/runtimes/peregrine/src/tests.rs @@ -35,7 +35,7 @@ use runtime_common::{ public_credentials::MAX_PUBLIC_CREDENTIAL_STORAGE_LENGTH, MAX_INDICES_BYTE_LENGTH, }, - dip::deposit::DepositKey, + deposits::DepositKey, AccountId, BlockNumber, };