]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blobdiff - tests/spec/tests.js
LeftPad ethereum private keys with zeros if needed
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / tests / spec / tests.js
index a4863b042f21267826bb02292cf7faae4a9ef0c7..9a1e54341c9516e11a2bfad7d71dcf2f856bbc53 100644 (file)
@@ -2850,4 +2850,29 @@ it('Can display the table as csv', function(done) {
     });
 });
 
+it('LeftPads ethereum keys that are less than 32 bytes', function(done) {
+    // see https://github.com/iancoleman/bip39/issues/155
+    selectNetwork("ETH - Ethereum");
+    driver.findElement(By.css('#bip32-tab a'))
+        .click()
+    driver.findElement(By.css('#bip32-path'))
+        .clear();
+    driver.findElement(By.css('#bip32-path'))
+        .sendKeys("m/44'/60'/0'");
+    driver.findElement(By.css('.phrase'))
+        .sendKeys('scout sort custom elite radar rare vivid thing trophy gesture cover snake change narrow kite list nation sustain buffalo erode open balance system young');
+    driver.sleep(generateDelay).then(function() {
+        driver.findElement(By.css(".address"))
+            .getText()
+            .then(function(address) {
+                expect(address).toBe("0x8943E785B4a5714FC87a3aFAad1eB1FeB602B118");
+                done();
+            });
+        //getFirstAddress(function(address) {
+        //    expect(address).toBe("0x8943E785B4a5714FC87a3aFAad1eB1FeB602B118");
+        //    done();
+        //});
+    });
+});
+
 });