forked from TrueCloudLab/frostfs-node
[#21] ir: Add config relay processor
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
be9e7664f3
commit
f11ae1035d
3 changed files with 58 additions and 0 deletions
|
@ -50,6 +50,7 @@ const (
|
|||
depositNotification = "Deposit"
|
||||
withdrawNotification = "Withdraw"
|
||||
chequeNotification = "Cheque"
|
||||
configNotification = "SetConfig"
|
||||
)
|
||||
|
||||
// New creates neofs mainnet contract processor instance.
|
||||
|
@ -109,6 +110,13 @@ func (np *Processor) ListenerParsers() []event.ParserInfo {
|
|||
cheque.SetParser(neofsEvent.ParseCheque)
|
||||
parsers = append(parsers, cheque)
|
||||
|
||||
// config event
|
||||
config := event.ParserInfo{}
|
||||
config.SetType(configNotification)
|
||||
config.SetScriptHash(np.neofsContract)
|
||||
config.SetParser(neofsEvent.ParseConfig)
|
||||
parsers = append(parsers, config)
|
||||
|
||||
return parsers
|
||||
}
|
||||
|
||||
|
@ -137,6 +145,13 @@ func (np *Processor) ListenerHandlers() []event.HandlerInfo {
|
|||
cheque.SetHandler(np.handleCheque)
|
||||
handlers = append(handlers, cheque)
|
||||
|
||||
// config handler
|
||||
config := event.HandlerInfo{}
|
||||
config.SetType(configNotification)
|
||||
config.SetScriptHash(np.neofsContract)
|
||||
config.SetHandler(np.handleConfig)
|
||||
handlers = append(handlers, config)
|
||||
|
||||
return handlers
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue