mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 11:41:48 +00:00
cli/smartcontract: allow to deploy contracts with scope
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
a340e11b0b
commit
0db5dd5fd7
3 changed files with 102 additions and 38 deletions
|
@ -843,7 +843,7 @@ func contractDeploy(ctx *cli.Context) error {
|
|||
Value: manifestBytes,
|
||||
},
|
||||
}
|
||||
_, data, err := cmdargs.ParseParams(ctx.Args(), true)
|
||||
signOffset, data, err := cmdargs.ParseParams(ctx.Args(), true)
|
||||
if err != nil {
|
||||
return cli.NewExitError(fmt.Errorf("unable to parse 'data' parameter: %w", err), 1)
|
||||
}
|
||||
|
@ -872,10 +872,15 @@ func contractDeploy(ctx *cli.Context) error {
|
|||
return cli.NewExitError(fmt.Errorf("can't get sender address: %w", err), 1)
|
||||
}
|
||||
|
||||
cosigners := []transaction.Signer{{
|
||||
Account: acc.Contract.ScriptHash(),
|
||||
Scopes: transaction.CalledByEntry,
|
||||
}}
|
||||
cosigners, sgnErr := cmdargs.GetSignersFromContext(ctx, signOffset)
|
||||
if sgnErr != nil {
|
||||
return err
|
||||
} else if len(cosigners) == 0 {
|
||||
cosigners = []transaction.Signer{{
|
||||
Account: acc.Contract.ScriptHash(),
|
||||
Scopes: transaction.CalledByEntry,
|
||||
}}
|
||||
}
|
||||
|
||||
sender, extErr := invokeWithArgs(ctx, acc, w, mgmtHash, "deploy", appCallParams, cosigners)
|
||||
if extErr != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue