prysm-pulse/validator/node/node_test.go
Nishant Das 9b008522b8 Refactor Validator Start Routine (#3594)
* make demo default

* make minimal config a flag

* lint

* initialize config at the start

* gaz

* make main method cleaner

* remove interop.go

* fix test

* lint

* gaz

* Update validator/accounts/interop.go

Co-Authored-By: terence tsao <terence@prysmaticlabs.com>

* fix docker build

* fix docker build
2019-09-26 13:23:25 -05:00

34 lines
996 B
Go

package node
import (
"flag"
"os"
"testing"
"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")
set.String("verbosity", "debug", "log verbosity")
context := cli.NewContext(app, set, nil)
if err := accounts.NewValidatorAccount(dir, "1234"); err != nil {
t.Fatalf("Could not create validator account: %v", err)
}
_, err := NewValidatorClient(context)
if err != nil {
t.Fatalf("Failed to create ValidatorClient: %v", err)
}
}