Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
number571 committed Nov 11, 2024
1 parent 4a5d44a commit f3d7778
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 133 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- `pkg/crypto/hashing`: doOnce encoding.HexEncode -> ToString method
- `pkg/network/message`: delete GetRand, GetRandMessageSizeBytes
- `pkg/network/anonymity`: delete GetNetworkMask

<!-- ... -->

Expand Down
9 changes: 4 additions & 5 deletions pkg/network/anonymity/anonymity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/network/anonymity/anonymity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
)
Expand Down
1 change: 0 additions & 1 deletion pkg/network/anonymity/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,5 @@ type INode interface {

type ISettings interface {
GetServiceName() string
GetNetworkMask() uint32
GetFetchTimeout() time.Duration
}
2 changes: 1 addition & 1 deletion test/result/badge_codelines.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion test/result/badge_coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit f3d7778

Please sign in to comment.