mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-11 05:30:07 +00:00
Merge pull request #2154 from nspcc-dev/remark14
wallet: add remark14 option to migrate UTXO assets to N3
This commit is contained in:
commit
580f1787b9
1 changed files with 14 additions and 0 deletions
|
@ -48,6 +48,10 @@ var (
|
||||||
Name: "rpc, r",
|
Name: "rpc, r",
|
||||||
Usage: "RPC node address",
|
Usage: "RPC node address",
|
||||||
}
|
}
|
||||||
|
r14Flag = cli.StringFlag{
|
||||||
|
Name: "remark14",
|
||||||
|
Usage: "Remark14 field",
|
||||||
|
}
|
||||||
timeoutFlag = cli.DurationFlag{
|
timeoutFlag = cli.DurationFlag{
|
||||||
Name: "timeout, t",
|
Name: "timeout, t",
|
||||||
Usage: "Timeout for the operation",
|
Usage: "Timeout for the operation",
|
||||||
|
@ -188,6 +192,7 @@ func NewCommands() []cli.Command {
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
walletPathFlag,
|
walletPathFlag,
|
||||||
rpcFlag,
|
rpcFlag,
|
||||||
|
r14Flag,
|
||||||
timeoutFlag,
|
timeoutFlag,
|
||||||
outFlag,
|
outFlag,
|
||||||
fromAddrFlag,
|
fromAddrFlag,
|
||||||
|
@ -487,6 +492,8 @@ func transferAsset(ctx *cli.Context) error {
|
||||||
return cli.NewExitError(fmt.Errorf("wallet contains no account for '%s'", from), 1)
|
return cli.NewExitError(fmt.Errorf("wallet contains no account for '%s'", from), 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
remark14 := ctx.String("remark14")
|
||||||
|
|
||||||
asset, err := getAssetID(ctx.String("asset"))
|
asset, err := getAssetID(ctx.String("asset"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return cli.NewExitError(fmt.Errorf("invalid asset id: %v", err), 1)
|
return cli.NewExitError(fmt.Errorf("invalid asset id: %v", err), 1)
|
||||||
|
@ -517,6 +524,13 @@ func transferAsset(ctx *cli.Context) error {
|
||||||
return cli.NewExitError(err, 1)
|
return cli.NewExitError(err, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if remark14 != "" {
|
||||||
|
tx.Attributes = append(tx.Attributes, transaction.Attribute{
|
||||||
|
Usage: transaction.Remark14,
|
||||||
|
Data: []byte(remark14),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
toFlag := ctx.Generic("to").(*flags.Address)
|
toFlag := ctx.Generic("to").(*flags.Address)
|
||||||
if !toFlag.IsSet {
|
if !toFlag.IsSet {
|
||||||
return cli.NewExitError("'to' address was not provided", 1)
|
return cli.NewExitError("'to' address was not provided", 1)
|
||||||
|
|
Loading…
Reference in a new issue