Skip to content

Commit

Permalink
Merge pull request #236 from bancorprotocol/235-error-reading-updatin…
Browse files Browse the repository at this point in the history
…g-pool-decimals

add float wrapper incase decimal input is string
  • Loading branch information
NIXBNT authored Nov 29, 2023
2 parents 4caa273 + 48b305d commit eb67be9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fastlane_bot/events/managers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ def get_tkn_symbol_and_decimals(

record = next((add for add in self.tokens if add["address"] == addr), None)
if record:
return record["symbol"], int(record["decimals"])
return record["symbol"], int(float(record["decimals"]))

return self.get_token_info_from_contract(web3, erc20_contracts, addr)

Expand Down
2 changes: 1 addition & 1 deletion fastlane_bot/events/managers/contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def _get_and_save_token_info_from_contract(
decimals = token_data.loc[token_data["key"] == key, "decimals"].iloc[0]
return symbol, decimals
else:
decimals = int(contract.functions.decimals().call())
decimals = int(float(contract.functions.decimals().call()))

if (
symbol is None
Expand Down

0 comments on commit eb67be9

Please sign in to comment.