aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/config_test.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-11-11 13:13:16 +0800
committerGitHub <noreply@github.com>2016-11-11 13:13:16 +0800
commit9eb6f627fa9e08573580fc5915e23d332a36071b (patch)
tree711a6f608e074df8ab514f1e269dac457ddc1fdc /swarm/api/config_test.go
parent80ea44c485c42032aa954f2a8580e3afb4aa5339 (diff)
parent8247bccf71351812cd60179c3ef0f9d596f117c1 (diff)
downloadgo-tangerine-9eb6f627fa9e08573580fc5915e23d332a36071b.tar
go-tangerine-9eb6f627fa9e08573580fc5915e23d332a36071b.tar.gz
go-tangerine-9eb6f627fa9e08573580fc5915e23d332a36071b.tar.bz2
go-tangerine-9eb6f627fa9e08573580fc5915e23d332a36071b.tar.lz
go-tangerine-9eb6f627fa9e08573580fc5915e23d332a36071b.tar.xz
go-tangerine-9eb6f627fa9e08573580fc5915e23d332a36071b.tar.zst
go-tangerine-9eb6f627fa9e08573580fc5915e23d332a36071b.zip
Merge pull request #3247 from fjl/bzzd
cmd: add swarm command line tools
Diffstat (limited to 'swarm/api/config_test.go')
-rw-r--r--swarm/api/config_test.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/swarm/api/config_test.go b/swarm/api/config_test.go
index 874701119..8fe3ddacc 100644
--- a/swarm/api/config_test.go
+++ b/swarm/api/config_test.go
@@ -30,14 +30,14 @@ import (
var (
hexprvkey = "65138b2aa745041b372153550584587da326ab440576b2a1191dd95cee30039c"
defaultConfig = `{
- "ChunkDbPath": "` + filepath.Join("TMPDIR", "0d2f62485607cf38d9d795d93682a517661e513e", "chunks") + `",
+ "ChunkDbPath": "` + filepath.Join("TMPDIR", "chunks") + `",
"DbCapacity": 5000000,
"CacheCapacity": 5000,
"Radius": 0,
"Branches": 128,
"Hash": "SHA3",
"CallInterval": 3000000000,
- "KadDbPath": "` + filepath.Join("TMPDIR", "0d2f62485607cf38d9d795d93682a517661e513e", "bzz-peers.json") + `",
+ "KadDbPath": "` + filepath.Join("TMPDIR", "bzz-peers.json") + `",
"MaxProx": 8,
"ProxBinSize": 2,
"BucketSize": 4,
@@ -59,7 +59,7 @@ var (
"Contract": "0x0000000000000000000000000000000000000000",
"Beneficiary": "0x0d2f62485607cf38d9d795d93682a517661e513e"
},
- "RequestDbPath": "` + filepath.Join("TMPDIR", "0d2f62485607cf38d9d795d93682a517661e513e", "requests") + `",
+ "RequestDbPath": "` + filepath.Join("TMPDIR", "requests") + `",
"RequestDbBatchSize": 512,
"KeyBufferSize": 1024,
"SyncBatchSize": 128,
@@ -79,7 +79,7 @@ var (
true,
false
],
- "Path": "` + filepath.Join("TMPDIR", "0d2f62485607cf38d9d795d93682a517661e513e") + `",
+ "Path": "TMPDIR",
"Port": "8500",
"PublicKey": "0x045f5cfd26692e48d0017d380349bcf50982488bc11b5145f3ddf88b24924299048450542d43527fbe29a5cb32f38d62755393ac002e6bfdd71b8d7ba725ecd7a3",
"BzzKey": "0xe861964402c0b78e2d44098329b8545726f215afa737d803714a4338552fcb81",
@@ -99,16 +99,12 @@ func TestConfigWriteRead(t *testing.T) {
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
- account := crypto.PubkeyToAddress(prvkey.PublicKey)
- dirpath := filepath.Join(tmp, common.Bytes2Hex(account.Bytes()))
- confpath := filepath.Join(dirpath, "config.json")
- data, err := ioutil.ReadFile(confpath)
+ data, err := ioutil.ReadFile(filepath.Join(orig.Path, "config.json"))
if err != nil {
t.Fatalf("default config file cannot be read: %v", err)
}
- exp := strings.Replace(defaultConfig, "TMPDIR", tmp, -1)
+ exp := strings.Replace(defaultConfig, "TMPDIR", orig.Path, -1)
exp = strings.Replace(exp, "\\", "\\\\", -1)
-
if string(data) != exp {
t.Fatalf("default config mismatch:\nexpected: %v\ngot: %v", exp, string(data))
}