[#1680] morph/netmap: Adopt to recent contract changes

After recent Netmap contract changes all read methods which return
network map (either candidates or snapshots) encode node descriptors
into same structure.

Decode `netmap.Node` contract-side structure from the call results.
Replace node state with the value from the `netmap.Node.State` field.

Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
This commit is contained in:
Leonard Lyubich 2022-09-28 15:34:28 +04:00 committed by fyrchik
parent d6c01199c8
commit eb1fba5182
14 changed files with 135 additions and 221 deletions

View file

@ -37,7 +37,7 @@ func (np *Processor) processNewEpoch(ev netmapEvent.NewEpoch) {
}
// get new netmap snapshot
networkMap, err := np.netmapClient.Snapshot()
networkMap, err := np.netmapClient.NetMap()
if err != nil {
np.log.Warn("can't get netmap snapshot to perform cleanup",
zap.String("error", err.Error()))