script_windows.go 622 B

123456789101112131415161718192021222324252627282930313233
  1. // +build windows
  2. package ethutil
  3. import (
  4. "fmt"
  5. "strings"
  6. "github.com/obscuren/mutan"
  7. "github.com/obscuren/mutan/backends"
  8. )
  9. // General compile function
  10. func Compile(script string, silent bool) (ret []byte, err error) {
  11. if len(script) > 2 {
  12. compiler := mutan.NewCompiler(backend.NewEthereumBackend())
  13. compiler.Silent = silent
  14. byteCode, errors := compiler.Compile(strings.NewReader(script))
  15. if len(errors) > 0 {
  16. var errs string
  17. for _, er := range errors {
  18. if er != nil {
  19. errs += er.Error()
  20. }
  21. }
  22. return nil, fmt.Errorf("%v", errs)
  23. }
  24. return byteCode, nil
  25. }
  26. return nil, nil
  27. }