diff options
Diffstat (limited to 'tests.js')
-rw-r--r-- | tests.js | 51 |
1 files changed, 51 insertions, 0 deletions
@@ -4216,6 +4216,57 @@ page.open(url, function(status) { | |||
4216 | }); | 4216 | }); |
4217 | }, | 4217 | }, |
4218 | 4218 | ||
4219 | // Litecoin uses xprv by default, and can optionally be set to ltpv | ||
4220 | // github issue 96 | ||
4221 | // https://github.com/iancoleman/bip39/issues/96 | ||
4222 | // Issue with extended keys on Litecoin | ||
4223 | function() { | ||
4224 | page.open(url, function(status) { | ||
4225 | // set the phrase and coin | ||
4226 | page.evaluate(function() { | ||
4227 | $(".phrase").val("abandon abandon ability"); | ||
4228 | $(".network option[selected]").removeAttr("selected"); | ||
4229 | $(".network option").filter(function() { | ||
4230 | return $(this).html() == "LTC - Litecoin"; | ||
4231 | }).prop("selected", true); | ||
4232 | $(".network").trigger("change"); | ||
4233 | $(".phrase").trigger("input"); | ||
4234 | }); | ||
4235 | // check the extended key is generated correctly | ||
4236 | waitForGenerate(function() { | ||
4237 | var expected = "xprv9s21ZrQH143K2jkGDCeTLgRewT9F2pH5JZs2zDmmjXes34geVnFiuNa8KTvY5WoYvdn4Ag6oYRoB6cXtc43NgJAEqDXf51xPm6fhiMCKwpi"; | ||
4238 | var actual = page.evaluate(function() { | ||
4239 | return $(".root-key").val(); | ||
4240 | }); | ||
4241 | if (actual != expected) { | ||
4242 | console.log("Litecoin root key does not default to xprv"); | ||
4243 | console.log("Expected: " + expected); | ||
4244 | console.log("Actual: " + actual); | ||
4245 | fail(); | ||
4246 | } | ||
4247 | // set litecoin to use ltub | ||
4248 | page.evaluate(function() { | ||
4249 | $(".addresses").empty(); | ||
4250 | $(".litecoin-use-ltub").prop("checked", true); | ||
4251 | $(".litecoin-use-ltub").trigger("change"); | ||
4252 | }); | ||
4253 | waitForGenerate(function() { | ||
4254 | var expected = "Ltpv71G8qDifUiNesiPqf6h5V6eQ8ic77oxQiYtawiACjBEx3sTXNR2HGDGnHETYxESjqkMLFBkKhWVq67ey1B2MKQXannUqNy1RZVHbmrEjnEU"; | ||
4255 | var actual = page.evaluate(function() { | ||
4256 | return $(".root-key").val(); | ||
4257 | }); | ||
4258 | if (actual != expected) { | ||
4259 | console.log("Litecoin root key cannot be set to use ltub"); | ||
4260 | console.log("Expected: " + expected); | ||
4261 | console.log("Actual: " + actual); | ||
4262 | fail(); | ||
4263 | } | ||
4264 | next(); | ||
4265 | }); | ||
4266 | }); | ||
4267 | }); | ||
4268 | }, | ||
4269 | |||
4219 | // If you wish to add more tests, do so here... | 4270 | // If you wish to add more tests, do so here... |
4220 | 4271 | ||
4221 | // Here is a blank test template | 4272 | // Here is a blank test template |