Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
etzellux committed Jan 31, 2025
1 parent 08ffe96 commit 3ea0cad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tinyman/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def int_list_to_bytes(nums):


def bytes_to_int(b):
if type(b) == str:
if isinstance(b, str):
b = b64decode(b)
return int.from_bytes(b, "big")

Expand All @@ -78,13 +78,13 @@ def bytes_to_int_list(b):


def get_state_int(state, key):
if type(key) == str:
if isinstance(key, str):
key = b64encode(key.encode())
return state.get(key.decode(), {"uint": 0})["uint"]


def get_state_bytes(state, key):
if type(key) == str:
if isinstance(key, str):
key = b64encode(key.encode())
return state.get(key.decode(), {"bytes": ""})["bytes"]

Expand Down
2 changes: 1 addition & 1 deletion tinyman/v2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
def decode_logs(logs: "list") -> dict:
decoded_logs = dict()
for log in logs:
if type(log) == str:
if isinstance(log, str):
log = b64decode(log.encode())
if b"%i" in log:
i = log.index(b"%i")
Expand Down

0 comments on commit 3ea0cad

Please sign in to comment.