[#265] innerring: Generate new audit event

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-12-18 12:27:19 +03:00 committed by Alex Vanin
parent 8c4e033db3
commit 87e1252065
8 changed files with 158 additions and 1 deletions

View file

@ -40,6 +40,8 @@ type (
morphClient *client.Client
netmapSnapshot cleanupTable
handleNewAudit event.Handler
}
// Params of the processor constructor.
@ -53,6 +55,7 @@ type (
ActiveState ActiveState
CleanupEnabled bool
CleanupThreshold uint64 // in epochs
HandleAudit event.Handler
}
)
@ -75,6 +78,8 @@ func New(p *Params) (*Processor, error) {
return nil, errors.New("ir/netmap: global state is not set")
case p.ActiveState == nil:
return nil, errors.New("ir/netmap: global state is not set")
case p.HandleAudit == nil:
return nil, errors.New("ir/netmap: audit handler is not set")
}
p.Log.Debug("netmap worker pool", zap.Int("size", p.PoolSize))
@ -93,6 +98,7 @@ func New(p *Params) (*Processor, error) {
activeState: p.ActiveState,
morphClient: p.MorphClient,
netmapSnapshot: newCleanupTable(p.CleanupEnabled, p.CleanupThreshold),
handleNewAudit: p.HandleAudit,
}, nil
}