[#627] morph: Inherit internal.StaticClient interface in all wrappers

There is a need to provide contract address getter from all contract client
wrappers.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-09-15 13:48:00 +03:00 committed by Alex Vanin
parent 1860f5040c
commit d6c0307431
14 changed files with 79 additions and 30 deletions

View file

@ -5,11 +5,16 @@ import (
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
"github.com/nspcc-dev/neofs-node/pkg/morph/client/audit"
"github.com/nspcc-dev/neofs-node/pkg/morph/client/internal"
)
// ClientWrapper is a wrapper over Audit contract
// client which implements storage of audit results.
type ClientWrapper audit.Client
type ClientWrapper struct {
internal.StaticClient
client *audit.Client
}
// NewFromMorph returns the wrapper instance from the raw morph client.
func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8, opts ...client.StaticClientOption) (*ClientWrapper, error) {
@ -18,5 +23,8 @@ func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8,
return nil, err
}
return (*ClientWrapper)(audit.New(staticClient)), nil
return &ClientWrapper{
StaticClient: staticClient,
client: audit.New(staticClient),
}, nil
}