Skip to content

Commit

Permalink
Fix test for web3 + POA test chain
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanjw committed Apr 10, 2020
1 parent 14c702b commit 8e2cdd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/dashboard/tests/test_dashboard_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,11 @@ def test_release_bounty_to_public_is_successful():
@staticmethod
def test_get_token_recipient_senders():
addresses = get_token_recipient_senders(
'rinkeby',
token_address="0x8ad3aA5d5ff084307d28C8f514D7a193B2Bfe725",
recipient_address="0x03bCeC53fD1a2617a3B064eE8fE4f4c4aacc765B")

def validate(address):
is_address(address) or address == "0x0"
return is_address(address) or address == "0x0"

assert all(validate(address) for address in addresses)
6 changes: 3 additions & 3 deletions app/dashboard/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ def get_profile_from_referral_code(code):

def get_bounty_invite_url(inviter, bounty_id):
"""Returns a unique url for each bounty and one who is inviting
Returns:
A unique string for each bounty
"""
Expand Down Expand Up @@ -1035,8 +1034,9 @@ def _extract_sender_address_from_log(log):
return decode_single("address", log['topics'][1])


def get_token_recipient_senders(recipient_address, token_address):
w3 = Web3(HTTPProvider(settings.WEB3_HTTP_PROVIDER))
def get_token_recipient_senders(network, recipient_address, token_address):
w3 = get_web3(network)

contract = w3.eth.contract(
address=token_address,
abi=erc20_abi,
Expand Down

0 comments on commit 8e2cdd4

Please sign in to comment.