[#172] v2/netmap: Add JSON converter for node info
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
2e1096200e
commit
b681b28e33
2 changed files with 58 additions and 0 deletions
22
v2/netmap/json_test.go
Normal file
22
v2/netmap/json_test.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package netmap_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/nspcc-dev/neofs-api-go/v2/netmap"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestNodeInfoJSON(t *testing.T) {
|
||||
exp := generateNodeInfo("public key", "/multi/addr", 2)
|
||||
|
||||
t.Run("non empty", func(t *testing.T) {
|
||||
data := netmap.NodeInfoToJSON(exp)
|
||||
require.NotNil(t, data)
|
||||
|
||||
got := netmap.NodeInfoFromJSON(data)
|
||||
require.NotNil(t, got)
|
||||
|
||||
require.Equal(t, exp, got)
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue