mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 15:51:04 +00:00
Fix for FungiblesAdapter - trait changes: Contains -> AssetChecking
This commit is contained in:
@@ -31,7 +31,7 @@ use frame_support::{
|
||||
log, match_types, parameter_types,
|
||||
traits::{
|
||||
fungibles::{self, Balanced, CreditOf},
|
||||
ConstU32, Contains, ContainsPair, Everything, Get, Nothing,
|
||||
ConstU32, ContainsPair, Everything, Get, Nothing,
|
||||
},
|
||||
};
|
||||
use pallet_asset_tx_payment::HandleCredit;
|
||||
@@ -43,10 +43,10 @@ use xcm::latest::{prelude::*, Weight as XCMWeight};
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
|
||||
AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, AsPrefixedGeneralIndex,
|
||||
ConvertedConcreteId, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds, FungiblesAdapter,
|
||||
IsConcrete, NativeAsset, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative,
|
||||
SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32,
|
||||
SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
|
||||
AssetChecking, ConvertedConcreteId, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds,
|
||||
FungiblesAdapter, IsConcrete, MintLocation, NativeAsset, ParentIsPreset, RelayChainAsNative,
|
||||
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
|
||||
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
|
||||
};
|
||||
use xcm_executor::{
|
||||
traits::{JustTry, ShouldExecute},
|
||||
@@ -244,13 +244,16 @@ impl<T: Get<MultiLocation>> ContainsPair<MultiAsset, MultiLocation> for AssetsFr
|
||||
|
||||
/// Allow checking in assets that have issuance > 0.
|
||||
pub struct NonZeroIssuance<AccountId, Assets>(PhantomData<(AccountId, Assets)>);
|
||||
impl<AccountId, Assets> Contains<<Assets as fungibles::Inspect<AccountId>>::AssetId>
|
||||
for NonZeroIssuance<AccountId, Assets>
|
||||
impl<AccountId, Assets> AssetChecking<Assets::AssetId> for NonZeroIssuance<AccountId, Assets>
|
||||
where
|
||||
Assets: fungibles::Inspect<AccountId>,
|
||||
{
|
||||
fn contains(id: &<Assets as fungibles::Inspect<AccountId>>::AssetId) -> bool {
|
||||
!Assets::total_issuance(*id).is_zero()
|
||||
fn asset_checking(id: &Assets::AssetId) -> Option<MintLocation> {
|
||||
if Assets::total_issuance(*id).is_zero() {
|
||||
None
|
||||
} else {
|
||||
Some(MintLocation::Local)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user