You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "src/app_events.py", line 19, in<module>
init_ws_event_scanner(config)
File "/home/aerilym/git/ssb/src/web3client/event_ws.py", line 516, in init_ws_event_scanner
asyncio.run(start(config))
File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete
returnfuture.result()
^^^^^^^^^^^^^^^
File "/home/aerilym/git/ssb/src/web3client/event_ws.py", line 512, in start
await monitor
File "/home/aerilym/git/ssb/src/web3client/event_ws.py", line 472, in monitor_events
await scan_past_queued_events(w3)
File "/home/aerilym/git/ssb/src/web3client/event_ws.py", line 420, in scan_past_queued_events
forrecentin await past_event.event.get_logs(from_block=from_block, to_block=block_current):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aerilym/git/sent-staking-backend/.venv/lib/python3.12/site-packages/web3/contract/async_contract.py", line 181, in get_logs
_filter_params = self._get_event_filter_params(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aerilym/git/sent-staking-backend/.venv/lib/python3.12/site-packages/eth_utils/decorators.py", line 29, in _wrapper
return self.method(obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aerilym/git/sent-staking-backend/.venv/lib/python3.12/site-packages/web3/contract/base_contract.py", line 311, in _get_event_filter_params
_, event_filter_params = construct_event_filter_params(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aerilym/git/sent-staking-backend/.venv/lib/python3.12/site-packages/web3/_utils/filters.py", line 117, in construct_event_filter_params
foraddrin filter_params["address"]:
^^^^^^^^^^^^^^^^^^^^^^
File "/home/aerilym/git/sent-staking-backend/.venv/lib/python3.12/site-packages/web3/_utils/validation.py", line 179, in validate_address
raise Web3TypeError(f"Address {value} must be provided as a string")
web3.exceptions.Web3TypeError: Address ['0xdA5ba...6763e', '0xFC7880C60...2295122F', '0x36eeDdB5...a71a0698E5B462f299Dec', '0xC212293A2d8255...813cC3FDd7a3ee'] must be provided as a string
Fill this section in if you know how this could or should be fixed
The simplest fix is to correct _utils/filters.py:97 to create a list instead of a list of lists, this should probably be de-duplicated because in the code path I'm using above address and contract_address are the same. (Not sure if this should be the case)
What happened?
called
event.get_logs(from_block=from_block, to_block=block_current)
with the instantiated parent contract havingaddress
set to a list of addresses.This raised an exception about address validity. It shouldn't have.
Code that produced the error
Full error output
Fill this section in if you know how this could or should be fixed
This suggestion is implemented in #3618
This method internally calls
_get_event_filter_params
which callsconstruct_event_filter_params
as such:contract/base_contract.py:308
By setting
contract_address
andaddress
toself.address
the following code block inconstruct_event_filter_params
is executed:_utils/filters.py:97
This then causes this later block to raise an exception:
As
is_list_like
is true, butfilter_params["address"]
has been incorrectly turned into a list of lists:The simplest fix is to correct
_utils/filters.py:97
to create a list instead of a list of lists, this should probably be de-duplicated because in the code path I'm using aboveaddress
andcontract_address
are the same. (Not sure if this should be the case)web3 Version
7.8.0
Python Version
3.12.3
Operating System
linux
Output from
pip freeze
The text was updated successfully, but these errors were encountered: