aboutsummaryrefslogtreecommitdiffstats
path: root/javascript
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-10-31 21:30:08 +0800
committerobscuren <geffobscura@gmail.com>2014-10-31 21:30:08 +0800
commit0ed1a8b50a9b9726cd57a2731d0405f6949c6188 (patch)
tree9f877ecdc89b784cd2820db8ca3f1de6e9c4d3e9 /javascript
parent8826e9694c3a8d4f480f0a021d8c02f7f61612c6 (diff)
downloaddexon-0ed1a8b50a9b9726cd57a2731d0405f6949c6188.tar
dexon-0ed1a8b50a9b9726cd57a2731d0405f6949c6188.tar.gz
dexon-0ed1a8b50a9b9726cd57a2731d0405f6949c6188.tar.bz2
dexon-0ed1a8b50a9b9726cd57a2731d0405f6949c6188.tar.lz
dexon-0ed1a8b50a9b9726cd57a2731d0405f6949c6188.tar.xz
dexon-0ed1a8b50a9b9726cd57a2731d0405f6949c6188.tar.zst
dexon-0ed1a8b50a9b9726cd57a2731d0405f6949c6188.zip
ethpipe => xeth (eXtended ETHereum)
Diffstat (limited to 'javascript')
-rw-r--r--javascript/javascript_runtime.go6
-rw-r--r--javascript/types.go22
2 files changed, 14 insertions, 14 deletions
diff --git a/javascript/javascript_runtime.go b/javascript/javascript_runtime.go
index deb6fe305..5885e5c6e 100644
--- a/javascript/javascript_runtime.go
+++ b/javascript/javascript_runtime.go
@@ -10,11 +10,11 @@ import (
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/chain"
"github.com/ethereum/go-ethereum/cmd/utils"
- "github.com/ethereum/go-ethereum/ethpipe"
"github.com/ethereum/go-ethereum/ethstate"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/logger"
+ "github.com/ethereum/go-ethereum/xeth"
"github.com/obscuren/otto"
)
@@ -23,7 +23,7 @@ var jsrelogger = logger.NewLogger("JSRE")
type JSRE struct {
ethereum *eth.Ethereum
Vm *otto.Otto
- pipe *ethpipe.JSPipe
+ pipe *xeth.JSXEth
events event.Subscription
@@ -48,7 +48,7 @@ func NewJSRE(ethereum *eth.Ethereum) *JSRE {
re := &JSRE{
ethereum,
otto.New(),
- ethpipe.NewJSPipe(ethereum),
+ xeth.NewJSXEth(ethereum),
nil,
make(map[string][]otto.Value),
}
diff --git a/javascript/types.go b/javascript/types.go
index b02ee9dc2..a98c48905 100644
--- a/javascript/types.go
+++ b/javascript/types.go
@@ -4,15 +4,15 @@ import (
"fmt"
"github.com/ethereum/go-ethereum"
- "github.com/ethereum/go-ethereum/ethpipe"
"github.com/ethereum/go-ethereum/ethstate"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/ui"
+ "github.com/ethereum/go-ethereum/xeth"
"github.com/obscuren/otto"
)
type JSStateObject struct {
- *ethpipe.JSObject
+ *xeth.JSObject
eth *JSEthereum
}
@@ -30,7 +30,7 @@ func (self *JSStateObject) EachStorage(call otto.FunctionCall) otto.Value {
// The JSEthereum object attempts to wrap the PEthereum object and returns
// meaningful javascript objects
type JSBlock struct {
- *ethpipe.JSBlock
+ *xeth.JSBlock
eth *JSEthereum
}
@@ -67,33 +67,33 @@ func NewJSMessage(message *ethstate.Message) JSMessage {
}
type JSEthereum struct {
- *ethpipe.JSPipe
+ *xeth.JSXEth
vm *otto.Otto
ethereum *eth.Ethereum
}
func (self *JSEthereum) GetBlock(hash string) otto.Value {
- return self.toVal(&JSBlock{self.JSPipe.BlockByHash(hash), self})
+ return self.toVal(&JSBlock{self.JSXEth.BlockByHash(hash), self})
}
func (self *JSEthereum) GetPeers() otto.Value {
- return self.toVal(self.JSPipe.Peers())
+ return self.toVal(self.JSXEth.Peers())
}
func (self *JSEthereum) GetKey() otto.Value {
- return self.toVal(self.JSPipe.Key())
+ return self.toVal(self.JSXEth.Key())
}
func (self *JSEthereum) GetStateObject(addr string) otto.Value {
- return self.toVal(&JSStateObject{ethpipe.NewJSObject(self.JSPipe.World().SafeGet(ethutil.Hex2Bytes(addr))), self})
+ return self.toVal(&JSStateObject{xeth.NewJSObject(self.JSXEth.World().SafeGet(ethutil.Hex2Bytes(addr))), self})
}
func (self *JSEthereum) Peers() otto.Value {
- return self.toVal(self.JSPipe.Peers())
+ return self.toVal(self.JSXEth.Peers())
}
func (self *JSEthereum) Transact(key, recipient, valueStr, gasStr, gasPriceStr, dataStr string) otto.Value {
- r, err := self.JSPipe.Transact(key, recipient, valueStr, gasStr, gasPriceStr, dataStr)
+ r, err := self.JSXEth.Transact(key, recipient, valueStr, gasStr, gasPriceStr, dataStr)
if err != nil {
fmt.Println(err)
@@ -104,7 +104,7 @@ func (self *JSEthereum) Transact(key, recipient, valueStr, gasStr, gasPriceStr,
}
func (self *JSEthereum) Create(key, valueStr, gasStr, gasPriceStr, scriptStr string) otto.Value {
- r, err := self.JSPipe.Transact(key, "", valueStr, gasStr, gasPriceStr, scriptStr)
+ r, err := self.JSXEth.Transact(key, "", valueStr, gasStr, gasPriceStr, scriptStr)
if err != nil {
fmt.Println(err)