mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-03 03:58:36 +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",
|
||||
Usage: "RPC node address",
|
||||
}
|
||||
r14Flag = cli.StringFlag{
|
||||
Name: "remark14",
|
||||
Usage: "Remark14 field",
|
||||
}
|
||||
timeoutFlag = cli.DurationFlag{
|
||||
Name: "timeout, t",
|
||||
Usage: "Timeout for the operation",
|
||||
|
@ -188,6 +192,7 @@ func NewCommands() []cli.Command {
|
|||
Flags: []cli.Flag{
|
||||
walletPathFlag,
|
||||
rpcFlag,
|
||||
r14Flag,
|
||||
timeoutFlag,
|
||||
outFlag,
|
||||
fromAddrFlag,
|
||||
|
@ -487,6 +492,8 @@ func transferAsset(ctx *cli.Context) error {
|
|||
return cli.NewExitError(fmt.Errorf("wallet contains no account for '%s'", from), 1)
|
||||
}
|
||||
|
||||
remark14 := ctx.String("remark14")
|
||||
|
||||
asset, err := getAssetID(ctx.String("asset"))
|
||||
if err != nil {
|
||||
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)
|
||||
}
|
||||
|
||||
if remark14 != "" {
|
||||
tx.Attributes = append(tx.Attributes, transaction.Attribute{
|
||||
Usage: transaction.Remark14,
|
||||
Data: []byte(remark14),
|
||||
})
|
||||
}
|
||||
|
||||
toFlag := ctx.Generic("to").(*flags.Address)
|
||||
if !toFlag.IsSet {
|
||||
return cli.NewExitError("'to' address was not provided", 1)
|
||||
|
|
Loading…
Reference in a new issue