From d7276001f379f6310adef81449ae411b0d1a5f83 Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Wed, 13 Dec 2017 16:19:54 +0800 Subject: [PATCH] eth_accounts. --- src/Eth.php | 1 + test/unit/EthTest.php | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/Eth.php b/src/Eth.php index cb1aa36..bf7084e 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -28,6 +28,7 @@ class Eth 'eth_mining' => [], 'eth_hashrate' => [], 'eth_gasPrice' => [], + 'eth_accounts' => [], ]; /** diff --git a/test/unit/EthTest.php b/test/unit/EthTest.php index b52c9d1..b4aab92 100644 --- a/test/unit/EthTest.php +++ b/test/unit/EthTest.php @@ -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 *