[#770] pkg/morph: Rename all parsers and handlers structs/interfaces
Prepare all listening structures for notary events: rename(add prefix/suffix 'notification') all notification specific handlers/parsers. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
c87bc70536
commit
d252aa4a3e
16 changed files with 174 additions and 175 deletions
|
@ -139,10 +139,10 @@ func listenMorphNotifications(c *cfg) {
|
|||
})
|
||||
}
|
||||
|
||||
func registerNotificationHandlers(scHash util.Uint160, lis event.Listener, parsers map[event.Type]event.Parser,
|
||||
func registerNotificationHandlers(scHash util.Uint160, lis event.Listener, parsers map[event.Type]event.NotificationParser,
|
||||
subs map[event.Type][]event.Handler) {
|
||||
for typ, handlers := range subs {
|
||||
pi := event.ParserInfo{}
|
||||
pi := event.NotificationParserInfo{}
|
||||
pi.SetType(typ)
|
||||
pi.SetScriptHash(scHash)
|
||||
|
||||
|
@ -153,15 +153,15 @@ func registerNotificationHandlers(scHash util.Uint160, lis event.Listener, parse
|
|||
|
||||
pi.SetParser(p)
|
||||
|
||||
lis.SetParser(pi)
|
||||
lis.SetNotificationParser(pi)
|
||||
|
||||
for _, h := range handlers {
|
||||
hi := event.HandlerInfo{}
|
||||
hi := event.NotificationHandlerInfo{}
|
||||
hi.SetType(typ)
|
||||
hi.SetScriptHash(scHash)
|
||||
hi.SetHandler(h)
|
||||
|
||||
lis.RegisterHandler(hi)
|
||||
lis.RegisterNotificationHandler(hi)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue