Skip to content

Commit

Permalink
identify the type name in decode and encode of signed snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
gdiazlo committed Dec 3, 2018
1 parent 507e17c commit 6e34d2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions protocol/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (b *SignedSnapshot) Encode() ([]byte, error) {
var buf bytes.Buffer
encoder := codec.NewEncoder(&buf, &codec.MsgpackHandle{})
if err := encoder.Encode(b); err != nil {
log.Errorf("Failed to encode message: %v", err)
log.Errorf("Failed to encode signed snapshot into message: %v", err)
return nil, err
}
return buf.Bytes(), nil
Expand All @@ -71,7 +71,7 @@ func (b *SignedSnapshot) Decode(msg []byte) error {
reader := bytes.NewReader(msg)
decoder := codec.NewDecoder(reader, &codec.MsgpackHandle{})
if err := decoder.Decode(b); err != nil {
log.Errorf("Failed to decode snapshots batch: %v", err)
log.Errorf("Failed to decode signed snapshot: %v", err)
return err
}
return nil
Expand Down

0 comments on commit 6e34d2d

Please sign in to comment.