fix a serialization error

This commit is contained in:
Guillaume Ballet 2019-04-04 20:04:03 +02:00
parent aae61ab16e
commit d2daff4258

View File

@ -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