diff options
author | obscuren <geffobscura@gmail.com> | 2014-10-31 21:30:08 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-10-31 21:30:08 +0800 |
commit | 0ed1a8b50a9b9726cd57a2731d0405f6949c6188 (patch) | |
tree | 9f877ecdc89b784cd2820db8ca3f1de6e9c4d3e9 /cmd | |
parent | 8826e9694c3a8d4f480f0a021d8c02f7f61612c6 (diff) | |
download | dexon-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 'cmd')
-rw-r--r-- | cmd/mist/bindings.go | 4 | ||||
-rw-r--r-- | cmd/mist/ext_app.go | 6 | ||||
-rw-r--r-- | cmd/mist/gui.go | 22 | ||||
-rw-r--r-- | cmd/mist/html_container.go | 4 | ||||
-rw-r--r-- | cmd/mist/qml_container.go | 4 | ||||
-rw-r--r-- | cmd/mist/ui_lib.go | 16 | ||||
-rw-r--r-- | cmd/utils/cmd.go | 4 | ||||
-rw-r--r-- | cmd/utils/websockets.go | 4 |
8 files changed, 32 insertions, 32 deletions
diff --git a/cmd/mist/bindings.go b/cmd/mist/bindings.go index f5a0dfcff..196fd38a1 100644 --- a/cmd/mist/bindings.go +++ b/cmd/mist/bindings.go @@ -24,9 +24,9 @@ import ( "github.com/ethereum/go-ethereum/chain" "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/ethpipe" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/logger" + "github.com/ethereum/go-ethereum/xeth" ) type plugin struct { @@ -46,7 +46,7 @@ func (gui *Gui) LogPrint(level logger.LogLevel, msg string) { } */ } -func (gui *Gui) Transact(recipient, value, gas, gasPrice, d string) (*ethpipe.JSReceipt, error) { +func (gui *Gui) Transact(recipient, value, gas, gasPrice, d string) (*xeth.JSReceipt, error) { var data string if len(recipient) == 0 { code, err := ethutil.Compile(d, false) diff --git a/cmd/mist/ext_app.go b/cmd/mist/ext_app.go index 8af9778bc..4a3ab1d2c 100644 --- a/cmd/mist/ext_app.go +++ b/cmd/mist/ext_app.go @@ -21,11 +21,11 @@ import ( "encoding/json" "github.com/ethereum/go-ethereum/chain" - "github.com/ethereum/go-ethereum/ethpipe" "github.com/ethereum/go-ethereum/ethstate" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/javascript" "github.com/ethereum/go-ethereum/ui/qt" + "github.com/ethereum/go-ethereum/xeth" "gopkg.in/qml.v1" ) @@ -43,7 +43,7 @@ type AppContainer interface { } type ExtApplication struct { - *ethpipe.JSPipe + *xeth.JSXEth eth chain.EthManager events event.Subscription @@ -57,7 +57,7 @@ type ExtApplication struct { func NewExtApplication(container AppContainer, lib *UiLib) *ExtApplication { return &ExtApplication{ - JSPipe: ethpipe.NewJSPipe(lib.eth), + JSXEth: xeth.NewJSXEth(lib.eth), eth: lib.eth, watcherQuitChan: make(chan bool), filters: make(map[string]*chain.Filter), diff --git a/cmd/mist/gui.go b/cmd/mist/gui.go index 4ae92a340..2dfdd104f 100644 --- a/cmd/mist/gui.go +++ b/cmd/mist/gui.go @@ -34,10 +34,10 @@ import ( "github.com/ethereum/go-ethereum/chain" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethminer" - "github.com/ethereum/go-ethereum/ethpipe" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/ethwire" "github.com/ethereum/go-ethereum/logger" + "github.com/ethereum/go-ethereum/xeth" "gopkg.in/qml.v1" ) @@ -84,7 +84,7 @@ type Gui struct { logLevel logger.LogLevel open bool - pipe *ethpipe.JSPipe + pipe *xeth.JSXEth Session string clientIdentity *ethwire.SimpleClientIdentity @@ -103,7 +103,7 @@ func NewWindow(ethereum *eth.Ethereum, config *ethutil.ConfigManager, clientIden panic(err) } - pipe := ethpipe.NewJSPipe(ethereum) + pipe := xeth.NewJSXEth(ethereum) gui := &Gui{eth: ethereum, txDb: db, pipe: pipe, logLevel: logger.LogLevel(logLevel), Session: session, open: false, clientIdentity: clientIdentity, config: config, plugins: make(map[string]plugin)} data, _ := ethutil.ReadAllFile(path.Join(ethutil.Config.ExecPath, "plugins.json")) json.Unmarshal([]byte(data), &gui.plugins) @@ -117,11 +117,11 @@ func (gui *Gui) Start(assetPath string) { // Register ethereum functions qml.RegisterTypes("Ethereum", 1, 0, []qml.TypeSpec{{ - Init: func(p *ethpipe.JSBlock, obj qml.Object) { p.Number = 0; p.Hash = "" }, + Init: func(p *xeth.JSBlock, obj qml.Object) { p.Number = 0; p.Hash = "" }, }, { - Init: func(p *ethpipe.JSTransaction, obj qml.Object) { p.Value = ""; p.Hash = ""; p.Address = "" }, + Init: func(p *xeth.JSTransaction, obj qml.Object) { p.Value = ""; p.Hash = ""; p.Address = "" }, }, { - Init: func(p *ethpipe.KeyVal, obj qml.Object) { p.Key = ""; p.Value = "" }, + Init: func(p *xeth.KeyVal, obj qml.Object) { p.Key = ""; p.Value = "" }, }}) // Create a new QML engine gui.engine = qml.NewEngine() @@ -287,7 +287,7 @@ func (gui *Gui) loadAddressBook() { } func (gui *Gui) insertTransaction(window string, tx *chain.Transaction) { - pipe := ethpipe.New(gui.eth) + pipe := xeth.New(gui.eth) nameReg := pipe.World().Config().Get("NameReg") addr := gui.address() @@ -299,7 +299,7 @@ func (gui *Gui) insertTransaction(window string, tx *chain.Transaction) { } var ( - ptx = ethpipe.NewJSTx(tx, pipe.World().State()) + ptx = xeth.NewJSTx(tx, pipe.World().State()) send = nameReg.Storage(tx.Sender()) rec = nameReg.Storage(tx.Recipient) s, r string @@ -346,7 +346,7 @@ func (gui *Gui) readPreviousTransactions() { func (gui *Gui) processBlock(block *chain.Block, initial bool) { name := strings.Trim(gui.pipe.World().Config().Get("NameReg").Storage(block.Coinbase).Str(), "\x00") - b := ethpipe.NewJSBlock(block) + b := xeth.NewJSBlock(block) b.Name = name gui.getObjectByName("chainView").Call("addBlock", b, initial) @@ -451,12 +451,12 @@ func (gui *Gui) update() { if bytes.Compare(tx.Sender(), gui.address()) == 0 { object.SubAmount(tx.Value) - //gui.getObjectByName("transactionView").Call("addTx", ethpipe.NewJSTx(tx), "send") + //gui.getObjectByName("transactionView").Call("addTx", xeth.NewJSTx(tx), "send") gui.txDb.Put(tx.Hash(), tx.RlpEncode()) } else if bytes.Compare(tx.Recipient, gui.address()) == 0 { object.AddAmount(tx.Value) - //gui.getObjectByName("transactionView").Call("addTx", ethpipe.NewJSTx(tx), "recv") + //gui.getObjectByName("transactionView").Call("addTx", xeth.NewJSTx(tx), "recv") gui.txDb.Put(tx.Hash(), tx.RlpEncode()) } diff --git a/cmd/mist/html_container.go b/cmd/mist/html_container.go index 755d5ea6e..082d65f67 100644 --- a/cmd/mist/html_container.go +++ b/cmd/mist/html_container.go @@ -28,10 +28,10 @@ import ( "path/filepath" "github.com/ethereum/go-ethereum/chain" - "github.com/ethereum/go-ethereum/ethpipe" "github.com/ethereum/go-ethereum/ethstate" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/javascript" + "github.com/ethereum/go-ethereum/xeth" "github.com/howeyc/fsnotify" "gopkg.in/qml.v1" ) @@ -139,7 +139,7 @@ func (app *HtmlApplication) Window() *qml.Window { } func (app *HtmlApplication) NewBlock(block *chain.Block) { - b := ðpipe.JSBlock{Number: int(block.BlockInfo().Number), Hash: ethutil.Bytes2Hex(block.Hash())} + b := &xeth.JSBlock{Number: int(block.BlockInfo().Number), Hash: ethutil.Bytes2Hex(block.Hash())} app.webView.Call("onNewBlockCb", b) } diff --git a/cmd/mist/qml_container.go b/cmd/mist/qml_container.go index 13a50d988..4f6ca0b7f 100644 --- a/cmd/mist/qml_container.go +++ b/cmd/mist/qml_container.go @@ -22,9 +22,9 @@ import ( "runtime" "github.com/ethereum/go-ethereum/chain" - "github.com/ethereum/go-ethereum/ethpipe" "github.com/ethereum/go-ethereum/ethstate" "github.com/ethereum/go-ethereum/ethutil" + "github.com/ethereum/go-ethereum/xeth" "gopkg.in/qml.v1" ) @@ -66,7 +66,7 @@ func (app *QmlApplication) NewWatcher(quitChan chan bool) { // Events func (app *QmlApplication) NewBlock(block *chain.Block) { - pblock := ðpipe.JSBlock{Number: int(block.BlockInfo().Number), Hash: ethutil.Bytes2Hex(block.Hash())} + pblock := &xeth.JSBlock{Number: int(block.BlockInfo().Number), Hash: ethutil.Bytes2Hex(block.Hash())} app.win.Call("onNewBlockCb", pblock) } diff --git a/cmd/mist/ui_lib.go b/cmd/mist/ui_lib.go index 6fffa845f..9d2554cf4 100644 --- a/cmd/mist/ui_lib.go +++ b/cmd/mist/ui_lib.go @@ -27,11 +27,11 @@ import ( "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/chain" "github.com/ethereum/go-ethereum/crypto" - "github.com/ethereum/go-ethereum/ethpipe" "github.com/ethereum/go-ethereum/ethstate" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/javascript" "github.com/ethereum/go-ethereum/ui/qt" + "github.com/ethereum/go-ethereum/xeth" "gopkg.in/qml.v1" ) @@ -42,7 +42,7 @@ type memAddr struct { // UI Library that has some basic functionality exposed type UiLib struct { - *ethpipe.JSPipe + *xeth.JSXEth engine *qml.Engine eth *eth.Ethereum connected bool @@ -58,7 +58,7 @@ type UiLib struct { } func NewUiLib(engine *qml.Engine, eth *eth.Ethereum, assetPath string) *UiLib { - return &UiLib{JSPipe: ethpipe.NewJSPipe(eth), engine: engine, eth: eth, assetPath: assetPath, jsEngine: javascript.NewJSRE(eth), filterCallbacks: make(map[int][]int)} //, filters: make(map[int]*ethpipe.JSFilter)} + return &UiLib{JSXEth: xeth.NewJSXEth(eth), engine: engine, eth: eth, assetPath: assetPath, jsEngine: javascript.NewJSRE(eth), filterCallbacks: make(map[int][]int)} //, filters: make(map[int]*xeth.JSFilter)} } func (self *UiLib) Notef(args []interface{}) { @@ -214,7 +214,7 @@ func (self *UiLib) StartDebugger() { func (self *UiLib) NewFilter(object map[string]interface{}) (id int) { filter := qt.NewFilterFromMap(object, self.eth) filter.MessageCallback = func(messages ethstate.Messages) { - self.win.Root().Call("invokeFilterCallback", ethpipe.ToJSMessages(messages), id) + self.win.Root().Call("invokeFilterCallback", xeth.ToJSMessages(messages), id) } id = self.eth.InstallFilter(filter) return id @@ -232,7 +232,7 @@ func (self *UiLib) NewFilterString(typ string) (id int) { func (self *UiLib) Messages(id int) *ethutil.List { filter := self.eth.GetFilter(id) if filter != nil { - messages := ethpipe.ToJSMessages(filter.Find()) + messages := xeth.ToJSMessages(filter.Find()) return messages } @@ -295,10 +295,10 @@ func mapToTxParams(object map[string]interface{}) map[string]string { return conv } -func (self *UiLib) Transact(params map[string]interface{}) (*ethpipe.JSReceipt, error) { +func (self *UiLib) Transact(params map[string]interface{}) (*xeth.JSReceipt, error) { object := mapToTxParams(params) - return self.JSPipe.Transact( + return self.JSXEth.Transact( object["from"], object["to"], object["value"], @@ -320,7 +320,7 @@ func (self *UiLib) Compile(code string) (string, error) { func (self *UiLib) Call(params map[string]interface{}) (string, error) { object := mapToTxParams(params) - return self.JSPipe.Execute( + return self.JSXEth.Execute( object["to"], object["value"], object["gas"], diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go index 7ee41d042..d9914a6f4 100644 --- a/cmd/utils/cmd.go +++ b/cmd/utils/cmd.go @@ -17,11 +17,11 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethminer" - "github.com/ethereum/go-ethereum/ethpipe" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/ethwire" "github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/rpc" + "github.com/ethereum/go-ethereum/xeth" ) var clilogger = logger.NewLogger("CLI") @@ -244,7 +244,7 @@ func KeyTasks(keyManager *crypto.KeyManager, KeyRing string, GenAddr bool, Secre func StartRpc(ethereum *eth.Ethereum, RpcPort int) { var err error - ethereum.RpcServer, err = rpc.NewJsonRpcServer(ethpipe.NewJSPipe(ethereum), RpcPort) + ethereum.RpcServer, err = rpc.NewJsonRpcServer(xeth.NewJSXEth(ethereum), RpcPort) if err != nil { clilogger.Errorf("Could not start RPC interface (port %v): %v", RpcPort, err) } else { diff --git a/cmd/utils/websockets.go b/cmd/utils/websockets.go index 7bda805ac..d3ba50e78 100644 --- a/cmd/utils/websockets.go +++ b/cmd/utils/websockets.go @@ -2,9 +2,9 @@ package utils import ( "github.com/ethereum/go-ethereum" - "github.com/ethereum/go-ethereum/ethpipe" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/websocket" + "github.com/ethereum/go-ethereum/xeth" ) func args(v ...interface{}) []interface{} { @@ -21,7 +21,7 @@ func NewWebSocketServer(eth *eth.Ethereum) *WebSocketServer { } func (self *WebSocketServer) Serv() { - pipe := ethpipe.NewJSPipe(self.ethereum) + pipe := xeth.NewJSXEth(self.ethereum) wsServ := websocket.NewServer("/eth", ":40404") wsServ.MessageFunc(func(c *websocket.Client, msg *websocket.Message) { |