Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
79009ca0
Commit
79009ca0
authored
Jun 27, 2014
by
zelig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transitional ethutil.ReadConfig fixes in ethchain tests (they still fail! FIXME :)
parent
423beddf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
6 deletions
+14
-6
block_chain_test.go
ethchain/block_chain_test.go
+9
-1
state_object_test.go
ethchain/state_object_test.go
+2
-2
state_test.go
ethchain/state_test.go
+1
-1
vm_test.go
ethchain/vm_test.go
+1
-1
config.go
ethutil/config.go
+1
-1
No files found.
ethchain/block_chain_test.go
View file @
79009ca0
package
ethchain
import
(
"container/list"
"fmt"
"github.com/ethereum/eth-go/ethdb"
"github.com/ethereum/eth-go/ethutil"
...
...
@@ -30,6 +31,10 @@ func (s *TestManager) PeerCount() int {
return
0
}
func
(
s
*
TestManager
)
Peers
()
*
list
.
List
{
return
list
.
New
()
}
func
(
s
*
TestManager
)
BlockChain
()
*
BlockChain
{
return
s
.
blockChain
}
...
...
@@ -50,7 +55,8 @@ func (tm *TestManager) Broadcast(msgType ethwire.MsgType, data []interface{}) {
}
func
NewTestManager
()
*
TestManager
{
ethutil
.
ReadConfig
(
".ethtest"
,
ethutil
.
LogStd
,
""
)
ethutil
.
ReadConfig
(
".ethtest"
,
"/tmp/ethtest"
,
""
,
"ETH"
)
db
,
err
:=
ethdb
.
NewMemDatabase
()
if
err
!=
nil
{
...
...
@@ -71,12 +77,14 @@ func NewTestManager() *TestManager {
return
testManager
}
func
(
tm
*
TestManager
)
AddFakeBlock
(
blk
[]
byte
)
error
{
block
:=
NewBlockFromBytes
(
blk
)
tm
.
Blocks
=
append
(
tm
.
Blocks
,
block
)
err
:=
tm
.
StateManager
()
.
Process
(
block
,
false
)
return
err
}
func
(
tm
*
TestManager
)
CreateChain1
()
error
{
err
:=
tm
.
AddFakeBlock
([]
byte
{
248
,
246
,
248
,
242
,
160
,
58
,
253
,
98
,
206
,
198
,
181
,
152
,
223
,
201
,
116
,
197
,
154
,
111
,
104
,
54
,
113
,
249
,
184
,
246
,
15
,
226
,
142
,
187
,
47
,
138
,
60
,
201
,
66
,
226
,
237
,
29
,
7
,
160
,
29
,
204
,
77
,
232
,
222
,
199
,
93
,
122
,
171
,
133
,
181
,
103
,
182
,
204
,
212
,
26
,
211
,
18
,
69
,
27
,
148
,
138
,
116
,
19
,
240
,
161
,
66
,
253
,
64
,
212
,
147
,
71
,
184
,
65
,
4
,
103
,
109
,
19
,
120
,
219
,
91
,
248
,
48
,
204
,
17
,
28
,
7
,
146
,
72
,
203
,
15
,
207
,
251
,
31
,
216
,
138
,
26
,
59
,
34
,
238
,
40
,
114
,
233
,
1
,
13
,
207
,
90
,
71
,
136
,
124
,
86
,
196
,
127
,
10
,
176
,
193
,
154
,
165
,
76
,
155
,
154
,
59
,
45
,
34
,
96
,
183
,
212
,
99
,
41
,
27
,
40
,
119
,
171
,
231
,
160
,
114
,
56
,
218
,
173
,
160
,
80
,
218
,
177
,
253
,
147
,
35
,
101
,
59
,
37
,
87
,
97
,
193
,
119
,
21
,
132
,
111
,
93
,
53
,
152
,
203
,
38
,
134
,
25
,
104
,
138
,
236
,
92
,
27
,
176
,
89
,
229
,
176
,
160
,
29
,
204
,
77
,
232
,
222
,
199
,
93
,
122
,
171
,
133
,
181
,
103
,
182
,
204
,
212
,
26
,
211
,
18
,
69
,
27
,
148
,
138
,
116
,
19
,
240
,
161
,
66
,
253
,
64
,
212
,
147
,
71
,
131
,
63
,
240
,
0
,
132
,
83
,
48
,
32
,
251
,
128
,
160
,
4
,
10
,
11
,
225
,
132
,
86
,
146
,
227
,
229
,
137
,
164
,
245
,
16
,
139
,
219
,
12
,
251
,
178
,
154
,
168
,
210
,
18
,
84
,
40
,
250
,
41
,
124
,
92
,
169
,
242
,
246
,
180
,
192
,
192
})
err
=
tm
.
AddFakeBlock
([]
byte
{
248
,
246
,
248
,
242
,
160
,
222
,
229
,
152
,
228
,
200
,
163
,
244
,
144
,
120
,
18
,
203
,
253
,
195
,
185
,
105
,
131
,
163
,
226
,
116
,
40
,
140
,
68
,
249
,
198
,
221
,
152
,
121
,
0
,
124
,
11
,
180
,
125
,
160
,
29
,
204
,
77
,
232
,
222
,
199
,
93
,
122
,
171
,
133
,
181
,
103
,
182
,
204
,
212
,
26
,
211
,
18
,
69
,
27
,
148
,
138
,
116
,
19
,
240
,
161
,
66
,
253
,
64
,
212
,
147
,
71
,
184
,
65
,
4
,
103
,
109
,
19
,
120
,
219
,
91
,
248
,
48
,
204
,
17
,
28
,
7
,
146
,
72
,
203
,
15
,
207
,
251
,
31
,
216
,
138
,
26
,
59
,
34
,
238
,
40
,
114
,
233
,
1
,
13
,
207
,
90
,
71
,
136
,
124
,
86
,
196
,
127
,
10
,
176
,
193
,
154
,
165
,
76
,
155
,
154
,
59
,
45
,
34
,
96
,
183
,
212
,
99
,
41
,
27
,
40
,
119
,
171
,
231
,
160
,
114
,
56
,
218
,
173
,
160
,
80
,
218
,
177
,
253
,
147
,
35
,
101
,
59
,
37
,
87
,
97
,
193
,
119
,
21
,
132
,
111
,
93
,
53
,
152
,
203
,
38
,
134
,
25
,
104
,
138
,
236
,
92
,
27
,
176
,
89
,
229
,
176
,
160
,
29
,
204
,
77
,
232
,
222
,
199
,
93
,
122
,
171
,
133
,
181
,
103
,
182
,
204
,
212
,
26
,
211
,
18
,
69
,
27
,
148
,
138
,
116
,
19
,
240
,
161
,
66
,
253
,
64
,
212
,
147
,
71
,
131
,
63
,
224
,
4
,
132
,
83
,
48
,
36
,
250
,
128
,
160
,
79
,
58
,
51
,
246
,
238
,
249
,
210
,
253
,
136
,
83
,
71
,
134
,
49
,
114
,
190
,
189
,
242
,
78
,
100
,
238
,
101
,
84
,
204
,
176
,
198
,
25
,
139
,
151
,
60
,
84
,
51
,
126
,
192
,
192
})
...
...
ethchain/state_object_test.go
View file @
79009ca0
...
...
@@ -9,7 +9,7 @@ import (
)
func
TestSync
(
t
*
testing
.
T
)
{
ethutil
.
ReadConfig
(
"
"
,
ethutil
.
LogStd
,
"
"
)
ethutil
.
ReadConfig
(
"
.ethtest"
,
"/tmp/ethtest"
,
""
,
"ETH
"
)
db
,
_
:=
ethdb
.
NewMemDatabase
()
state
:=
NewState
(
ethutil
.
NewTrie
(
db
,
""
))
...
...
@@ -28,7 +28,7 @@ func TestSync(t *testing.T) {
}
func
TestObjectGet
(
t
*
testing
.
T
)
{
ethutil
.
ReadConfig
(
"
"
,
ethutil
.
LogStd
,
"
"
)
ethutil
.
ReadConfig
(
"
.ethtest"
,
"/tmp/ethtest"
,
""
,
"ETH
"
)
db
,
_
:=
ethdb
.
NewMemDatabase
()
ethutil
.
Config
.
Db
=
db
...
...
ethchain/state_test.go
View file @
79009ca0
...
...
@@ -7,7 +7,7 @@ import (
)
func
TestSnapshot
(
t
*
testing
.
T
)
{
ethutil
.
ReadConfig
(
"
"
,
ethutil
.
LogStd
,
"
"
)
ethutil
.
ReadConfig
(
"
.ethtest"
,
"/tmp/ethtest"
,
""
,
"ETH
"
)
db
,
_
:=
ethdb
.
NewMemDatabase
()
state
:=
NewState
(
ethutil
.
NewTrie
(
db
,
""
))
...
...
ethchain/vm_test.go
View file @
79009ca0
...
...
@@ -12,7 +12,7 @@ import (
)
func
TestRun4
(
t
*
testing
.
T
)
{
ethutil
.
ReadConfig
(
"
"
,
ethutil
.
LogStd
,
"
"
)
ethutil
.
ReadConfig
(
"
.ethtest"
,
"/tmp/ethtest"
,
""
,
"ETH
"
)
db
,
_
:=
ethdb
.
NewMemDatabase
()
state
:=
NewState
(
ethutil
.
NewTrie
(
db
,
""
))
...
...
ethutil/config.go
View file @
79009ca0
...
...
@@ -44,7 +44,7 @@ func ReadConfig(ConfigFile string, Datadir string, Identifier string, EnvPrefix
}
else
{
g
.
ParseAll
()
}
Config
=
&
config
{
ExecPath
:
Datadir
,
Debug
:
true
,
Ver
:
"0.5.1
4
"
,
conf
:
g
,
Identifier
:
Identifier
}
Config
=
&
config
{
ExecPath
:
Datadir
,
Debug
:
true
,
Ver
:
"0.5.1
5
"
,
conf
:
g
,
Identifier
:
Identifier
}
Config
.
SetClientString
(
"Ethereum(G)"
)
}
return
Config
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment