mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +00:00
cmd/abigen: require either '--abi' or '--combined-json' (#31045)
This commit is contained in:
parent
f6d3f64b7c
commit
89376fd489
1 changed files with 11 additions and 1 deletions
|
|
@ -94,10 +94,20 @@ func init() {
|
||||||
|
|
||||||
func abigen(c *cli.Context) error {
|
func abigen(c *cli.Context) error {
|
||||||
utils.CheckExclusive(c, abiFlag, jsonFlag) // Only one source can be selected.
|
utils.CheckExclusive(c, abiFlag, jsonFlag) // Only one source can be selected.
|
||||||
|
|
||||||
if c.String(pkgFlag.Name) == "" {
|
if c.String(pkgFlag.Name) == "" {
|
||||||
utils.Fatalf("No destination package specified (--pkg)")
|
utils.Fatalf("No destination package specified (--pkg)")
|
||||||
}
|
}
|
||||||
lang := bind.LangGo
|
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":
|
||||||
|
lang = bind.LangGo
|
||||||
|
default:
|
||||||
|
utils.Fatalf("Unsupported destination language \"%s\" (--lang)", c.String(langFlag.Name))
|
||||||
|
}
|
||||||
// If the entire solidity code was specified, build and bind based on that
|
// If the entire solidity code was specified, build and bind based on that
|
||||||
var (
|
var (
|
||||||
abis []string
|
abis []string
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue