Skip to content

Commit

Permalink
[#722] neofs-adm: Check returned tx hash
Browse files Browse the repository at this point in the history
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
  • Loading branch information
fyrchik authored and cthulhu-rider committed May 16, 2022
1 parent 37f9d08 commit c55950b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/neofs-adm/internal/modules/morph/n3client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package morph
import (
"context"
"errors"
"fmt"
"time"

"github.com/nspcc-dev/neo-go/pkg/config/netmode"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit c55950b

Please sign in to comment.