Skip to content

Commit 818b001

Browse files
committed
Cleanup accounts jsonrpc code
1 parent 630260d commit 818b001

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

extras/jsonrpc/daemon.go

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,10 @@ func (d *Client) AccountFund(fromAccount string, toAccount string, amount string
182182

183183
func (d *Client) AccountCreate(accountName string, singleKey bool) (*AccountCreateResponse, error) {
184184
response := new(AccountCreateResponse)
185-
args := struct {
186-
AccountName string `json:"account_name"`
187-
SingleKey bool `json:"single_key"`
188-
}{
189-
AccountName: accountName,
190-
SingleKey: singleKey,
191-
}
192-
structs.DefaultTagName = "json"
193-
return response, d.call(response, "account_create", structs.Map(args))
185+
return response, d.call(response, "account_create", map[string]interface{}{
186+
"account_name": accountName,
187+
"single_key": singleKey,
188+
})
194189
}
195190

196191
func (d *Client) AccountRemove(accountID string) (*AccountRemoveResponse, error) {

extras/jsonrpc/daemon_types.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,13 @@ type AccountListResponse struct {
213213
type AccountBalanceResponse string
214214

215215
type AccountCreateResponse struct {
216-
ID string `json:"id"`
217-
Name string `json:"name"`
218-
PublicKey string `json:"public_key"`
219-
PrivateKey string `json:"private_key"`
220-
Seed string `json:"seed"`
221-
Ledger string `json:"ledger"`
216+
ID string `json:"id"`
217+
Name string `json:"name"`
218+
PublicKey string `json:"public_key"`
219+
PrivateKey string `json:"private_key"`
220+
Seed string `json:"seed"`
221+
Ledger string `json:"ledger"`
222+
ModifiedOn float64 `json:"modified_on"`
222223
}
223224

224225
type AccountRemoveResponse AccountCreateResponse

0 commit comments

Comments
 (0)