From 017fb6abed9455c7c99631adcb0bb04d42741f87 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Tue, 25 May 2021 15:19:22 +0300 Subject: [PATCH] [#505] ir/container: Use client wrapper with enabled notary calls Construct wrapper over the Container contract client with `TryNotary` option since it is required to perform invocations of notary contract. Signed-off-by: Leonard Lyubich --- pkg/innerring/innerring.go | 2 +- pkg/innerring/processors/container/process_container.go | 1 - pkg/innerring/processors/container/processor.go | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/innerring/innerring.go b/pkg/innerring/innerring.go index 528e908f6..c57cbe6f1 100644 --- a/pkg/innerring/innerring.go +++ b/pkg/innerring/innerring.go @@ -357,7 +357,7 @@ func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper) (*Server, error return nil, err } - cnrClient, err := cntWrapper.NewFromMorph(server.morphClient, server.contracts.container, fee) + cnrClient, err := cntWrapper.NewFromMorph(server.morphClient, server.contracts.container, fee, cntWrapper.TryNotary()) if err != nil { return nil, err } diff --git a/pkg/innerring/processors/container/process_container.go b/pkg/innerring/processors/container/process_container.go index 2ce325bc9..1c4fb5206 100644 --- a/pkg/innerring/processors/container/process_container.go +++ b/pkg/innerring/processors/container/process_container.go @@ -65,7 +65,6 @@ func (cp *Processor) checkPutContainer(e *containerEvent.Put) error { } func (cp *Processor) approvePutContainer(e *containerEvent.Put) { - // FIXME: here we should try notary invoke // FIXME: here we should bind key to owner if needed err := cp.cnrClient.Put(e.Container(), e.PublicKey(), e.Signature()) if err != nil { diff --git a/pkg/innerring/processors/container/processor.go b/pkg/innerring/processors/container/processor.go index 007b01103..d68fed242 100644 --- a/pkg/innerring/processors/container/processor.go +++ b/pkg/innerring/processors/container/processor.go @@ -29,7 +29,7 @@ type ( morphClient *client.Client alphabetState AlphabetState feeProvider *config.FeeConfig - cnrClient *wrapper.Wrapper + cnrClient *wrapper.Wrapper // notary must be enabled idClient *neofsid.ClientWrapper }