diff --git a/src/Eth.php b/src/Eth.php index fecb6f9..dd80e63 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -24,6 +24,7 @@ class Eth private $methods = [ 'eth_protocolVersion' => [], 'eth_syncing' => [], + 'eth_coinbase' => [], ]; /** diff --git a/test/unit/EthTest.php b/test/unit/EthTest.php index b13ef48..18f5ac0 100644 --- a/test/unit/EthTest.php +++ b/test/unit/EthTest.php @@ -72,6 +72,28 @@ class EthTest extends TestCase }); } + /** + * testCoinbase + * + * @return void + */ + public function testCoinbase() + { + $eth = $this->web3->eth; + + $eth->coinbase(function ($err, $coinbase) { + if ($err !== null) { + // infura banned us to use coinbase + return $this->assertTrue($err->getCode() === 405); + } + if (isset($coinbase->result)) { + $this->assertTrue(is_string($coinbasse->result)); + } else { + $this->fail($coinbase->error->message); + } + }); + } + /** * testUnallowedMethod *