]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Change BIP44 purpose and coin fields to readonly
authorIan Coleman <coleman.ian@gmail.com>
Wed, 2 Aug 2017 06:12:41 +0000 (16:12 +1000)
committerIan Coleman <coleman.ian@gmail.com>
Wed, 2 Aug 2017 07:12:13 +0000 (17:12 +1000)
src/index.html
src/js/index.js
tests.js

index 8edb0ae4f985e5e7139df617ba12d4ccce9bfe90..6a5e6447f8fdca8bd6d513577ad38125c6b49d76 100644 (file)
                                         <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank" data-translate>Purpose</a>
                                     </label>
                                     <div class="col-sm-10">
-                                        <input id="purpose" type="text" class="purpose form-control" value="44">
+                                        <input id="purpose" type="text" class="purpose form-control" value="44" readonly>
                                     </div>
                                 </div>
                                 <div class="form-group">
                                         <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank" data-translate>Coin</a>
                                     </label>
                                     <div class="col-sm-10">
-                                        <input id="coin" type="text" class="coin form-control" value="0">
+                                        <input id="coin" type="text" class="coin form-control" value="0" readonly>
                                     </div>
                                 </div>
                                 <div class="form-group">
index 9b8432a4d64686dfbf45cdaf6f8d2ed275c85bd6..84c773f86dd7b7352e76ea749dbae1841873b9c7 100644 (file)
@@ -88,8 +88,6 @@
         DOM.more.on("click", showMore);
         DOM.rootKey.on("input", delayedRootKeyChanged);
         DOM.bip32path.on("input", calcForDerivationPath);
-        DOM.bip44purpose.on("input", calcForDerivationPath);
-        DOM.bip44coin.on("input", calcForDerivationPath);
         DOM.bip44account.on("input", calcForDerivationPath);
         DOM.bip44change.on("input", calcForDerivationPath);
         DOM.tab.on("shown.bs.tab", calcForDerivationPath);
index 4f922ce133eafefc5377e76cb1c19d1da6848530..ea2904336ba6ee9ed12058a4156f5beb22bfb511 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -1028,70 +1028,6 @@ page.open(url, function(status) {
 });
 },
 
-// BIP44 purpose field changes address list
-function() {
-page.open(url, function(status) {
-    // set the phrase
-    var expected = "1JbDzRJ2cDT8aat2xwKd6Pb2zzavow5MhF";
-    page.evaluate(function() {
-        $(".phrase").val("abandon abandon ability");
-        $(".phrase").trigger("input");
-    });
-    waitForGenerate(function() {
-        // change the bip44 purpose field to 45
-        page.evaluate(function() {
-            $("#bip44 .purpose").val("45");
-            $("#bip44 .purpose").trigger("input");
-        });
-        waitForGenerate(function() {
-            // check the address for the new derivation path
-            var actual = page.evaluate(function() {
-                return $(".address:first").text();
-            });
-            if (actual != expected) {
-                console.log("BIP44 purpose field generates incorrect address");
-                console.log("Expected: " + expected);
-                console.log("Actual: " + actual);
-                fail();
-            }
-            next();
-        });
-    });
-});
-},
-
-// BIP44 coin field changes address list
-function() {
-page.open(url, function(status) {
-    // set the phrase
-    var expected = "1F6dB2djQYrxoyfZZmfr6D5voH8GkJTghk";
-    page.evaluate(function() {
-        $(".phrase").val("abandon abandon ability");
-        $(".phrase").trigger("input");
-    });
-    waitForGenerate(function() {
-        // change the bip44 purpose field to 45
-        page.evaluate(function() {
-            $("#bip44 .coin").val("1");
-            $("#bip44 .coin").trigger("input");
-        });
-        waitForGenerate(function() {
-            // check the address for the new derivation path
-            var actual = page.evaluate(function() {
-                return $(".address:first").text();
-            });
-            if (actual != expected) {
-                console.log("BIP44 coin field generates incorrect address");
-                console.log("Expected: " + expected);
-                console.log("Actual: " + actual);
-                fail();
-            }
-            next();
-        });
-    });
-});
-},
-
 // BIP44 account field changes address list
 function() {
 page.open(url, function(status) {
@@ -3392,7 +3328,7 @@ page.open(url, function(status) {
     // check the BIP44 account extended private key
     waitForGenerate(function() {
         var actual = page.evaluate(function() {
-            return $(".account-xprv").val();
+            return $("#bip44 .account-xprv").val();
         });
         if (actual != expected) {
             console.log("BIP44 account extended private key is incorrect");
@@ -3418,7 +3354,7 @@ page.open(url, function(status) {
     // check the BIP44 account extended public key
     waitForGenerate(function() {
         var actual = page.evaluate(function() {
-            return $(".account-xpub").val();
+            return $("#bip44 .account-xpub").val();
         });
         if (actual != expected) {
             console.log("BIP44 account extended public key is incorrect");