For example, using abandon abandon ability becomes 8 zeros but how does
the entropy field know it's hex and not binary? It assumes the
worst-case scenario of binary, so entropy should be shown in binary.
Perhaps if entropy type is explicitly selected in the future this can be
changed back to using hex. But while magical assumptions exist, binary
it must be.
}
phraseChangeTimeoutEvent = setTimeout(function() {
phraseChanged();
- var entropy = mnemonic.toRawEntropyHex(DOM.phrase.val());
+ var entropy = mnemonic.toRawEntropyBin(DOM.phrase.val());
if (entropy !== null) {
DOM.entropyMnemonicLength.val("raw");
DOM.entropy.val(entropy);
return h;
}
+ self.toRawEntropyBin = function(mnemonic) {
+ var b = mnemonicToBinaryString(mnemonic);
+ var d = b.substring(0, b.length / 33 * 32);
+ return d;
+ }
+
self.toSeed = function(mnemonic, passphrase) {
passphrase = passphrase || '';
mnemonic = self.joinWords(self.splitWords(mnemonic)); // removes duplicate blanks
driver.findElement(By.css('.entropy'))
.getAttribute("value")
.then(function(entropy) {
- expect(entropy).toBe("00000001");
- done();
+ expect(entropy).toBe("00000000000000000000000000000001");
+ driver.findElement(By.css('.phrase'))
+ .getAttribute("value")
+ .then(function(phrase) {
+ expect(phrase).toBe("abandon abandon about");
+ done();
+ });
});
});
});