diff options
author | obscuren <geffobscura@gmail.com> | 2014-08-15 19:16:07 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-08-15 19:16:07 +0800 |
commit | a6c4543c575b52b943ff54f74c9d650d73175fe0 (patch) | |
tree | 23473e3076be6b394db680a5149cb8006f00a9db /javascript | |
parent | c362172567e7bd499ea0d0bcf84c54a9b7788614 (diff) | |
download | go-tangerine-a6c4543c575b52b943ff54f74c9d650d73175fe0.tar.gz go-tangerine-a6c4543c575b52b943ff54f74c9d650d73175fe0.tar.zst go-tangerine-a6c4543c575b52b943ff54f74c9d650d73175fe0.zip |
Moving over to ethpipe
Diffstat (limited to 'javascript')
-rw-r--r-- | javascript/types.go | 32 |
1 files changed, 1 insertions, 31 deletions
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 |