Skip to content

Commit 0d400c7

Browse files
committed
fix: linter issues
1 parent 587ff14 commit 0d400c7

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

params.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const (
5151
// 68, 112, and 113.
5252
DeploymentCSV
5353

54-
// NOTE: DefinedDeployments must always come last since it is used to
54+
// DefinedDeployments must always come last since it is used to
5555
// determine how many defined deployments there currently are.
5656

5757
// DefinedDeployments is the number of currently defined deployments.
@@ -193,7 +193,7 @@ type Params struct {
193193
// MinDiffReductionTime is the amount of time after which the minimum
194194
// required difficulty should be reduced when a block hasn't been found.
195195
//
196-
// NOTE: This only applies if ReduceMinDifficulty is true.
196+
// This only applies if ReduceMinDifficulty is true.
197197
MinDiffReductionTime time.Duration
198198

199199
// GenerateSupported specifies whether CPU mining is allowed.
@@ -786,7 +786,7 @@ func (d DNSSeed) String() string {
786786
// error - ErrDuplicateNet if the network is already registered, or another error if the
787787
// parameters are invalid; otherwise, returns nil on success.
788788
//
789-
// Note:
789+
// Comments:
790790
// - Registering the same network more than once will result in an error.
791791
// - This function is not thread-safe and should be called during initialization.
792792
func Register(params *Params) error {

register_test.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,6 @@ type TestSuite struct {
2626
suite.Suite
2727
}
2828

29-
// assertAddrMagics checks if the address magic IDs and cash address prefixes
30-
func (ts *TestSuite) assertAddrMagics(p *Params, want bool) {
31-
ts.Equal(want, IsPubKeyHashAddrID(p.Net, p.LegacyPubKeyHashAddrID), "P2PKH magic %s", p.Name)
32-
ts.Equal(want, IsScriptHashAddrID(p.Net, p.LegacyScriptHashAddrID), "P2SH magic %s", p.Name)
33-
34-
full := p.CashAddressPrefix + ":"
35-
ts.Equal(want, IsCashAddressPrefix(p.Net, full), "cashaddr %s", p.Name)
36-
ts.Equal(want, IsCashAddressPrefix(p.Net, strings.ToUpper(full)), "cashaddr upper %s", p.Name)
37-
}
38-
39-
// assertHD checks if the HDPrivateKeyID can be converted to a HDPublicKeyID.
40-
func (ts *TestSuite) assertHD(p *Params, wantErr bool) {
41-
pub, err := HDPrivateKeyToPublicKeyID(p.HDPrivateKeyID[:])
42-
if wantErr {
43-
ts.ErrorIs(err, ErrUnknownHDKeyID, "HD priv->pub should fail for %s", p.Name)
44-
} else {
45-
ts.Require().NoError(err, "HD priv->pub failed for %s", p.Name)
46-
ts.Equal(p.HDPublicKeyID[:], pub, "HD pub mismatch for %s", p.Name)
47-
}
48-
}
49-
5029
// TestRegisterFlow tests the registration flow of networks, ensuring that
5130
func (ts *TestSuite) TestRegisterFlow() {
5231
builtins := []*Params{&MainNetParams, &RegressionNetParams, &TestNetParams}
@@ -103,6 +82,27 @@ func (ts *TestSuite) TestRegisterFlow() {
10382
})
10483
}
10584

85+
// assertAddrMagics checks if the address magic IDs and cash address prefixes
86+
func (ts *TestSuite) assertAddrMagics(p *Params, want bool) {
87+
ts.Equal(want, IsPubKeyHashAddrID(p.Net, p.LegacyPubKeyHashAddrID), "P2PKH magic %s", p.Name)
88+
ts.Equal(want, IsScriptHashAddrID(p.Net, p.LegacyScriptHashAddrID), "P2SH magic %s", p.Name)
89+
90+
full := p.CashAddressPrefix + ":"
91+
ts.Equal(want, IsCashAddressPrefix(p.Net, full), "cashaddr %s", p.Name)
92+
ts.Equal(want, IsCashAddressPrefix(p.Net, strings.ToUpper(full)), "cashaddr upper %s", p.Name)
93+
}
94+
95+
// assertHD checks if the HDPrivateKeyID can be converted to a HDPublicKeyID.
96+
func (ts *TestSuite) assertHD(p *Params, wantErr bool) {
97+
pub, err := HDPrivateKeyToPublicKeyID(p.HDPrivateKeyID[:])
98+
if wantErr {
99+
ts.ErrorIs(err, ErrUnknownHDKeyID, "HD priv->pub should fail for %s", p.Name)
100+
} else {
101+
ts.Require().NoError(err, "HD priv->pub failed for %s", p.Name)
102+
ts.Equal(p.HDPublicKeyID[:], pub, "HD pub mismatch for %s", p.Name)
103+
}
104+
}
105+
106106
// TestRegisterSuite runs the test suite for the chaincfg package.
107107
func TestRegisterSuite(t *testing.T) {
108108
suite.Run(t, new(TestSuite))

0 commit comments

Comments
 (0)