eth_hashrate.
This commit is contained in:
parent
5ba3ed1371
commit
d0a97a1472
@ -26,6 +26,7 @@ class Eth
|
||||
'eth_syncing' => [],
|
||||
'eth_coinbase' => [],
|
||||
'eth_mining' => [],
|
||||
'eth_hashrate' => [],
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user