[#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

@ -39,14 +39,8 @@ const (
)
// New creates, initializes and returns the Client instance.
//
// If StaticClient is nil, client.ErrNilStaticClient is returned.
func New(c *client.StaticClient) (*Client, error) {
if c == nil {
return nil, client.ErrNilStaticClient
}
return &Client{client: c}, nil
func New(c *client.StaticClient) *Client {
return &Client{client: c}
}
// Morph returns raw morph client.