Skip to content

Commit

Permalink
A further deliberate panic in ethier/gen.go to see full output; abige…
Browse files Browse the repository at this point in the history
…n differs and regexp is a bad idea here because it's too fragile
  • Loading branch information
ARR4N committed Jun 8, 2022
1 parent 2cdae9c commit 5050138
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ethier/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,6 @@ func extendGeneratedCode(generated, combinedJSON *bytes.Buffer) ([]byte, error)
RuntimeSourceMaps[%q].RuntimeCode = strings.Replace(RuntimeSourceMaps[%[2]q].RuntimeCode, "__$%s$__", %s, -1)`,
l, matches[1], matches[2], matches[3],
)
var code []string
for k, c := range meta.Contracts {
code = append(code, fmt.Sprintf("%s => %s", k, c.RuntimeCode))
}
panic(fmt.Sprintf("%s\n%s", lines[i], strings.Join(code, "\n")))
}

// Effectively the same as running goimports on the (ugly) generated code.
Expand All @@ -259,5 +254,6 @@ 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
}

0 comments on commit 5050138

Please sign in to comment.