Fix API
This commit is contained in:
parent
e562fbf645
commit
1e553c1ab6
|
@ -83,7 +83,7 @@ exports.check = function(opts) {
|
|||
* @return {Promise.<Buffer>} A promise that contains computed nonce for
|
||||
* the given target when fulfilled.
|
||||
*/
|
||||
exports.do = function(opts) {
|
||||
exports.doAsync = function(opts) {
|
||||
var initialHash;
|
||||
if (opts.payload) {
|
||||
initialHash = bmcrypto.sha512(opts.payload);
|
||||
|
|
2
test.js
2
test.js
|
@ -282,7 +282,7 @@ describe("POW", function() {
|
|||
if (allTests) {
|
||||
it("should do a POW", function() {
|
||||
this.timeout(300000);
|
||||
return POW.do({target: 10693764680411, initialHash: Buffer("8ff2d685db89a0af2e3dbfd3f700ae96ef4d9a1eac72fd778bbb368c7510cddda349e03207e1c4965bd95c6f7265e8f1a481a08afab3874eaafb9ade09a10880", "hex")})
|
||||
return POW.doAsync({target: 10693764680411, initialHash: Buffer("8ff2d685db89a0af2e3dbfd3f700ae96ef4d9a1eac72fd778bbb368c7510cddda349e03207e1c4965bd95c6f7265e8f1a481a08afab3874eaafb9ade09a10880", "hex")})
|
||||
.then(function(nonce) {
|
||||
// Multiple valid nonces.
|
||||
expect([2373146, 2543600]).to.include(nonce);
|
||||
|
|
Loading…
Reference in New Issue
Block a user