Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
number571 committed Dec 14, 2024
1 parent 15f1a17 commit 88ed1ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions pkg/anonymity/anonymity.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (p *sNode) runProducer(pCtx context.Context) error {
continue
}
// internal logger
_, _ = p.storeHashWithProduce(pCtx, netMsg)
_, _ = p.produceMessage(pCtx, netMsg)
}
}
}
Expand All @@ -126,7 +126,7 @@ func (p *sNode) runConsumer(pCtx context.Context) error {
continue
}
// internal logger
_ = p.messageHandler(pCtx, netMsg)
_ = p.consumeMessage(pCtx, netMsg)
}
}
}
Expand Down Expand Up @@ -225,7 +225,7 @@ func (p *sNode) recvResponse(pCtx context.Context, pActionKey string) ([]byte, e
}
}

func (p *sNode) messageHandler(pCtx context.Context, pNetMsg net_message.IMessage) error {
func (p *sNode) consumeMessage(pCtx context.Context, pNetMsg net_message.IMessage) error {
logBuilder := anon_logger.NewLogBuilder(p.fSettings.GetServiceName())

// update logger state
Expand Down Expand Up @@ -389,7 +389,7 @@ func (p *sNode) enrichLogger(pLogBuilder anon_logger.ILogBuilder, pNetMsg net_me
WithSize(size)
}

func (p *sNode) storeHashWithProduce(
func (p *sNode) produceMessage(
pCtx context.Context,
pNetMsg net_message.IMessage,
) (bool, error) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/anonymity/anonymity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func TestHandleWrapper(t *testing.T) {
defer testFreeNodes([]INode{_node}, 7)

node := _node.(*sNode)
handler := node.messageHandler
handler := node.consumeMessage
client := node.fQBProcessor.GetClient()

privKey := client.GetPrivKey()
Expand Down Expand Up @@ -488,11 +488,11 @@ func TestStoreHashWithBroadcastMessage(t *testing.T) {
})

netMsg := node.testNewNetworkMessage(sett, msg)
if ok, err := node.storeHashWithProduce(ctx, netMsg); !ok || err != nil {
if ok, err := node.produceMessage(ctx, netMsg); !ok || err != nil {
t.Error(err)
return
}
if ok, err := node.storeHashWithProduce(ctx, netMsg); ok || err != nil {
if ok, err := node.produceMessage(ctx, netMsg); ok || err != nil {
switch {
case ok:
t.Error("success store one message again")
Expand Down

0 comments on commit 88ed1ee

Please sign in to comment.