[#971] *: Add optional parameters to audit morph client calls

Adapt all audit wrapper calls to new
structures.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-11-16 23:56:41 +03:00 committed by Alex Vanin
parent 8a2f5c980b
commit 7ac3145980
2 changed files with 9 additions and 2 deletions

View file

@ -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

View file

@ -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)