Skip to content

Commit 3b38b99

Browse files
committed
fix: fix bitshares#306
1 parent 0f1fd3e commit 3b38b99

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

bitsharesbase/operationids.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,14 @@
6666
"liquidity_pool_withdraw",
6767
"liquidity_pool_exchange",
6868
]
69-
operations = {o: ops.index(o) for o in ops}
69+
operations = [x for x, _ in enumerate(ops)]
7070

7171

72-
def getOperationNameForId(i):
72+
def getOperationNameForId(i: int):
7373
"""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
74+
if i < len(ops):
75+
return ops[i]
76+
return f"Unknown Operation ID {i}"
7877

7978

8079
def getOperationName(id: str):

0 commit comments

Comments
 (0)