]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Merge pull request #71 from LedgerHQ/master
authoriancoleman <coleman.ian@gmail.com>
Tue, 6 Jun 2017 04:25:13 +0000 (14:25 +1000)
committerGitHub <noreply@github.com>
Tue, 6 Jun 2017 04:25:13 +0000 (14:25 +1000)
Deleting the remaining checksum from the Ripple private key

bip39-standalone.html
src/js/bitcoinjs-extensions.js
src/js/index.js
tests.js

index 98a33b2cde95a7b3ef12712e94d2eaef9b77a9e3..09634b882b150ab98c796adc8b8901b0ab00186b 100644 (file)
@@ -19936,6 +19936,26 @@ bitcoin.networks.peercoin = {
   wif: 0xb7,
 };
 
+bitcoin.networks.slimcoin = {
+  bip32: {
+    public: 0xef6adf10,
+    private: 0xef69ea80
+  },
+  pubKeyHash: 0x3f,
+  scriptHash: 0x7d,
+  wif: 0x46,
+};
+
+bitcoin.networks.slimcointn = {
+  bip32: {
+    public: 0x043587CF,
+    private: 0x04358394
+  },
+  pubKeyHash: 0x6f,
+  scriptHash: 0xc4,
+  wif: 0x57,
+};
+
 </script>
         <script>(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ethUtil = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
 (function (global){
@@ -44872,6 +44892,20 @@ window.Entropy = new (function() {
                 DOM.bip44coin.val(1);
             },
         },
+        {
+            name: "Slimcoin",
+            onSelect: function() {
+                network = bitcoin.networks.slimcoin;
+                DOM.bip44coin.val(63);
+            },
+        },
+        {
+            name: "Slimcoin Testnet",
+            onSelect: function() {
+                network = bitcoin.networks.slimcointn;
+                DOM.bip44coin.val(111);
+            },
+        },
         {
             name: "Viacoin",
             onSelect: function() {
index ed1bb09669adb80e42598e33e3f3c4d60ad18551..dd5069cf1671e08f31f8c8e1b5f43980cdaaae37 100644 (file)
@@ -75,3 +75,23 @@ bitcoin.networks.peercoin = {
   wif: 0xb7,
 };
 
+bitcoin.networks.slimcoin = {
+  bip32: {
+    public: 0xef6adf10,
+    private: 0xef69ea80
+  },
+  pubKeyHash: 0x3f,
+  scriptHash: 0x7d,
+  wif: 0x46,
+};
+
+bitcoin.networks.slimcointn = {
+  bip32: {
+    public: 0x043587CF,
+    private: 0x04358394
+  },
+  pubKeyHash: 0x6f,
+  scriptHash: 0xc4,
+  wif: 0x57,
+};
+
index c4d99afea4576ead9613bc8f66b5f16b80b36abd..b24a6591d02bf886f577d57c7c74167720f36b9f 100644 (file)
                 DOM.bip44coin.val(1);
             },
         },
+        {
+            name: "Slimcoin",
+            onSelect: function() {
+                network = bitcoin.networks.slimcoin;
+                DOM.bip44coin.val(63);
+            },
+        },
+        {
+            name: "Slimcoin Testnet",
+            onSelect: function() {
+                network = bitcoin.networks.slimcointn;
+                DOM.bip44coin.val(111);
+            },
+        },
         {
             name: "Viacoin",
             onSelect: function() {
index e6bd9c5ffa9c90d92a3362a05fe87823bf90478d..6d4702aa0e5a207210f8a90e35c0b7423e94ce63 100644 (file)
--- a/tests.js
+++ b/tests.js
@@ -753,6 +753,66 @@ page.open(url, function(status) {
 });
 },
 
+// Network can be set to Slimcoin
+function() {
+page.open(url, function(status) {
+    // set the phrase and coin
+    var expected = "SNzPi1CafHFm3WWjRo43aMgiaEEj3ogjww";
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability");
+        $(".phrase").trigger("input");
+        $(".network option[selected]").removeAttr("selected");
+        $(".network option").filter(function() {
+            return $(this).html() == "Slimcoin";
+        }).prop("selected", true);
+        $(".network").trigger("change");
+    });
+    // check the address is generated correctly
+    waitForGenerate(function() {
+        var actual = page.evaluate(function() {
+            return $(".address:first").text();
+        });
+        if (actual != expected) {
+            console.log("Slimcoin address is incorrect");
+            console.log("Expected: " + expected);
+            console.log("Actual: " + actual);
+            fail();
+        }
+        next();
+    });
+});
+},
+
+// Network can be set to Slimcointn
+function() {
+page.open(url, function(status) {
+    // set the phrase and coin
+    var expected = "n3nMgWufTek5QQAr6uwMhg5xbzj8xqc4Dq";
+    page.evaluate(function() {
+        $(".phrase").val("abandon abandon ability");
+        $(".phrase").trigger("input");
+        $(".network option[selected]").removeAttr("selected");
+        $(".network option").filter(function() {
+            return $(this).html() == "Slimcoin Testnet";
+        }).prop("selected", true);
+        $(".network").trigger("change");
+    });
+    // check the address is generated correctly
+    waitForGenerate(function() {
+        var actual = page.evaluate(function() {
+            return $(".address:first").text();
+        });
+        if (actual != expected) {
+            console.log("Slimcoin testnet address is incorrect");
+            console.log("Expected: " + expected);
+            console.log("Actual: " + actual);
+            fail();
+        }
+        next();
+    });
+});
+},
+
 // BIP39 seed is set from phrase
 function() {
 page.open(url, function(status) {