diff --git a/pkg/morph/event/netmap/add_peer.go b/pkg/morph/event/netmap/add_peer.go index e04a8979a..1d013b34f 100644 --- a/pkg/morph/event/netmap/add_peer.go +++ b/pkg/morph/event/netmap/add_peer.go @@ -3,6 +3,7 @@ package netmap import ( "fmt" + "github.com/nspcc-dev/neo-go/pkg/network/payload" "github.com/nspcc-dev/neo-go/pkg/vm/stackitem" "github.com/nspcc-dev/neofs-node/pkg/morph/client" "github.com/nspcc-dev/neofs-node/pkg/morph/event" @@ -10,6 +11,10 @@ import ( type AddPeer struct { node []byte + + // For notary notifications only. + // Contains raw transactions of notary request. + notaryRequest *payload.P2PNotaryRequest } // MorphEvent implements Neo:Morph Event interface. @@ -19,6 +24,12 @@ func (s AddPeer) Node() []byte { return s.node } +// NotaryRequest returns raw notary request if notification +// was received via notary service. Otherwise, returns nil. +func (s AddPeer) NotaryRequest() *payload.P2PNotaryRequest { + return s.notaryRequest +} + const expectedItemNumAddPeer = 1 func ParseAddPeer(prms []stackitem.Item) (event.Event, error) { diff --git a/pkg/morph/event/netmap/add_peer_notary.go b/pkg/morph/event/netmap/add_peer_notary.go index cdc6961a1..d957b0a19 100644 --- a/pkg/morph/event/netmap/add_peer_notary.go +++ b/pkg/morph/event/netmap/add_peer_notary.go @@ -43,5 +43,7 @@ func ParseAddPeerNotary(ne event.NotaryEvent) (event.Event, error) { } } + ev.notaryRequest = ne.Raw() + return ev, nil }