From d2daff4258a66b8d0e1904095b5ebaffcb46c49e Mon Sep 17 00:00:00 2001 From: Guillaume Ballet Date: Thu, 4 Apr 2019 20:04:03 +0200 Subject: [PATCH] fix a serialization error --- accounts/hd.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/accounts/hd.go b/accounts/hd.go index 30963326f..24aa777ae 100644 --- a/accounts/hd.go +++ b/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