aboutsummaryrefslogtreecommitdiffstats
path: root/javascript
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-02 17:30:27 +0800
committerobscuren <geffobscura@gmail.com>2015-01-02 17:30:27 +0800
commit0fb1bcd32192b8bf05a328b955a08da4cefe0180 (patch)
tree67460b927eb41b2876e8e6b7eb9dece494dbd088 /javascript
parent8da07e91e40c1d1bb43763b7e959ae92e5770af2 (diff)
parenta4dc12f12c7a06f5e28d5b1e760249875ef7a8c5 (diff)
downloadgo-tangerine-0fb1bcd32192b8bf05a328b955a08da4cefe0180.tar
go-tangerine-0fb1bcd32192b8bf05a328b955a08da4cefe0180.tar.gz
go-tangerine-0fb1bcd32192b8bf05a328b955a08da4cefe0180.tar.bz2
go-tangerine-0fb1bcd32192b8bf05a328b955a08da4cefe0180.tar.lz
go-tangerine-0fb1bcd32192b8bf05a328b955a08da4cefe0180.tar.xz
go-tangerine-0fb1bcd32192b8bf05a328b955a08da4cefe0180.tar.zst
go-tangerine-0fb1bcd32192b8bf05a328b955a08da4cefe0180.zip
Merge branch 'poc8' into docbranch
Diffstat (limited to 'javascript')
-rw-r--r--javascript/javascript_runtime.go4
-rw-r--r--javascript/types.go10
2 files changed, 7 insertions, 7 deletions
diff --git a/javascript/javascript_runtime.go b/javascript/javascript_runtime.go
index a26f0154e..af1405049 100644
--- a/javascript/javascript_runtime.go
+++ b/javascript/javascript_runtime.go
@@ -7,10 +7,10 @@ import (
"path"
"path/filepath"
- "github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
+ "github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
@@ -203,7 +203,7 @@ func (self *JSRE) addPeer(call otto.FunctionCall) otto.Value {
if err != nil {
return otto.FalseValue()
}
- self.ethereum.ConnectToPeer(host)
+ self.ethereum.SuggestPeer(host)
return otto.TrueValue()
}
diff --git a/javascript/types.go b/javascript/types.go
index d5acaecce..ce1d9995a 100644
--- a/javascript/types.go
+++ b/javascript/types.go
@@ -3,7 +3,7 @@ package javascript
import (
"fmt"
- "github.com/ethereum/go-ethereum"
+ "github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/ui"
@@ -18,11 +18,11 @@ type JSStateObject struct {
func (self *JSStateObject) EachStorage(call otto.FunctionCall) otto.Value {
cb := call.Argument(0)
- self.JSObject.EachStorage(func(key string, value *ethutil.Value) {
- value.Decode()
- cb.Call(self.eth.toVal(self), self.eth.toVal(key), self.eth.toVal(ethutil.Bytes2Hex(value.Bytes())))
- })
+ it := self.JSObject.Trie().Iterator()
+ for it.Next() {
+ cb.Call(self.eth.toVal(self), self.eth.toVal(ethutil.Bytes2Hex(it.Key)), self.eth.toVal(ethutil.Bytes2Hex(it.Value)))
+ }
return otto.UndefinedValue()
}