Skip to content

Commit

Permalink
fix xcm barrier to allow SetTopic
Browse files Browse the repository at this point in the history
  • Loading branch information
mn13 committed Nov 13, 2023
1 parent b6abd38 commit 1859169
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions eq-xcm/src/barrier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ use xcm_executor::traits::ShouldExecute;
pub struct AllowReserveAssetDepositedFrom<EqAssets, AllowedOrigins>(
PhantomData<(EqAssets, AllowedOrigins)>,
);
impl<EqAssets: AssetXcmGetter, AllowedOrigins: Contains<MultiLocation>> ShouldExecute
for AllowReserveAssetDepositedFrom<EqAssets, AllowedOrigins>

impl<EqAssets: AssetXcmGetter, AllowedOrigins: Contains<MultiLocation>>
AllowReserveAssetDepositedFrom<EqAssets, AllowedOrigins>
{
fn should_execute<RuntimeCall>(
fn check<RuntimeCall>(
origin: &MultiLocation,
instructions: &mut [Instruction<RuntimeCall>],
max_weight: Weight,
Expand Down Expand Up @@ -88,6 +89,23 @@ impl<EqAssets: AssetXcmGetter, AllowedOrigins: Contains<MultiLocation>> ShouldEx
}
}

impl<EqAssets: AssetXcmGetter, AllowedOrigins: Contains<MultiLocation>> ShouldExecute
for AllowReserveAssetDepositedFrom<EqAssets, AllowedOrigins>
{
fn should_execute<RuntimeCall>(
origin: &MultiLocation,
instructions: &mut [Instruction<RuntimeCall>],
max_weight: Weight,
_weight_credit: &mut Weight,
) -> Result<(), ProcessMessageError> {
if let Some((SetTopic(_), rest)) = instructions.split_last_mut() {
Self::check(origin, rest, max_weight, _weight_credit)
} else {
Self::check(origin, instructions, max_weight, _weight_credit)
}
}
}

pub struct AllowReserveTransferAssetsFromAccountId;

impl ShouldExecute for AllowReserveTransferAssetsFromAccountId {
Expand Down

0 comments on commit 1859169

Please sign in to comment.