From 8ef7dd320c6611d3dede981ef370c1dffa4fb171 Mon Sep 17 00:00:00 2001 From: Evgeniy Stratonikov Date: Wed, 3 Mar 2021 14:47:36 +0300 Subject: [PATCH] cli: rename `multisig sign` to `wallet sign` --- cli/multisig_test.go | 4 ++-- cli/wallet/multisig.go | 24 +----------------------- cli/wallet/wallet.go | 18 +++++++++++++++--- 3 files changed, 18 insertions(+), 28 deletions(-) diff --git a/cli/multisig_test.go b/cli/multisig_test.go index 337f4d81e..f64c0335e 100644 --- a/cli/multisig_test.go +++ b/cli/multisig_test.go @@ -76,7 +76,7 @@ func TestSignMultisigTx(t *testing.T) { "--out", txPath) 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, "--wallet", wallet2Path, "--address", multisigAddr, "--in", txPath, "--out", txPath) @@ -100,7 +100,7 @@ func TestSignMultisigTx(t *testing.T) { "--", strings.Join([]string{multisigHash.StringLE(), ":", "Global"}, "")) 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, "--wallet", wallet2Path, "--address", multisigAddr, "--in", txPath, "--out", txPath) diff --git a/cli/wallet/multisig.go b/cli/wallet/multisig.go index 4c730a33b..ddb18f54d 100644 --- a/cli/wallet/multisig.go +++ b/cli/wallet/multisig.go @@ -10,29 +10,7 @@ import ( "github.com/urfave/cli" ) -func newMultisigCommands() []cli.Command { - 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 --address
--in --out ", - Action: signMultisig, - Flags: signFlags, - }, - } -} - -func signMultisig(ctx *cli.Context) error { +func signStoredTransaction(ctx *cli.Context) error { wall, err := openWallet(ctx.String("wallet")) if err != nil { return cli.NewExitError(err, 1) diff --git a/cli/wallet/wallet.go b/cli/wallet/wallet.go index f9334a84b..b9f461e9a 100644 --- a/cli/wallet/wallet.go +++ b/cli/wallet/wallet.go @@ -69,6 +69,16 @@ func NewCommands() []cli.Command { }, } 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{{ Name: "wallet", Usage: "create, open and manage a NEO wallet", @@ -191,9 +201,11 @@ func NewCommands() []cli.Command { }, }, { - Name: "multisig", - Usage: "work with multisig address", - Subcommands: newMultisigCommands(), + Name: "sign", + Usage: "cosign transaction with multisig/contract/additional account", + UsageText: "sign --wallet --address
--in --out ", + Action: signStoredTransaction, + Flags: signFlags, }, { Name: "nep17",