accounts, internal: Changes in response to review

This commit is contained in:
Nick Johnson
2018-02-22 13:27:41 +00:00
committed by Guillaume Ballet
parent f7027dd68c
commit 78375608a4
6 changed files with 137 additions and 118 deletions

View File

@ -139,12 +139,12 @@ func (path DerivationPath) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("\"%s\"", path.String())), nil
}
func (dp *DerivationPath) UnmarshalJSON(b []byte) error {
var path string
func (path *DerivationPath) UnmarshalJSON(b []byte) error {
var dp string
var err error
if err = json.Unmarshal(b, &path); err != nil {
if err = json.Unmarshal(b, &dp); err != nil {
return err
}
*dp, err = ParseDerivationPath(path)
*path, err = ParseDerivationPath(dp)
return err
}