diff --git a/pkg/morph/client/client.go b/pkg/morph/client/client.go index fcc6aebd6..6c686b4c2 100644 --- a/pkg/morph/client/client.go +++ b/pkg/morph/client/client.go @@ -51,11 +51,11 @@ var ErrNilClient = errors.New("client is nil") // HaltState returned if TestInvoke function processed without panic. const HaltState = "HALT" -type NotHaltStateError struct { +type notHaltStateError struct { state, exception string } -func (e *NotHaltStateError) Error() string { +func (e *notHaltStateError) Error() string { return fmt.Sprintf( "chain/client: contract execution finished with state %s; exception: %s", e.state, @@ -101,7 +101,7 @@ func (c *Client) Invoke(contract util.Uint160, fee fixedn.Fixed8, method string, } if resp.State != HaltState { - return &NotHaltStateError{state: resp.State, exception: resp.FaultException} + return ¬HaltStateError{state: resp.State, exception: resp.FaultException} } if len(resp.Script) == 0 { @@ -151,7 +151,7 @@ func (c *Client) TestInvoke(contract util.Uint160, method string, args ...interf } if val.State != HaltState { - return nil, &NotHaltStateError{state: val.State, exception: val.FaultException} + return nil, ¬HaltStateError{state: val.State, exception: val.FaultException} } return val.Stack, nil diff --git a/pkg/morph/client/notary.go b/pkg/morph/client/notary.go index f523b057c..ea5dfe831 100644 --- a/pkg/morph/client/notary.go +++ b/pkg/morph/client/notary.go @@ -244,7 +244,7 @@ func (c *Client) notaryInvoke(committee bool, contract util.Uint160, method stri // check invocation state if test.State != HaltState { - return &NotHaltStateError{state: test.State, exception: test.FaultException} + return ¬HaltStateError{state: test.State, exception: test.FaultException} } // if test invocation failed, then return error