2022-01-31 11:58:55 +00:00
|
|
|
package netmap
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
|
|
|
"github.com/nspcc-dev/neofs-sdk-go/netmap"
|
|
|
|
)
|
|
|
|
|
2022-09-28 11:34:28 +00:00
|
|
|
// GetNetMap calls "snapshot" method and decodes netmap.NetMap from the response.
|
2022-06-08 23:18:26 +00:00
|
|
|
func (c *Client) GetNetMap(diff uint64) (*netmap.NetMap, error) {
|
2022-01-31 11:58:55 +00:00
|
|
|
prm := client.TestInvokePrm{}
|
|
|
|
prm.SetMethod(snapshotMethod)
|
2022-03-11 09:28:34 +00:00
|
|
|
prm.SetArgs(diff)
|
2022-01-31 11:58:55 +00:00
|
|
|
|
|
|
|
res, err := c.client.TestInvoke(prm)
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
|
2022-09-28 11:34:28 +00:00
|
|
|
return decodeNetMap(res)
|
2022-01-31 11:58:55 +00:00
|
|
|
}
|