[#722] neofs-adm: Check returned tx hash

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-04-07 11:14:10 +03:00 committed by LeL
parent 37f9d083fb
commit c55950bd70

View file

@ -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 {