cli: rename multisig sign to wallet sign

This commit is contained in:
Evgeniy Stratonikov 2021-03-03 14:47:36 +03:00
parent e66d36900c
commit 8ef7dd320c
3 changed files with 18 additions and 28 deletions

View file

@ -76,7 +76,7 @@ func TestSignMultisigTx(t *testing.T) {
"--out", txPath) "--out", txPath)
e.In.WriteString("pass\r") e.In.WriteString("pass\r")
e.Run(t, "neo-go", "wallet", "multisig", "sign", e.Run(t, "neo-go", "wallet", "sign",
"--rpc-endpoint", "http://"+e.RPC.Addr, "--rpc-endpoint", "http://"+e.RPC.Addr,
"--wallet", wallet2Path, "--address", multisigAddr, "--wallet", wallet2Path, "--address", multisigAddr,
"--in", txPath, "--out", txPath) "--in", txPath, "--out", txPath)
@ -100,7 +100,7 @@ func TestSignMultisigTx(t *testing.T) {
"--", strings.Join([]string{multisigHash.StringLE(), ":", "Global"}, "")) "--", strings.Join([]string{multisigHash.StringLE(), ":", "Global"}, ""))
e.In.WriteString("pass\r") e.In.WriteString("pass\r")
e.Run(t, "neo-go", "wallet", "multisig", "sign", e.Run(t, "neo-go", "wallet", "sign",
"--rpc-endpoint", "http://"+e.RPC.Addr, "--rpc-endpoint", "http://"+e.RPC.Addr,
"--wallet", wallet2Path, "--address", multisigAddr, "--wallet", wallet2Path, "--address", multisigAddr,
"--in", txPath, "--out", txPath) "--in", txPath, "--out", txPath)

View file

@ -10,29 +10,7 @@ import (
"github.com/urfave/cli" "github.com/urfave/cli"
) )
func newMultisigCommands() []cli.Command { func signStoredTransaction(ctx *cli.Context) error {
signFlags := []cli.Flag{
walletPathFlag,
outFlag,
inFlag,
cli.StringFlag{
Name: "address, a",
Usage: "Address to use",
},
}
signFlags = append(signFlags, options.RPC...)
return []cli.Command{
{
Name: "sign",
Usage: "sign a transaction",
UsageText: "multisig sign --wallet <path> --address <address> --in <file.in> --out <file.out>",
Action: signMultisig,
Flags: signFlags,
},
}
}
func signMultisig(ctx *cli.Context) error {
wall, err := openWallet(ctx.String("wallet")) wall, err := openWallet(ctx.String("wallet"))
if err != nil { if err != nil {
return cli.NewExitError(err, 1) return cli.NewExitError(err, 1)

View file

@ -69,6 +69,16 @@ func NewCommands() []cli.Command {
}, },
} }
claimFlags = append(claimFlags, options.RPC...) claimFlags = append(claimFlags, options.RPC...)
signFlags := []cli.Flag{
walletPathFlag,
outFlag,
inFlag,
cli.StringFlag{
Name: "address, a",
Usage: "Address to use",
},
}
signFlags = append(signFlags, options.RPC...)
return []cli.Command{{ return []cli.Command{{
Name: "wallet", Name: "wallet",
Usage: "create, open and manage a NEO wallet", Usage: "create, open and manage a NEO wallet",
@ -191,9 +201,11 @@ func NewCommands() []cli.Command {
}, },
}, },
{ {
Name: "multisig", Name: "sign",
Usage: "work with multisig address", Usage: "cosign transaction with multisig/contract/additional account",
Subcommands: newMultisigCommands(), UsageText: "sign --wallet <path> --address <address> --in <file.in> --out <file.out>",
Action: signStoredTransaction,
Flags: signFlags,
}, },
{ {
Name: "nep17", Name: "nep17",