(t *testing.T)
| 31 | ) |
| 32 | |
| 33 | func TestBookkeeper_Serialization(t *testing.T) { |
| 34 | pubkey, err := hex.DecodeString("039af138392513408f9d1509c651c60066c05b2305de17e44f68088510563e2279") |
| 35 | assert.Nil(t, err) |
| 36 | pub, err := keypair.DeserializePublicKey(pubkey) |
| 37 | assert.Nil(t, err) |
| 38 | bookkeeper := &Bookkeeper{ |
| 39 | PubKey: pub, |
| 40 | Action: BookkeeperAction(1), |
| 41 | Cert: pubkey, |
| 42 | Issuer: pub, |
| 43 | } |
| 44 | sink := common.NewZeroCopySink(nil) |
| 45 | bookkeeper.Serialization(sink) |
| 46 | bookkeeper2 := &Bookkeeper{} |
| 47 | source := common.NewZeroCopySource(sink.Bytes()) |
| 48 | err = bookkeeper2.Deserialization(source) |
| 49 | assert.Nil(t, err) |
| 50 | |
| 51 | assert.Equal(t, bookkeeper, bookkeeper2) |
| 52 | } |
nothing calls this directly
no test coverage detected