forked from TrueCloudLab/frostfs-node
[#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:
parent
1860f5040c
commit
d6c0307431
14 changed files with 79 additions and 30 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue