Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion network-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ live:
- name: Ethereum
networks:
- chainid: 1
explorer: https://api.etherscan.io/api
explorer: https://api.etherscan.io/v2/api?chainid=1
host: $ETH_RPC_URL
id: mainnet
multicall2: "0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696"
Expand Down Expand Up @@ -34,6 +34,7 @@ development:
port: 8545
evm_version: shanghai
host: http://127.0.0.1
explorer: https://api.etherscan.io/v2/api?chainid=1
id: mainnet-fork
name: Ganache-CLI (Mainnet Fork)
timeout: 360
Expand Down
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def execute_votes(accounts, vote_ids, dao_voting, topup="10 ether"):
print(f"vote #{vote_id} executed")
execution_transactions.append(tx)

Helpers._prefetch_contracts_from_etherscan()
Helpers.prefetch_contracts_from_etherscan()

return execution_transactions

Expand All @@ -163,13 +163,14 @@ def is_executed(vote_id, dao_voting):
return vote_status[1]

@staticmethod
def _prefetch_contracts_from_etherscan():
def prefetch_contracts_from_etherscan():
if not Helpers._etherscan_is_fetched:
print(f"prefetch contracts from Etherscan to parse events")
# In case of issue with events parsing from local abi
# add contracts here to fetch the abis from etherscan
# Use next format to fetch the abi:
# Contract.from_explorer(<contract_address>)
Contract.from_explorer(contracts.cs_exit_penalties.address)

Helpers._etherscan_is_fetched = True

Expand Down
8 changes: 7 additions & 1 deletion tests/regression/test_csm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from brownie import reverts, web3, ZERO_ADDRESS, accounts, chain

from tests.conftest import Helpers
from utils.balance import set_balance_in_wei
from utils.config import (
contracts,
Expand Down Expand Up @@ -35,6 +36,11 @@
MAX_DEPOSITS = 50


@pytest.fixture(scope="module", autouse=True)
def prefetch_contracts_from_etherscan():
Helpers.prefetch_contracts_from_etherscan()


@pytest.fixture(scope="module")
def csm():
return contracts.csm
Expand Down Expand Up @@ -468,7 +474,7 @@ def test_eject_bad_performer(csm, ejector, strikes, node_operator, stranger):

def test_voluntary_eject(csm, ejector, node_operator):
eject_payment_value = get_sys_fee_to_eject()
operator_address = csm.getNodeOperator(node_operator)["rewardAddress"]
operator_address = csm.getNodeOperatorOwner(node_operator)

tx = ejector.voluntaryEject(
node_operator, 0, 1, ZERO_ADDRESS, {"value": eject_payment_value, "from": operator_address}
Expand Down
Loading