eth_getWork
This commit is contained in:
parent
9b66125202
commit
5b47025afe
@ -304,6 +304,7 @@ class Eth
|
||||
]
|
||||
]
|
||||
],
|
||||
'eth_getWork' => []
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -1025,6 +1025,32 @@ class EthTest extends TestCase
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* testGetWork
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testGetWork()
|
||||
{
|
||||
$eth = $this->eth;
|
||||
|
||||
$eth->getWork(function ($err, $work) {
|
||||
if ($err !== null) {
|
||||
return $this->fail($err->getMessage());
|
||||
}
|
||||
if (isset($work->result)) {
|
||||
$this->assertTrue(is_array($work->result));
|
||||
} else {
|
||||
if (isset($work->error)) {
|
||||
// we cannot get work if coinbase isnot set.
|
||||
$this->assertTrue(is_string($work->error->message));
|
||||
} else {
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* testUnallowedMethod
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user