diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f92715c..4837aa8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,7 +40,4 @@ jobs: sudo apt-get install -y solc abigen - name: Run tests - run: | - solc --version - abigen --version - npm run test + run: npm run test diff --git a/ethier/gen.go b/ethier/gen.go index bc00cea..6a68966 100644 --- a/ethier/gen.go +++ b/ethier/gen.go @@ -169,8 +169,14 @@ var ( // Regular expressions for modifying abigen-generated code to work with the // extraTemplate code above. - deployedRegexp = regexp.MustCompile(`^\s*return address, tx, &(.+?)\{.*Transactor.*\}, nil\s*$`) - libReplacementRegexp = regexp.MustCompile(`^\s*(.+?)Bin = strings.Replace\(.+?, "__\$([0-9a-f]{34})\$__", (.+?), -1\)\s*$`) + deployedRegexp = regexp.MustCompile(`^\s*return address, tx, &(.+?)\{.*Transactor.*\}, nil\s*$`) + // Note the option for matching strings.Replace or strings.ReplaceAll due to + // a recent change in abigen. + libReplacementRegexp = regexp.MustCompile(`^\s*(.+?)Bin = strings.Replace(?:All)?\(.+?, "__\$([0-9a-f]{34})\$__", (.+?)(?:, -1)?\)\s*$`) + // TODO(aschlosberg) replace regular expressions with a more explicit + // approach for modifying the output code. This likely requires a PR to the + // go-ethereum repo to allow bind.Bind (+/- abigen) to accept an alternate + // template. ) // extendGeneratedCode adds ethier-specific functionality to code generated by @@ -254,6 +260,5 @@ func extendGeneratedCode(generated, combinedJSON *bytes.Buffer) ([]byte, error) if err := format.Node(buf, fset, f); err != nil { return nil, fmt.Errorf("format.Node(%T, %T, %T): %v", buf, fset, f, err) } - panic(buf.String()) return buf.Bytes(), nil }