eth_hashrate.

This commit is contained in:
sc0Vu 2017-12-13 16:15:52 +08:00
parent 5ba3ed1371
commit d0a97a1472
2 changed files with 22 additions and 0 deletions

View File

@ -26,6 +26,7 @@ class Eth
'eth_syncing' => [],
'eth_coinbase' => [],
'eth_mining' => [],
'eth_hashrate' => [],
];
/**

View File

@ -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
*