diff options
author | Ian Coleman <coleman.ian@gmail.com> | 2017-08-16 10:43:09 +1000 |
---|---|---|
committer | Ian Coleman <coleman.ian@gmail.com> | 2017-08-16 10:43:09 +1000 |
commit | ed6d9d3905aa581f1a76d37d601c6be39954d1ff (patch) | |
tree | adb9b239acf04ff3011af37161e616ad1e25be5c /tests.js | |
parent | 47b64d3ee12f475fc939b9fbfc3f7ae2578ea2e1 (diff) | |
download | BIP39-ed6d9d3905aa581f1a76d37d601c6be39954d1ff.tar.gz BIP39-ed6d9d3905aa581f1a76d37d601c6be39954d1ff.tar.zst BIP39-ed6d9d3905aa581f1a76d37d601c6be39954d1ff.zip |
Clear old seed when mnemonic is changed
Diffstat (limited to 'tests.js')
-rw-r--r-- | tests.js | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -4120,6 +4120,41 @@ page.open(url, function(status) { | |||
4120 | }); | 4120 | }); |
4121 | }, | 4121 | }, |
4122 | 4122 | ||
4123 | // github issue 43 | ||
4124 | // Cleared mnemonic and root key still allows addresses to be generated | ||
4125 | // https://github.com/iancoleman/bip39/issues/43 | ||
4126 | function() { | ||
4127 | page.open(url, function(status) { | ||
4128 | // set the phrase | ||
4129 | page.evaluate(function() { | ||
4130 | $("#bip49-tab a").click(); | ||
4131 | $(".phrase").val("abandon abandon ability"); | ||
4132 | $(".phrase").trigger("input"); | ||
4133 | }); | ||
4134 | waitForGenerate(function() { | ||
4135 | // clear the mnemonic and root key | ||
4136 | page.evaluate(function() { | ||
4137 | $(".phrase").val(""); | ||
4138 | $(".phrase").trigger("input"); | ||
4139 | $(".root-key").val(""); | ||
4140 | $(".root-key").trigger("input"); | ||
4141 | $(".more").click(); | ||
4142 | }); | ||
4143 | waitForFeedback(function() { | ||
4144 | // check there are no addresses shown | ||
4145 | var addressCount = page.evaluate(function() { | ||
4146 | return $(".address").length; | ||
4147 | }); | ||
4148 | if (addressCount != 0) { | ||
4149 | console.log("Clearing mnemonic should not allow addresses to be generated"); | ||
4150 | fail(); | ||
4151 | } | ||
4152 | next(); | ||
4153 | }); | ||
4154 | }); | ||
4155 | }); | ||
4156 | }, | ||
4157 | |||
4123 | // If you wish to add more tests, do so here... | 4158 | // If you wish to add more tests, do so here... |
4124 | 4159 | ||
4125 | // Here is a blank test template | 4160 | // Here is a blank test template |