diff --git a/cli/smartcontract/smart_contract.go b/cli/smartcontract/smart_contract.go index 9328a8f4d..24a1373f0 100644 --- a/cli/smartcontract/smart_contract.go +++ b/cli/smartcontract/smart_contract.go @@ -266,7 +266,7 @@ func inspect(ctx *cli.Context) error { return cli.NewExitError(err, 1) } if compile { - b, err = compiler.Compile(bytes.NewReader(b), &compiler.Options{}) + b, err = compiler.Compile(bytes.NewReader(b)) if err != nil { return cli.NewExitError(errors.Wrap(err, "failed to compile"), 1) } diff --git a/pkg/vm/cli/cli.go b/pkg/vm/cli/cli.go index 3083e0b6e..e4e2115ba 100644 --- a/pkg/vm/cli/cli.go +++ b/pkg/vm/cli/cli.go @@ -259,7 +259,7 @@ func handleLoadGo(c *ishell.Context) { c.Err(err) return } - b, err := compiler.Compile(bytes.NewReader(fb), &compiler.Options{}) + b, err := compiler.Compile(bytes.NewReader(fb)) if err != nil { c.Err(err) return diff --git a/pkg/vm/compiler/compiler.go b/pkg/vm/compiler/compiler.go index 7973efa8a..5ead0d34a 100644 --- a/pkg/vm/compiler/compiler.go +++ b/pkg/vm/compiler/compiler.go @@ -37,7 +37,7 @@ type buildInfo struct { } // Compile compiles a Go program into bytecode that can run on the NEO virtual machine. -func Compile(r io.Reader, o *Options) ([]byte, error) { +func Compile(r io.Reader) ([]byte, error) { conf := loader.Config{ParserMode: parser.ParseComments} f, err := conf.ParseFile("", r) if err != nil { @@ -84,7 +84,7 @@ func CompileAndSave(src string, o *Options) error { if err != nil { return err } - b, err = Compile(bytes.NewReader(b), o) + b, err = Compile(bytes.NewReader(b)) if err != nil { return fmt.Errorf("error while trying to compile smart contract file: %v", err) } diff --git a/pkg/vm/compiler/compiler_test.go b/pkg/vm/compiler/compiler_test.go index 1ab46d1ae..5ddd11824 100644 --- a/pkg/vm/compiler/compiler_test.go +++ b/pkg/vm/compiler/compiler_test.go @@ -44,14 +44,10 @@ func filterFilename(infos []os.FileInfo) string { } func compileFile(src string) error { - o := compiler.Options{ - Outfile: "tmp/contract.avm", - } - file, err := os.Open(src) if err != nil { return err } - _, err = compiler.Compile(file, &o) + _, err = compiler.Compile(file) return err } diff --git a/pkg/vm/tests/vm_test.go b/pkg/vm/tests/vm_test.go index a65357e67..deb18eaa7 100644 --- a/pkg/vm/tests/vm_test.go +++ b/pkg/vm/tests/vm_test.go @@ -52,7 +52,7 @@ func vmAndCompile(t *testing.T, src string) *vm.VM { vm.RegisterInteropFunc("Neo.Storage.Put", storePlugin.Put, 1) vm.RegisterInteropFunc("Neo.Storage.GetContext", storePlugin.GetContext, 1) - b, err := compiler.Compile(strings.NewReader(src), &compiler.Options{}) + b, err := compiler.Compile(strings.NewReader(src)) if err != nil { t.Fatal(err) }