X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fspec%2Ftests.js;h=10575efb9f97da948facae8246c9d55ffe7df71d;hb=90422a41afbd0de30dfa98f1091d6ca2af426cec;hp=58318db6df5d9f3f5afca9a139342362bcb1a5e6;hpb=42e00ef56a00c304090c54ef05ff1fc0dcb148b6;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FBIP39.git diff --git a/tests/spec/tests.js b/tests/spec/tests.js index 58318db..10575ef 100644 --- a/tests/spec/tests.js +++ b/tests/spec/tests.js @@ -168,6 +168,17 @@ function selectNetwork(name) { }, name); } +function selectBip85Language(language) { + driver.executeScript(function() { + var selectText = arguments[0]; + $(".bip85-mnemonic-language option[selected]").removeAttr("selected"); + $(".bip85-mnemonic-language option").filter(function(i,e) { + return $(e).html() == selectText; + }).prop("selected", true); + $(".bip85-mnemonic-language").trigger("change"); + }, language); +} + function testEntropyType(done, entropyText, entropyTypeUnsafe) { // entropy type is compiled into regexp so needs escaping // see https://stackoverflow.com/a/2593661 @@ -640,7 +651,7 @@ it('Allows selection of namecoin', function(done) { phrase: "abandon abandon ability", firstAddress: "Mw2vK2Bvex1yYtYF6sfbEg2YGoUc98YUD2", firstPubKey: "0398066486fe87cbcb9da8e29d180b44937b6c43ad1ec4d3bddd77b7905765937e", - firstPrivKey: "L4A8sSkrGndiXyZdj6Fnju8Wu76s96cdHHmPxV3C5M2R2w4GVNco", + firstPrivKey: "TkJvbqVdNnGsCtFaV2nE8x3qqhYnYriRkGAB4747cEDRg9VUKKiz", }; testNetwork(done, params); }); @@ -906,6 +917,16 @@ it('Allows selection of Aryacoin', function(done) { }; testNetwork(done, params); }); +it('Allows selection of Cosmos Hub', function(done) { + var params = { + selectText: "ATOM - Cosmos Hub", + phrase: "abandon abandon ability", + firstAddress: "cosmos17mkch9syem8gtf6wh7p38thdgav6dwezpkylny", + firstPubKey: "cosmospub1addwnpepq0sgn66ty4suk5vx3hsmxxqd5z3amegqwlu59funrzyz5u8r9758qhl84ys", + firstPrivKey: "zUnETPxmE2vkHzLHTAlO9wg8PL/GEEBc1I4yVwvSV8M=", + }; + testNetwork(done, params); +}); it('Allows selection of Auroracoin', function(done) { var params = { selectText: "AUR - Auroracoin", @@ -1214,6 +1235,26 @@ it('Allows selection of FIO', function(done) { }; testNetwork(done, params); }); +it('Allows selection of Firo', function(done) { + var params = { + selectText: "FIRO - Firo (Zcoin rebrand)", + phrase: "abandon abandon ability", + firstAddress: "a6VcMdP4XgAA9Tr7xNszmPG5FZpfRf17Cq", + firstPubKey: "0236f2348c32dc62d69488b01988ed1154df261723ec60461cb6e62189984c62db", + firstPrivKey: "Y8k3XQRQrJoABEao4Sw45s744g6xth7yviNqFcN7zqPqKUJrrKTQ", + }; + testNetwork(done, params); +}); +it('Allows selection of Zcoin', function(done) { + var params = { + selectText: "XZC - Zcoin (rebranded to Firo)", + phrase: "abandon abandon ability", + firstAddress: "a6VcMdP4XgAA9Tr7xNszmPG5FZpfRf17Cq", + firstPubKey: "0236f2348c32dc62d69488b01988ed1154df261723ec60461cb6e62189984c62db", + firstPrivKey: "Y8k3XQRQrJoABEao4Sw45s744g6xth7yviNqFcN7zqPqKUJrrKTQ", + }; + testNetwork(done, params); +}); it('Allows selection of Firstcoin', function(done) { var params = { selectText: "FRST - Firstcoin", @@ -1604,6 +1645,16 @@ it('Allows selection of RevolutionVR', function(done) { }; testNetwork(done, params); }); +it('Allows selection of Ritocoin', function(done) { + var params = { + selectText: "RITO - Ritocoin", + phrase: "abandon abandon ability", + firstAddress: "BMbHdwDiuaZh4ATp8Xapf4srv3swzAGgkf", + firstPubKey: "036f5f55dc37fa97294a2a5ae4d92735d4392d4405cbbebebf2d70d5d6781be622", + firstPrivKey: "Mdaumz3494kxCeiEBame4ZBzjtTQ5mYzD8notv2EBW8FcNy3PiYd", + }; + testNetwork(done, params); +}); it('Allows selection of Rubycoin', function(done) { var params = { selectText: "RBY - Rubycoin", @@ -1844,16 +1895,6 @@ it('Allows selection of Wincoin', function(done) { }; testNetwork(done, params); }); -it('Allows selection of Zcoin', function(done) { - var params = { - selectText: "XZC - Zcoin", - phrase: "abandon abandon ability", - firstAddress: "a6VcMdP4XgAA9Tr7xNszmPG5FZpfRf17Cq", - firstPubKey: "0236f2348c32dc62d69488b01988ed1154df261723ec60461cb6e62189984c62db", - firstPrivKey: "Y8k3XQRQrJoABEao4Sw45s744g6xth7yviNqFcN7zqPqKUJrrKTQ", - }; - testNetwork(done, params); -}); it('Allows selection of Zcash', function(done) { var params = { selectText: "ZEC - Zcash", @@ -2155,6 +2196,16 @@ it('Allows selection of Stellar', function(done) { }; testNetwork(done, params); }); +it('Allows selection of Nano', function(done) { + var params = { + selectText: "NANO - Nano", + phrase: "deal wedding panda forum property artist whip total word student sea middle", + firstAddress: "nano_15fum9n68681dz73qyu37fuc9tro84gqm86eptdqpm9jutkfnt34agkoqpw5", + firstPubKey: "0dbb99e84310c05fca1bfb612b76a3eb15309d79988cb6977b4cf1dea4da6822", + firstPrivKey: "30633c8497cc47e0aefd52c7971ffd45e6c5d166274c7978feca3482a859c0af", + }; + testNetwork(done, params); +}); it('Allows selection of Wagerr', function(done) { var params = { selectText: "WGR - Wagerr", @@ -2286,6 +2337,28 @@ it('Allows selection of Binance Smart Chain', function(done) { testNetwork(done, params); }); +it('Allows selection of TRX on Tron', function(done) { + var params = { + selectText: "TRX - Tron", + phrase: "abandon abandon ability", + firstAddress: "TA891Fu7vVz595BGQpNX2MCzr7yBcxuoC7", + firstPubKey: "0337bbb060e6166066f7f9e59e52f67bc23a6c9d0cbc815b82b6d89112444842e7", + firstPrivKey: "3a8fbd0379a815764979de86a3fcda759cb62d49e784e7b2a9a03206c90cfae2", + }; + testNetwork(done, params); +}); + +it('Allows selection of ZooBlockchain', function(done) { + var params = { + selectText: "ZBC - ZooBlockchain", + phrase: "shy invest oxygen real lunar moral merge corn program air affair amazing dove imitate combine solve library fresh case alcohol pole question act thing", + firstAddress: "ZBC_MGEZVH3U_SXPCBHTU_KSWDPQ4X_K6MSI3VR_CQAYMTLC_RXUMM3DJ_LFABCAXA", + firstPubKey: "61899a9f7495de209e7454ac37c3975799246eb11401864d628de8c66c695940", + firstPrivKey: "adb11e79068fa7366ec4f5963ad57115d666b1ad2b369b92d962563adf7dd48b", + }; + testNetwork(done, params); +}); + // BIP39 seed is set from phrase it('Sets the bip39 seed from the prhase', function(done) { driver.findElement(By.css('.phrase')) @@ -4939,6 +5012,43 @@ it('Shows split prase cards', function(done) { }); }); +// Pull Request 454 https://github.com/iancoleman/bip39/pull/454 +// Add BIP85 support +it('Show BIP85', function(done) { + var originalPhrase = "install scatter logic circle pencil average fall shoe quantum disease suspect usage"; + driver.findElement(By.css('.phrase')) + .sendKeys(originalPhrase); + driver.sleep(generateDelay).then(function() { + driver.findElement(By.css('.showBip85')).click(); + driver.findElement(By.css('.showBip85')).isSelected().then(function(isSelected) { + expect(isSelected).toBe(true) + driver.findElement(By.css('#bip85Field')).getAttribute("value").then(function(childMnemonic) { + expect(childMnemonic).toBe('girl mad pet galaxy egg matter matrix prison refuse sense ordinary nose') + done(); + }) + }); + }); +}); + +it('Show BIP85 in non-English languages', function(done) { + pending("BIP85 library update"); + var originalPhrase = "install scatter logic circle pencil average fall shoe quantum disease suspect usage"; + driver.findElement(By.css('.phrase')) + .sendKeys(originalPhrase); + driver.sleep(generateDelay).then(function() { + driver.findElement(By.css('.showBip85')).click(); + selectBip85Language("3"); + driver.findElement(By.css('.showBip85')).isSelected().then(function(isSelected) { + expect(isSelected).toBe(true) + driver.findElement(By.css('#bip85Field')).getAttribute("value").then(function(childMnemonic) { + expect(childMnemonic).not.toBe('girl mad pet galaxy egg matter matrix prison refuse sense ordinary nose') + //expect(childMnemonic).toBe('Not sure yet, something Spanish') + done(); + }) + }); + }); +}); + // It allows manually specifying the entropy type it('Allows entropy type to be manually selected', function(done) { driver.findElement(By.css('.use-entropy'))