forked from TrueCloudLab/frostfs-node
[#609] morph/client: Check return state in invoke
Test invocations are used in `Invoke` method to calculate consumed gas. We can check return code and return error if panic happened in contract. This is already done the same way in `TestInvoke` method. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
7cead1bc3a
commit
0ec3faefc9
1 changed files with 4 additions and 0 deletions
|
@ -100,6 +100,10 @@ func (c *Client) Invoke(contract util.Uint160, fee fixedn.Fixed8, method string,
|
|||
return err
|
||||
}
|
||||
|
||||
if resp.State != HaltState {
|
||||
return &NotHaltStateError{state: resp.State, exception: resp.FaultException}
|
||||
}
|
||||
|
||||
if len(resp.Script) == 0 {
|
||||
return errEmptyInvocationScript
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue