File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -13,19 +13,18 @@ class EVM extends AbstractAPI
13
13
*
14
14
* @return array|null
15
15
*/
16
- public function ethCall (array $ payload ): ?array
16
+ public function evmCall (array $ payload ): ?array
17
17
{
18
18
$ body = [
19
19
'jsonrpc ' => '2.0 ' ,
20
- 'method ' => 'eth_call ' ,
21
- 'params ' => [$ payload , 'latest ' ],
22
- 'id ' => null ,
20
+ ...$ payload ,
23
21
];
24
22
25
23
$ headers = [
26
24
'Content-Type ' => 'application/json ' ,
27
25
];
28
26
29
- return $ this ->withApi ('evm ' )->requestPost ('api/ ' , $ body , $ headers );
27
+ return $ this ->withApi ('evm ' )
28
+ ->requestPost ('api/ ' , $ body , $ headers );
30
29
}
31
30
}
Original file line number Diff line number Diff line change 13
13
class EVMTest extends TestCase
14
14
{
15
15
/** @test */
16
- public function eth_call_calls_correct_url ()
16
+ public function evm_call_calls_correct_url ()
17
17
{
18
18
$ this ->assertResponse (
19
19
method: 'POST ' ,
20
20
path: 'api/ ' ,
21
21
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 ,
26
30
]);
27
31
},
28
32
expectedApi: 'evm '
You can’t perform that action at this time.
0 commit comments