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