Skip to content

Commit

Permalink
Merge pull request #2 from joelcho/master
Browse files Browse the repository at this point in the history
fix Invalid request
  • Loading branch information
drlecks authored Jul 14, 2022
2 parents 766b8b9 + 5866875 commit c5c6b2a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Core/SWeb3.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,17 @@ function setPersonalData($address, $privKey)

function call($method, $params = null)
{
if ($params != null) $params = $this->utils->forceAllNumbersHex($params);

//format api data
$ethRequest = new Ethereum_CRPC();
$ethRequest->id = 1;
$ethRequest->jsonrpc = '2.0';
$ethRequest->method = $method;
$ethRequest->params = $params;

if ($params != null) {
$ethRequest->params = $this->utils->forceAllNumbersHex($params);
} else {
$ethRequest->params = [];
}

if ($this->do_batch) {
$this->batched_calls []= $ethRequest;
return true;
Expand Down

0 comments on commit c5c6b2a

Please sign in to comment.