[#1513] morph/netmap: Use node state constants from Netmap contract

`Netmap` contract exports enumeration of the node states.

Replace using literals and constants from NeoFS API Go V2 with the
values provided by contract.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-06-16 14:20:03 +03:00 committed by LeL
parent 21d2f8f861
commit 808ba87e82
2 changed files with 7 additions and 6 deletions

View file

@ -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{}