[#452] innerring: Use reputation processor

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-03-31 18:41:47 +03:00 committed by Alex Vanin
parent 09e4479d44
commit b18da34b55
3 changed files with 56 additions and 6 deletions

View file

@ -13,6 +13,8 @@ import (
wrapContainer "github.com/nspcc-dev/neofs-node/pkg/morph/client/container/wrapper"
morphNetmap "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap"
wrapNetmap "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap/wrapper"
"github.com/nspcc-dev/neofs-node/pkg/morph/client/reputation"
reputationWrapper "github.com/nspcc-dev/neofs-node/pkg/morph/client/reputation/wrapper"
"github.com/pkg/errors"
)
@ -70,3 +72,18 @@ func NewBalanceClient(cli *client.Client, contract util.Uint160) (*balanceWrappe
return balanceWrapper.New(enhancedBalanceClient)
}
// NewReputationClient creates wrapper to work with reputation contract.
func NewReputationClient(cli *client.Client, contract util.Uint160) (*reputationWrapper.ClientWrapper, error) {
staticClient, err := client.NewStatic(cli, contract, 0)
if err != nil {
return nil, errors.Wrap(err, "could not create static client of reputation contract")
}
enhancedRepurationClient, err := reputation.New(staticClient)
if err != nil {
return nil, errors.Wrap(err, "could not create reputation contract client")
}
return reputationWrapper.WrapClient(enhancedRepurationClient), nil
}