diff options
-rw-r--r-- | tests.js | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -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 | ||
3589 | function() { | ||
3590 | page.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 |