diff --git a/src/Eth.php b/src/Eth.php index 78dad86..b84a255 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -89,6 +89,13 @@ class Eth ] ] ], + 'eth_getUncleCountByBlockHash' => [ + 'params' => [ + [ + 'validators' => BlockHashValidator::class + ] + ] + ], ]; /** diff --git a/test/unit/EthTest.php b/test/unit/EthTest.php index 320cfe7..b8a59b8 100644 --- a/test/unit/EthTest.php +++ b/test/unit/EthTest.php @@ -312,6 +312,31 @@ class EthTest extends TestCase }); } + /** + * testGetUncleCountByBlockHash + * + * @return void + */ + public function testGetUncleCountByBlockHash() + { + $eth = $this->web3->eth; + + $eth->getUncleCountByBlockHash('0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', function ($err, $uncleCount) { + if ($err !== null) { + return $this->fail($err->getMessage()); + } + if (isset($uncleCount->result)) { + $this->assertTrue(is_string($uncleCount->result)); + } else { + if (isset($uncleCount->error)) { + $this->fail($uncleCount->error->message); + } else { + $this->assertTrue(true); + } + } + }); + } + /** * testUnallowedMethod *