From 1cd7d4456b80c38f343cb54a624408c28c5acb13 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 16 Apr 2014 04:08:25 +0200 Subject: Updated to use new state object --- ethereum/dev_console.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'ethereum/dev_console.go') 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) -- cgit