From 8e2cdd459e0b7a7fef08e97c0d9d736fdf5af8f3 Mon Sep 17 00:00:00 2001 From: Dylan Wilson Date: Thu, 9 Apr 2020 22:45:12 -0700 Subject: [PATCH] Fix test for web3 + POA test chain --- app/dashboard/tests/test_dashboard_utils.py | 3 ++- app/dashboard/utils.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/dashboard/tests/test_dashboard_utils.py b/app/dashboard/tests/test_dashboard_utils.py index 3819ce07508..ac0e4aff8a4 100644 --- a/app/dashboard/tests/test_dashboard_utils.py +++ b/app/dashboard/tests/test_dashboard_utils.py @@ -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) diff --git a/app/dashboard/utils.py b/app/dashboard/utils.py index dc3bfb85443..709f1a1f210 100644 --- a/app/dashboard/utils.py +++ b/app/dashboard/utils.py @@ -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 """ @@ -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,