@@ -113,6 +113,13 @@ func (self *EthereumApi) NewFilter(args *FilterOptions, reply *interface{}) erro
113
113
return nil
114
114
}
115
115
116
+ func (self * EthereumApi ) UninstallFilter (id int , reply * interface {}) error {
117
+ delete (self .logs , id )
118
+ self .filterManager .UninstallFilter (id )
119
+ * reply = true
120
+ return nil
121
+ }
122
+
116
123
func (self * EthereumApi ) NewFilterString (args string , reply * interface {}) error {
117
124
var id int
118
125
filter := core .NewFilter (self .xeth .Backend ())
@@ -273,6 +280,11 @@ func (p *EthereumApi) GetIsMining(reply *interface{}) error {
273
280
return nil
274
281
}
275
282
283
+ func (p * EthereumApi ) SetMining (shouldmine bool , reply * interface {}) error {
284
+ * reply = p .xeth .SetMining (shouldmine )
285
+ return nil
286
+ }
287
+
276
288
func (p * EthereumApi ) BlockNumber (reply * interface {}) error {
277
289
* reply = p .xeth .Backend ().ChainManager ().CurrentBlock ().Number ()
278
290
return nil
@@ -306,6 +318,21 @@ func (p *EthereumApi) GetCodeAt(args *GetCodeAtArgs, reply *interface{}) error {
306
318
return nil
307
319
}
308
320
321
+ func (p * EthereumApi ) GetCompilers (reply * interface {}) error {
322
+ c := []string {"serpent" }
323
+ * reply = c
324
+ return nil
325
+ }
326
+
327
+ func (p * EthereumApi ) CompileSerpent (script string , reply * interface {}) error {
328
+ res , err := ethutil .Compile (script , false )
329
+ if err != nil {
330
+ return err
331
+ }
332
+ * reply = res
333
+ return nil
334
+ }
335
+
309
336
func (p * EthereumApi ) Sha3 (args * Sha3Args , reply * interface {}) error {
310
337
* reply = toHex (crypto .Sha3 (fromHex (args .Data )))
311
338
return nil
@@ -394,6 +421,12 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
394
421
return p .GetIsListening (reply )
395
422
case "eth_mining" :
396
423
return p .GetIsMining (reply )
424
+ case "eth_setMining" :
425
+ args , err := req .ToBoolArgs ()
426
+ if err != nil {
427
+ return err
428
+ }
429
+ return p .SetMining (args , reply )
397
430
case "eth_peerCount" :
398
431
return p .GetPeerCount (reply )
399
432
case "eth_number" :
@@ -460,6 +493,12 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
460
493
return err
461
494
}
462
495
return p .NewFilterString (args , reply )
496
+ case "eth_uninstallFilter" :
497
+ args , err := req .ToUninstallFilterArgs ()
498
+ if err != nil {
499
+ return err
500
+ }
501
+ return p .UninstallFilter (args , reply )
463
502
case "eth_changed" :
464
503
args , err := req .ToIdArgs ()
465
504
if err != nil {
@@ -493,6 +532,14 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
493
532
return err
494
533
}
495
534
return p .WatchTx (args , reply )
535
+ case "eth_compilers" :
536
+ return p .GetCompilers (reply )
537
+ case "eth_serpent" :
538
+ args , err := req .ToCompileArgs ()
539
+ if err != nil {
540
+ return err
541
+ }
542
+ return p .CompileSerpent (args , reply )
496
543
case "web3_sha3" :
497
544
args , err := req .ToSha3Args ()
498
545
if err != nil {
0 commit comments