diff --git a/cmd/neofs-node/netmap.go b/cmd/neofs-node/netmap.go index 3fea962f..2942dc7c 100644 --- a/cmd/neofs-node/netmap.go +++ b/cmd/neofs-node/netmap.go @@ -4,7 +4,6 @@ import ( "github.com/nspcc-dev/neofs-api-go/pkg/netmap" netmapGRPC "github.com/nspcc-dev/neofs-api-go/v2/netmap/grpc" crypto "github.com/nspcc-dev/neofs-crypto" - "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap/wrapper" "github.com/nspcc-dev/neofs-node/pkg/morph/event" netmapEvent "github.com/nspcc-dev/neofs-node/pkg/morph/event/netmap" netmapTransportGRPC "github.com/nspcc-dev/neofs-node/pkg/network/transport/netmap/grpc" @@ -119,7 +118,7 @@ func addNewEpochNotificationHandler(c *cfg, h event.Handler) { func goOffline(c *cfg) { err := c.cfgNetmap.wrapper.UpdatePeerState( crypto.MarshalPublicKey(&c.key.PublicKey), - wrapper.StateOffline, + netmap.NodeStateOffline, ) if err != nil { diff --git a/pkg/morph/client/netmap/wrapper/update_state.go b/pkg/morph/client/netmap/wrapper/update_state.go index ad296f0f..70902bb3 100644 --- a/pkg/morph/client/netmap/wrapper/update_state.go +++ b/pkg/morph/client/netmap/wrapper/update_state.go @@ -1,26 +1,17 @@ package wrapper import ( + "github.com/nspcc-dev/neofs-api-go/pkg/netmap" contract "github.com/nspcc-dev/neofs-node/pkg/morph/client/netmap" "github.com/pkg/errors" ) -// NodeState is a type of node states enumeration. -type NodeState int64 - -const ( - _ NodeState = iota - - // StateOffline is an offline node state value. - StateOffline -) - // UpdatePeerState changes peer status through Netmap contract // call. -func (w *Wrapper) UpdatePeerState(key []byte, state NodeState) error { +func (w *Wrapper) UpdatePeerState(key []byte, state netmap.NodeState) error { args := contract.UpdateStateArgs{} args.SetPublicKey(key) - args.SetState(int64(state)) + args.SetState(int64(state.ToV2())) // invoke smart contract call //