eth_mining.

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

View File

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

View File

@ -94,6 +94,27 @@ class EthTest extends TestCase
}); });
} }
/**
* testMining
*
* @return void
*/
public function testMining()
{
$eth = $this->web3->eth;
$eth->mining(function ($err, $mining) {
if ($err !== null) {
return $this->fail($err->getMessage());
}
if (isset($mining->result)) {
$this->assertTrue($mining->result !== null);
} else {
$this->fail($mining->error->message);
}
});
}
/** /**
* testUnallowedMethod * testUnallowedMethod
* *