forked from TrueCloudLab/frostfs-node
[#562] cmd/neofs-node: use NEP-6 wallet for keys
Also use neo-go private key wrapper where possible, as it already has methods for (un)marshaling. Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
1553967328
commit
3f07313604
17 changed files with 119 additions and 53 deletions
|
@ -3,6 +3,7 @@ package nodeconfig
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/encoding/address"
|
||||
"github.com/nspcc-dev/neofs-node/cmd/neofs-node/config"
|
||||
configtest "github.com/nspcc-dev/neofs-node/cmd/neofs-node/config/test"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/network"
|
||||
|
@ -43,6 +44,7 @@ func TestNodeSection(t *testing.T) {
|
|||
addr := BootstrapAddress(c)
|
||||
attributes := Attributes(c)
|
||||
relay := Relay(c)
|
||||
wKey := Wallet(c)
|
||||
|
||||
expectedAddr, err := network.AddressFromString("s01.neofs.devenv:8080")
|
||||
require.NoError(t, err)
|
||||
|
@ -54,6 +56,11 @@ func TestNodeSection(t *testing.T) {
|
|||
require.Len(t, attributes, 2)
|
||||
require.Equal(t, "Price:11", attributes[0])
|
||||
require.Equal(t, "UN-LOCODE:RU MSK", attributes[1])
|
||||
|
||||
require.NotNil(t, wKey)
|
||||
require.Equal(t,
|
||||
config.StringSafe(c.Sub("node").Sub("wallet"), "address"),
|
||||
address.Uint160ToString(wKey.GetScriptHash()))
|
||||
}
|
||||
|
||||
configtest.ForEachFileType(path, fileConfigTest)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue