From b89ed8eb7bc9ced4a7daa33cc81e1579a6d2ddfc Mon Sep 17 00:00:00 2001 From: zelig Date: Sun, 14 Dec 2014 18:12:27 +0000 Subject: adapt javascript pkg to new backend, use SuggestPeer --- javascript/javascript_runtime.go | 4 ++-- javascript/types.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'javascript') diff --git a/javascript/javascript_runtime.go b/javascript/javascript_runtime.go index 84d61d405..169ed509e 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" @@ -202,7 +202,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..cf5a6677b 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" -- cgit v1.2.3 From 780abaec988df302e0c98f1a35e9af35b5623746 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 23 Dec 2014 18:35:36 +0100 Subject: Switched to new trie --- javascript/types.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'javascript') diff --git a/javascript/types.go b/javascript/types.go index cf5a6677b..ce1d9995a 100644 --- a/javascript/types.go +++ b/javascript/types.go @@ -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() } -- cgit v1.2.3