forked from TrueCloudLab/frostfs-node
[#280] ir: Add netmap processor unit tests
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
fb5dcc15d2
commit
d00b1c0d29
15 changed files with 690 additions and 41 deletions
|
@ -10,24 +10,24 @@ import (
|
|||
)
|
||||
|
||||
type AddPeer struct {
|
||||
node []byte
|
||||
NodeBytes []byte
|
||||
|
||||
// For notary notifications only.
|
||||
// Contains raw transactions of notary request.
|
||||
notaryRequest *payload.P2PNotaryRequest
|
||||
Request *payload.P2PNotaryRequest
|
||||
}
|
||||
|
||||
// MorphEvent implements Neo:Morph Event interface.
|
||||
func (AddPeer) MorphEvent() {}
|
||||
|
||||
func (s AddPeer) Node() []byte {
|
||||
return s.node
|
||||
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.notaryRequest
|
||||
return s.Request
|
||||
}
|
||||
|
||||
const expectedItemNumAddPeer = 1
|
||||
|
@ -47,7 +47,7 @@ func ParseAddPeer(e *state.ContainedNotificationEvent) (event.Event, error) {
|
|||
return nil, event.WrongNumberOfParameters(expectedItemNumAddPeer, ln)
|
||||
}
|
||||
|
||||
ev.node, err = client.BytesFromStackItem(params[0])
|
||||
ev.NodeBytes, err = client.BytesFromStackItem(params[0])
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not get raw nodeinfo: %w", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue