From 44780a98217804cfe43ef25e69203e326d2ca501 Mon Sep 17 00:00:00 2001 From: sc0Vu Date: Wed, 13 Dec 2017 16:01:37 +0800 Subject: [PATCH] eth_syncing. --- src/Eth.php | 1 + test/unit/EthTest.php | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/Eth.php b/src/Eth.php index 5f6e463..fecb6f9 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -23,6 +23,7 @@ class Eth */ private $methods = [ 'eth_protocolVersion' => [], + 'eth_syncing' => [], ]; /** diff --git a/test/unit/EthTest.php b/test/unit/EthTest.php index 35a2692..b13ef48 100644 --- a/test/unit/EthTest.php +++ b/test/unit/EthTest.php @@ -50,6 +50,28 @@ class EthTest extends TestCase }); } + /** + * testSyncing + * + * @return void + */ + public function testSyncing() + { + $eth = $this->web3->eth; + + $eth->syncing(function ($err, $syncing) { + if ($err !== null) { + return $this->fail($err->getMessage()); + } + if (isset($syncing->result)) { + // due to the result might be object or bool, only test is null + $this->assertTrue($syncing->result !== null); + } else { + $this->fail($syncing->error->message); + } + }); + } + /** * testUnallowedMethod *