diff options
author | zelig <viktor.tron@gmail.com> | 2014-06-25 23:58:07 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2014-06-25 23:58:07 +0800 |
commit | 98f1ee9442d3b3d744e25dbddd9b54dc60180ad1 (patch) | |
tree | f05f7be355838fd104f227714082bd9ea89cb591 /ethutil | |
parent | a02edf7a9306c9c0b2f0208152347b47f1a4e689 (diff) | |
parent | b0dc50c2a0e25bf88901f3dd481f14bc3375adc5 (diff) | |
download | go-tangerine-98f1ee9442d3b3d744e25dbddd9b54dc60180ad1.tar go-tangerine-98f1ee9442d3b3d744e25dbddd9b54dc60180ad1.tar.gz go-tangerine-98f1ee9442d3b3d744e25dbddd9b54dc60180ad1.tar.bz2 go-tangerine-98f1ee9442d3b3d744e25dbddd9b54dc60180ad1.tar.lz go-tangerine-98f1ee9442d3b3d744e25dbddd9b54dc60180ad1.tar.xz go-tangerine-98f1ee9442d3b3d744e25dbddd9b54dc60180ad1.tar.zst go-tangerine-98f1ee9442d3b3d744e25dbddd9b54dc60180ad1.zip |
merge upstream
Diffstat (limited to 'ethutil')
-rw-r--r-- | ethutil/script.go | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/ethutil/script.go b/ethutil/script.go index c8b1da51c..235498df2 100644 --- a/ethutil/script.go +++ b/ethutil/script.go @@ -3,6 +3,7 @@ package ethutil import ( "fmt" "github.com/obscuren/mutan" + "github.com/obscuren/mutan/backends" "github.com/obscuren/serpent-go" "strings" ) @@ -19,7 +20,9 @@ func Compile(script string) (ret []byte, err error) { return byteCode, nil } else { - byteCode, errors := mutan.Compile(strings.NewReader(script), false) + compiler := mutan.NewCompiler(backend.NewEthereumBackend()) + byteCode, errors := compiler.Compile(strings.NewReader(script)) + //byteCode, errors := mutan.Compile(strings.NewReader(script), false) if len(errors) > 0 { var errs string for _, er := range errors { @@ -33,21 +36,3 @@ func Compile(script string) (ret []byte, err error) { return byteCode, nil } } - -func CompileScript(script string) ([]byte, []byte, error) { - // Preprocess - mainInput, initInput := mutan.PreParse(script) - // Compile main script - mainScript, err := Compile(mainInput) - if err != nil { - return nil, nil, err - } - - // Compile init script - initScript, err := Compile(initInput) - if err != nil { - return nil, nil, err - } - - return mainScript, initScript, nil -} |