@@ -280,8 +280,9 @@ async def process_events(self):
280280 event ["event" ]["module_id" ] == "System"
281281 and event ["event" ]["event_id" ] == "ExtrinsicSuccess"
282282 ):
283- self .__is_success = True
284- self .__error_message = None
283+ if self .__error_message is None :
284+ self .__is_success = True
285+ self .__error_message = None
285286
286287 if "dispatch_info" in event ["event" ]["attributes" ]:
287288 self .__weight = event ["event" ]["attributes" ]["dispatch_info" ][
@@ -294,13 +295,21 @@ async def process_events(self):
294295 elif (
295296 event ["event" ]["module_id" ] == "System"
296297 and event ["event" ]["event_id" ] == "ExtrinsicFailed"
298+ ) or (
299+ event ["event" ]["module_id" ] == "MevShield"
300+ and event ["event" ]["event_id" ] == "DecryptedRejected"
297301 ):
298302 self .__is_success = False
299303
300- dispatch_info = event ["event" ]["attributes" ]["dispatch_info" ]
301- dispatch_error = event ["event" ]["attributes" ]["dispatch_error" ]
302-
303- self .__weight = dispatch_info ["weight" ]
304+ if event ["event" ]["module_id" ] == "System" :
305+ dispatch_info = event ["event" ]["attributes" ]["dispatch_info" ]
306+ dispatch_error = event ["event" ]["attributes" ]["dispatch_error" ]
307+ self .__weight = dispatch_info ["weight" ]
308+ else :
309+ # MEV shield extrinsics
310+ dispatch_info = event ["event" ]["attributes" ]["reason" ]["post_info" ]
311+ dispatch_error = event ["event" ]["attributes" ]["reason" ]["error" ]
312+ self .__weight = event ["event" ]["attributes" ]["reason" ]["post_info" ]["actual_weight" ]
304313
305314 if "Module" in dispatch_error :
306315 if isinstance (dispatch_error ["Module" ], tuple ):
0 commit comments