diff options
author | obscuren <geffobscura@gmail.com> | 2014-04-16 10:08:25 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-04-16 10:08:25 +0800 |
commit | 1cd7d4456b80c38f343cb54a624408c28c5acb13 (patch) | |
tree | de63c196b7a707a9bbc0787fb7af9992bf628948 /ethereum | |
parent | 6b644c17a7ff2746863c03f2d67b24ae75951256 (diff) | |
download | go-tangerine-1cd7d4456b80c38f343cb54a624408c28c5acb13.tar.gz go-tangerine-1cd7d4456b80c38f343cb54a624408c28c5acb13.tar.zst go-tangerine-1cd7d4456b80c38f343cb54a624408c28c5acb13.zip |
Updated to use new state object
Diffstat (limited to 'ethereum')
-rw-r--r-- | ethereum/dev_console.go | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/ethereum/dev_console.go b/ethereum/dev_console.go index 421c3fa60..0f03b5e53 100644 --- a/ethereum/dev_console.go +++ b/ethereum/dev_console.go @@ -11,8 +11,7 @@ import ( "github.com/ethereum/eth-go/ethdb" "github.com/ethereum/eth-go/ethutil" "github.com/ethereum/eth-go/ethwire" - "github.com/obscuren/mutan" - _ "math/big" + "github.com/ethereum/go-ethereum/utils" "os" "strings" ) @@ -171,7 +170,7 @@ func (i *Console) ParseInput(input string) bool { if err != nil { fmt.Println("recipient err:", err) } else { - tx := ethchain.NewTransactionMessage(recipient, ethutil.Big(tokens[2]), ethutil.Big(tokens[3]), ethutil.Big(tokens[4]), []string{""}) + tx := ethchain.NewTransactionMessage(recipient, ethutil.Big(tokens[2]), ethutil.Big(tokens[3]), ethutil.Big(tokens[4]), nil) key := ethutil.Config.Db.GetKeys()[0] tx.Sign(key.PrivateKey) @@ -190,15 +189,22 @@ func (i *Console) ParseInput(input string) bool { } case "contract": fmt.Println("Contract editor (Ctrl-D = done)") - asm, err := mutan.Compile(strings.NewReader(i.Editor()), false) + + mainInput, initInput := ethutil.PreProcess(i.Editor()) + mainScript, err := utils.Compile(mainInput) if err != nil { fmt.Println(err) + break } + initScript, err := utils.Compile(initInput) + if err != nil { + fmt.Println(err) - code := ethutil.Assemble(asm) + break + } - contract := ethchain.NewContractCreationTx(ethutil.Big(tokens[0]), ethutil.Big(tokens[1]), code) + contract := ethchain.NewContractCreationTx(ethutil.Big(tokens[0]), ethutil.Big(tokens[1]), mainScript, initScript) key := ethutil.Config.Db.GetKeys()[0] contract.Sign(key.PrivateKey) |