remove unnecessary argument encoding from bytes.decode() and str.encode()

the encoding parameter defaults to utf-8, so it's not needed
This commit is contained in:
Pavol Rusnak
2023-01-03 22:38:28 +01:00
parent c9b02a6470
commit 3d0c66f0f6
20 changed files with 31 additions and 33 deletions
+2 -2
View File
@@ -74,7 +74,7 @@ def decode(pr: str) -> Invoice:
data_length = len(tagdata) / 5
if tag == "d":
invoice.description = _trim_to_bytes(tagdata).decode("utf-8")
invoice.description = _trim_to_bytes(tagdata).decode()
elif tag == "h" and data_length == 52:
invoice.description_hash = _trim_to_bytes(tagdata).hex()
elif tag == "p" and data_length == 52:
@@ -260,7 +260,7 @@ class LnAddr(object):
def __str__(self):
return "LnAddr[{}, amount={}{} tags=[{}]]".format(
bytes.hex(self.pubkey.serialize()).decode("utf-8"),
bytes.hex(self.pubkey.serialize()).decode(),
self.amount,
self.currency,
", ".join([k + "=" + str(v) for k, v in self.tags]),