]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/commitdiff
Add Sugarchain testnet support
authorJang Chongchan <jangchongchan20@gmail.com>
Tue, 28 Apr 2020 14:32:24 +0000 (23:32 +0900)
committerJang Chongchan <jangchongchan20@gmail.com>
Tue, 28 Apr 2020 14:33:27 +0000 (23:33 +0900)
src/js/bitcoinjs-extensions.js
src/js/index.js
src/js/segwit-parameters.js
tests/spec/tests.js

index e331c241c986c480eba052be6255c31f101d171b..2792e13388501b139f52a83295a6c5715f31b1d2 100644 (file)
@@ -1750,6 +1750,17 @@ libs.bitcoin.networks.sugarchain = {
     wif: 0x80
 };
 
+libs.bitcoin.networks.sugarchaintestnet = {
+    messagePrefix: '\x18Sugarchain Signed Message:\n',
+    bip32: {
+        public: 0x045f1cf6,
+        private: 0x045f18bc,
+    },
+    pubKeyHash: 0x42,
+    scriptHash: 0x80,
+    wif: 0xef
+};
+
 // https://github.com/libs.bitcoinjs-lib/blob/3f6f5ef97a1ee1b8337865209282c0095e22b2e7/src/networks.js
 libs.bitcoin.networks.regtest = {
   messagePrefix: '\x18Bitcoin Signed Message:\n',
index 0471e8619d2e3d0f749f0414ceb09f524616c051..f00d90bf2190f78411ade614a8769069bfd83025 100644 (file)
                 setHdCoin(408);
             },
         },
+        {
+            name: "TUGAR - Sugarchain Testnet",
+            onSelect: function() {
+                network = libs.bitcoin.networks.sugarchaintestnet;
+                setHdCoin(408);
+            },
+        },
         {
             name: "SWTC - Jingtum",
             onSelect: function() {
index 0c41bf7619e98627decfb361f9de97004387721c..ea6f86e382e9d9ce9e070780e368aa1ac6fe7d53 100644 (file)
@@ -709,4 +709,30 @@ libs.bitcoin.networks.sugarchain.p2wpkhInP2sh = {
        wif: 0x80
 };
 
+libs.bitcoin.networks.sugarchaintestnet.p2wpkh = {
+       baseNetwork: "sugarchaintestnet",
+       messagePrefix: '\x18Sugarchain Signed Message:\n',
+       bech32: 'tugar',
+       bip32: {
+               public: 0x045f1cf6,
+               private: 0x045f18bc
+       },
+       pubKeyHash: 0x42,
+       scriptHash: 0x80,
+       wif: 0xef
+};
+
+libs.bitcoin.networks.sugarchaintestnet.p2wpkhInP2sh = {
+       baseNetwork: "sugarchaintestnet",
+       messagePrefix: '\x18Sugarchain Signed Message:\n',
+       bech32: 'tugar',
+       bip32: {
+               public: 0x044a5262,
+               private: 0x044a4e28
+       },
+       pubKeyHash: 0x42,
+       scriptHash: 0x80,
+       wif: 0xef
+};
+
 })();
index e7c81bcad598129c3fefbe158676eb5e106fad30..15a52b30c9824ee2cd62dee62fe79e11bb741340 100644 (file)
@@ -1685,6 +1685,16 @@ it('Allows selection of Sugarchain', function(done) {
     };
     testNetwork(done, params);
 });
+it('Allows selection of Sugarchain Testnet', function(done) {
+    var params = {
+        selectText: "TUGAR - Sugarchain Testnet",
+        phrase: "abandon abandon ability",
+        firstAddress: "TkoRzLZQyaY88dAACNVwUFMYekR7pv6CbY",
+        firstPubKey: "035bc9fa22eff2246ec07bb09c9e32f5f9fee517b4f49a8f117508f8fb41905b25",
+        firstPrivKey: "cSd33sGUzymVeaH8ZGzWiyNhjJ1UHuPGLy6goXgNvMjLDqioARWW",
+    };
+    testNetwork(done, params);
+});
 it('Allows selection of Syscoin', function(done) {
     var params = {
         selectText: "SYS - Syscoin",