diff options
author | Guillaume Ballet <gballet@gmail.com> | 2019-04-05 02:04:03 +0800 |
---|---|---|
committer | Guillaume Ballet <gballet@gmail.com> | 2019-04-08 19:21:22 +0800 |
commit | d2daff4258a66b8d0e1904095b5ebaffcb46c49e (patch) | |
tree | a02fdb96da255c36fe947bd2767cb746ca8b91bd /accounts | |
parent | aae61ab16e0dcf15181906fb9b8b4a4c8de52464 (diff) | |
download | go-tangerine-d2daff4258a66b8d0e1904095b5ebaffcb46c49e.tar go-tangerine-d2daff4258a66b8d0e1904095b5ebaffcb46c49e.tar.gz go-tangerine-d2daff4258a66b8d0e1904095b5ebaffcb46c49e.tar.bz2 go-tangerine-d2daff4258a66b8d0e1904095b5ebaffcb46c49e.tar.lz go-tangerine-d2daff4258a66b8d0e1904095b5ebaffcb46c49e.tar.xz go-tangerine-d2daff4258a66b8d0e1904095b5ebaffcb46c49e.tar.zst go-tangerine-d2daff4258a66b8d0e1904095b5ebaffcb46c49e.zip |
fix a serialization error
Diffstat (limited to 'accounts')
-rw-r--r-- | accounts/hd.go | 4 |
1 files changed, 3 insertions, 1 deletions
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 |