Skip to content

Commit

Permalink
fix a serialization error
Browse files Browse the repository at this point in the history
  • Loading branch information
gballet committed Apr 8, 2019
1 parent aae61ab commit d2daff4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion accounts/hd.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,12 @@ func (path DerivationPath) String() string {
return result
}

// MarshalJSON turns a derivation path into its json-serialized string
func (path DerivationPath) MarshalJSON() ([]byte, error) {
return json.Marshal(fmt.Sprintf("\"%s\"", path.String()))
return json.Marshal(path.String())
}

// UnmarshalJSON a json-serialized string back into a derivation path
func (path *DerivationPath) UnmarshalJSON(b []byte) error {
var dp string
var err error
Expand Down

0 comments on commit d2daff4

Please sign in to comment.