@@ -30,14 +30,14 @@ import (
30
30
var (
31
31
hexprvkey = "65138b2aa745041b372153550584587da326ab440576b2a1191dd95cee30039c"
32
32
defaultConfig = `{
33
- "ChunkDbPath": "` + filepath .Join ("TMPDIR" , "0d2f62485607cf38d9d795d93682a517661e513e" , " chunks" ) + `",
33
+ "ChunkDbPath": "` + filepath .Join ("TMPDIR" , "chunks" ) + `",
34
34
"DbCapacity": 5000000,
35
35
"CacheCapacity": 5000,
36
36
"Radius": 0,
37
37
"Branches": 128,
38
38
"Hash": "SHA3",
39
39
"CallInterval": 3000000000,
40
- "KadDbPath": "` + filepath .Join ("TMPDIR" , "0d2f62485607cf38d9d795d93682a517661e513e" , " bzz-peers.json" ) + `",
40
+ "KadDbPath": "` + filepath .Join ("TMPDIR" , "bzz-peers.json" ) + `",
41
41
"MaxProx": 8,
42
42
"ProxBinSize": 2,
43
43
"BucketSize": 4,
59
59
"Contract": "0x0000000000000000000000000000000000000000",
60
60
"Beneficiary": "0x0d2f62485607cf38d9d795d93682a517661e513e"
61
61
},
62
- "RequestDbPath": "` + filepath .Join ("TMPDIR" , "0d2f62485607cf38d9d795d93682a517661e513e" , " requests" ) + `",
62
+ "RequestDbPath": "` + filepath .Join ("TMPDIR" , "requests" ) + `",
63
63
"RequestDbBatchSize": 512,
64
64
"KeyBufferSize": 1024,
65
65
"SyncBatchSize": 128,
79
79
true,
80
80
false
81
81
],
82
- "Path": "` + filepath . Join ( " TMPDIR" , "0d2f62485607cf38d9d795d93682a517661e513e" ) + ` ",
82
+ "Path": "TMPDIR",
83
83
"Port": "8500",
84
84
"PublicKey": "0x045f5cfd26692e48d0017d380349bcf50982488bc11b5145f3ddf88b24924299048450542d43527fbe29a5cb32f38d62755393ac002e6bfdd71b8d7ba725ecd7a3",
85
85
"BzzKey": "0xe861964402c0b78e2d44098329b8545726f215afa737d803714a4338552fcb81",
@@ -99,16 +99,12 @@ func TestConfigWriteRead(t *testing.T) {
99
99
if err != nil {
100
100
t .Fatalf ("expected no error, got %v" , err )
101
101
}
102
- account := crypto .PubkeyToAddress (prvkey .PublicKey )
103
- dirpath := filepath .Join (tmp , common .Bytes2Hex (account .Bytes ()))
104
- confpath := filepath .Join (dirpath , "config.json" )
105
- data , err := ioutil .ReadFile (confpath )
102
+ data , err := ioutil .ReadFile (filepath .Join (orig .Path , "config.json" ))
106
103
if err != nil {
107
104
t .Fatalf ("default config file cannot be read: %v" , err )
108
105
}
109
- exp := strings .Replace (defaultConfig , "TMPDIR" , tmp , - 1 )
106
+ exp := strings .Replace (defaultConfig , "TMPDIR" , orig . Path , - 1 )
110
107
exp = strings .Replace (exp , "\\ " , "\\ \\ " , - 1 )
111
-
112
108
if string (data ) != exp {
113
109
t .Fatalf ("default config mismatch:\n expected: %v\n got: %v" , exp , string (data ))
114
110
}
0 commit comments