eth_accounts.

This commit is contained in:
sc0Vu 2017-12-13 16:19:54 +08:00
parent b87e3e9de8
commit d7276001f3
2 changed files with 22 additions and 0 deletions

View File

@ -28,6 +28,7 @@ class Eth
'eth_mining' => [],
'eth_hashrate' => [],
'eth_gasPrice' => [],
'eth_accounts' => [],
];
/**

View File

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