2b2b2c2c45
There is no need in a separate `New()` or `WrapClient()` Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
22 lines
697 B
Go
22 lines
697 B
Go
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"
|
|
)
|
|
|
|
// ClientWrapper is a wrapper over Audit contract
|
|
// client which implements storage of audit results.
|
|
type ClientWrapper audit.Client
|
|
|
|
// 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
|
|
}
|
|
|
|
return (*ClientWrapper)(audit.New(staticClient)), nil
|
|
}
|