Repository: kaspanet/kaspad
Pull request #1521 (2021-02-11 11:39:01)

Change Testnet name to kaspad-testnet-2

codecov[bot]: # [Codecov](https://codecov.io/gh/kaspanet/kaspad/pull/1521?src=pr&el=h1) Report
> Merging [#1521](https://codecov.io/gh/kaspanet/kaspad/pull/1521?src=pr&el=desc) (e213595) into [v0.8.8-dev](https://codecov.io/gh/kaspanet/kaspad/commit/09545b94b71b92c1ab044ade17f973a450cafe1f?el=desc) (09545b9) will **increase** coverage by `0.10%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/kaspanet/kaspad/pull/1521/graphs/tree.svg?width=650&height=150&src=pr&token=2FBIEEJTNU)](https://codecov.io/gh/kaspanet/kaspad/pull/1521?src=pr&el=tree)

```diff
@@              Coverage Diff               @@
##           v0.8.8-dev    #1521      +/-   ##
==============================================
+ Coverage       61.72%   61.83%   +0.10%     
==============================================
  Files             514      514              
  Lines           19254    19254              
==============================================
+ Hits            11884    11905      +21     
+ Misses           5681     5655      -26     
- Partials         1689     1694       +5     
```


| [Impacted Files](https://codecov.io/gh/kaspanet/kaspad/pull/1521?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [domain/dagconfig/params.go](https://codecov.io/gh/kaspanet/kaspad/pull/1521/diff?src=pr&el=tree#diff-ZG9tYWluL2RhZ2NvbmZpZy9wYXJhbXMuZ28=) | `91.66% <ø> (ø)` | |
| [...ersselectedchainstore/headersselectedchainstore.go](https://codecov.io/gh/kaspanet/kaspad/pull/1521/diff?src=pr&el=tree#diff-ZG9tYWluL2NvbnNlbnN1cy9kYXRhc3RydWN0dXJlcy9oZWFkZXJzc2VsZWN0ZWRjaGFpbnN0b3JlL2hlYWRlcnNzZWxlY3RlZGNoYWluc3RvcmUuZ28=) | `70.87% <0.00%> (-2.92%)` | :arrow_down: |
| [app/protocol/flows/blockrelay/handle\_relay\_invs.go](https://codecov.io/gh/kaspanet/kaspad/pull/1521/diff?src=pr&el=tree#diff-YXBwL3Byb3RvY29sL2Zsb3dzL2Jsb2NrcmVsYXkvaGFuZGxlX3JlbGF5X2ludnMuZ28=) | `70.00% <0.00%> (+1.33%)` | :arrow_up: |
| [...uctures/acceptancedatastore/acceptancedatastore.go](https://codecov.io/gh/kaspanet/kaspad/pull/1521/diff?src=pr&el=tree#diff-ZG9tYWluL2NvbnNlbnN1cy9kYXRhc3RydWN0dXJlcy9hY2NlcHRhbmNlZGF0YXN0b3JlL2FjY2VwdGFuY2VkYXRhc3RvcmUuZ28=) | `64.44% <0.00%> (+15.55%)` | :arrow_up: |
| [...consensus/database/serialization/acceptancedata.go](https://codecov.io/gh/kaspanet/kaspad/pull/1521/diff?src=pr&el=tree#diff-ZG9tYWluL2NvbnNlbnN1cy9kYXRhYmFzZS9zZXJpYWxpemF0aW9uL2FjY2VwdGFuY2VkYXRhLmdv) | `78.04% <0.00%> (+36.58%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/kaspanet/kaspad/pull/1521?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/kaspanet/kaspad/pull/1521?src=pr&el=footer). Last update [09545b9...e213595](https://codecov.io/gh/kaspanet/kaspad/pull/1521?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/domain/dagconfig/params.go b/domain/dagconfig/params.go
index 6c794b21..20bdcbe1 100644
--- a/domain/dagconfig/params.go
+++ b/domain/dagconfig/params.go
@@ -256,7 +256,7 @@ var MainnetParams = Params{
 // TestnetParams defines the network parameters for the test Kaspa network.
 var TestnetParams = Params{
 	K:           defaultGHOSTDAGK,
-	Name:        "kaspa-testnet",
+	Name:        "kaspa-testnet-2",
 	Net:         appmessage.Testnet,
 	RPCPort:     "16210",
 	DefaultPort: "16211",


Test patch:
diff --git a/domain/consensus/processes/dagtraversalmanager/window_test.go b/domain/consensus/processes/dagtraversalmanager/window_test.go
index 188129bb..399e434a 100644
--- a/domain/consensus/processes/dagtraversalmanager/window_test.go
+++ b/domain/consensus/processes/dagtraversalmanager/window_test.go
@@ -19,7 +19,7 @@ func TestBlueBlockWindow(t *testing.T) {
 		id                               string //id is a virtual entity that is used only for tests so we can define relations between blocks without knowing their hash
 		expectedWindowWithGenesisPadding []string
 	}{
-		"kaspa-mainnet": {
+		dagconfig.MainnetParams.Name: {
 			{
 				parents:                          []string{"A"},
 				id:                               "B",
@@ -91,7 +91,7 @@ func TestBlueBlockWindow(t *testing.T) {
 				expectedWindowWithGenesisPadding: []string{"N", "M", "L", "K", "J", "I", "F", "C", "D", "H"},
 			},
 		},
-		"kaspa-testnet": {
+		dagconfig.TestnetParams.Name: {
 			{
 				parents:                          []string{"A"},
 				id:                               "B",
@@ -163,7 +163,7 @@ func TestBlueBlockWindow(t *testing.T) {
 				expectedWindowWithGenesisPadding: []string{"N", "M", "L", "K", "J", "I", "F", "H", "C", "D"},
 			},
 		},
-		"kaspa-devnet": {
+		dagconfig.DevnetParams.Name: {
 			{
 				parents:                          []string{"A"},
 				id:                               "B",
@@ -235,7 +235,7 @@ func TestBlueBlockWindow(t *testing.T) {
 				expectedWindowWithGenesisPadding: []string{"N", "M", "L", "K", "J", "I", "F", "H", "C", "D"},
 			},
 		},
-		"kaspa-simnet": {
+		dagconfig.SimnetParams.Name: {
 			{
 				parents:                          []string{"A"},
 				id:                               "B",
diff --git a/domain/consensus/processes/difficultymanager/difficultymanager_test.go b/domain/consensus/processes/difficultymanager/difficultymanager_test.go
index 1b921f59..4bd2a4be 100644
--- a/domain/consensus/processes/difficultymanager/difficultymanager_test.go
+++ b/domain/consensus/processes/difficultymanager/difficultymanager_test.go
@@ -1,10 +1,11 @@
 package difficultymanager_test
 
 import (
-	"github.com/kaspanet/kaspad/util/difficulty"
 	"testing"
 	"time"
 
+	"github.com/kaspanet/kaspad/util/difficulty"
+
 	"github.com/kaspanet/kaspad/util/mstime"
 
 	"github.com/kaspanet/kaspad/domain/consensus/utils/consensushashing"
@@ -132,9 +133,9 @@ func TestDifficulty(t *testing.T) {
 
 		var expectedBits uint32
 		switch params.Name {
-		case "kaspa-testnet", "kaspa-devnet":
+		case dagconfig.TestnetParams.Name, dagconfig.DevnetParams.Name:
 			expectedBits = uint32(0x1e7f83df)
-		case "kaspa-mainnet":
+		case dagconfig.MainnetParams.Name:
 			expectedBits = uint32(0x207f83df)
 		}
 
diff --git a/domain/consensus/processes/pruningmanager/pruning_test.go b/domain/consensus/processes/pruningmanager/pruning_test.go
index 94071618..d0057f35 100644
--- a/domain/consensus/processes/pruningmanager/pruning_test.go
+++ b/domain/consensus/processes/pruningmanager/pruning_test.go
@@ -27,16 +27,16 @@ type testJSON struct {
 func TestPruning(t *testing.T) {
 	expectedPruningPointByNet := map[string]map[string]string{
 		"chain-for-test-pruning.json": {
-			"kaspa-mainnet": "1582",
-			"kaspa-simnet":  "1582",
-			"kaspa-devnet":  "1582",
-			"kaspa-testnet": "1582",
+			dagconfig.MainnetParams.Name: "1582",
+			dagconfig.TestnetParams.Name: "1582",
+			dagconfig.DevnetParams.Name:  "1582",
+			dagconfig.SimnetParams.Name:  "1582",
 		},
 		"dag-for-test-pruning.json": {
-			"kaspa-mainnet": "503",
-			"kaspa-simnet":  "502",
-			"kaspa-devnet":  "503",
-			"kaspa-testnet": "503",
+			dagconfig.MainnetParams.Name: "503",
+			dagconfig.TestnetParams.Name: "503",
+			dagconfig.DevnetParams.Name:  "503",
+			dagconfig.SimnetParams.Name:  "502",
 		},
 	}
 
diff --git a/domain/consensus/pruning_test.go b/domain/consensus/pruning_test.go
index 8ca354d8..bd574ee1 100644
--- a/domain/consensus/pruning_test.go
+++ b/domain/consensus/pruning_test.go
@@ -1,17 +1,18 @@
 package consensus
 
 import (
+	"testing"
+
 	"github.com/kaspanet/kaspad/domain/consensus/utils/testutils"
 	"github.com/kaspanet/kaspad/domain/dagconfig"
-	"testing"
 )
 
 func TestPruningDepth(t *testing.T) {
 	expectedResult := map[string]uint64{
-		"kaspa-mainnet": 244838,
-		"kaspa-testnet": 244838,
-		"kaspa-devnet":  244838,
-		"kaspa-simnet":  192038,
+		dagconfig.MainnetParams.Name: 244838,
+		dagconfig.TestnetParams.Name: 244838,
+		dagconfig.DevnetParams.Name:  244838,
+		dagconfig.SimnetParams.Name:  192038,
 	}
 	testutils.ForAllNets(t, true, func(t *testing.T, params *dagconfig.Params) {
 		expected, found := expectedResult[params.Name]
diff --git a/util/difficulty/difficulty_test.go b/util/difficulty/difficulty_test.go
index 2abd922f..ed563b80 100644
--- a/util/difficulty/difficulty_test.go
+++ b/util/difficulty/difficulty_test.go
@@ -2,20 +2,21 @@ package difficulty_test
 
 import (
 	"fmt"
-	"github.com/kaspanet/kaspad/domain/consensus/utils/testutils"
-	"github.com/kaspanet/kaspad/domain/dagconfig"
-	"github.com/kaspanet/kaspad/util/difficulty"
 	"math"
 	"math/big"
 	"testing"
+
+	"github.com/kaspanet/kaspad/domain/consensus/utils/testutils"
+	"github.com/kaspanet/kaspad/domain/dagconfig"
+	"github.com/kaspanet/kaspad/util/difficulty"
 )
 
 func TestGetHashrateString(t *testing.T) {
 	var results = map[string]string{
-		"kaspa-mainnet": "2 H/s",
-		"kaspa-testnet": "131.07 KH/s",
-		"kaspa-devnet":  "131.07 KH/s",
-		"kaspa-simnet":  "2.00 KH/s",
+		dagconfig.MainnetParams.Name: "2 H/s",
+		dagconfig.TestnetParams.Name: "131.07 KH/s",
+		dagconfig.DevnetParams.Name:  "131.07 KH/s",
+		dagconfig.SimnetParams.Name:  "2.00 KH/s",
 	}
 	testutils.ForAllNets(t, false, func(t *testing.T, params *dagconfig.Params) {
 		targetGenesis := difficulty.CompactToBig(params.GenesisBlock.Header.Bits())