diff --git a/pkg/network/anonymity/anonymity_test.go b/pkg/network/anonymity/anonymity_test.go index f7bbd5fb..50197c68 100644 --- a/pkg/network/anonymity/anonymity_test.go +++ b/pkg/network/anonymity/anonymity_test.go @@ -77,7 +77,7 @@ func TestNodeSettings(t *testing.T) { func TestSettings(t *testing.T) { t.Parallel() - for i := 0; i < 3; i++ { + for i := 0; i < 1; i++ { testSettings(t, i) } } @@ -89,22 +89,9 @@ func testSettings(t *testing.T, n int) { return } }() - switch n { + switch n { // nolint: gocritic case 0: - _ = NewSettings(&SSettings{ - FNetworkMask: 1, - FFetchTimeout: time.Second, - }) - case 1: - _ = NewSettings(&SSettings{ - FServiceName: "TEST", - FFetchTimeout: time.Second, - }) - case 2: - _ = NewSettings(&SSettings{ - FServiceName: "TEST", - FNetworkMask: 1, - }) + _ = NewSettings(&SSettings{}) } } @@ -694,7 +681,6 @@ func testNewNodeWithDB(timeWait time.Duration, addr string, db database.IKVDatab node := NewNode( NewSettings(&SSettings{ FServiceName: "TEST", - FNetworkMask: networkMask, FFetchTimeout: timeWait, }), // internal_std_logger.NewStdLogger(&stLogging{}, internal_anon_logger.GetLogFunc()), diff --git a/pkg/network/anonymity/examples/echo/construct.go b/pkg/network/anonymity/examples/echo/construct.go index 1b6d2d06..ad09ee5b 100644 --- a/pkg/network/anonymity/examples/echo/construct.go +++ b/pkg/network/anonymity/examples/echo/construct.go @@ -30,7 +30,6 @@ func newNode(serviceName, address string) anonymity.INode { return anonymity.NewNode( anonymity.NewSettings(&anonymity.SSettings{ FServiceName: serviceName, - FNetworkMask: networkMask, FFetchTimeout: time.Minute, }), logger.NewLogger( diff --git a/pkg/network/anonymity/examples/ping-pong/construct.go b/pkg/network/anonymity/examples/ping-pong/construct.go index 1b6d2d06..ad09ee5b 100644 --- a/pkg/network/anonymity/examples/ping-pong/construct.go +++ b/pkg/network/anonymity/examples/ping-pong/construct.go @@ -30,7 +30,6 @@ func newNode(serviceName, address string) anonymity.INode { return anonymity.NewNode( anonymity.NewSettings(&anonymity.SSettings{ FServiceName: serviceName, - FNetworkMask: networkMask, FFetchTimeout: time.Minute, }), logger.NewLogger( diff --git a/pkg/network/anonymity/settings.go b/pkg/network/anonymity/settings.go index f097d463..4fb56fbc 100644 --- a/pkg/network/anonymity/settings.go +++ b/pkg/network/anonymity/settings.go @@ -11,25 +11,17 @@ var ( type SSettings sSettings type sSettings struct { FServiceName string - FNetworkMask uint32 FFetchTimeout time.Duration } func NewSettings(pSett *SSettings) ISettings { return (&sSettings{ FServiceName: pSett.FServiceName, - FNetworkMask: pSett.FNetworkMask, FFetchTimeout: pSett.FFetchTimeout, }).mustNotNull() } func (p *sSettings) mustNotNull() ISettings { - if p.FServiceName == "" { - panic(`p.FServiceName == ""`) - } - if p.FNetworkMask == 0 { - panic(`p.FNetworkMask == 0`) - } if p.FFetchTimeout == 0 { panic(`p.FFetchTimeout == 0`) } @@ -43,7 +35,3 @@ func (p *sSettings) GetServiceName() string { func (p *sSettings) GetFetchTimeout() time.Duration { return p.FFetchTimeout } - -func (p *sSettings) GetNetworkMask() uint32 { - return p.FNetworkMask -} diff --git a/test/result/badge_codelines.svg b/test/result/badge_codelines.svg index bff5fa1e..f7206dc8 100644 --- a/test/result/badge_codelines.svg +++ b/test/result/badge_codelines.svg @@ -1 +1 @@ -code lines: 12394code lines12394 \ No newline at end of file +code lines: 12366code lines12366 \ No newline at end of file diff --git a/test/result/badge_coverage.svg b/test/result/badge_coverage.svg index 9fd7bd14..2eb8e6b2 100644 --- a/test/result/badge_coverage.svg +++ b/test/result/badge_coverage.svg @@ -1 +1 @@ -coverage: 97%coverage97% \ No newline at end of file +coverage: 98%coverage98% \ No newline at end of file diff --git a/test/result/coverage.svg b/test/result/coverage.svg index 4802055b..0d847000 100644 --- a/test/result/coverage.svg +++ b/test/result/coverage.svg @@ -7,7 +7,7 @@ > - + - + - + - + client @@ -52,12 +52,12 @@ - + crypto @@ -65,12 +65,12 @@ - + encoding @@ -78,12 +78,12 @@ - + logger @@ -91,7 +91,7 @@ - + - + payload @@ -117,12 +117,12 @@ - + state @@ -130,12 +130,12 @@ - + storage @@ -143,12 +143,12 @@ - + client.go @@ -156,12 +156,12 @@ - + message @@ -169,12 +169,12 @@ - + asymmetric @@ -182,12 +182,12 @@ - + hashing @@ -195,18 +195,18 @@ - + - + puzzle/puzzle.go @@ -214,12 +214,12 @@ - + random/random.go @@ -227,12 +227,12 @@ - + symmetric/symmetric.go @@ -240,12 +240,12 @@ - + bytes.go @@ -253,18 +253,18 @@ - + - + hex.go @@ -272,12 +272,12 @@ - + serialize_json.go @@ -285,18 +285,18 @@ - + - + logger.go @@ -304,13 +304,13 @@ - + - + - + conn @@ -336,12 +336,12 @@ - + connkeeper @@ -349,18 +349,18 @@ - + - + message @@ -368,12 +368,12 @@ - + network.go @@ -381,12 +381,12 @@ - + settings.go @@ -394,12 +394,12 @@ - + joiner @@ -407,12 +407,12 @@ - + payload32.go @@ -420,12 +420,12 @@ - + payload64.go @@ -433,12 +433,12 @@ - + state.go @@ -446,12 +446,12 @@ - + cache/lru.go @@ -459,12 +459,12 @@ - + database @@ -472,12 +472,12 @@ - + message.go @@ -485,12 +485,12 @@ - + dsa.go @@ -498,12 +498,12 @@ - + kem.go @@ -511,12 +511,12 @@ - + key.go @@ -524,12 +524,12 @@ - + map_pubkeys.go @@ -537,18 +537,18 @@ - + - + hmac.go @@ -556,20 +556,13 @@ - + -action.go - - + - + - + -head.go - - + logger @@ -614,12 +600,12 @@ - + queue @@ -627,25 +613,18 @@ - + -settings.go - - + conn.go @@ -653,12 +632,12 @@ - + settings.go @@ -666,12 +645,12 @@ - + connkeeper.go @@ -679,37 +658,30 @@ - + - + -settings.go - - + - + message.go @@ -717,18 +689,25 @@ - + +settings.go + - + joiner32.go @@ -736,12 +715,12 @@ - + database.go @@ -749,12 +728,12 @@ - + log_builder.go @@ -762,24 +741,24 @@ - + - + - + queue.go @@ -787,7 +766,7 @@ - +