prysm-pulse/validator/node/node_test.go
Raul Jordan 281e5d1cfd
Provide Real Keystore to Validator Service for Public/Private Key Access at Runtime (#1570)
* provide validator with real keystore public key

* fmt

* build errors buildkite

* readd imports removed by goimport

* gazelle

* address broken tests

* make reference to filename a param

* fmt

* imports

* gazelle

* os remove all

* Use better Temp storage for tests

* testmain approach to avoid repeating expensive operation for each test

* travis lint

* fix test

* nokeystore in status test

* passing

* fix goimports
2019-02-13 17:49:06 -06:00

34 lines
946 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")
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)
}
}