Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
number571 committed Nov 13, 2024
1 parent 54aac23 commit 813bfea
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions examples/traffic_actions/keeper/client_hlt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func main() {

netMsg := net_message.NewMessage(
netSett,
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FService, msg),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FNetwork, msg),
)

if err := hltClient.PutMessage(ctx, netMsg); err != nil {
Expand All @@ -92,7 +92,7 @@ func main() {
panic(err)
}

if netMsg.GetPayload().GetHead() != hiddenlake.GSettings.FProtoMask.FService {
if netMsg.GetPayload().GetHead() != hiddenlake.GSettings.FProtoMask.FNetwork {
panic("net.payload.head is invalid")
}

Expand Down
2 changes: 1 addition & 1 deletion examples/traffic_actions/keeper/prod_test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func main() {

netMsg := net_message.NewMessage(
netSett,
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FService, msg),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FNetwork, msg),
)

start1 := time.Now()
Expand Down
4 changes: 2 additions & 2 deletions examples/traffic_actions/loader/client_hll/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func pushMessages(ctx context.Context, netMsgSettings net_message.IConstructSett

netMsg := net_message.NewMessage(
netMsgSettings,
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FService, msg),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FNetwork, msg),
)
if err := hltClient.PutMessage(ctx, netMsg); err != nil {
return err
Expand Down Expand Up @@ -150,7 +150,7 @@ func checkMessages(ctx context.Context, netMsgSettings net_message.ISettings, ms
return err
}

if netMsg.GetPayload().GetHead() != hiddenlake.GSettings.FProtoMask.FService {
if netMsg.GetPayload().GetHead() != hiddenlake.GSettings.FProtoMask.FNetwork {
return errors.New("network mask is invalid")
}

Expand Down
2 changes: 1 addition & 1 deletion internal/helpers/encryptor/internal/handler/decrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func HandleMessageDecryptAPI(
}

netPld := netMsg.GetPayload()
if netPld.GetHead() != hiddenlake.GSettings.FProtoMask.FService {
if netPld.GetHead() != hiddenlake.GSettings.FProtoMask.FNetwork {
pLogger.PushWarn(logBuilder.WithMessage("invalid_net_mask"))
_ = api.Response(pW, http.StatusUnsupportedMediaType, "failed: invalid network mask")
return
Expand Down
4 changes: 2 additions & 2 deletions internal/helpers/encryptor/internal/handler/decrypt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestHandleMessageDecryptAPI(t *testing.T) {
net_message.NewConstructSettings(&net_message.SConstructSettings{
FSettings: net_message.NewSettings(&net_message.SSettings{}),
}),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FService, encMsg),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FNetwork, encMsg),
).ToString()

mapKeys := asymmetric.NewMapPubKeys()
Expand Down Expand Up @@ -92,7 +92,7 @@ func TestHandleMessageDecryptAPI(t *testing.T) {
net_message.NewConstructSettings(&net_message.SConstructSettings{
FSettings: net_message.NewSettings(&net_message.SSettings{}),
}),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FService, encMsgNotFayload),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FNetwork, encMsgNotFayload),
).ToString()
if err := decryptAPIRequestOK(handler, netMsgNotPayload); err == nil {
t.Error("request success with invalid decrypted payload")
Expand Down
2 changes: 1 addition & 1 deletion internal/helpers/encryptor/internal/handler/encrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func HandleMessageEncryptAPI(
}),
FParallel: pParallel,
}),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FService, msg),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FNetwork, msg),
)

pLogger.PushInfo(logBuilder.WithMessage(http_logger.CLogSuccess))
Expand Down
2 changes: 1 addition & 1 deletion internal/helpers/loader/internal/handler/transfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func TestHandleTransferAPI(t *testing.T) {
netMsg := net_message.NewMessage(
netMsgSettings,
payload.NewPayload32(
hiddenlake.GSettings.FProtoMask.FService,
hiddenlake.GSettings.FProtoMask.FNetwork,
encMsg,
),
)
Expand Down
2 changes: 1 addition & 1 deletion internal/helpers/traffic/internal/handler/hashes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func TestHandleHashesAPI(t *testing.T) {

netMsg := net_message.NewMessage(
testNetworkMessageSettings(),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FService, msg),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FNetwork, msg),
)
if err := hltClient.PutMessage(context.Background(), netMsg); err != nil {
t.Error(err)
Expand Down
2 changes: 1 addition & 1 deletion internal/helpers/traffic/internal/handler/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func HandleMessageAPI(
return
}

if netMsg.GetPayload().GetHead() != hiddenlake.GSettings.FProtoMask.FService {
if netMsg.GetPayload().GetHead() != hiddenlake.GSettings.FProtoMask.FNetwork {
pHTTPLogger.PushWarn(logBuilder.WithMessage("network_mask"))
_ = api.Response(pW, http.StatusLocked, "failed: network mask")
return
Expand Down
4 changes: 2 additions & 2 deletions internal/helpers/traffic/internal/handler/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestHandleMessageAPI2(t *testing.T) {
net_message.NewConstructSettings(&net_message.SConstructSettings{
FSettings: net_message.NewSettings(&net_message.SSettings{}),
}),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FService, msg),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FNetwork, msg),
)
if err := storage.Push(netMsg); err != nil {
t.Error(err)
Expand Down Expand Up @@ -190,7 +190,7 @@ func TestHandleMessageAPI(t *testing.T) {

netMsg := net_message.NewMessage(
testNetworkMessageSettings(),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FService, msg),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FNetwork, msg),
)
if err := hltClient.PutMessage(context.Background(), netMsg); err != nil {
t.Error(err)
Expand Down
2 changes: 1 addition & 1 deletion internal/helpers/traffic/internal/handler/pointer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func TestHandlePointerAPI(t *testing.T) {

netMsg := net_message.NewMessage(
testNetworkMessageSettings(),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FService, msg),
payload.NewPayload32(hiddenlake.GSettings.FProtoMask.FNetwork, msg),
)
if err := hltClient.PutMessage(context.Background(), netMsg); err != nil {
t.Error(err)
Expand Down
2 changes: 1 addition & 1 deletion internal/helpers/traffic/pkg/app/init_network_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (p *sApp) initNetworkNode(pStorage storage.IMessageStorage) {
}),
cache.NewLRUCache(hiddenlake.GSettings.FNetworkManager.FCacheHashesCap),
).HandleFunc(
hiddenlake.GSettings.FProtoMask.FService,
hiddenlake.GSettings.FProtoMask.FNetwork,
handler.HandleServiceTCP(p.fConfig, pStorage, p.fAnonLogger),
)
}
4 changes: 2 additions & 2 deletions internal/service/pkg/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (p *sApp) Run(pCtx context.Context) error {
p.runListenerPPROF,
p.runListenerHTTP,
p.runListenerNode,
p.runNode,
p.runAnonymityNode,
}

ctx, cancel := context.WithCancel(pCtx)
Expand Down Expand Up @@ -208,7 +208,7 @@ func (p *sApp) runListenerNode(pCtx context.Context, wg *sync.WaitGroup, pChErr
<-pCtx.Done()
}

func (p *sApp) runNode(pCtx context.Context, wg *sync.WaitGroup, pChErr chan<- error) {
func (p *sApp) runAnonymityNode(pCtx context.Context, wg *sync.WaitGroup, pChErr chan<- error) {
defer wg.Done()

if err := p.fNode.Run(pCtx); err != nil {
Expand Down

0 comments on commit 813bfea

Please sign in to comment.