From 21fa739d0e006949b731ce1c62f4ab9cd9969fe4 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Wed, 2 Aug 2023 21:06:12 +0300 Subject: [PATCH] morph: Fix estimations announcements Some contract methods still require regular (non-notary) calls. Signed-off-by: Pavel Karpy --- cmd/neofs-node/container.go | 2 +- pkg/morph/client/container/client.go | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cmd/neofs-node/container.go b/cmd/neofs-node/container.go index d187874ad31..46ea955ff05 100644 --- a/cmd/neofs-node/container.go +++ b/cmd/neofs-node/container.go @@ -41,7 +41,7 @@ const ( func initContainerService(c *cfg) { // container wrapper that tries to invoke notary // requests if chain is configured so - wrap, err := cntClient.NewFromMorph(c.cfgMorph.client, c.cfgContainer.scriptHash, 0) + wrap, err := cntClient.NewFromMorph(c.cfgMorph.client, c.cfgContainer.scriptHash, 0, cntClient.TryNotary()) fatalOnErr(err) c.shared.cnrClient = wrap diff --git a/pkg/morph/client/container/client.go b/pkg/morph/client/container/client.go index f32a8eb1346..438505d9a0c 100644 --- a/pkg/morph/client/container/client.go +++ b/pkg/morph/client/container/client.go @@ -89,9 +89,15 @@ type opts struct { } func defaultOpts() *opts { - var o = new(opts) - o.staticOpts = append(o.staticOpts, client.TryNotary()) - return o + return new(opts) +} + +// TryNotary returns option to enable +// notary invocation tries. +func TryNotary() Option { + return func(o *opts) { + o.staticOpts = append(o.staticOpts, client.TryNotary()) + } } // AsAlphabet returns option to sign main TX