Skip to content

7.9.0: Can't make batch requests without provider._is_batching #3642

Open
@Sputchik

Description

@Sputchik

What happened?

in < 7.9.0 you could make both batch and single requests without any fuckery around _is_batching

Code that produced the error

def _raise_stray_errors_from_cache(self) -> None:
        """
        Check the request response cache for any errors not tied to current requests
        and raise them if found.
        """
        if not self._is_batching:
            for (
                response
            ) in self._request_processor._request_response_cache._data.values():
                request = (
                    self._request_processor._request_information_cache.get_cache_entry(
                        generate_cache_key(response["id"])
                    )
                )
                if "error" in response and request is None:
                    # if we find an error response in the cache without a corresponding
                    # request, raise the error
                    validate_rpc_response_and_raise_if_error(
                        response, None, logger=self.logger
                    )

Full error output

In: web3\providers\persistent\persistent.py
generate_cache_key(response["id"])
                       ~~~~~~~~^^^^^^
TypeError: list indices must be integers or slices, not str

Fill this section in if you know how this could or should be fixed

revert whatever this is

web3 Version

No response

Python Version

No response

Operating System

No response

Output from pip freeze

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions