[#16] Fix balanceOf wrapper for api request

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-09-01 17:33:26 +03:00
parent 58cb90966a
commit 80f10dab7b
4 changed files with 36 additions and 27 deletions

View file

@ -6,6 +6,7 @@ import (
"github.com/nspcc-dev/neofs-api-go/v2/session"
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
"github.com/nspcc-dev/neofs-node/pkg/morph/client/balance"
"github.com/nspcc-dev/neofs-node/pkg/morph/client/balance/wrapper"
accountingTransportGRPC "github.com/nspcc-dev/neofs-node/pkg/network/transport/accounting/grpc"
accountingService "github.com/nspcc-dev/neofs-node/pkg/services/accounting"
accounting "github.com/nspcc-dev/neofs-node/pkg/services/accounting/morph"
@ -25,6 +26,9 @@ func initAccountingService(c *cfg) {
balanceClient, err := balance.New(staticClient)
fatalOnErr(err)
balanceMorphWrapper, err := wrapper.New(balanceClient)
fatalOnErr(err)
metaHdr := new(session.ResponseMetaHeader)
xHdr := new(session.XHeader)
xHdr.SetKey("test X-Header key")
@ -36,7 +40,7 @@ func initAccountingService(c *cfg) {
accountingService.NewSignService(
c.key,
accountingService.NewExecutionService(
accounting.NewExecutor(balanceClient),
accounting.NewExecutor(balanceMorphWrapper),
metaHdr,
),
),