2020-12-21 13:47:19 +00:00
|
|
|
package audit
|
|
|
|
|
|
|
|
import (
|
2021-05-21 10:39:01 +00:00
|
|
|
"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"
|
2020-12-21 13:47:19 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/client/audit"
|
|
|
|
)
|
|
|
|
|
|
|
|
// ClientWrapper is a wrapper over Audit contract
|
|
|
|
// client which implements storage of audit results.
|
|
|
|
type ClientWrapper audit.Client
|
|
|
|
|
2021-05-21 10:39:01 +00:00
|
|
|
// NewFromMorph returns the wrapper instance from the raw morph client.
|
|
|
|
func NewFromMorph(cli *client.Client, contract util.Uint160, fee fixedn.Fixed8) (*ClientWrapper, error) {
|
|
|
|
staticClient, err := client.NewStatic(cli, contract, fee)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
2021-05-21 11:02:46 +00:00
|
|
|
return (*ClientWrapper)(audit.New(staticClient)), nil
|
2021-05-21 10:39:01 +00:00
|
|
|
}
|