File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,19 +13,18 @@ class EVM extends AbstractAPI
1313 *
1414 * @return array|null
1515 */
16- public function ethCall (array $ payload ): ?array
16+ public function evmCall (array $ payload ): ?array
1717 {
1818 $ body = [
1919 'jsonrpc ' => '2.0 ' ,
20- 'method ' => 'eth_call ' ,
21- 'params ' => [$ payload , 'latest ' ],
22- 'id ' => null ,
20+ ...$ payload ,
2321 ];
2422
2523 $ headers = [
2624 'Content-Type ' => 'application/json ' ,
2725 ];
2826
29- return $ this ->withApi ('evm ' )->requestPost ('api/ ' , $ body , $ headers );
27+ return $ this ->withApi ('evm ' )
28+ ->requestPost ('api/ ' , $ body , $ headers );
3029 }
3130}
Original file line number Diff line number Diff line change 1313class EVMTest extends TestCase
1414{
1515 /** @test */
16- public function eth_call_calls_correct_url ()
16+ public function evm_call_calls_correct_url ()
1717 {
1818 $ this ->assertResponse (
1919 method: 'POST ' ,
2020 path: 'api/ ' ,
2121 callback: function (ArkClient $ client ) {
22- return $ client ->evm ()->ethCall ([
23- 'from ' => '0x1234567890abcdef ' ,
24- 'to ' => '0xfedcba0987654321 ' ,
25- 'data ' => '0xabcdef ' ,
22+ return $ client ->evm ()->evmCall ([
23+ 'method ' => 'eth_call ' ,
24+ 'params ' => [[
25+ 'from ' => '0x1234567890abcdef ' ,
26+ 'to ' => '0xfedcba0987654321 ' ,
27+ 'data ' => '0xabcdef ' ,
28+ ], 'latest ' ],
29+ 'id ' => null ,
2630 ]);
2731 },
2832 expectedApi: 'evm '
You can’t perform that action at this time.
0 commit comments