eth_syncing.
This commit is contained in:
parent
864a7a1fb7
commit
44780a9821
@ -23,6 +23,7 @@ class Eth
|
|||||||
*/
|
*/
|
||||||
private $methods = [
|
private $methods = [
|
||||||
'eth_protocolVersion' => [],
|
'eth_protocolVersion' => [],
|
||||||
|
'eth_syncing' => [],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user