Skip to content

Commit

Permalink
chore: fix (some) failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdefinitelyahuman committed Feb 2, 2024
1 parent 27a360c commit 5bedabb
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 36 deletions.
8 changes: 4 additions & 4 deletions tests/network/contract/test_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def test_existing_different_chains(network):
Contract.from_explorer("0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2")

network.disconnect()
network.connect("ropsten")
network.connect("goerli")
with pytest.raises(ValueError):
Contract("0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2")

Expand Down Expand Up @@ -270,9 +270,9 @@ def test_autofetch_missing(network, config, mocker):


def test_as_proxy_for(network):
proxy = "0xAfE212AEDf1c8dCd0E470d73B3B4035D32A75Efd"
impl = "0x098DCb095318A8B5321c5f2DB3fA04a55A780A20"
network.connect("ropsten")
proxy = "0x2410B710ecA3818003c091c42E3803cC7D70AeE9"
impl = "0x7542fb54dc0c2d71a00d9409b48f5e464b5e9f24"
network.connect("goerli")

original = Contract.from_explorer(proxy)
proxy = Contract.from_explorer(proxy, as_proxy_for=impl)
Expand Down
19 changes: 0 additions & 19 deletions tests/network/contract/test_persistence.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,6 @@ def test_persist_load_unload(testproject, network):
assert len(testproject.BrownieTester) == 1


def test_persist_change_network(testproject, network):
network.connect("mainnet")
testproject.BrownieTester.at("0xdAC17F958D2ee523a2206206994597C13D831ec7")
testproject.BrownieTester.at("0xB8c77482e45F1F44dE1745F52C74426C631bDD52")
assert len(testproject.BrownieTester) == 2
network.disconnect(False)
assert len(testproject.BrownieTester) == 0
network.connect("ropsten")
testproject.BrownieTester.at("0xBcd0a9167015Ee213Ba01dAff79d60CD221B0cAC")
assert len(testproject.BrownieTester) == 1
network.disconnect(False)
network.connect("mainnet")
assert len(testproject.BrownieTester) == 2
assert testproject.BrownieTester[0].address == "0xdAC17F958D2ee523a2206206994597C13D831ec7"
network.disconnect(False)
network.connect("ropsten")
assert testproject.BrownieTester[0].address == "0xBcd0a9167015Ee213Ba01dAff79d60CD221B0cAC"


def test_delete(testproject, network):
network.connect("mainnet")
testproject.BrownieTester.at("0xdAC17F958D2ee523a2206206994597C13D831ec7")
Expand Down
6 changes: 3 additions & 3 deletions tests/network/test_main_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ def test_disconnect(devnetwork, rpc, web3):
devnetwork.disconnect()


def test_connect_ropsten(network):
network.connect("ropsten")
assert network.show_active() == "ropsten"
def test_connect_goerli(network):
network.connect("goerli")
assert network.show_active() == "goerli"


def test_connect_raises_connected(devnetwork):
Expand Down
12 changes: 6 additions & 6 deletions tests/network/test_web3.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def test_genesis_hash(web3, devnetwork):
def test_genesis_hash_different_networks(devnetwork, web3):
ganache_hash = web3.genesis_hash
devnetwork.disconnect()
devnetwork.connect("ropsten")
assert web3.genesis_hash == "41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d"
devnetwork.connect("goerli")
assert web3.genesis_hash == "bf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a"
assert web3.genesis_hash != ganache_hash


Expand All @@ -83,9 +83,9 @@ def test_genesis_hash_disconnected(web3):


def test_chain_uri(web3, network):
network.connect("ropsten")
network.connect("goerli")
assert web3.chain_uri.startswith(
"blockchain://41941023680923e0fe4d74a34bdac8141f2540e3ae90623718e47d66d1ca4a2d/block/"
"blockchain://bf7e331f7f7c1dd2e05159666b3bf8bc7a8a3a9eb1d518969eab529dd9b88c1a/block"
)


Expand Down Expand Up @@ -113,8 +113,8 @@ def test_supports_traces_not_connected(web3, network):


def test_supports_traces_infura(web3, network):
# ropsten should return false (infura, geth)
network.connect("ropsten")
# goerli should return false (infura, geth)
network.connect("goerli")
assert not web3.supports_traces


Expand Down
5 changes: 3 additions & 2 deletions tests/network/transaction/test_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,10 @@ def test_contractabi(ExternalCallTester, accounts, tester, ext_tester):


def test_traces_not_supported(network, chain):
network.connect("ropsten")
network.connect("goerli")

tx = chain.get_transaction("0xfd9f98a245d3cff68dd67546fa7e89009a291101f045f81eb9afd14abcbdc6aa")
# this tx reverted
tx = chain.get_transaction("0xbb75b5cccc0c009f2073097252e76a1f8452ba6b3b7c5a5837c59a37bfaee305")

# the confirmation output should work even without traces
tx._confirm_output()
Expand Down
4 changes: 2 additions & 2 deletions tests/test/plugin/test_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ def test_require_network_pass():
# should run because we are connected to development
pass
@pytest.mark.require_network("ropsten")
@pytest.mark.require_network("goerli")
def test_require_network_skip():
# should skip because we are not connected to ropsten
# should skip because we are not connected to goerli
pass
@pytest.mark.require_network
Expand Down

0 comments on commit 5bedabb

Please sign in to comment.