From 244c76022af53c1f5b337a5a2cdb70358cf85e19 Mon Sep 17 00:00:00 2001 From: Ian Coleman Date: Wed, 18 Dec 2019 09:07:17 +1100 Subject: [PATCH] Convert mnemonic to hex entropy instead of binary --- src/js/index.js | 4 +++- tests/spec/tests.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/index.js b/src/js/index.js index 3db0a31..c9e7b44 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -239,10 +239,12 @@ } phraseChangeTimeoutEvent = setTimeout(function() { phraseChanged(); - var entropy = mnemonic.toRawEntropyBin(DOM.phrase.val()); + var entropy = mnemonic.toRawEntropyHex(DOM.phrase.val()); if (entropy !== null) { DOM.entropyMnemonicLength.val("raw"); DOM.entropy.val(entropy); + DOM.entropyTypeInputs.filter("[value='hexadecimal']").prop("checked", true); + entropyTypeAutoDetect = false; } }, 400); } diff --git a/tests/spec/tests.js b/tests/spec/tests.js index bdc5909..fefb8b7 100644 --- a/tests/spec/tests.js +++ b/tests/spec/tests.js @@ -4243,7 +4243,7 @@ it('Converts mnemonics into raw entropy', function(done) { driver.findElement(By.css('.entropy')) .getAttribute("value") .then(function(entropy) { - expect(entropy).toBe("00000000000000000000000000000001"); + expect(entropy).toBe("00000001"); driver.findElement(By.css('.phrase')) .getAttribute("value") .then(function(phrase) { -- 2.41.0