Skip to content

Commit

Permalink
getBalance issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ranabd36 committed Jan 29, 2020
1 parent 586420c commit 01aa19e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Methods/EthClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ public function getBalance(Address $address, BlockNumber $blockNumber): ?Wei
$this->client->request(1, 'eth_getBalance', [$address->toString(), $blockNumber->toString()])
);

$amount = ($response->getRpcResult()) ? \Phlib\base_convert($response->getRpcResult(), 16, 10) : 0;
return new Wei($amount);
return new Wei(hexdec($response->getRpcResult()));
}

public function getStorageAt(Address $address, int $quantity, BlockNumber $blockNumber): string
Expand Down

0 comments on commit 01aa19e

Please sign in to comment.