ethereum / execution-spec-tests

A Python framework and collection of test cases to generate test vectors for Ethereum execution clients

Home Page:https://ethereum.github.io/execution-spec-tests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat/refactor: extend `EthRPC` framework class and use it in `gentest.py`

danceratopz opened this issue · comments

#556 added classes to help calling ETH and Engine API methods on clients, we should extend these classes and refactor gentest.py to use them:

def _make_request(self, data) -> requests.Response:
error_str = "An error occurred while making remote request: "
try:
response = requests.post(self.node_url, headers=self.headers, data=json.dumps(data))
if response.status_code >= 200 and response.status_code < 300:
return response
else:
print(error_str + response.text, file=stderr)
raise requests.exceptions.HTTPError
except requests.exceptions.RequestException as e:
print(error_str, e, file=stderr)
raise e

commented

could you please assign this to me?