We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f1fd3e commit 3b38b99Copy full SHA for 3b38b99
bitsharesbase/operationids.py
@@ -66,15 +66,14 @@
66
"liquidity_pool_withdraw",
67
"liquidity_pool_exchange",
68
]
69
-operations = {o: ops.index(o) for o in ops}
+operations = [x for x, _ in enumerate(ops)]
70
71
72
-def getOperationNameForId(i):
+def getOperationNameForId(i: int):
73
"""Convert an operation id into the corresponding string."""
74
- for key in operations:
75
- if int(operations[key]) is int(i):
76
- return key
77
- return "Unknown Operation ID %d" % i
+ if i < len(ops):
+ return ops[i]
+ return f"Unknown Operation ID {i}"
78
79
80
def getOperationName(id: str):
0 commit comments