[#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:
|
||||
return fmt.Errorf("unsupported state %v", node.State)
|
||||
case netmapcontract.NodeStateOnline:
|
||||
dst.SetOnline()
|
||||
dst.SetStatus(netmap.Online)
|
||||
case netmapcontract.NodeStateOffline:
|
||||
dst.SetOffline()
|
||||
dst.SetStatus(netmap.Offline)
|
||||
case netmapcontract.NodeStateMaintenance:
|
||||
dst.SetMaintenance()
|
||||
dst.SetStatus(netmap.Maintenance)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
@ -20,11 +20,11 @@ func Test_stackItemsToNodeInfos(t *testing.T) {
|
|||
|
||||
switch i % 3 {
|
||||
default:
|
||||
expected[i].SetOffline()
|
||||
expected[i].SetStatus(netmap.Offline)
|
||||
case int(netmapcontract.NodeStateOnline):
|
||||
expected[i].SetOnline()
|
||||
expected[i].SetStatus(netmap.Online)
|
||||
case int(netmapcontract.NodeStateMaintenance):
|
||||
expected[i].SetMaintenance()
|
||||
expected[i].SetStatus(netmap.Maintenance)
|
||||
}
|
||||
|
||||
expected[i].SetPublicKey(pub)
|
||||
|
@ -38,12 +38,12 @@ func Test_stackItemsToNodeInfos(t *testing.T) {
|
|||
|
||||
var state int64
|
||||
|
||||
switch {
|
||||
case expected[i].IsOnline():
|
||||
switch expected[i].Status() {
|
||||
case netmap.Online:
|
||||
state = int64(netmapcontract.NodeStateOnline)
|
||||
case expected[i].IsOffline():
|
||||
case netmap.Offline:
|
||||
state = int64(netmapcontract.NodeStateOffline)
|
||||
case expected[i].IsMaintenance():
|
||||
case netmap.Maintenance:
|
||||
state = int64(netmapcontract.NodeStateMaintenance)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue