diff --git a/pkg/morph/client/netmap/update_state.go b/pkg/morph/client/netmap/update_state.go index e6c8cca719..1b860ffe6c 100644 --- a/pkg/morph/client/netmap/update_state.go +++ b/pkg/morph/client/netmap/update_state.go @@ -3,6 +3,7 @@ package netmap import ( "fmt" + "github.com/nspcc-dev/neofs-contract/netmap" "github.com/nspcc-dev/neofs-node/pkg/morph/client" ) @@ -36,9 +37,9 @@ func (c *Client) UpdatePeerState(p UpdatePeerPrm) error { method += "IR" } - state := 2 + state := netmap.OfflineState if p.online { - state = 1 + state = netmap.OnlineState } prm := client.InvokePrm{} diff --git a/pkg/morph/event/netmap/update_peer.go b/pkg/morph/event/netmap/update_peer.go index e7fd5fcfd2..83037a5959 100644 --- a/pkg/morph/event/netmap/update_peer.go +++ b/pkg/morph/event/netmap/update_peer.go @@ -7,7 +7,7 @@ import ( "github.com/nspcc-dev/neo-go/pkg/crypto/keys" "github.com/nspcc-dev/neo-go/pkg/network/payload" "github.com/nspcc-dev/neo-go/pkg/rpc/response/result/subscriptions" - v2netmap "github.com/nspcc-dev/neofs-api-go/v2/netmap" + "github.com/nspcc-dev/neofs-contract/netmap" "github.com/nspcc-dev/neofs-node/pkg/morph/client" "github.com/nspcc-dev/neofs-node/pkg/morph/event" ) @@ -73,11 +73,11 @@ func ParseUpdatePeer(e *subscriptions.NotificationEvent) (event.Event, error) { return nil, fmt.Errorf("could not get node status: %w", err) } - switch v2netmap.NodeState(st) { + switch st { default: return nil, fmt.Errorf("unsupported node state %d", st) - case v2netmap.Offline: - case v2netmap.Online: + case int64(netmap.OfflineState): + case int64(netmap.OnlineState): ev.online = true }