Skip to content

Commit

Permalink
Ensure source always from AH
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Dec 11, 2024
1 parent 48c28d4 commit 8a88a8b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bridges/snowbridge/primitives/router/src/outbound/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ use sp_std::{iter::Peekable, marker::PhantomData, prelude::*};
use xcm::prelude::*;
use xcm_executor::traits::{ConvertLocation, ExportXcm};

pub const ASSET_HUB_PARA_ID:u32 = 1000;

pub struct EthereumBlobExporter<
UniversalLocation,
EthereumNetwork,
Expand Down Expand Up @@ -94,13 +96,16 @@ where
return Err(SendError::NotApplicable)
}

// Check the location here can only be AssetHub sovereign
ensure!(local_sub.len() == 1, SendError::NotApplicable);
let para_id = match local_sub.as_slice() {
[Parachain(para_id)] => *para_id,
_ => {
log::error!(target: "xcm::ethereum_blob_exporter", "could not get parachain id from universal source '{local_sub:?}'.");
return Err(SendError::NotApplicable)
return Err(SendError::NotApplicable);
},
};
ensure!(para_id == ASSET_HUB_PARA_ID, SendError::NotApplicable);

let source_location = Location::new(1, local_sub.clone());

Expand Down

0 comments on commit 8a88a8b

Please sign in to comment.