Merge pull request #1448 from nspcc-dev/rpc/create_tx_from_script_fix

rpc: check VM state in (*Client).CreateTXFromScript
This commit is contained in:
Roman Khimov 2020-10-01 16:01:14 +03:00 committed by GitHub
commit 5b6db7e93b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -155,6 +155,9 @@ func (c *Client) CreateTxFromScript(script []byte, acc *wallet.Account, sysFee,
if err != nil {
return nil, fmt.Errorf("can't add system fee to transaction: %w", err)
}
if result.State != "HALT" {
return nil, fmt.Errorf("can't add system fee to transaction: bad vm state: %s", result.State)
}
sysFee = result.GasConsumed
}