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 2065105 commit 16b6dfbCopy full SHA for 16b6dfb
bitsharesbase/operationids.py
@@ -66,14 +66,15 @@
66
"liquidity_pool_withdraw",
67
"liquidity_pool_exchange",
68
]
69
-operations = [x for x, _ in enumerate(ops)]
+operations = {o: ops.index(o) for o in ops}
70
71
72
-def getOperationNameForId(i: int):
+def getOperationNameForId(i):
73
"""Convert an operation id into the corresponding string."""
74
- if i < len(ops):
75
- return ops[i]
76
- return f"Unknown Operation ID {i}"
+ for key in operations:
+ if int(operations[key]) is int(i):
+ return key
77
+ return "Unknown Operation ID %d" % i
78
79
80
def getOperationName(id: str):
0 commit comments