@@ -20,6 +20,8 @@ import (
20
20
"github.com/ethereum/go-ethereum/core/state"
21
21
"github.com/ethereum/go-ethereum/crypto"
22
22
"github.com/ethereum/go-ethereum/eth"
23
+ "github.com/ethereum/go-ethereum/rpc/comms"
24
+ "github.com/ethereum/go-ethereum/rpc/codec"
23
25
)
24
26
25
27
const (
@@ -105,7 +107,8 @@ func testJEthRE(t *testing.T) (string, *testjethre, *eth.Ethereum) {
105
107
t .Errorf ("Error creating DocServer: %v" , err )
106
108
}
107
109
tf := & testjethre {ds : ds , stateDb : ethereum .ChainManager ().State ().Copy ()}
108
- repl := newJSRE (ethereum , assetPath , "" , "" , false , tf )
110
+ client := comms .NewInProcClient (codec .JSON )
111
+ repl := newJSRE (ethereum , assetPath , "" , client , false , tf )
109
112
tf .jsre = repl
110
113
return tmp , tf , ethereum
111
114
}
@@ -125,7 +128,7 @@ func TestNodeInfo(t *testing.T) {
125
128
defer ethereum .Stop ()
126
129
defer os .RemoveAll (tmp )
127
130
want := `{"DiscPort":0,"IP":"0.0.0.0","ListenAddr":"","Name":"test","NodeID":"4cb2fc32924e94277bf94b5e4c983beedb2eabd5a0bc941db32202735c6625d020ca14a5963d1738af43b6ac0a711d61b1a06de931a499fe2aa0b1a132a902b5","NodeUrl":"enode://4cb2fc32924e94277bf94b5e4c983beedb2eabd5a0bc941db32202735c6625d020ca14a5963d1738af43b6ac0a711d61b1a06de931a499fe2aa0b1a132a902b5@0.0.0.0:0","TCPPort":0,"Td":"131072"}`
128
- checkEvalJSON (t , repl , `admin.nodeInfo() ` , want )
131
+ checkEvalJSON (t , repl , `admin.nodeInfo` , want )
129
132
}
130
133
131
134
func TestAccounts (t * testing.T ) {
@@ -139,7 +142,7 @@ func TestAccounts(t *testing.T) {
139
142
checkEvalJSON (t , repl , `eth.accounts` , `["` + testAddress + `"]` )
140
143
checkEvalJSON (t , repl , `eth.coinbase` , `"` + testAddress + `"` )
141
144
142
- val , err := repl .re .Run (`admin .newAccount("password")` )
145
+ val , err := repl .re .Run (`personal .newAccount("password")` )
143
146
if err != nil {
144
147
t .Errorf ("expected no error, got %v" , err )
145
148
}
@@ -161,7 +164,7 @@ func TestBlockChain(t *testing.T) {
161
164
defer ethereum .Stop ()
162
165
defer os .RemoveAll (tmp )
163
166
// get current block dump before export/import.
164
- val , err := repl .re .Run ("JSON.stringify(admin. debug.dumpBlock())" )
167
+ val , err := repl .re .Run ("JSON.stringify(debug.dumpBlock(eth.blockNumber ))" )
165
168
if err != nil {
166
169
t .Errorf ("expected no error, got %v" , err )
167
170
}
@@ -178,14 +181,14 @@ func TestBlockChain(t *testing.T) {
178
181
179
182
ethereum .ChainManager ().Reset ()
180
183
181
- checkEvalJSON (t , repl , `admin.export (` + tmpfileq + `)` , `true` )
184
+ checkEvalJSON (t , repl , `admin.exportChain (` + tmpfileq + `)` , `true` )
182
185
if _ , err := os .Stat (tmpfile ); err != nil {
183
186
t .Fatal (err )
184
187
}
185
188
186
189
// check import, verify that dumpBlock gives the same result.
187
- checkEvalJSON (t , repl , `admin.import (` + tmpfileq + `)` , `true` )
188
- checkEvalJSON (t , repl , `admin. debug.dumpBlock()` , beforeExport )
190
+ checkEvalJSON (t , repl , `admin.importChain (` + tmpfileq + `)` , `true` )
191
+ checkEvalJSON (t , repl , `debug.dumpBlock(eth.blockNumber )` , beforeExport )
189
192
}
190
193
191
194
func TestMining (t * testing.T ) {
0 commit comments