Skip to content

Commit 3e65142

Browse files
[xcm-builder] Replaced deprecated CurrencyAdapter with FungibleAdapter (paritytech#3287)
I found out during the cleanup of this deprecation message in the `polkadot-fellows` repository that we deprecated `CurrencyAdapter` without making the recommended changes. ## TODO - [ ] fix `polkadot-fellows` bump to 1.6.0 polkadot-fellows/runtimes#159 --------- Co-authored-by: Francisco Aguirre <[email protected]>
1 parent 6ea9431 commit 3e65142

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

substrate/frame/contracts/mock-network/src/parachain.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,11 @@ use sp_runtime::traits::{Get, IdentityLookup, MaybeEquivalence};
3737

3838
use sp_std::prelude::*;
3939
use xcm::latest::prelude::*;
40-
#[allow(deprecated)]
41-
use xcm_builder::CurrencyAdapter as XcmCurrencyAdapter;
4240
use xcm_builder::{
4341
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowTopLevelPaidExecutionFrom,
4442
ConvertedConcreteId, EnsureXcmOrigin, FixedRateOfFungible, FixedWeightBounds,
45-
FrameTransactionalProcessor, FungiblesAdapter, IsConcrete, NativeAsset, NoChecking,
46-
ParentAsSuperuser, ParentIsPreset, SignedAccountId32AsNative, SignedToAccountId32,
43+
FrameTransactionalProcessor, FungibleAdapter, FungiblesAdapter, IsConcrete, NativeAsset,
44+
NoChecking, ParentAsSuperuser, ParentIsPreset, SignedAccountId32AsNative, SignedToAccountId32,
4745
SovereignSignedViaLocation, WithComputedOrigin,
4846
};
4947
use xcm_executor::{traits::JustTry, Config, XcmExecutor};
@@ -184,9 +182,8 @@ pub fn estimate_fee_for_weight(weight: Weight) -> u128 {
184182
units_per_mb * (weight.proof_size() as u128) / (WEIGHT_PROOF_SIZE_PER_MB as u128)
185183
}
186184

187-
#[allow(deprecated)]
188185
pub type LocalBalancesTransactor =
189-
XcmCurrencyAdapter<Balances, IsConcrete<TokenLocation>, SovereignAccountOf, AccountId, ()>;
186+
FungibleAdapter<Balances, IsConcrete<TokenLocation>, SovereignAccountOf, AccountId, ()>;
190187

191188
pub struct FromLocationToAsset<Location, AssetId>(PhantomData<(Location, AssetId)>);
192189
impl MaybeEquivalence<Location, AssetIdForAssets>

substrate/frame/contracts/mock-network/src/relay_chain.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ use sp_runtime::traits::IdentityLookup;
2929
use polkadot_parachain_primitives::primitives::Id as ParaId;
3030
use polkadot_runtime_parachains::{configuration, origin, shared};
3131
use xcm::latest::prelude::*;
32-
#[allow(deprecated)]
33-
use xcm_builder::CurrencyAdapter as XcmCurrencyAdapter;
3432
use xcm_builder::{
3533
AccountId32Aliases, AllowExplicitUnpaidExecutionFrom, AllowSubscriptionsFrom,
3634
AllowTopLevelPaidExecutionFrom, ChildParachainAsNative, ChildParachainConvertsVia,
3735
ChildSystemParachainAsSuperuser, DescribeAllTerminal, DescribeFamily, FixedRateOfFungible,
38-
FixedWeightBounds, FrameTransactionalProcessor, HashedDescription, IsConcrete,
36+
FixedWeightBounds, FrameTransactionalProcessor, FungibleAdapter, HashedDescription, IsConcrete,
3937
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, WithComputedOrigin,
4038
};
4139
use xcm_executor::{Config, XcmExecutor};
@@ -119,9 +117,8 @@ pub type SovereignAccountOf = (
119117
ChildParachainConvertsVia<ParaId, AccountId>,
120118
);
121119

122-
#[allow(deprecated)]
123120
pub type LocalBalancesTransactor =
124-
XcmCurrencyAdapter<Balances, IsConcrete<TokenLocation>, SovereignAccountOf, AccountId, ()>;
121+
FungibleAdapter<Balances, IsConcrete<TokenLocation>, SovereignAccountOf, AccountId, ()>;
125122

126123
pub type AssetTransactors = LocalBalancesTransactor;
127124

0 commit comments

Comments
 (0)