[#21] ir: Add inner ring list relay processor

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-09-08 12:06:34 +03:00
parent f11ae1035d
commit 4aee3de24e
3 changed files with 54 additions and 0 deletions

View file

@ -51,6 +51,7 @@ const (
withdrawNotification = "Withdraw"
chequeNotification = "Cheque"
configNotification = "SetConfig"
updateIRNotification = "InnerRingUpdate"
)
// New creates neofs mainnet contract processor instance.
@ -117,6 +118,13 @@ func (np *Processor) ListenerParsers() []event.ParserInfo {
config.SetParser(neofsEvent.ParseConfig)
parsers = append(parsers, config)
// update inner ring event
updateIR := event.ParserInfo{}
updateIR.SetType(updateIRNotification)
updateIR.SetScriptHash(np.neofsContract)
updateIR.SetParser(neofsEvent.ParseUpdateInnerRing)
parsers = append(parsers, updateIR)
return parsers
}
@ -152,6 +160,13 @@ func (np *Processor) ListenerHandlers() []event.HandlerInfo {
config.SetHandler(np.handleConfig)
handlers = append(handlers, config)
// updateIR handler
updateIR := event.HandlerInfo{}
updateIR.SetType(updateIRNotification)
updateIR.SetScriptHash(np.neofsContract)
updateIR.SetHandler(np.handleUpdateInnerRing)
handlers = append(handlers, updateIR)
return handlers
}