Skip to content

Commit

Permalink
fixed token tap migration to web3 newer version
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamad Bastin committed Oct 2, 2023
1 parent 315b2d3 commit 3674d47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions faucet/faucet_manager/credit_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def get_claimed(self):
return _sum

def get_unclaimed(self):
print("max_claim_amount", self.chain.max_claim_amount)
print("get_claimed", self.get_claimed())
return self.chain.max_claim_amount - self.get_claimed()
# print("max_claim_amount", self.chain.max_claim_amount)
# print("get_claimed", self.get_claimed())
return int(self.chain.max_claim_amount) - int(self.get_claimed())


class WeeklyCreditStrategy(SimpleCreditStrategy):
Expand Down
4 changes: 2 additions & 2 deletions tokenTap/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ def create_uint32_random_nonce():

def hash_message(user, token, amount, nonce):

message_hash = Web3().solidityKeccak(
message_hash = Web3().solidity_keccak(
["address", "address", "uint256", "uint32"],
[Web3.toChecksumAddress(user), Web3.toChecksumAddress(token), amount, nonce],
[Web3.to_checksum_address(user), Web3.to_checksum_address(token), amount, nonce],
)
hashed_message = encode_defunct(hexstr=message_hash.hex())

Expand Down

0 comments on commit 3674d47

Please sign in to comment.