diff --git a/pkg/innerring/innerring.go b/pkg/innerring/innerring.go index 8449d878..3c349969 100644 --- a/pkg/innerring/innerring.go +++ b/pkg/innerring/innerring.go @@ -20,7 +20,6 @@ import ( auditWrapper "github.com/nspcc-dev/neofs-node/pkg/morph/client/audit/wrapper" "github.com/nspcc-dev/neofs-node/pkg/morph/event" "github.com/nspcc-dev/neofs-node/pkg/morph/subscriber" - auditSvc "github.com/nspcc-dev/neofs-node/pkg/services/audit" audittask "github.com/nspcc-dev/neofs-node/pkg/services/audit/taskmanager" "github.com/nspcc-dev/neofs-node/pkg/util/precision" "github.com/panjf2000/ants/v2" @@ -140,13 +139,6 @@ func (s *Server) Stop() { go s.mainnetListener.Stop() } -func (s *Server) WriteReport(r *auditSvc.Report) error { - res := r.Result() - res.SetPublicKey(s.pubKey) - - return s.auditClient.PutAuditResult(res) -} - // New creates instance of inner ring sever structure. func New(ctx context.Context, log *zap.Logger, cfg *viper.Viper) (*Server, error) { var err error diff --git a/pkg/innerring/state.go b/pkg/innerring/state.go index ec0e333e..d55b413a 100644 --- a/pkg/innerring/state.go +++ b/pkg/innerring/state.go @@ -3,6 +3,7 @@ package innerring import ( "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/nspcc-dev/neofs-node/pkg/innerring/invoke" + "github.com/nspcc-dev/neofs-node/pkg/services/audit" "go.uber.org/zap" ) @@ -73,3 +74,12 @@ func (s *Server) InitAndVoteForSidechainValidator(validators []keys.PublicKey) e return s.voteForSidechainValidator(validators) } + +// WriteReport composes audit result structure from audit report +// and sends it to Audit contract. +func (s *Server) WriteReport(r *audit.Report) error { + res := r.Result() + res.SetPublicKey(s.pubKey) + + return s.auditClient.PutAuditResult(res) +}