From 7ac3145980b2e9bad5f6eb7a184039b39d1bd544 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Tue, 16 Nov 2021 23:56:41 +0300 Subject: [PATCH] [#971] *: Add optional parameters to audit morph client calls Adapt all audit wrapper calls to new structures. Signed-off-by: Pavel Karpy --- pkg/innerring/state.go | 6 +++++- pkg/morph/client/audit/wrapper/result_test.go | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/innerring/state.go b/pkg/innerring/state.go index 89b9be78ea..305f7a2e33 100644 --- a/pkg/innerring/state.go +++ b/pkg/innerring/state.go @@ -6,6 +6,7 @@ import ( "github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neofs-node/pkg/innerring/processors/governance" + auditwrp "github.com/nspcc-dev/neofs-node/pkg/morph/client/audit/wrapper" "github.com/nspcc-dev/neofs-node/pkg/services/audit" control "github.com/nspcc-dev/neofs-node/pkg/services/control/ir" "github.com/nspcc-dev/neofs-node/pkg/util/state" @@ -145,7 +146,10 @@ func (s *Server) WriteReport(r *audit.Report) error { res := r.Result() res.SetPublicKey(s.pubKey) - return s.auditClient.PutAuditResult(res) + prm := auditwrp.PutPrm{} + prm.SetResult(res) + + return s.auditClient.PutAuditResult(prm) } // ResetEpochTimer resets block timer that produces events to update epoch diff --git a/pkg/morph/client/audit/wrapper/result_test.go b/pkg/morph/client/audit/wrapper/result_test.go index b9165e0b9c..be8d471168 100644 --- a/pkg/morph/client/audit/wrapper/result_test.go +++ b/pkg/morph/client/audit/wrapper/result_test.go @@ -40,7 +40,10 @@ func TestAuditResults(t *testing.T) { auditRes.SetPublicKey(key.PublicKey().Bytes()) auditRes.SetContainerID(id) - require.NoError(t, auditClientWrapper.PutAuditResult(auditRes)) + prm := auditWrapper.PutPrm{} + prm.SetResult(auditRes) + + require.NoError(t, auditClientWrapper.PutAuditResult(prm)) time.Sleep(5 * time.Second)