frostfs-node/pkg/morph/event/netmap/add_peer.go

29 lines
617 B
Go
Raw Permalink Normal View History

package netmap
import (
"github.com/nspcc-dev/neo-go/pkg/network/payload"
)
type AddPeer struct {
NodeBytes []byte
// For notary notifications only.
// Contains raw transactions of notary request.
Request *payload.P2PNotaryRequest
}
// MorphEvent implements Neo:Morph Event interface.
func (AddPeer) MorphEvent() {}
func (s AddPeer) Node() []byte {
return s.NodeBytes
}
// NotaryRequest returns raw notary request if notification
// was received via notary service. Otherwise, returns nil.
func (s AddPeer) NotaryRequest() *payload.P2PNotaryRequest {
return s.Request
}
const expectedItemNumAddPeer = 1