diff --git a/src/Eth.php b/src/Eth.php index 355f474..16d8c98 100644 --- a/src/Eth.php +++ b/src/Eth.php @@ -317,6 +317,15 @@ class Eth ] ] ], + 'eth_submitHashrate' => [ + 'params' => [ + [ + 'validators' => BlockHashValidator::class + ], [ + 'validators' => BlockHashValidator::class + ] + ] + ], ]; /** diff --git a/test/unit/EthTest.php b/test/unit/EthTest.php index 79871ce..984535e 100644 --- a/test/unit/EthTest.php +++ b/test/unit/EthTest.php @@ -1080,6 +1080,34 @@ class EthTest extends TestCase }); } + /** + * testSubmitHashrate + * + * @return void + */ + public function testSubmitHashrate() + { + $eth = $this->eth; + + $eth->submitHashrate( + '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', + '0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000' + , function ($err, $work) { + if ($err !== null) { + return $this->fail($err->getMessage()); + } + if (isset($work->result)) { + $this->assertTrue(is_bool($work->result)); + } else { + if (isset($work->error)) { + $this->assertTrue(is_string($work->error->message)); + } else { + $this->assertTrue(true); + } + } + }); + } + /** * testUnallowedMethod *