Skip to content

Commit

Permalink
Merge pull request #1777 from cyyber/dev
Browse files Browse the repository at this point in the history
Fix: walletd conversion of binary data in token name and symbol
  • Loading branch information
cyyber authored Aug 1, 2023
2 parents a7e751a + cd7e94d commit 85f9631
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/qrl/daemon/walletd.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,19 @@ def to_plain_transaction(self, tx):
ptx.message.message_hash = bin2hstr(tx.message.message_hash)

elif tx.WhichOneof('transactionType') == 'token':
ptx.token.symbol = tx.token.symbol
ptx.token.name = tx.token.name
try:
ptx.token.symbol = tx.token.symbol.decode()
except UnicodeDecodeError:
ptx.token.symbol = bin2hstr(tx.token.symbol)
except Exception:
ptx.token.symbol = str(tx.token.symbol)
try:
ptx.token.name = tx.token.name.decode()
except UnicodeDecodeError:
ptx.token.name = bin2hstr(tx.token.name)
except Exception:
ptx.token.name = str(tx.token.name)

ptx.token.owner = self.address_to_qaddress(tx.token.owner)
ptx.token.decimals = tx.token.decimals
for initial_balance in tx.token.initial_balances:
Expand Down

0 comments on commit 85f9631

Please sign in to comment.