Skip to content

Commit

Permalink
Get rid of set_deployer_class, optional deployer_class to the env
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielSchiavini committed Jun 4, 2024
1 parent 5f13b42 commit 7332ad8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 0 additions & 4 deletions boa_zksync/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,23 @@

def set_zksync_env(url):
boa.set_env(ZksyncEnv.from_url(url))
boa.set_deployer_class(ZksyncDeployer)


def set_zksync_test_env(node_args=()):
boa.set_env(ZksyncEnv(rpc=EraTestNode(node_args=node_args)))
boa.set_deployer_class(ZksyncDeployer)


def set_zksync_fork(url, *args, **kwargs):
env = ZksyncEnv.from_url(url)
env.fork(*args, **kwargs)
boa.set_env(env)
boa.set_deployer_class(ZksyncDeployer)


def set_zksync_browser_env(*args, **kwargs):
# import locally because jupyter is generally not installed
from boa_zksync.browser import ZksyncBrowserEnv

boa.set_env(ZksyncBrowserEnv(*args, **kwargs))
boa.set_deployer_class(ZksyncDeployer)


boa.set_zksync_env = set_zksync_env
Expand Down
2 changes: 2 additions & 0 deletions boa_zksync/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from eth_account import Account
from requests import HTTPError

from boa_zksync.deployer import ZksyncDeployer
from boa_zksync.node import EraTestNode
from boa_zksync.types import DeployTransaction, ZksyncComputation, ZksyncMessage

Expand All @@ -31,6 +32,7 @@ class ZksyncEnv(NetworkEnv):
An implementation of the Env class for zkSync environments.
This is a mix-in so the logic may be reused in both network and browser modes.
"""
deployer_class = ZksyncDeployer

def __init__(self, rpc: str | RPC, *args, **kwargs):
super().__init__(rpc, *args, **kwargs)
Expand Down

0 comments on commit 7332ad8

Please sign in to comment.