Skip to content

Commit

Permalink
Fix case sensitive golos address comparison
Browse files Browse the repository at this point in the history
Addresses in golos blockchain are lowercase only.

Signed-off-by: alfred richardsn <rchrdsn@protonmail.ch>
  • Loading branch information
r4rdsn committed Jun 11, 2020
1 parent 9697bb8 commit d509036
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/escrow/blockchain/golos_blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,14 @@ async def get_limits(self, asset: str):

async def transfer(self, to: str, amount: Decimal, asset: str, memo: str = ""):
transaction = await get_running_loop().run_in_executor(
None, self._golos.transfer, to, amount, self.address, self.wif, asset, memo,
None,
self._golos.transfer,
to.lower(),
amount,
self.address,
self.wif,
asset,
memo,
)
return self.trx_url(transaction["id"])

Expand Down Expand Up @@ -159,7 +166,7 @@ async def _check_operation(
date = datetime.strptime(op["timestamp"], "%Y-%m-%dT%H:%M:%S")
if timegm(date.timetuple()) < req["transaction_time"]:
continue
if op["to"] != self.address or op["from"] != req["from_address"]:
if op["to"] != self.address or op["from"] != req["from_address"].lower():
continue
if "timeout_handler" in req:
req["timeout_handler"].cancel()
Expand Down

0 comments on commit d509036

Please sign in to comment.