@@ -322,14 +322,13 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
322
322
return err
323
323
}
324
324
325
- id := api .xeth ().RegisterFilter (args .Earliest , args .Latest , args .Skip , args .Max , args .Address , args .Topics )
325
+ id := api .xeth ().NewLogFilter (args .Earliest , args .Latest , args .Skip , args .Max , args .Address , args .Topics )
326
326
* reply = newHexNum (big .NewInt (int64 (id )).Bytes ())
327
+
327
328
case "eth_newBlockFilter" :
328
- args := new (FilterStringArgs )
329
- if err := json .Unmarshal (req .Params , & args ); err != nil {
330
- return err
331
- }
332
- * reply = newHexNum (api .xeth ().NewFilterString (args .Word ))
329
+ * reply = newHexNum (api .xeth ().NewBlockFilter ())
330
+ case "eth_newPendingTransactionFilter" :
331
+ * reply = newHexNum (api .xeth ().NewTransactionFilter ())
333
332
case "eth_uninstallFilter" :
334
333
args := new (FilterIdArgs )
335
334
if err := json .Unmarshal (req .Params , & args ); err != nil {
@@ -341,7 +340,17 @@ func (api *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) err
341
340
if err := json .Unmarshal (req .Params , & args ); err != nil {
342
341
return err
343
342
}
344
- * reply = NewLogsRes (api .xeth ().FilterChanged (args .Id ))
343
+
344
+ switch api .xeth ().GetFilterType (args .Id ) {
345
+ case xeth .BlockFilterTy :
346
+ * reply = NewHashesRes (api .xeth ().BlockFilterChanged (args .Id ))
347
+ case xeth .TransactionFilterTy :
348
+ * reply = NewHashesRes (api .xeth ().TransactionFilterChanged (args .Id ))
349
+ case xeth .LogFilterTy :
350
+ * reply = NewLogsRes (api .xeth ().LogFilterChanged (args .Id ))
351
+ default :
352
+ * reply = []string {} // reply empty string slice
353
+ }
345
354
case "eth_getFilterLogs" :
346
355
args := new (FilterIdArgs )
347
356
if err := json .Unmarshal (req .Params , & args ); err != nil {
0 commit comments