eth_getWork

This commit is contained in:
sc0Vu 2017-12-14 22:20:37 +08:00
parent 9b66125202
commit 5b47025afe
2 changed files with 27 additions and 0 deletions

View File

@ -304,6 +304,7 @@ class Eth
]
]
],
'eth_getWork' => []
];
/**

View File

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