From b7f796e78b513d4b8c9d7b0fdb9729c736c55903 Mon Sep 17 00:00:00 2001 From: Kagami Hiiragi Date: Sun, 11 Jan 2015 15:00:12 +0300 Subject: [PATCH] Fix test again --- lib/platform.browser.js | 6 +++--- package.json | 2 +- test.js | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/platform.browser.js b/lib/platform.browser.js index e132198..5632214 100644 --- a/lib/platform.browser.js +++ b/lib/platform.browser.js @@ -8,9 +8,9 @@ // `bitmessage -> eccrypto -> elliptic -> hash.js` so it won't add // additional bytes to the bundle. var hash = require("hash.js"); -// Use only one submodule from `sha.js` here and in subworker because -// it's faster. It will add additional bytes to the bundle but not that -// much (~10-30KB). +// Use only one submodule from `sha.js` here and in worker because it's +// faster. It will add additional bytes to the bundle but not that much +// (~9KB). var Sha512 = require("sha.js/sha512"); var BN = require("bn.js"); var work = require("webworkify"); diff --git a/package.json b/package.json index d1322c4..bdceed5 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,7 @@ "hash.js": "^1.0.2", "nan": "^1.4.1", "object-assign": "^2.0.0", - "sha.js": "^2.3.0", + "sha.js": "^2.3.1", "webworkify": "^1.0.1" } } diff --git a/test.js b/test.js index d4eae51..5c5cb6c 100644 --- a/test.js +++ b/test.js @@ -283,11 +283,13 @@ describe("POW", function() { it("should do a POW", function() { this.timeout(300000); var target = typeof window === "undefined" ? 297422593171 : 10693764680411; - var nonces = typeof window === "undefined" ? [21997550] : [2373146, 2543600]; + var validNonces = typeof window === "undefined" ? + [21997550] : + [2373146, 2543600, 3593915]; return POW.doAsync({target: target, initialHash: Buffer("8ff2d685db89a0af2e3dbfd3f700ae96ef4d9a1eac72fd778bbb368c7510cddda349e03207e1c4965bd95c6f7265e8f1a481a08afab3874eaafb9ade09a10880", "hex")}) .then(function(computedNonce) { // Multiple valid nonces. - expect(nonces).to.include(computedNonce); + expect(validNonces).to.include(computedNonce); }); }); }