aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Coleman <coleman.ian@gmail.com>2017-03-03 08:30:06 +1100
committerIan Coleman <coleman.ian@gmail.com>2017-03-03 08:30:06 +1100
commitd2d98ef7a6b859ea173d044677e0b1abf1dceb41 (patch)
tree5d3ddd6196d08f3da1a1c6230b7da73c087c44bf
parent599fb39e4e775c4f972ecfa3a9c4548177c23183 (diff)
downloadBIP39-d2d98ef7a6b859ea173d044677e0b1abf1dceb41.tar.gz
BIP39-d2d98ef7a6b859ea173d044677e0b1abf1dceb41.tar.zst
BIP39-d2d98ef7a6b859ea173d044677e0b1abf1dceb41.zip
Regression test for seed from Japanese mnemonic
-rw-r--r--tests.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests.js b/tests.js
index 6d14b48..d55b8f4 100644
--- a/tests.js
+++ b/tests.js
@@ -3582,6 +3582,35 @@ page.open(url, function(status) {
3582}); 3582});
3583}, 3583},
3584 3584
3585
3586// github issue 60
3587// Japanese mnemonics generate incorrect bip32 seed
3588// BIP39 seed is set from phrase
3589function() {
3590page.open(url, function(status) {
3591 // set the phrase
3592 var expected = "a262d6fb6122ecf45be09c50492b31f92e9beb7d9a845987a02cefda57a15f9c467a17872029a9e92299b5cbdf306e3a0ee620245cbd508959b6cb7ca637bd55";
3593 page.evaluate(function() {
3594 $(".phrase").val("あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あいこくしん あおぞら");
3595 $("#passphrase").val("メートルガバヴァぱばぐゞちぢ十人十色");
3596 $("#passphrase").trigger("input");
3597 });
3598 // check the seed is generated correctly
3599 waitForGenerate(function() {
3600 var actual = page.evaluate(function() {
3601 return $(".seed").val();
3602 });
3603 if (actual != expected) {
3604 console.log("BIP39 seed is incorrectly generated from Japanese mnemonic");
3605 console.log("Expected: " + expected);
3606 console.log("Actual: " + actual);
3607 fail();
3608 }
3609 next();
3610 });
3611});
3612},
3613
3585// If you wish to add more tests, do so here... 3614// If you wish to add more tests, do so here...
3586 3615
3587// Here is a blank test template 3616// Here is a blank test template