Skip to content

Commit

Permalink
feat: Eratestnode class rename to AnvilZKsync
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickAlphaC committed Dec 8, 2024
1 parent 46681c9 commit edc1a08
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions boa_zksync/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from boa_zksync.contract import ZksyncContract
from boa_zksync.environment import ZksyncEnv
from boa_zksync.node import EraTestNode
from boa_zksync.node import AnvilZKsync
from boa_zksync.verifiers import ZksyncExplorer


Expand All @@ -15,7 +15,7 @@ def set_zksync_env(url, explorer_url=None, nickname=None):

def set_zksync_test_env(node_args=(), nickname=None):
return boa.set_env(
ZksyncEnv(rpc=EraTestNode(node_args=node_args), nickname=nickname)
ZksyncEnv(rpc=AnvilZKsync(node_args=node_args), nickname=nickname)
)


Expand Down
6 changes: 3 additions & 3 deletions boa_zksync/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from requests import HTTPError

from boa_zksync.deployer import ZksyncDeployer
from boa_zksync.node import EraTestNode
from boa_zksync.node import AnvilZKsync
from boa_zksync.types import (
CONTRACT_DEPLOYER_ADDRESS,
DEFAULT_SALT,
Expand Down Expand Up @@ -66,7 +66,7 @@ def _reset_fork(self, block_identifier="latest"):
self._vm = None
if (
block_identifier == "latest"
and isinstance(self._rpc, EraTestNode)
and isinstance(self._rpc, AnvilZKsync)
and (inner_rpc := self._rpc.inner_rpc)
):
del self._rpc # close the old rpc
Expand All @@ -93,7 +93,7 @@ def fork_rpc(
if reset_traces:
self.sha3_trace: dict = {}
self.sstore_trace: dict = {}
self._rpc = EraTestNode(rpc, block_identifier, **kwargs)
self._rpc = AnvilZKsync(rpc, block_identifier, **kwargs)

def register_contract(self, address, obj):
addr = Address(address)
Expand Down
2 changes: 1 addition & 1 deletion boa_zksync/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from boa_zksync.util import find_free_port, stop_subprocess, wait_url


class EraTestNode(EthereumRPC):
class AnvilZKsync(EthereumRPC):
# list of public+private keys for test accounts in the anvil-zksync
TEST_ACCOUNTS = [
(
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from eth_account import Account

import boa_zksync
from boa_zksync import EraTestNode
from boa_zksync import AnvilZKsync
from boa_zksync.deployer import ZksyncDeployer

STARTING_SUPPLY = 100
Expand Down Expand Up @@ -58,7 +58,7 @@ def zksync_sepolia_env():
@pytest.fixture(scope="module")
def account():
# default rich account from era_test_node
_public_key, private_key = EraTestNode.TEST_ACCOUNTS[0]
_public_key, private_key = AnvilZKsync.TEST_ACCOUNTS[0]
return Account.from_key(private_key)


Expand Down
4 changes: 2 additions & 2 deletions tests/test_sepolia.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from boa.rpc import EthereumRPC

import boa_zksync
from boa_zksync import EraTestNode
from boa_zksync import AnvilZKsync
from boa_zksync.environment import ZERO_ADDRESS


Expand Down Expand Up @@ -37,7 +37,7 @@ def set_implementation(_implementation: address):


def test_fork_rpc(zksync_sepolia_fork):
assert isinstance(boa.env._rpc, EraTestNode)
assert isinstance(boa.env._rpc, AnvilZKsync)
assert isinstance(boa.env._rpc.inner_rpc, EthereumRPC)


Expand Down

0 comments on commit edc1a08

Please sign in to comment.