eth_blockNumber.

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

View File

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

View File

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