diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-23 20:37:03 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-23 20:37:03 +0800 |
commit | d35380c19e5ce92b57158e7780f7105dc4136916 (patch) | |
tree | 44b358714448d492dcf8cdcddb4d1e6e57c4318b | |
parent | 5f8911f7cba2cf837d891735f46b02b34e4fc228 (diff) | |
download | go-tangerine-d35380c19e5ce92b57158e7780f7105dc4136916.tar.gz go-tangerine-d35380c19e5ce92b57158e7780f7105dc4136916.tar.zst go-tangerine-d35380c19e5ce92b57158e7780f7105dc4136916.zip |
New main script through init return value
-rw-r--r-- | ethereal/ui/gui.go | 5 | ||||
-rw-r--r-- | ethereal/ui/ui_lib.go | 2 | ||||
-rw-r--r-- | ethereum/config.go | 3 | ||||
-rw-r--r-- | ethereum/repl.go | 15 | ||||
-rw-r--r-- | ethereum/repl_darwin.go | 2 |
5 files changed, 17 insertions, 10 deletions
diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go index 7290bd6ec..022f192bf 100644 --- a/ethereal/ui/gui.go +++ b/ethereal/ui/gui.go @@ -9,7 +9,6 @@ import ( "github.com/ethereum/eth-go/ethpub" "github.com/ethereum/eth-go/ethutil" "github.com/go-qml/qml" - "github.com/obscuren/mutan" "math/big" "strings" ) @@ -262,7 +261,7 @@ func (gui *Gui) Transact(recipient, value, gas, gasPrice, data string) (*ethpub. func (gui *Gui) Create(recipient, value, gas, gasPrice, data string) (*ethpub.PReceipt, error) { keyPair := ethutil.GetKeyRing().Get(0) - mainInput, initInput := mutan.PreParse(data) + //mainInput, initInput := mutan.PreParse(data) - return gui.pub.Create(ethutil.Hex(keyPair.PrivateKey), value, gas, gasPrice, initInput, mainInput) + return gui.pub.Create(ethutil.Hex(keyPair.PrivateKey), value, gas, gasPrice, data) } diff --git a/ethereal/ui/ui_lib.go b/ethereal/ui/ui_lib.go index 0c43f1675..1c88b0181 100644 --- a/ethereal/ui/ui_lib.go +++ b/ethereal/ui/ui_lib.go @@ -135,7 +135,7 @@ func (ui *UiLib) DebugTx(recipient, valueStr, gasStr, gasPriceStr, data string) for _, str := range dis { ui.win.Root().Call("setAsm", str) } - callerTx := ethchain.NewContractCreationTx(ethutil.Big(valueStr), ethutil.Big(gasStr), ethutil.Big(gasPriceStr), callerScript, nil) + callerTx := ethchain.NewContractCreationTx(ethutil.Big(valueStr), ethutil.Big(gasStr), ethutil.Big(gasPriceStr), nil) // Contract addr as test address keyPair := ethutil.GetKeyRing().Get(0) diff --git a/ethereum/config.go b/ethereum/config.go index f39f3b7da..5da910f2b 100644 --- a/ethereum/config.go +++ b/ethereum/config.go @@ -31,7 +31,7 @@ func Init() { flag.PrintDefaults() } - flag.StringVar(&Identifier, "i", "", "Custom client identifier") + flag.StringVar(&Identifier, "i", "", "custom client identifier") flag.BoolVar(&StartMining, "m", false, "start dagger mining") flag.BoolVar(&ShowGenesis, "g", false, "prints genesis header and exits") flag.BoolVar(&StartRpc, "r", false, "start rpc server") @@ -47,7 +47,6 @@ func Init() { flag.StringVar(&ImportKey, "import", "", "imports the given private key (hex)") flag.IntVar(&MaxPeer, "x", 10, "maximum desired peers") flag.BoolVar(&StartJsConsole, "js", false, "exp") - //flag.StringVar(&InputFile, "e", "", "Run javascript file") flag.Parse() diff --git a/ethereum/repl.go b/ethereum/repl.go index d1243d19c..10f51675e 100644 --- a/ethereum/repl.go +++ b/ethereum/repl.go @@ -48,13 +48,22 @@ func (self *JSRepl) parseInput(code string) { // The JSEthereum object attempts to wrap the PEthereum object and returns // meaningful javascript objects +type JSBlock struct { + *ethpub.PBlock + eth *JSEthereum +} + +func (self *JSBlock) GetTransaction(hash string) otto.Value { + return self.eth.toVal(self.PBlock.GetTransaction(hash)) +} + type JSEthereum struct { *ethpub.PEthereum vm *otto.Otto } func (self *JSEthereum) GetBlock(hash string) otto.Value { - return self.toVal(self.PEthereum.GetBlock(hash)) + return self.toVal(&JSBlock{self.PEthereum.GetBlock(hash), self}) } func (self *JSEthereum) GetKey() otto.Value { @@ -76,8 +85,8 @@ func (self *JSEthereum) Transact(key, recipient, valueStr, gasStr, gasPriceStr, return self.toVal(r) } -func (self *JSEthereum) Create(key, valueStr, gasStr, gasPriceStr, initStr, bodyStr string) otto.Value { - r, err := self.PEthereum.Create(key, valueStr, gasStr, gasPriceStr, initStr, bodyStr) +func (self *JSEthereum) Create(key, valueStr, gasStr, gasPriceStr, scriptStr string) otto.Value { + r, err := self.PEthereum.Create(key, valueStr, gasStr, gasPriceStr, scriptStr) if err != nil { fmt.Println(err) diff --git a/ethereum/repl_darwin.go b/ethereum/repl_darwin.go index fa36b0d52..b61d4edd7 100644 --- a/ethereum/repl_darwin.go +++ b/ethereum/repl_darwin.go @@ -102,7 +102,7 @@ L: break L } - addHistory(str) //allow user to recall this line + addHistory(str[:len(str)-1]) //allow user to recall this line self.parseInput(str) |