From b21a6ccedef2ac1b81ddb6c72497b8801c7c814d Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 21 May 2021 14:09:01 +0300 Subject: [PATCH] [#496] Remove unused type aliases and errors Signed-off-by: Evgenii Stratonikov --- pkg/morph/client/balance/wrapper/wrapper.go | 13 +------------ pkg/morph/client/container/wrapper/wrapper.go | 8 +------- pkg/morph/client/netmap/wrapper/wrapper.go | 13 +------------ 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/pkg/morph/client/balance/wrapper/wrapper.go b/pkg/morph/client/balance/wrapper/wrapper.go index 41dccf2e..7afbc68f 100644 --- a/pkg/morph/client/balance/wrapper/wrapper.go +++ b/pkg/morph/client/balance/wrapper/wrapper.go @@ -1,7 +1,6 @@ package wrapper import ( - "errors" "fmt" "github.com/nspcc-dev/neo-go/pkg/encoding/fixedn" @@ -10,12 +9,6 @@ import ( "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 // client which implements: // * 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 // and can lead to panic. 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. func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8) (*Wrapper, error) { staticClient, err := client.NewStatic(cli, contract, fee) diff --git a/pkg/morph/client/container/wrapper/wrapper.go b/pkg/morph/client/container/wrapper/wrapper.go index 7635cea5..32ff7e1e 100644 --- a/pkg/morph/client/container/wrapper/wrapper.go +++ b/pkg/morph/client/container/wrapper/wrapper.go @@ -9,12 +9,6 @@ import ( "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 // client which implements container storage and // eACL storage methods. @@ -24,7 +18,7 @@ type Client = container.Client // expression (or just declaring a Wrapper variable) is unsafe // and can lead to panic. type Wrapper struct { - client *Client + client *container.Client } // NewFromMorph returns the wrapper instance from the raw morph client. diff --git a/pkg/morph/client/netmap/wrapper/wrapper.go b/pkg/morph/client/netmap/wrapper/wrapper.go index 0bfc47c7..9310eeb1 100644 --- a/pkg/morph/client/netmap/wrapper/wrapper.go +++ b/pkg/morph/client/netmap/wrapper/wrapper.go @@ -1,7 +1,6 @@ package wrapper import ( - "errors" "fmt" "github.com/nspcc-dev/neo-go/pkg/encoding/fixedn" @@ -10,12 +9,6 @@ import ( "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 // client which implements: // * network map storage; @@ -26,13 +19,9 @@ type Client = netmap.Client // expression (or just declaring a Wrapper variable) is unsafe // and can lead to panic. 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. func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8) (*Wrapper, error) { staticClient, err := client.NewStatic(cli, contract, fee)