Skip to content

Commit

Permalink
add comment addressing reasoning for hex encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-axner committed Mar 2, 2021
1 parent 9ffcbe9 commit cb28f10
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions x/ibc/core/02-client/keeper/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ func (k Keeper) UpdateClient(ctx sdk.Context, clientID string, header exported.H
// emit the full header in events
var headerStr string
if header != nil {
// Marshal the Header as an Any and encode the resulting bytes to hex.
// This prevents the event value from containing invalid UTF-8 characters
// which may cause data to be lost when JSON encoding/decoding.
headerStr = hex.EncodeToString(types.MustMarshalHeader(k.cdc, header))

}
Expand Down

0 comments on commit cb28f10

Please sign in to comment.