Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix tests by updating web3 #386

Merged
merged 6 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ requests>=2.28.1
safe-cli==0.7.0
safe-eth-py==5.5.0
slackclient==2.9.4
web3==6.5.0
web3>=6.20.0
bh2smith marked this conversation as resolved.
Show resolved Hide resolved
SQLAlchemy<2.0.0
sqlalchemy-stubs==0.4
pandas==2.0.3
Expand Down
4 changes: 1 addition & 3 deletions tests/e2e/test_post_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ def setUp(self) -> None:
self.test_safe = "0xAb4178341C37e2307726361eEAE47FCA606cd458"
self.cow = Token("0x3430d04E42a722c5Ae52C5Bffbf1F230C2677600", 18)
self.receiver = Address("0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0")
self.client = EthereumClient(
URI(f"https://goerli.infura.io/v3/{os.environ.get('INFURA_KEY')}")
)
self.client = EthereumClient(URI("https://rpc.ankr.com/eth_goerli"))
bh2smith marked this conversation as resolved.
Show resolved Hide resolved

def test_token_decimals(self):
token_transfer = Transfer(
Expand Down
3 changes: 1 addition & 2 deletions tests/e2e/test_token_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
from dune_client.types import Address
from web3 import Web3

from src.constants import INFURA_KEY
from src.utils.token_details import get_token_decimals

W3 = Web3(Web3.HTTPProvider(f"https://goerli.infura.io/v3/{INFURA_KEY}"))
W3 = Web3(Web3.HTTPProvider("https://rpc.ankr.com/eth_goerli"))
bh2smith marked this conversation as resolved.
Show resolved Hide resolved


class TestTokenDecimals(unittest.TestCase):
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_multisend.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
from web3 import Web3

from src.abis.load import weth9
from src.constants import COW_TOKEN_ADDRESS, INFURA_KEY
from src.constants import COW_TOKEN_ADDRESS
from src.fetch.transfer_file import Transfer
from src.models.token import Token
from src.multisend import build_encoded_multisend, prepend_unwrap_if_necessary


class TestMultiSend(unittest.TestCase):
def setUp(self) -> None:
node_url = f"https://mainnet.infura.io/v3/{INFURA_KEY}"
node_url = "https://rpc.ankr.com/eth"
self.client = EthereumClient(URI(node_url))

def test_prepend_unwrap(self):
Expand Down Expand Up @@ -58,7 +58,7 @@ def test_prepend_unwrap(self):
hex_weth_balance = hex(weth_balance)[2:].rjust(64, "0")
self.assertEqual(
f"{unwrap_method_id}{hex_weth_balance}",
"0x" + unwrap.data.hex(),
unwrap.data.hex(),
)

def test_multisend_encoding(self):
Expand Down
Loading