X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests.js;h=6a7a960b1a027cfe7be1c9d176497e618c584647;hb=24137d96070eb6cb47ef8239738ec6a135f0b675;hp=ace2fbb1f73e21be8692c34dbd351bace4158f26;hpb=0edac945e597099d1cabfa684e3c172b3d70cf6c;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git diff --git a/tests.js b/tests.js index ace2fbb..6a7a960 100644 --- a/tests.js +++ b/tests.js @@ -607,6 +607,66 @@ page.open(url, function(status) { }); }, +// Network can be set to ethereum +function() { + +page.open(url, function(status) { + + // set the phrase and coin + page.evaluate(function() { + $(".phrase").val("abandon abandon ability"); + $(".phrase").trigger("input"); + $(".network option[selected]").removeAttr("selected"); + $(".network option[value=13]").prop("selected", true); + $(".network").trigger("change"); + }); + waitForGenerate(function() { + // check the address is generated correctly + // this value comes from + // https://www.myetherwallet.com/#view-wallet-info + // I do not understand the capitalization scheme for this hex encoding + var expected = "0xe5815d5902Ad612d49283DEdEc02100Bd44C2772"; + var actual = page.evaluate(function() { + return $(".address:first").text(); + }); + if (actual != expected.toLowerCase()) { + console.log("Ethereum address is incorrect"); + console.log("Expected: " + expected); + console.log("Actual: " + actual); + fail(); + } + // check the private key is correct + // this private key can be imported into + // https://www.myetherwallet.com/#view-wallet-info + // and it should correlate to the address above + var expected = "8f253078b73d7498302bb78c171b23ce7a8fb511987d2b2702b731638a4a15e7"; + var actual = page.evaluate(function() { + return $(".privkey:first").text(); + }); + if (actual != expected) { + console.log("Ethereum privkey is incorrect"); + console.log("Expected: " + expected); + console.log("Actual: " + actual); + fail(); + } + // check the public key is correct + // TODO + // don't have any third-party source to generate the expected value + //var expected = "?"; + //var actual = page.evaluate(function() { + // return $(".pubkey:first").text(); + //}); + //if (actual != expected) { + // console.log("Ethereum privkey is incorrect"); + // console.log("Expected: " + expected); + // console.log("Actual: " + actual); + // fail(); + //} + next(); + }); +}); +}, + // BIP39 seed is set from phrase function() { page.open(url, function(status) {