eth_syncing.

This commit is contained in:
sc0Vu 2017-12-13 16:01:37 +08:00
parent 864a7a1fb7
commit 44780a9821
2 changed files with 23 additions and 0 deletions

View File

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

View File

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