forked from TrueCloudLab/frostfs-node
[#1959] neofs-adm: Check transaction validity in tests
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>support/v0.34
parent
942155be6e
commit
23622ed283
|
@ -372,6 +372,13 @@ func (l *localClient) InvokeScript(script []byte, signers []transaction.Signer)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *localClient) SendRawTransaction(tx *transaction.Transaction) (util.Uint256, error) {
|
func (l *localClient) SendRawTransaction(tx *transaction.Transaction) (util.Uint256, error) {
|
||||||
|
// We need to test that transaction was formed correctly to catch as many errors as we can.
|
||||||
|
bs := tx.Bytes()
|
||||||
|
_, err := transaction.NewTransactionFromBytes(bs)
|
||||||
|
if err != nil {
|
||||||
|
return tx.Hash(), fmt.Errorf("invalid transaction: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
l.transactions = append(l.transactions, tx)
|
l.transactions = append(l.transactions, tx)
|
||||||
return tx.Hash(), nil
|
return tx.Hash(), nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue