From a6c4543c575b52b943ff54f74c9d650d73175fe0 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 15 Aug 2014 13:16:07 +0200 Subject: Moving over to ethpipe --- javascript/types.go | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'javascript') diff --git a/javascript/types.go b/javascript/types.go index fb1e54ae7..375e7b24c 100644 --- a/javascript/types.go +++ b/javascript/types.go @@ -128,37 +128,7 @@ func (self *JSEthereum) toVal(v interface{}) otto.Value { } func (self *JSEthereum) Messages(object map[string]interface{}) otto.Value { - filter := ethchain.NewFilter(self.ethereum) - - if object["earliest"] != nil { - earliest := object["earliest"] - if e, ok := earliest.(string); ok { - filter.SetEarliestBlock(ethutil.Hex2Bytes(e)) - } else { - filter.SetEarliestBlock(earliest) - } - } - - if object["latest"] != nil { - latest := object["latest"] - if l, ok := latest.(string); ok { - filter.SetLatestBlock(ethutil.Hex2Bytes(l)) - } else { - filter.SetLatestBlock(latest) - } - } - if object["to"] != nil { - filter.AddTo(ethutil.Hex2Bytes(object["to"].(string))) - } - if object["from"] != nil { - filter.AddFrom(ethutil.Hex2Bytes(object["from"].(string))) - } - if object["max"] != nil { - filter.SetMax(object["max"].(int)) - } - if object["skip"] != nil { - filter.SetSkip(object["skip"].(int)) - } + filter := ethchain.NewFilterFromMap(object, self.ethereum) messages := filter.Find() var msgs []JSMessage -- cgit v1.2.3