Skip to content

Commit 968846c

Browse files
committed
apply addition in sync_substrate
1 parent 4d63306 commit 968846c

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

async_substrate_interface/sync_substrate.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ def process_events(self):
258258
and event["event"]["event_id"] == "ExtrinsicFailed"
259259
) or (
260260
event["event"]["module_id"] == "MevShield"
261-
and event["event"]["event_id"] == "DecryptedRejected"
261+
and event["event"]["event_id"]
262+
in ("DecryptedRejected", "DecryptionFailed")
262263
):
263264
possible_success = False
264265
self.__is_success = False
@@ -269,13 +270,23 @@ def process_events(self):
269270
self.__weight = dispatch_info["weight"]
270271
else:
271272
# MEV shield extrinsics
272-
dispatch_info = event["event"]["attributes"]["reason"][
273-
"post_info"
274-
]
275-
dispatch_error = event["event"]["attributes"]["reason"]["error"]
276-
self.__weight = event["event"]["attributes"]["reason"][
277-
"post_info"
278-
]["actual_weight"]
273+
if event["event"]["event_id"] == "DecryptedRejected":
274+
dispatch_info = event["event"]["attributes"]["reason"][
275+
"post_info"
276+
]
277+
dispatch_error = event["event"]["attributes"]["reason"][
278+
"error"
279+
]
280+
self.__weight = event["event"]["attributes"]["reason"][
281+
"post_info"
282+
]["actual_weight"]
283+
else:
284+
self.__error_message = {
285+
"type": "MevShield",
286+
"name": "DecryptionFailed",
287+
"docs": event["event"]["attributes"]["reason"],
288+
}
289+
continue
279290

280291
if "Module" in dispatch_error:
281292
if isinstance(dispatch_error["Module"], tuple):

0 commit comments

Comments
 (0)