eth_submitHashrate

This commit is contained in:
sc0Vu 2017-12-14 23:17:26 +08:00
parent a34ad9216f
commit 9a06702505
2 changed files with 37 additions and 0 deletions

View File

@ -317,6 +317,15 @@ class Eth
]
]
],
'eth_submitHashrate' => [
'params' => [
[
'validators' => BlockHashValidator::class
], [
'validators' => BlockHashValidator::class
]
]
],
];
/**

View File

@ -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
*