diff --git a/src/Eth.php b/src/Eth.php index 41bd3f7..cb1aa36 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -27,6 +27,7 @@ class Eth 'eth_coinbase' => [], 'eth_mining' => [], 'eth_hashrate' => [], + 'eth_gasPrice' => [], ]; /** diff --git a/test/unit/EthTest.php b/test/unit/EthTest.php index cd98b22..b52c9d1 100644 --- a/test/unit/EthTest.php +++ b/test/unit/EthTest.php @@ -136,6 +136,27 @@ class EthTest extends TestCase }); } + /** + * testGasPrice + * + * @return void + */ + public function testGasPrice() + { + $eth = $this->web3->eth; + + $eth->gasPrice(function ($err, $gasPrice) { + if ($err !== null) { + return $this->fail($err->getMessage()); + } + if (isset($gasPrice->result)) { + $this->assertTrue(is_string($gasPrice->result)); + } else { + $this->fail($gasPrice->error->message); + } + }); + } + /** * testUnallowedMethod *