aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/hd.go
diff options
context:
space:
mode:
authorGuillaume Ballet <gballet@gmail.com>2019-04-05 02:04:03 +0800
committerGuillaume Ballet <gballet@gmail.com>2019-04-08 19:21:22 +0800
commitd2daff4258a66b8d0e1904095b5ebaffcb46c49e (patch)
treea02fdb96da255c36fe947bd2767cb746ca8b91bd /accounts/hd.go
parentaae61ab16e0dcf15181906fb9b8b4a4c8de52464 (diff)
downloadgo-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/hd.go')
-rw-r--r--accounts/hd.go4
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