diff --git a/cumulus/xcm/xcm-emulator/src/lib.rs b/cumulus/xcm/xcm-emulator/src/lib.rs index 27118f3f0caf7..4084b90d6e7bf 100644 --- a/cumulus/xcm/xcm-emulator/src/lib.rs +++ b/cumulus/xcm/xcm-emulator/src/lib.rs @@ -1489,15 +1489,17 @@ where } } +pub type MessageOriginFor = + <<::Runtime as MessageQueueConfig>::MessageProcessor as ProcessMessage>::Origin; + pub struct DefaultRelayMessageProcessor(PhantomData); // Process UMP messages on the relay impl ProcessMessage for DefaultRelayMessageProcessor where T: RelayChain, T::Runtime: MessageQueueConfig, - <::MessageProcessor as ProcessMessage>::Origin: - PartialEq, - MessageQueuePallet: EnqueueMessage + ServiceQueues, + MessageOriginFor: From, + MessageQueuePallet: EnqueueMessage> + ServiceQueues, { type Origin = ParaId; @@ -1509,7 +1511,7 @@ where ) -> Result { MessageQueuePallet::::enqueue_message( msg.try_into().expect("Message too long"), - AggregateMessageOrigin::Ump(UmpQueueId::Para(para)), + AggregateMessageOrigin::Ump(UmpQueueId::Para(para)).into(), ); MessageQueuePallet::::service_queues(Weight::MAX); @@ -1521,9 +1523,8 @@ impl ServiceQueues for DefaultRelayMessageProcessor where T: RelayChain, T::Runtime: MessageQueueConfig, - <::MessageProcessor as ProcessMessage>::Origin: - PartialEq, - MessageQueuePallet: EnqueueMessage + ServiceQueues, + MessageOriginFor: From, + MessageQueuePallet: EnqueueMessage> + ServiceQueues, { type OverweightMessageAddress = (); diff --git a/prdoc/pr_10158.prdoc b/prdoc/pr_10158.prdoc new file mode 100644 index 0000000000000..992461d6f6906 --- /dev/null +++ b/prdoc/pr_10158.prdoc @@ -0,0 +1,10 @@ +title: allow more generic origins in xcm-emulator message processor +doc: +- audience: Runtime Dev + description: |- + Right now the default message processor is somewhat tied to specific `AggregateMessageOrigin` from `polkadot_runtime_parachains::inclusion`. this pr changes it so that we require a conversion from that AggregateMessageOrigin, but nothing else, the rest stays generic. + + In the longer run we can allow customizing the processor to some other thing, but this was a sufficiently easier change +crates: +- name: xcm-emulator + bump: patch