[#80] netmap: process subnet in selection

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-11-26 15:31:36 +03:00 committed by Leonard Lyubich
parent b49404d9b6
commit 279a5a1e0b
4 changed files with 135 additions and 2 deletions

View file

@ -3,6 +3,7 @@ package netmap
import (
"testing"
subnetid "github.com/nspcc-dev/neofs-sdk-go/subnet/id"
"github.com/stretchr/testify/require"
)
@ -42,6 +43,12 @@ func newReplica(c uint32, s string) *Replica {
return r
}
func newSubnetID(id uint32) *subnetid.ID {
var s subnetid.ID
s.SetNumber(id)
return &s
}
func nodeInfoFromAttributes(props ...string) NodeInfo {
attrs := make([]*NodeAttribute, len(props)/2)
for i := range attrs {