11 func TestMarshalingFuncs(t *testing.T) {
12 xprv, err := NewXPrv(nil)
17 want := make([]byte, hex.EncodedLen(len(xprv.Bytes())))
18 hex.Encode(want, xprv.Bytes())
20 got, err := json.Marshal(xprv)
24 // First and last bytes are "
25 if !reflect.DeepEqual(want, got[1:len(got)-1]) {
26 t.Errorf("marshaling error: want = %+v, got = %+v", want, got)
30 err = json.Unmarshal(got, &secXprv)
34 if !bytes.Equal(xprv[:], secXprv[:]) {
35 t.Errorf("unmarshaling error: want = %+v, got = %+v", xprv, secXprv)