diff --git a/src/Eth.php b/src/Eth.php index d9c98eb..41bd3f7 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -26,6 +26,7 @@ class Eth 'eth_syncing' => [], 'eth_coinbase' => [], 'eth_mining' => [], + 'eth_hashrate' => [], ]; /** diff --git a/test/unit/EthTest.php b/test/unit/EthTest.php index ae76054..cd98b22 100644 --- a/test/unit/EthTest.php +++ b/test/unit/EthTest.php @@ -115,6 +115,27 @@ class EthTest extends TestCase }); } + /** + * testHashrate + * + * @return void + */ + public function testHashrate() + { + $eth = $this->web3->eth; + + $eth->hashrate(function ($err, $hashrate) { + if ($err !== null) { + return $this->fail($err->getMessage()); + } + if (isset($hashrate->result)) { + $this->assertTrue(is_string($hashrate->result)); + } else { + $this->fail($hashrate->error->message); + } + }); + } + /** * testUnallowedMethod *