[#312] netmap: Support NetmapService.NetmapSnapshot RPC

Extend functionality of `NetMap` type. Add `NetMapSnapshot` operation to
`client` package.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-09-17 14:07:56 +04:00 committed by LeL
parent f2f97f656d
commit 664392afc2
6 changed files with 210 additions and 3 deletions

View file

@ -1,6 +1,8 @@
package netmaptest
import (
"math/rand"
"github.com/nspcc-dev/neofs-sdk-go/netmap"
subnetidtest "github.com/nspcc-dev/neofs-sdk-go/subnet/id/test"
)
@ -68,3 +70,14 @@ func NetworkInfo() (x netmap.NetworkInfo) {
return
}
// NodeInfo returns random netmap.NodeInfo.
func NodeInfo() (x netmap.NodeInfo) {
key := make([]byte, 33)
rand.Read(key)
x.SetPublicKey(key)
x.SetNetworkEndpoints("1", "2", "3")
return
}