Skip to content

Commit 49c9531

Browse files
committed
Fix wallet opts passing
1 parent c68c7e0 commit 49c9531

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

extras/jsonrpc/daemon.go

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -603,23 +603,20 @@ func (d *Client) AccountAdd(accountName string, seed *string, privateKey *string
603603
}
604604

605605
type WalletCreateOpts struct {
606-
SkipOnStartup bool `json:"skip_on_startup,omitempty"`
607-
CreateAccount bool `json:"create_account,omitempty"`
608-
SingleKey bool `json:"single_key,omitempty"`
609-
}
610-
611-
type WalletCreateArgs struct {
612-
WalletCreateOpts
613-
ID string `json:"wallet_id"`
606+
ID string `json:"wallet_id"`
607+
SkipOnStartup bool `json:"skip_on_startup,omitempty"`
608+
CreateAccount bool `json:"create_account,omitempty"`
609+
SingleKey bool `json:"single_key,omitempty"`
614610
}
615611

616612
func (d *Client) WalletCreate(id string, opts *WalletCreateOpts) (*Wallet, error) {
617613
response := new(Wallet)
618614
if opts == nil {
619615
opts = &WalletCreateOpts{}
620616
}
621-
args := WalletCreateArgs{ID: id, WalletCreateOpts: *opts}
622-
return response, d.call(response, "wallet_create", structs.Map(args))
617+
opts.ID = id
618+
structs.DefaultTagName = "json"
619+
return response, d.call(response, "wallet_create", structs.Map(opts))
623620
}
624621

625622
func (d *Client) WalletAdd(id string) (*Wallet, error) {

0 commit comments

Comments
 (0)