Explorar o código

fix a serialization error

Guillaume Ballet %!s(int64=6) %!d(string=hai) anos
pai
achega
d2daff4258
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      accounts/hd.go

+ 3 - 1
accounts/hd.go

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