diff options
author | Elad <theman@elad.im> | 2018-08-15 23:41:52 +0800 |
---|---|---|
committer | Balint Gabor <balint.g@gmail.com> | 2018-08-15 23:41:52 +0800 |
commit | e8752f4e9f9be3d2932cd4835a5d72d17ac2338b (patch) | |
tree | 73f1514fc0134f2f5ef4b467f1076548b8a18bc3 /cmd/swarm/run_test.go | |
parent | 040aa2bb101e5e602308b24812bfbf2451b21174 (diff) | |
download | go-tangerine-e8752f4e9f9be3d2932cd4835a5d72d17ac2338b.tar go-tangerine-e8752f4e9f9be3d2932cd4835a5d72d17ac2338b.tar.gz go-tangerine-e8752f4e9f9be3d2932cd4835a5d72d17ac2338b.tar.bz2 go-tangerine-e8752f4e9f9be3d2932cd4835a5d72d17ac2338b.tar.lz go-tangerine-e8752f4e9f9be3d2932cd4835a5d72d17ac2338b.tar.xz go-tangerine-e8752f4e9f9be3d2932cd4835a5d72d17ac2338b.tar.zst go-tangerine-e8752f4e9f9be3d2932cd4835a5d72d17ac2338b.zip |
cmd/swarm, swarm: added access control functionality (#17404)
Co-authored-by: Janos Guljas <janos@resenje.org>
Co-authored-by: Anton Evangelatov <anton.evangelatov@gmail.com>
Co-authored-by: Balint Gabor <balint.g@gmail.com>
Diffstat (limited to 'cmd/swarm/run_test.go')
-rw-r--r-- | cmd/swarm/run_test.go | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/cmd/swarm/run_test.go b/cmd/swarm/run_test.go index 90d3c98ba..3e766dc10 100644 --- a/cmd/swarm/run_test.go +++ b/cmd/swarm/run_test.go @@ -18,10 +18,12 @@ package main import ( "context" + "crypto/ecdsa" "fmt" "io/ioutil" "net" "os" + "path" "path/filepath" "runtime" "sync" @@ -175,14 +177,15 @@ func (c *testCluster) Cleanup() { } type testNode struct { - Name string - Addr string - URL string - Enode string - Dir string - IpcPath string - Client *rpc.Client - Cmd *cmdtest.TestCmd + Name string + Addr string + URL string + Enode string + Dir string + IpcPath string + PrivateKey *ecdsa.PrivateKey + Client *rpc.Client + Cmd *cmdtest.TestCmd } const testPassphrase = "swarm-test-passphrase" @@ -289,7 +292,11 @@ func existingTestNode(t *testing.T, dir string, bzzaccount string) *testNode { func newTestNode(t *testing.T, dir string) *testNode { conf, account := getTestAccount(t, dir) - node := &testNode{Dir: dir} + ks := keystore.NewKeyStore(path.Join(dir, "keystore"), 1<<18, 1) + + pk := decryptStoreAccount(ks, account.Address.Hex(), []string{testPassphrase}) + + node := &testNode{Dir: dir, PrivateKey: pk} // assign ports ports, err := getAvailableTCPPorts(2) |