diff --git a/lib/pow.js b/lib/pow.js index c0ad44c..ffac708 100644 --- a/lib/pow.js +++ b/lib/pow.js @@ -83,7 +83,7 @@ exports.check = function(opts) { * @return {Promise.} 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); diff --git a/test.js b/test.js index b01b42c..322417d 100644 --- a/test.js +++ b/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);