@@ -40,7 +40,7 @@ use xcm_builder::{
40
40
MintLocation , NoChecking , TakeWeightCredit ,
41
41
} ;
42
42
use xcm_executor:: {
43
- traits:: { ConvertLocation , EventEmitter , JustTry } ,
43
+ traits:: { ConvertLocation , JustTry } ,
44
44
XcmExecutor ,
45
45
} ;
46
46
@@ -296,92 +296,11 @@ pub type Barrier = (
296
296
297
297
pub type Trader = FixedRateOfFungible < NativeTokenPerSecondPerByte , ( ) > ;
298
298
299
- thread_local ! {
300
- static EMITTED_EVENTS : RefCell <Vec <<TestRuntime as frame_system:: Config >:: RuntimeEvent >> = RefCell :: new( Vec :: new( ) ) ;
301
- }
302
- pub struct TestEventEmitter { }
303
- impl TestEventEmitter {
304
- pub fn events ( ) -> Vec < <TestRuntime as frame_system:: Config >:: RuntimeEvent > {
305
- EMITTED_EVENTS . with ( |events| events. borrow ( ) . clone ( ) )
306
- }
307
-
308
- pub fn reset_events ( ) {
309
- EMITTED_EVENTS . with ( |events| events. borrow_mut ( ) . clear ( ) ) ;
310
- }
311
- }
312
- impl EventEmitter for TestEventEmitter {
313
- fn emit_sent_event (
314
- origin : Location ,
315
- destination : Location ,
316
- message : Option < Xcm < ( ) > > ,
317
- message_id : XcmHash ,
318
- ) {
319
- sp_tracing:: tracing:: trace!( target: "xcm::mock" ,
320
- ?origin,
321
- ?destination,
322
- ?message,
323
- ?message_id,
324
- "EventEmitter::emit_sent_event =>"
325
- ) ;
326
- XcmPallet :: emit_sent_event ( origin, destination, message, message_id) ;
327
- let events = frame_system:: Pallet :: < TestRuntime > :: events ( ) ;
328
- if let Some ( event) = events. last ( ) {
329
- EMITTED_EVENTS . with ( |q| q. borrow_mut ( ) . push ( event. event . clone ( ) ) ) ;
330
- sp_tracing:: tracing:: trace!( target: "xcm::mock" ,
331
- ?event,
332
- "EventEmitter::emit_sent_event <="
333
- ) ;
334
- }
335
- }
336
-
337
- fn emit_send_failure_event (
338
- origin : Location ,
339
- destination : Location ,
340
- error : SendError ,
341
- message_id : XcmHash ,
342
- ) {
343
- sp_tracing:: tracing:: debug!( target: "xcm::mock" ,
344
- ?origin,
345
- ?destination,
346
- ?error,
347
- ?message_id,
348
- "EventEmitter::emit_send_failure_event =>"
349
- ) ;
350
- XcmPallet :: emit_send_failure_event ( origin, destination, error, message_id) ;
351
- let events = frame_system:: Pallet :: < TestRuntime > :: events ( ) ;
352
- if let Some ( event) = events. last ( ) {
353
- EMITTED_EVENTS . with ( |q| q. borrow_mut ( ) . push ( event. event . clone ( ) ) ) ;
354
- sp_tracing:: tracing:: debug!( target: "xcm::mock" ,
355
- ?event,
356
- "EventEmitter::emit_send_failure_event <="
357
- ) ;
358
- }
359
- }
360
-
361
- fn emit_process_failure_event ( origin : Location , error : XcmError , message_id : XcmHash ) {
362
- sp_tracing:: tracing:: debug!( target: "xcm::mock" ,
363
- ?origin,
364
- ?error,
365
- ?message_id,
366
- "EventEmitter::emit_process_failure_event =>"
367
- ) ;
368
- XcmPallet :: emit_process_failure_event ( origin, error, message_id) ;
369
- let events = frame_system:: Pallet :: < TestRuntime > :: events ( ) ;
370
- if let Some ( event) = events. last ( ) {
371
- EMITTED_EVENTS . with ( |q| q. borrow_mut ( ) . push ( event. event . clone ( ) ) ) ;
372
- sp_tracing:: tracing:: debug!( target: "xcm::mock" ,
373
- ?event,
374
- "EventEmitter::emit_process_failure_event <="
375
- ) ;
376
- }
377
- }
378
- }
379
-
380
299
pub struct XcmConfig ;
381
300
impl xcm_executor:: Config for XcmConfig {
382
301
type RuntimeCall = RuntimeCall ;
383
302
type XcmSender = XcmRouter ;
384
- type XcmEventEmitter = TestEventEmitter ;
303
+ type XcmEventEmitter = XcmPallet ;
385
304
type AssetTransactor = AssetTransactors ;
386
305
type OriginConverter = ( ) ;
387
306
type IsReserve = RelayTokenToAssetHub ;
0 commit comments