Skip to content

Commit

Permalink
Fixes to make partially compatible with web3==6
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarvaja committed Feb 2, 2024
1 parent cb6dca0 commit 8535604
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ethproto/brwrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def get_events(self, eth_wrapper, event_name, filter_kwargs={}):
event = getattr(w3_contract.events, event_name)
if "fromBlock" not in filter_kwargs:
filter_kwargs["fromBlock"] = self.get_first_block(eth_wrapper)
event_filter = event.createFilter(**filter_kwargs)
event_filter = event.create_filter(**filter_kwargs)
return event_filter.get_all_entries()

def deploy(self, eth_contract, init_params, from_, **kwargs):
Expand Down
6 changes: 3 additions & 3 deletions src/ethproto/w3wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def register_w3_provider(provider_key="w3", tester=None, provider_kwargs={}):
from web3.auto import w3

if W3_POA == "auto":
assert w3.isConnected()
assert w3.is_connected()
try:
w3.eth.get_block("latest")
except ExtraDataLengthError:
Expand Down Expand Up @@ -353,7 +353,7 @@ def get_events(self, eth_wrapper, event_name, filter_kwargs={}):
event = getattr(contract.events, event_name)
if "fromBlock" not in filter_kwargs:
filter_kwargs["fromBlock"] = self.get_first_block(eth_wrapper)
event_filter = event.createFilter(**filter_kwargs)
event_filter = event.create_filter(**filter_kwargs)
return event_filter.get_all_entries()

def init_eth_wrapper(self, eth_wrapper, owner, init_params, kwargs):
Expand All @@ -369,7 +369,7 @@ def init_eth_wrapper(self, eth_wrapper, owner, init_params, kwargs):
ERC1967Proxy = self.get_contract_factory("ERC1967Proxy")
init_data = real_contract.functions.initialize(
*init_params
).buildTransaction({**self.tx_kwargs, **{"from": eth_wrapper.owner}})["data"]
).build_transaction({**self.tx_kwargs, **{"from": eth_wrapper.owner}})["data"]
proxy_contract = self.construct(
ERC1967Proxy,
(real_contract.address, init_data),
Expand Down

0 comments on commit 8535604

Please sign in to comment.