forked from TrueCloudLab/frostfs-node
[#1382] morph: Replace deprecated methods
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
e5c8f7ff9f
commit
d4be2f20d4
2 changed files with 10 additions and 10 deletions
|
@ -136,11 +136,11 @@ func decodeNodeInfo(dst *netmap.NodeInfo, itemNode stackitem.Item) error {
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("unsupported state %v", node.State)
|
return fmt.Errorf("unsupported state %v", node.State)
|
||||||
case netmapcontract.NodeStateOnline:
|
case netmapcontract.NodeStateOnline:
|
||||||
dst.SetOnline()
|
dst.SetStatus(netmap.Online)
|
||||||
case netmapcontract.NodeStateOffline:
|
case netmapcontract.NodeStateOffline:
|
||||||
dst.SetOffline()
|
dst.SetStatus(netmap.Offline)
|
||||||
case netmapcontract.NodeStateMaintenance:
|
case netmapcontract.NodeStateMaintenance:
|
||||||
dst.SetMaintenance()
|
dst.SetStatus(netmap.Maintenance)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -20,11 +20,11 @@ func Test_stackItemsToNodeInfos(t *testing.T) {
|
||||||
|
|
||||||
switch i % 3 {
|
switch i % 3 {
|
||||||
default:
|
default:
|
||||||
expected[i].SetOffline()
|
expected[i].SetStatus(netmap.Offline)
|
||||||
case int(netmapcontract.NodeStateOnline):
|
case int(netmapcontract.NodeStateOnline):
|
||||||
expected[i].SetOnline()
|
expected[i].SetStatus(netmap.Online)
|
||||||
case int(netmapcontract.NodeStateMaintenance):
|
case int(netmapcontract.NodeStateMaintenance):
|
||||||
expected[i].SetMaintenance()
|
expected[i].SetStatus(netmap.Maintenance)
|
||||||
}
|
}
|
||||||
|
|
||||||
expected[i].SetPublicKey(pub)
|
expected[i].SetPublicKey(pub)
|
||||||
|
@ -38,12 +38,12 @@ func Test_stackItemsToNodeInfos(t *testing.T) {
|
||||||
|
|
||||||
var state int64
|
var state int64
|
||||||
|
|
||||||
switch {
|
switch expected[i].Status() {
|
||||||
case expected[i].IsOnline():
|
case netmap.Online:
|
||||||
state = int64(netmapcontract.NodeStateOnline)
|
state = int64(netmapcontract.NodeStateOnline)
|
||||||
case expected[i].IsOffline():
|
case netmap.Offline:
|
||||||
state = int64(netmapcontract.NodeStateOffline)
|
state = int64(netmapcontract.NodeStateOffline)
|
||||||
case expected[i].IsMaintenance():
|
case netmap.Maintenance:
|
||||||
state = int64(netmapcontract.NodeStateMaintenance)
|
state = int64(netmapcontract.NodeStateMaintenance)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue