eth_coinbase.

This commit is contained in:
sc0Vu 2017-12-13 16:10:22 +08:00
parent 44780a9821
commit 413c1abb68
2 changed files with 23 additions and 0 deletions

View File

@ -24,6 +24,7 @@ class Eth
private $methods = [
'eth_protocolVersion' => [],
'eth_syncing' => [],
'eth_coinbase' => [],
];
/**

View File

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