2020-07-10 14:17:51 +00:00
|
|
|
package morph
|
|
|
|
|
|
|
|
import (
|
2020-07-24 13:54:03 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/event/netmap"
|
2020-07-10 14:17:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
const eventOpt = "event"
|
|
|
|
|
|
|
|
// NewEpochEventType is a config section of new epoch notification event.
|
|
|
|
const NewEpochEventType = "new_epoch"
|
|
|
|
|
|
|
|
// ContractEventOptPath returns the config path to notification event name of particular contract.
|
|
|
|
func ContractEventOptPath(contract, event string) string {
|
|
|
|
return optPath(prefix, contract, eventOpt, event)
|
|
|
|
}
|
|
|
|
|
|
|
|
var mParsers = map[string][]struct {
|
|
|
|
typ string
|
|
|
|
parser event.Parser
|
|
|
|
}{
|
|
|
|
NetmapContractName: {
|
|
|
|
{
|
|
|
|
typ: NewEpochEventType,
|
|
|
|
parser: netmap.ParseNewEpoch,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|