aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/packages.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-22 20:12:01 +0800
committerobscuren <geffobscura@gmail.com>2015-02-22 20:12:01 +0800
commit483d96a89d68023360d211ab329400f4b960fe48 (patch)
tree985a6cd9d713cb36e57064da5b465d8810bc42d0 /rpc/packages.go
parentbba7ccb07f08e0c6ad404abfb363deaec1db5fab (diff)
downloadgo-tangerine-483d96a89d68023360d211ab329400f4b960fe48.tar
go-tangerine-483d96a89d68023360d211ab329400f4b960fe48.tar.gz
go-tangerine-483d96a89d68023360d211ab329400f4b960fe48.tar.bz2
go-tangerine-483d96a89d68023360d211ab329400f4b960fe48.tar.lz
go-tangerine-483d96a89d68023360d211ab329400f4b960fe48.tar.xz
go-tangerine-483d96a89d68023360d211ab329400f4b960fe48.tar.zst
go-tangerine-483d96a89d68023360d211ab329400f4b960fe48.zip
Added eth_logs & fixed issue with manual log filtering
* Implemented `eth_logs` * Fixed issue with `filter.Find()` where logs were appended to an incorrect, non-returned slice resulting in no logs found
Diffstat (limited to 'rpc/packages.go')
-rw-r--r--rpc/packages.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/rpc/packages.go b/rpc/packages.go
index aed43cae2..b51bde7ce 100644
--- a/rpc/packages.go
+++ b/rpc/packages.go
@@ -167,6 +167,15 @@ func (self *EthereumApi) Logs(id int, reply *interface{}) error {
return nil
}
+func (self *EthereumApi) AllLogs(args *FilterOptions, reply *interface{}) error {
+ filter := core.NewFilter(self.xeth.Backend())
+ filter.SetOptions(toFilterOptions(args))
+
+ *reply = toLogs(filter.Find())
+
+ return nil
+}
+
func (p *EthereumApi) GetBlock(args *GetBlockArgs, reply *interface{}) error {
err := args.requirements()
if err != nil {
@@ -509,6 +518,12 @@ func (p *EthereumApi) GetRequestReply(req *RpcRequest, reply *interface{}) error
return err
}
return p.Logs(args, reply)
+ case "eth_logs":
+ args, err := req.ToFilterArgs()
+ if err != nil {
+ return err
+ }
+ return p.AllLogs(args, reply)
case "eth_gasPrice":
*reply = defaultGasPrice
return nil