diff --git a/tinyman/utils.py b/tinyman/utils.py index 5fc1776..791ec46 100644 --- a/tinyman/utils.py +++ b/tinyman/utils.py @@ -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") @@ -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"] diff --git a/tinyman/v2/utils.py b/tinyman/v2/utils.py index a26600f..ee3f4a1 100644 --- a/tinyman/v2/utils.py +++ b/tinyman/v2/utils.py @@ -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")