From 872b2497114209119becf2e8a4d4a5818e2084ee Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 28 Jan 2015 18:35:49 +0100 Subject: further cleaned up xeth interface --- javascript/javascript_runtime.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'javascript/javascript_runtime.go') diff --git a/javascript/javascript_runtime.go b/javascript/javascript_runtime.go index adc9022b7..c780eb754 100644 --- a/javascript/javascript_runtime.go +++ b/javascript/javascript_runtime.go @@ -24,7 +24,7 @@ var jsrelogger = logger.NewLogger("JSRE") type JSRE struct { ethereum *eth.Ethereum Vm *otto.Otto - pipe *xeth.JSXEth + pipe *xeth.XEth events event.Subscription @@ -49,7 +49,7 @@ func NewJSRE(ethereum *eth.Ethereum) *JSRE { re := &JSRE{ ethereum, otto.New(), - xeth.NewJSXEth(ethereum), + xeth.New(ethereum), nil, make(map[string][]otto.Value), } -- cgit v1.2.3 From 84adf77bf3492351de82f0ec820a1d280e85a5cd Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 29 Jan 2015 13:10:34 +0100 Subject: Added RPC "Call" for JS calls to contracts --- javascript/javascript_runtime.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'javascript/javascript_runtime.go') diff --git a/javascript/javascript_runtime.go b/javascript/javascript_runtime.go index c780eb754..398daf43a 100644 --- a/javascript/javascript_runtime.go +++ b/javascript/javascript_runtime.go @@ -58,8 +58,7 @@ func NewJSRE(ethereum *eth.Ethereum) *JSRE { re.Vm.Run(jsLib) // Load extra javascript files - re.LoadIntFile("string.js") - re.LoadIntFile("big.js") + re.LoadIntFile("bignumber.min.js") // Subscribe to events mux := ethereum.EventMux() -- cgit v1.2.3 From 56f777b2fc77275bc636562b66a08b19afe2ec56 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 5 Feb 2015 03:16:16 +0100 Subject: cmd/ethereum, cmd/mist, core, eth, javascript, xeth: fixes for new p2p API --- javascript/javascript_runtime.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'javascript/javascript_runtime.go') diff --git a/javascript/javascript_runtime.go b/javascript/javascript_runtime.go index 398daf43a..a09aff027 100644 --- a/javascript/javascript_runtime.go +++ b/javascript/javascript_runtime.go @@ -14,6 +14,7 @@ import ( "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/logger" + "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/state" "github.com/ethereum/go-ethereum/xeth" "github.com/obscuren/otto" @@ -201,8 +202,15 @@ func (self *JSRE) addPeer(call otto.FunctionCall) otto.Value { if err != nil { return otto.FalseValue() } - self.ethereum.SuggestPeer(host) - + idstr, err := call.Argument(0).ToString() + if err != nil { + return otto.FalseValue() + } + id, err := discover.HexID(idstr) + if err != nil { + return otto.FalseValue() + } + self.ethereum.SuggestPeer(host, id) return otto.TrueValue() } -- cgit v1.2.3 From 2cf4fed11b01bb99e08b838f7df2b9396f42f758 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Sat, 7 Feb 2015 00:15:04 +0100 Subject: cmd/mist, eth, javascript, p2p: use Node URLs for peer suggestions --- javascript/javascript_runtime.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'javascript/javascript_runtime.go') diff --git a/javascript/javascript_runtime.go b/javascript/javascript_runtime.go index a09aff027..0aa0f73e2 100644 --- a/javascript/javascript_runtime.go +++ b/javascript/javascript_runtime.go @@ -14,7 +14,6 @@ import ( "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/logger" - "github.com/ethereum/go-ethereum/p2p/discover" "github.com/ethereum/go-ethereum/state" "github.com/ethereum/go-ethereum/xeth" "github.com/obscuren/otto" @@ -198,19 +197,13 @@ func (self *JSRE) watch(call otto.FunctionCall) otto.Value { } func (self *JSRE) addPeer(call otto.FunctionCall) otto.Value { - host, err := call.Argument(0).ToString() + nodeURL, err := call.Argument(0).ToString() if err != nil { return otto.FalseValue() } - idstr, err := call.Argument(0).ToString() - if err != nil { - return otto.FalseValue() - } - id, err := discover.HexID(idstr) - if err != nil { + if err := self.ethereum.SuggestPeer(nodeURL); err != nil { return otto.FalseValue() } - self.ethereum.SuggestPeer(host, id) return otto.TrueValue() } -- cgit v1.2.3