From c55950bd7082776051353dfdce52ec2c7a1553d0 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Thu, 7 Apr 2022 11:14:10 +0300 Subject: [PATCH] [#722] neofs-adm: Check returned tx hash Signed-off-by: Evgenii Stratonikov --- cmd/neofs-adm/internal/modules/morph/n3client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/neofs-adm/internal/modules/morph/n3client.go b/cmd/neofs-adm/internal/modules/morph/n3client.go index 98fea08c6..c3f5688eb 100644 --- a/cmd/neofs-adm/internal/modules/morph/n3client.go +++ b/cmd/neofs-adm/internal/modules/morph/n3client.go @@ -3,6 +3,7 @@ package morph import ( "context" "errors" + "fmt" "time" "github.com/nspcc-dev/neo-go/pkg/config/netmode" @@ -84,6 +85,10 @@ func (c *clientContext) sendTx(tx *transaction.Transaction, cmd *cobra.Command, return err } + if h != tx.Hash() { + return fmt.Errorf("sent and actual tx hashes mismatch:\n\tsent: %v\n\tactual: %v", tx.Hash().StringLE(), h.StringLE()) + } + c.Hashes = append(c.Hashes, h) if await {