cmd/abigen: require either `--abi` or `--combined-json` (#31045)
This PR addresses issue #30768 , which highlights that running cmd/abigen/abigen --pkg my_package example.json (erroneously omitting the --abi flag) generates an empty binding, when it should fail explicitly. --------- Co-authored-by: jwasinger <j-wasinger@hotmail.com>
This commit is contained in:
parent
ea31bd9faf
commit
cc814d6b7b
|
@ -98,6 +98,9 @@ func abigen(c *cli.Context) error {
|
|||
if c.String(pkgFlag.Name) == "" {
|
||||
utils.Fatalf("No destination package specified (--pkg)")
|
||||
}
|
||||
if c.String(abiFlag.Name) == "" && c.String(jsonFlag.Name) == "" {
|
||||
utils.Fatalf("Either contract ABI source (--abi) or combined-json (--combined-json) are required")
|
||||
}
|
||||
var lang bind.Lang
|
||||
switch c.String(langFlag.Name) {
|
||||
case "go":
|
||||
|
|
Loading…
Reference in New Issue