aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ethutil/script.go23
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
-}