Add Inner Ring code

This commit is contained in:
Stanislav Bogatyrev 2020-07-24 16:54:03 +03:00
parent dadfd90dcd
commit b7b5079934
400 changed files with 11420 additions and 8690 deletions

View file

@ -0,0 +1,39 @@
package netmap
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestNetMap_Nodes(t *testing.T) {
nm := New()
info1 := Info{}
info1.SetPublicKey([]byte{1, 2, 3})
info2 := Info{}
info2.SetPublicKey([]byte{4, 5, 6})
nodes := []Info{
info1,
info2,
}
nm.SetNodes(nodes)
require.Equal(t, nodes, nm.Nodes())
}
func TestNetMap_Root(t *testing.T) {
nm := New()
bucket := &Bucket{
Key: "key",
Value: "value",
}
nm.SetRoot(bucket)
require.Equal(t, bucket, nm.Root())
}