forked from TrueCloudLab/frostfs-node
[#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:
parent
d0ce835fbf
commit
b1614a284d
8 changed files with 75 additions and 110 deletions
|
@ -144,39 +144,32 @@ func New(p *Params) (*Processor, error) {
|
|||
|
||||
// ListenerNotificationHandlers for the 'event.Listener' event producer.
|
||||
func (np *Processor) ListenerNotificationHandlers() []event.NotificationHandlerInfo {
|
||||
var (
|
||||
handlers = make([]event.NotificationHandlerInfo, 0, 6)
|
||||
|
||||
h event.NotificationHandlerInfo
|
||||
)
|
||||
|
||||
h.SetScriptHash(np.frostfsContract)
|
||||
|
||||
// deposit handler
|
||||
h.SetType(event.TypeFromString(depositNotification))
|
||||
h.SetParser(frostfsEvent.ParseDeposit)
|
||||
h.AddHandler(np.handleDeposit)
|
||||
handlers = append(handlers, h)
|
||||
|
||||
// withdraw handler
|
||||
h.SetType(event.TypeFromString(withdrawNotification))
|
||||
h.SetParser(frostfsEvent.ParseWithdraw)
|
||||
h.AddHandler(np.handleWithdraw)
|
||||
handlers = append(handlers, h)
|
||||
|
||||
// cheque handler
|
||||
h.SetType(event.TypeFromString(chequeNotification))
|
||||
h.SetParser(frostfsEvent.ParseCheque)
|
||||
h.AddHandler(np.handleCheque)
|
||||
handlers = append(handlers, h)
|
||||
|
||||
// config handler
|
||||
h.SetType(event.TypeFromString(configNotification))
|
||||
h.SetParser(frostfsEvent.ParseConfig)
|
||||
h.AddHandler(np.handleConfig)
|
||||
handlers = append(handlers, h)
|
||||
|
||||
return handlers
|
||||
return []event.NotificationHandlerInfo{
|
||||
{
|
||||
Contract: np.frostfsContract,
|
||||
Type: event.TypeFromString(depositNotification),
|
||||
Parser: frostfsEvent.ParseDeposit,
|
||||
Handlers: []event.Handler{np.handleDeposit},
|
||||
},
|
||||
{
|
||||
Contract: np.frostfsContract,
|
||||
Type: event.TypeFromString(withdrawNotification),
|
||||
Parser: frostfsEvent.ParseWithdraw,
|
||||
Handlers: []event.Handler{np.handleWithdraw},
|
||||
},
|
||||
{
|
||||
Contract: np.frostfsContract,
|
||||
Type: event.TypeFromString(chequeNotification),
|
||||
Parser: frostfsEvent.ParseCheque,
|
||||
Handlers: []event.Handler{np.handleCheque},
|
||||
},
|
||||
{
|
||||
Contract: np.frostfsContract,
|
||||
Type: event.TypeFromString(configNotification),
|
||||
Parser: frostfsEvent.ParseConfig,
|
||||
Handlers: []event.Handler{np.handleConfig},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// ListenerNotaryParsers for the 'event.Listener' event producer.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue