diff --git a/README.md b/README.md index 66d75f0..759e880 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ transfer = wallet.deposit( In order to run test you need to run local-setup on your machine. For running tests, use: ```console make wait -make prepare-tests +make prepare-environment make run-tests ``` diff --git a/zksync2/module/module_builder.py b/zksync2/module/module_builder.py index 140674e..deb47a5 100644 --- a/zksync2/module/module_builder.py +++ b/zksync2/module/module_builder.py @@ -3,17 +3,20 @@ from zksync2.module.middleware import build_zksync_middleware from typing import Union -from web3._utils.module import attach_modules from eth_typing import URI from web3 import Web3 +class ZkWeb3(Web3): + zksync: ZkSync + + class ZkSyncBuilder: @classmethod - def build(cls, url: Union[URI, str]) -> Web3: + def build(cls, url: Union[URI, str]) -> ZkWeb3: web3_module = Web3() zksync_provider = ZkSyncProvider(url) zksync_middleware = build_zksync_middleware(zksync_provider) web3_module.middleware_onion.add(zksync_middleware) - attach_modules(web3_module, {"zksync": (ZkSync,)}) + web3_module.zksync = ZkSync(web3_module) return web3_module