-
Notifications
You must be signed in to change notification settings - Fork 38
/
wrapper.go
30 lines (25 loc) · 894 Bytes
/
wrapper.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package audit
import (
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
"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 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) {
staticClient, err := client.NewStatic(cli, contract, fee, opts...)
if err != nil {
return nil, err
}
return &ClientWrapper{
StaticClient: staticClient,
client: audit.New(staticClient),
}, nil
}