mirror of
https://github.com/LBRYFoundation/lbcd.git
synced 2025-09-01 01:35:15 +00:00
Rename exportwatchingwallet zip option to download.
This commit is contained in:
parent
8fb5c9f0e6
commit
e321b6bdc7
1 changed files with 12 additions and 12 deletions
24
cmds.go
24
cmds.go
|
@ -106,9 +106,9 @@ func (cmd *GetCurrentNetCmd) UnmarshalJSON(b []byte) error {
|
||||||
// unmarshaling of exportwatchingwallet JSON websocket extension
|
// unmarshaling of exportwatchingwallet JSON websocket extension
|
||||||
// commands.
|
// commands.
|
||||||
type ExportWatchingWalletCmd struct {
|
type ExportWatchingWalletCmd struct {
|
||||||
id interface{}
|
id interface{}
|
||||||
Account string
|
Account string
|
||||||
Zip bool
|
Download bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enforce that ExportWatchingWalletCmd satisifies the btcjson.Cmd
|
// Enforce that ExportWatchingWalletCmd satisifies the btcjson.Cmd
|
||||||
|
@ -123,7 +123,7 @@ func NewExportWatchingWalletCmd(id interface{}, optArgs ...interface{}) (*Export
|
||||||
|
|
||||||
// Optional parameters set to their defaults.
|
// Optional parameters set to their defaults.
|
||||||
account := ""
|
account := ""
|
||||||
zip := false
|
dl := false
|
||||||
|
|
||||||
if len(optArgs) > 0 {
|
if len(optArgs) > 0 {
|
||||||
a, ok := optArgs[0].(string)
|
a, ok := optArgs[0].(string)
|
||||||
|
@ -133,17 +133,17 @@ func NewExportWatchingWalletCmd(id interface{}, optArgs ...interface{}) (*Export
|
||||||
account = a
|
account = a
|
||||||
}
|
}
|
||||||
if len(optArgs) > 1 {
|
if len(optArgs) > 1 {
|
||||||
z, ok := optArgs[0].(bool)
|
b, ok := optArgs[0].(bool)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("second optarg zip must be a boolean")
|
return nil, errors.New("second optarg zip must be a boolean")
|
||||||
}
|
}
|
||||||
zip = z
|
dl = b
|
||||||
}
|
}
|
||||||
|
|
||||||
return &ExportWatchingWalletCmd{
|
return &ExportWatchingWalletCmd{
|
||||||
id: id,
|
id: id,
|
||||||
Account: account,
|
Account: account,
|
||||||
Zip: zip,
|
Download: dl,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,11 +178,11 @@ func (cmd *ExportWatchingWalletCmd) MarshalJSON() ([]byte, error) {
|
||||||
Id: cmd.id,
|
Id: cmd.id,
|
||||||
}
|
}
|
||||||
|
|
||||||
if cmd.Account != "" || cmd.Zip {
|
if cmd.Account != "" || cmd.Download {
|
||||||
raw.Params = append(raw.Params, cmd.Account)
|
raw.Params = append(raw.Params, cmd.Account)
|
||||||
}
|
}
|
||||||
if cmd.Zip {
|
if cmd.Download {
|
||||||
raw.Params = append(raw.Params, cmd.Zip)
|
raw.Params = append(raw.Params, cmd.Download)
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(raw)
|
return json.Marshal(raw)
|
||||||
|
|
Loading…
Add table
Reference in a new issue