mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 11:41:02 +00:00
Make xcm-simulator async with more tests (#3618)
* make xcm simulator async * fmt * nightly fmt * Update xcm/xcm-simulator/example/src/parachain.rs Co-authored-by: Keith Yeung <kungfukeith11@gmail.com> * accept keith review suggestion * master.into Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
@@ -166,6 +166,11 @@ pub mod mock_msg_queue {
|
||||
#[pallet::getter(fn parachain_id)]
|
||||
pub(super) type ParachainId<T: Config> = StorageValue<_, ParaId, ValueQuery>;
|
||||
|
||||
#[pallet::storage]
|
||||
#[pallet::getter(fn received_dmp)]
|
||||
/// A queue of received DMP messages
|
||||
pub(super) type ReceivedDmp<T: Config> = StorageValue<_, Vec<Xcm<T::Call>>, ValueQuery>;
|
||||
|
||||
impl<T: Config> Get<ParaId> for Pallet<T> {
|
||||
fn get() -> ParaId {
|
||||
Self::parachain_id()
|
||||
@@ -266,7 +271,8 @@ pub mod mock_msg_queue {
|
||||
Self::deposit_event(Event::UnsupportedVersion(id));
|
||||
},
|
||||
Ok(Ok(x)) => {
|
||||
let outcome = T::XcmExecutor::execute_xcm(Parent.into(), x, limit);
|
||||
let outcome = T::XcmExecutor::execute_xcm(Parent.into(), x.clone(), limit);
|
||||
<ReceivedDmp<T>>::append(x);
|
||||
Self::deposit_event(Event::ExecutedDownward(id, outcome));
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user