OSDN Git Service

edit hrp (#2071)
authorwyjDoraemon <46176410+wyjDoraemon@users.noreply.github.com>
Wed, 11 Aug 2021 02:57:20 +0000 (21:57 -0500)
committerGitHub <noreply@github.com>
Wed, 11 Aug 2021 02:57:20 +0000 (10:57 +0800)
common/address_test.go
consensus/general.go

index 59048c8..abbaaf2 100644 (file)
@@ -66,8 +66,8 @@ func TestAddresses(t *testing.T) {
                },
                {
                        name:    "segwit testnet p2wpkh v0",
-                       addr:    "tm1qw508d6qejxtdg4y5r3zarvary0c5xw7kw8fqyc",
-                       encoded: "tm1qw508d6qejxtdg4y5r3zarvary0c5xw7kw8fqyc",
+                       addr:    "tn1qw508d6qejxtdg4y5r3zarvary0c5xw7ku7wsq7",
+                       encoded: "tn1qw508d6qejxtdg4y5r3zarvary0c5xw7ku7wsq7",
                        valid:   true,
                        result: tstAddressWitnessPubKeyHash(
                                0,
@@ -85,8 +85,8 @@ func TestAddresses(t *testing.T) {
                },
                {
                        name:    "segwit testnet p2wsh v0",
-                       addr:    "tm1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qqq379v",
-                       encoded: "tm1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qqq379v",
+                       addr:    "tn1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qrd6us3",
+                       encoded: "tn1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3qrd6us3",
                        valid:   true,
                        result: tstAddressWitnessScriptHash(
                                0,
@@ -108,8 +108,8 @@ func TestAddresses(t *testing.T) {
                },
                {
                        name:    "segwit testnet p2wsh witness v0",
-                       addr:    "tm1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesvkesyk",
-                       encoded: "tm1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesvkesyk",
+                       addr:    "tn1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvses0mjj3t",
+                       encoded: "tn1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvses0mjj3t",
                        valid:   true,
                        result: tstAddressWitnessScriptHash(
                                0,
@@ -187,19 +187,19 @@ func TestAddresses(t *testing.T) {
                },
                {
                        name:  "segwit mixed case",
-                       addr:  "tm1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sL5k7",
+                       addr:  "tn1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sL5k7",
                        valid: false,
                        net:   &consensus.TestNetParams,
                },
                {
                        name:  "segwit zero padding of more than 4 bits",
-                       addr:  "tm1pw508d6qejxtdg4y5r3zarqfsj6c3",
+                       addr:  "tn1pw508d6qejxtdg4y5r3zarqfsj6c3",
                        valid: false,
                        net:   &consensus.TestNetParams,
                },
                {
                        name:  "segwit non-zero padding in 8-to-5 conversion",
-                       addr:  "tm1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3pjxtptv",
+                       addr:  "tn1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3pjxtptv",
                        valid: false,
                        net:   &consensus.TestNetParams,
                },
index 8b50fa5..46e774c 100644 (file)
@@ -132,7 +132,7 @@ var MainNetParams = Params{
 // TestNetParams is the config for test-net
 var TestNetParams = Params{
        Name:            "test",
-       Bech32HRPSegwit: "tm",
+       Bech32HRPSegwit: "tn",
        DefaultPort:     "46656",
        DNSSeeds:        []string{},
        CasperConfig: CasperConfig{
@@ -153,7 +153,7 @@ var TestNetParams = Params{
 // SoloNetParams is the config for test-net
 var SoloNetParams = Params{
        Name:            "solo",
-       Bech32HRPSegwit: "sm",
+       Bech32HRPSegwit: "sn",
        CasperConfig: CasperConfig{
                BlockTimeInterval:      6000,
                MaxTimeOffsetMs:        24000,