diff --git a/client/api/evm.py b/client/api/evm.py index 1552790..9386134 100644 --- a/client/api/evm.py +++ b/client/api/evm.py @@ -3,10 +3,8 @@ class EVM(Resource): - def eth_call(self, params: list[dict[str, Any]]): + def call(self, params: dict[str, Any]): return self.with_endpoint('evm').request_post('', { 'jsonrpc': "2.0", - 'method': "eth_call", - 'params': [params, "latest"], - 'id': None, + **params, }) diff --git a/tests/api/test_evm.py b/tests/api/test_evm.py index ba13d2d..1765842 100644 --- a/tests/api/test_evm.py +++ b/tests/api/test_evm.py @@ -13,7 +13,11 @@ def test_eth_call_methods_correct_url(): ) client = ArkClient('http://127.0.0.1:4002/evm/api') - client.evm.eth_call([{ 'random': 'data' }]) + client.evm.call({ + 'method': 'eth_call', + 'params': [[{ 'random': 'data' }], 'latest'], + 'id': None, + }) assert len(responses.calls) == 1 assert responses.calls[0].request.url == 'http://127.0.0.1:4002/evm/api/' assert json.loads(responses.calls[0].request.body.decode()) == {