prysm-pulse/validator/node/node_test.go
Raul Jordan 7beafa159d
Support Starting Validator Binary from Unencrypted Keys JSON (#3308)
* next compatible, tests pass

* terence feedback

* skip comment

* fixes

* misc fix

* on block

* parse from unencrypted keys json

* mod val client

* launching unencrypted workssss

* fix broken build

* fix up build

* rem prints

* resolve lint

* bls comment

* fix docker deps

* gaz
2019-08-26 16:07:09 -05:00

35 lines
1.0 KiB
Go

package node
import (
"flag"
"os"
"testing"
"github.com/prysmaticlabs/prysm/shared/keystore"
"github.com/prysmaticlabs/prysm/shared/testutil"
"github.com/prysmaticlabs/prysm/validator/accounts"
"github.com/urfave/cli"
)
// Test that the sharding node can build with default flag values.
func TestNode_Builds(t *testing.T) {
app := cli.NewApp()
set := flag.NewFlagSet("test", 0)
set.String("datadir", testutil.TempDir()+"/datadir", "the node data directory")
dir := testutil.TempDir() + "/keystore1"
defer os.RemoveAll(dir)
defer os.RemoveAll(testutil.TempDir() + "/datadir")
set.String("keystore-path", dir, "path to keystore")
set.String("password", "1234", "validator account password")
context := cli.NewContext(app, set, nil)
if err := accounts.NewValidatorAccount(dir, "1234"); err != nil {
t.Fatalf("Could not create validator account: %v", err)
}
keys := make(map[string]*keystore.Key)
_, err := NewValidatorClient(context, keys)
if err != nil {
t.Fatalf("Failed to create ValidatorClient: %v", err)
}
}