Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.
Closed
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
9 changes: 6 additions & 3 deletions zksync2/module/module_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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