From 3dbb7333245acbeff31688eed8223a6e69ba1ef9 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 16 May 2023 14:00:44 +0300 Subject: [PATCH] cli: require contract config file for bindings generation It's an error if config file isn't provided and bindings config needs to be generated. Signed-off-by: Anna Shaleva --- cli/smartcontract/smart_contract.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cli/smartcontract/smart_contract.go b/cli/smartcontract/smart_contract.go index 818f07ac2..b478f076f 100644 --- a/cli/smartcontract/smart_contract.go +++ b/cli/smartcontract/smart_contract.go @@ -400,7 +400,8 @@ func contractCompile(ctx *cli.Context) error { manifestFile := ctx.String("manifest") confFile := ctx.String("config") debugFile := ctx.String("debug") - if len(confFile) == 0 && (len(manifestFile) != 0 || len(debugFile) != 0) { + bindings := ctx.String("bindings") + if len(confFile) == 0 && (len(manifestFile) != 0 || len(debugFile) != 0 || len(bindings) != 0) { return cli.NewExitError(errNoConfFile, 1) } @@ -409,7 +410,7 @@ func contractCompile(ctx *cli.Context) error { DebugInfo: debugFile, ManifestFile: manifestFile, - BindingsFile: ctx.String("bindings"), + BindingsFile: bindings, NoStandardCheck: ctx.Bool("no-standards"), NoEventsCheck: ctx.Bool("no-events"),