Skip to content

Commit

Permalink
[FAB-11976] hex encoding for binary keys in collection
Browse files Browse the repository at this point in the history
Keys in a collection are hashed to binary and may contain unprintable
characters. This change set introduces hex encoding for said keys in order
to improve the usefulness of log entries.

Change-Id: I3bfcf63506cca968ca2d514c33bf5d20e4782e2a
Signed-off-by: Alessandro Sorniotti <ale.linux@sopit.net>
Signed-off-by: Matthias Neugschwandtner <eug@zurich.ibm.com>
  • Loading branch information
ale-linux committed Sep 14, 2018
1 parent fdc4889 commit 5769cc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/common/validation/statebased/vpmanagerimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,14 +313,14 @@ func (m *KeyLevelValidationParameterManagerImpl) GetValidationParameterForKey(cc
if coll == "" {
mdMap, err = state.GetStateMetadata(cc, key)
if err != nil {
err = errors.WithMessage(err, fmt.Sprintf("could not retrieve metadata for %s:%s:%s", cc, coll, key))
err = errors.WithMessage(err, fmt.Sprintf("could not retrieve metadata for %s:%s", cc, key))
logger.Errorf(err.Error())
return nil, err
}
} else {
mdMap, err = state.GetPrivateDataMetadata(cc, coll, key)
if err != nil {
err = errors.WithMessage(err, fmt.Sprintf("could not retrieve metadata for %s:%s:%s", cc, coll, key))
err = errors.WithMessage(err, fmt.Sprintf("could not retrieve metadata for %s:%s:%x", cc, coll, []byte(key)))
logger.Errorf(err.Error())
return nil, err
}
Expand Down

0 comments on commit 5769cc3

Please sign in to comment.