File tree Expand file tree Collapse file tree 2 files changed +10
-19
lines changed
bridges/snowbridge/primitives/router/src/outbound
cumulus/parachains/runtimes/assets/asset-hub-westend/src Expand file tree Collapse file tree 2 files changed +10
-19
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ use sp_core::{H160, H256};
2121use sp_runtime:: traits:: MaybeEquivalence ;
2222use sp_std:: { iter:: Peekable , marker:: PhantomData , prelude:: * } ;
2323use xcm:: prelude:: * ;
24- use xcm_builder:: { ExporterFor , NetworkExportTableItem } ;
24+ use xcm_builder:: { ExporterFor , NetworkExportTable , NetworkExportTableItem } ;
2525use xcm_executor:: traits:: { ConvertLocation , ExportXcm } ;
2626
2727pub struct EthereumBlobExporter <
@@ -424,16 +424,11 @@ impl<T: Get<Vec<NetworkExportTableItem>>, M: Contains<Xcm<()>>> ExporterFor
424424 remote_location : & InteriorLocation ,
425425 xcm : & Xcm < ( ) > ,
426426 ) -> Option < ( Location , Option < Asset > ) > {
427- T :: get ( )
428- . into_iter ( )
429- . find ( |item| {
430- & item. remote_network == network &&
431- M :: contains ( xcm) &&
432- item. remote_location_filter
433- . as_ref ( )
434- . map ( |filters| filters. iter ( ) . any ( |filter| filter == remote_location) )
435- . unwrap_or ( true )
436- } )
437- . map ( |item| ( item. bridge , item. payment ) )
427+ // check the XCM
428+ if !M :: contains ( xcm) {
429+ return None
430+ }
431+ // check `network` and `remote_location`
432+ NetworkExportTable :: < T > :: exporter_for ( network, remote_location, xcm)
438433 }
439434}
Original file line number Diff line number Diff line change @@ -659,7 +659,7 @@ pub mod bridging {
659659 use super :: * ;
660660 use assets_common:: matching:: FromNetwork ;
661661 use core:: ops:: ControlFlow ;
662- use frame_support:: traits:: { EverythingBut , ProcessMessageError } ;
662+ use frame_support:: traits:: ProcessMessageError ;
663663 use sp_std:: collections:: btree_set:: BTreeSet ;
664664 use testnet_parachains_constants:: westend:: snowbridge:: {
665665 EthereumNetwork , INBOUND_QUEUE_PALLET_INDEX ,
@@ -734,7 +734,7 @@ pub mod bridging {
734734 |_| true ,
735735 |inst| {
736736 return match inst {
737- AliasOrigin ( ..) => Err ( ProcessMessageError :: Unsupported ) ,
737+ AliasOrigin ( ..) => Err ( ProcessMessageError :: Yield ) ,
738738 _ => Ok ( ControlFlow :: Continue ( ( ) ) ) ,
739739 }
740740 } ,
@@ -749,11 +749,7 @@ pub mod bridging {
749749 XcmForSnowbridgeV2 ,
750750 > ;
751751
752- pub type EthereumNetworkExportTable =
753- snowbridge_router_primitives:: outbound:: NetworkWithXcmExportTable <
754- EthereumBridgeTable ,
755- EverythingBut < XcmForSnowbridgeV2 > ,
756- > ;
752+ pub type EthereumNetworkExportTable = xcm_builder:: NetworkExportTable < EthereumBridgeTable > ;
757753
758754 pub type IsTrustedBridgedReserveLocationForForeignAsset =
759755 IsForeignConcreteAsset < FromNetwork < UniversalLocation , EthereumNetwork > > ;
You can’t perform that action at this time.
0 commit comments