aboutsummaryrefslogtreecommitdiffstats
path: root/javascript
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-08-15 19:16:07 +0800
committerobscuren <geffobscura@gmail.com>2014-08-15 19:16:07 +0800
commita6c4543c575b52b943ff54f74c9d650d73175fe0 (patch)
tree23473e3076be6b394db680a5149cb8006f00a9db /javascript
parentc362172567e7bd499ea0d0bcf84c54a9b7788614 (diff)
downloadgo-tangerine-a6c4543c575b52b943ff54f74c9d650d73175fe0.tar
go-tangerine-a6c4543c575b52b943ff54f74c9d650d73175fe0.tar.gz
go-tangerine-a6c4543c575b52b943ff54f74c9d650d73175fe0.tar.bz2
go-tangerine-a6c4543c575b52b943ff54f74c9d650d73175fe0.tar.lz
go-tangerine-a6c4543c575b52b943ff54f74c9d650d73175fe0.tar.xz
go-tangerine-a6c4543c575b52b943ff54f74c9d650d73175fe0.tar.zst
go-tangerine-a6c4543c575b52b943ff54f74c9d650d73175fe0.zip
Moving over to ethpipe
Diffstat (limited to 'javascript')
-rw-r--r--javascript/types.go32
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