Skip to content

Commit

Permalink
fix: fix #306
Browse files Browse the repository at this point in the history
  • Loading branch information
xeroc committed May 13, 2022
1 parent 0f1fd3e commit 3b38b99
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions bitsharesbase/operationids.py
Expand Up @@ -66,15 +66,14 @@
"liquidity_pool_withdraw",
"liquidity_pool_exchange",
]
operations = {o: ops.index(o) for o in ops}
operations = [x for x, _ in enumerate(ops)]


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


def getOperationName(id: str):
Expand Down

0 comments on commit 3b38b99

Please sign in to comment.