diff --git a/src/Eth.php b/src/Eth.php index dd80e63..d9c98eb 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -25,6 +25,7 @@ class Eth 'eth_protocolVersion' => [], 'eth_syncing' => [], 'eth_coinbase' => [], + 'eth_mining' => [], ]; /** diff --git a/test/unit/EthTest.php b/test/unit/EthTest.php index 18f5ac0..ae76054 100644 --- a/test/unit/EthTest.php +++ b/test/unit/EthTest.php @@ -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 *