[#625] morph/client: make all constructors return no error

In some places we panic, in some we return error, in some (audit) just return a client.
However in all of the places static client is created immediately before
the sugared-client creation.

This commit makes all constructors to just return a client for the sake
of code simplification and unification.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-01-29 16:21:49 +03:00 committed by LeL
parent 3c5b62d839
commit 0decb95591
11 changed files with 12 additions and 73 deletions

View file

@ -1,7 +1,6 @@
package client
import (
"errors"
"fmt"
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
@ -35,10 +34,6 @@ type staticOpts struct {
// parameter of StaticClient.
type StaticClientOption func(*staticOpts)
// ErrNilStaticClient is returned by functions that expect
// a non-nil StaticClient pointer, but received nil.
var ErrNilStaticClient = errors.New("static client is nil")
// NewStatic creates, initializes and returns the StaticClient instance.
//
// If provided Client instance is nil, ErrNilClient is returned.