[#496] Remove unused type aliases and errors

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-05-21 14:09:01 +03:00 committed by Alex Vanin
parent 2b2b2c2c45
commit b21a6ccede
3 changed files with 3 additions and 31 deletions

View file

@ -1,7 +1,6 @@
package wrapper package wrapper
import ( import (
"errors"
"fmt" "fmt"
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn" "github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
@ -10,12 +9,6 @@ import (
"github.com/nspcc-dev/neofs-node/pkg/morph/client/balance" "github.com/nspcc-dev/neofs-node/pkg/morph/client/balance"
) )
// Client represents the Balance contract client.
//
// It is a type alias of
// github.com/nspcc-dev/neofs-node/pkg/morph/client/balance.Client.
type Client = balance.Client
// Wrapper is a wrapper over balance contract // Wrapper is a wrapper over balance contract
// client which implements: // client which implements:
// * tool for obtaining the amount of funds in the client's account; // * tool for obtaining the amount of funds in the client's account;
@ -26,13 +19,9 @@ type Client = balance.Client
// expression (or just declaring a Wrapper variable) is unsafe // expression (or just declaring a Wrapper variable) is unsafe
// and can lead to panic. // and can lead to panic.
type Wrapper struct { type Wrapper struct {
client *Client client *balance.Client
} }
// ErrNilWrapper is returned by functions that expect
// a non-nil Wrapper pointer, but received nil.
var ErrNilWrapper = errors.New("balance contract client wrapper is nil")
// NewFromMorph returns the wrapper instance from the raw morph client. // NewFromMorph returns the wrapper instance from the raw morph client.
func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8) (*Wrapper, error) { func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8) (*Wrapper, error) {
staticClient, err := client.NewStatic(cli, contract, fee) staticClient, err := client.NewStatic(cli, contract, fee)

View file

@ -9,12 +9,6 @@ import (
"github.com/nspcc-dev/neofs-node/pkg/morph/client/container" "github.com/nspcc-dev/neofs-node/pkg/morph/client/container"
) )
// Client represents the Container contract client.
//
// It is a type alias of
// github.com/nspcc-dev/neofs-node/pkg/morph/client/container.Client.
type Client = container.Client
// Wrapper is a wrapper over container contract // Wrapper is a wrapper over container contract
// client which implements container storage and // client which implements container storage and
// eACL storage methods. // eACL storage methods.
@ -24,7 +18,7 @@ type Client = container.Client
// expression (or just declaring a Wrapper variable) is unsafe // expression (or just declaring a Wrapper variable) is unsafe
// and can lead to panic. // and can lead to panic.
type Wrapper struct { type Wrapper struct {
client *Client client *container.Client
} }
// NewFromMorph returns the wrapper instance from the raw morph client. // NewFromMorph returns the wrapper instance from the raw morph client.

View file

@ -1,7 +1,6 @@
package wrapper package wrapper
import ( import (
"errors"
"fmt" "fmt"
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn" "github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
@ -10,12 +9,6 @@ import (
"github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap" "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap"
) )
// Client represents the Netmap contract client.
//
// It is a type alias of
// github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap.Client.
type Client = netmap.Client
// Wrapper is a wrapper over netmap contract // Wrapper is a wrapper over netmap contract
// client which implements: // client which implements:
// * network map storage; // * network map storage;
@ -26,13 +19,9 @@ type Client = netmap.Client
// expression (or just declaring a Wrapper variable) is unsafe // expression (or just declaring a Wrapper variable) is unsafe
// and can lead to panic. // and can lead to panic.
type Wrapper struct { type Wrapper struct {
client *Client client *netmap.Client
} }
// ErrNilWrapper is returned by functions that expect
// a non-nil Wrapper pointer, but received nil.
var ErrNilWrapper = errors.New("netmap contract client wrapper is nil")
// NewFromMorph returns the wrapper instance from the raw morph client. // NewFromMorph returns the wrapper instance from the raw morph client.
func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8) (*Wrapper, error) { func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8) (*Wrapper, error) {
staticClient, err := client.NewStatic(cli, contract, fee) staticClient, err := client.NewStatic(cli, contract, fee)