diff --git a/CHANGELOG.md b/CHANGELOG.md index a596e75e..f75ce414 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - `pkg/crypto/hashing`: doOnce encoding.HexEncode -> ToString method - `pkg/network/message`: delete GetRand, GetRandMessageSizeBytes +- `pkg/network/anonymity`: delete GetNetworkMask diff --git a/pkg/network/anonymity/anonymity.go b/pkg/network/anonymity/anonymity.go index b1d8abd5..e15a09fa 100644 --- a/pkg/network/anonymity/anonymity.go +++ b/pkg/network/anonymity/anonymity.go @@ -62,11 +62,10 @@ func NewNode( } func (p *sNode) Run(pCtx context.Context) error { + networkMask := p.fQueue.GetSettings().GetNetworkMask() + enableFunc := func() error { - p.fNetwork.HandleFunc( - p.fSettings.GetNetworkMask(), - p.networkHandler, - ) + p.fNetwork.HandleFunc(networkMask, p.networkHandler) return nil } if err := p.fState.Enable(enableFunc); err != nil { @@ -75,7 +74,7 @@ func (p *sNode) Run(pCtx context.Context) error { defer func() { disableFunc := func() error { - p.fNetwork.HandleFunc(p.fSettings.GetNetworkMask(), nil) + p.fNetwork.HandleFunc(networkMask, nil) return nil } _ = p.fState.Disable(disableFunc) diff --git a/pkg/network/anonymity/anonymity_test.go b/pkg/network/anonymity/anonymity_test.go index a824f0f8..f7bbd5fb 100644 --- a/pkg/network/anonymity/anonymity_test.go +++ b/pkg/network/anonymity/anonymity_test.go @@ -774,7 +774,7 @@ func (p *sNode) testNewNetworkMessage(pSett net_message.IConstructSettings, pMsg return net_message.NewMessage( pSett, payload.NewPayload32( - p.fSettings.GetNetworkMask(), + p.fQueue.GetSettings().GetNetworkMask(), pMsgBytes, ), ) diff --git a/pkg/network/anonymity/types.go b/pkg/network/anonymity/types.go index 56811722..cde49998 100644 --- a/pkg/network/anonymity/types.go +++ b/pkg/network/anonymity/types.go @@ -37,6 +37,5 @@ type INode interface { type ISettings interface { GetServiceName() string - GetNetworkMask() uint32 GetFetchTimeout() time.Duration } diff --git a/test/result/badge_codelines.svg b/test/result/badge_codelines.svg index 4bc8978c..bff5fa1e 100644 --- a/test/result/badge_codelines.svg +++ b/test/result/badge_codelines.svg @@ -1 +1 @@ -code lines: 12480code lines12480 \ No newline at end of file +code lines: 12394code lines12394 \ No newline at end of file diff --git a/test/result/badge_coverage.svg b/test/result/badge_coverage.svg index 2eb8e6b2..9fd7bd14 100644 --- a/test/result/badge_coverage.svg +++ b/test/result/badge_coverage.svg @@ -1 +1 @@ -coverage: 98%coverage98% \ No newline at end of file +coverage: 97%coverage97% \ No newline at end of file diff --git a/test/result/coverage.svg b/test/result/coverage.svg index 3c622912..4802055b 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,12 +556,12 @@ - + action.go @@ -569,7 +569,7 @@ - + - + - + head.go @@ -601,12 +601,12 @@ - + logger @@ -614,12 +614,12 @@ - + queue @@ -627,25 +627,25 @@ - + settings.go - + conn.go @@ -653,12 +653,12 @@ - + settings.go @@ -666,12 +666,12 @@ - + connkeeper.go @@ -679,30 +679,37 @@ - + - + +settings.go + - + - + message.go @@ -710,25 +717,18 @@ - + -settings.go - - + joiner32.go @@ -736,12 +736,12 @@ - + database.go @@ -749,12 +749,12 @@ - + log_builder.go @@ -762,24 +762,24 @@ - + - + - + queue.go @@ -787,7 +787,7 @@ - +