[#1546] morph/event: Export NotificationHandlerInfo fields

Hiding them achieves nothing, as the struct has no methods and is not
used concurrently.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-12-06 16:12:47 +03:00 committed by Evgenii Stratonikov
parent d0ce835fbf
commit b1614a284d
8 changed files with 75 additions and 110 deletions

View file

@ -223,21 +223,17 @@ func registerNotificationHandlers(scHash util.Uint160, lis event.Listener, parse
subs map[event.Type][]event.Handler,
) {
for typ, handlers := range subs {
hi := event.NotificationHandlerInfo{}
hi.SetType(typ)
hi.SetScriptHash(scHash)
p, ok := parsers[typ]
if !ok {
panic(fmt.Sprintf("missing parser for event %s", typ))
}
hi.SetParser(p)
for _, h := range handlers {
hi.AddHandler(h)
}
lis.RegisterNotificationHandler(hi)
lis.RegisterNotificationHandler(event.NotificationHandlerInfo{
Contract: scHash,
Type: typ,
Parser: p,
Handlers: handlers,
})
}
}