Skip to content

Commit 16b6dfb

Browse files
committed
Revert "fix: fix #306"
This reverts commit 3b38b99.
1 parent 2065105 commit 16b6dfb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

bitsharesbase/operationids.py

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

7171

72-
def getOperationNameForId(i: int):
72+
def getOperationNameForId(i):
7373
"""Convert an operation id into the corresponding string."""
74-
if i < len(ops):
75-
return ops[i]
76-
return f"Unknown Operation ID {i}"
74+
for key in operations:
75+
if int(operations[key]) is int(i):
76+
return key
77+
return "Unknown Operation ID %d" % i
7778

7879

7980
def getOperationName(id: str):

0 commit comments

Comments
 (0)