[#474] morph/client: Add FaultException to error msg

If non-"HALT" `State` occurs after
calling `InvokeFunction` NeoGo client
method, add `FaultException` information
to returning error. Add returning state
check to `NotaryInvoke` method of the
morph/client.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-04-09 23:10:59 +03:00 committed by Alex Vanin
parent f6f2e4d10f
commit 4a4aee82e0
2 changed files with 19 additions and 1 deletions

View file

@ -222,6 +222,11 @@ func (c *Client) notaryInvoke(committee bool, contract util.Uint160, method stri
return err
}
// check invocation state
if test.State != HaltState {
return &NotHaltStateError{state: test.State, exception: test.FaultException}
}
// if test invocation failed, then return error
if len(test.Script) == 0 {
return errEmptyInvocationScript