Skip to content

Commit dc1680b

Browse files
authored
refactor: update eth call payload handling (#139)
1 parent f5808ee commit dc1680b

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

client/api/evm.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33

44

55
class EVM(Resource):
6-
def eth_call(self, params: list[dict[str, Any]]):
6+
def call(self, params: dict[str, Any]):
77
return self.with_endpoint('evm').request_post('', {
88
'jsonrpc': "2.0",
9-
'method': "eth_call",
10-
'params': [params, "latest"],
11-
'id': None,
9+
**params,
1210
})

tests/api/test_evm.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ def test_eth_call_methods_correct_url():
1313
)
1414

1515
client = ArkClient('http://127.0.0.1:4002/evm/api')
16-
client.evm.eth_call([{ 'random': 'data' }])
16+
client.evm.call({
17+
'method': 'eth_call',
18+
'params': [[{ 'random': 'data' }], 'latest'],
19+
'id': None,
20+
})
1721
assert len(responses.calls) == 1
1822
assert responses.calls[0].request.url == 'http://127.0.0.1:4002/evm/api/'
1923
assert json.loads(responses.calls[0].request.body.decode()) == {

0 commit comments

Comments
 (0)