From ba234699cd20dd7820253dfe1409bac2cf56a6a3 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Mon, 6 Sep 2021 18:01:15 +0300 Subject: [PATCH] [#794] ir/neofs: Print tx IDs in LE on Withdraw and Deposit events IDs come from NeoFS contract in big endian, but it is customary to write in the node logs in little endian. Signed-off-by: Leonard Lyubich --- pkg/innerring/processors/neofs/handlers.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/innerring/processors/neofs/handlers.go b/pkg/innerring/processors/neofs/handlers.go index ef9ccdce..e42d9d01 100644 --- a/pkg/innerring/processors/neofs/handlers.go +++ b/pkg/innerring/processors/neofs/handlers.go @@ -3,6 +3,7 @@ package neofs import ( "encoding/hex" + "github.com/nspcc-dev/neo-go/pkg/util/slice" "github.com/nspcc-dev/neofs-node/pkg/morph/event" neofsEvent "github.com/nspcc-dev/neofs-node/pkg/morph/event/neofs" "go.uber.org/zap" @@ -12,7 +13,7 @@ func (np *Processor) handleDeposit(ev event.Event) { deposit := ev.(neofsEvent.Deposit) np.log.Info("notification", zap.String("type", "deposit"), - zap.String("id", hex.EncodeToString(deposit.ID()))) + zap.String("id", hex.EncodeToString(slice.CopyReverse(deposit.ID())))) // send event to the worker pool @@ -28,7 +29,7 @@ func (np *Processor) handleWithdraw(ev event.Event) { withdraw := ev.(neofsEvent.Withdraw) np.log.Info("notification", zap.String("type", "withdraw"), - zap.String("id", hex.EncodeToString(withdraw.ID()))) + zap.String("id", hex.EncodeToString(slice.CopyReverse(withdraw.ID())))) // send event to the worker pool