Skip to content

Commit eddc776

Browse files
committed
[FAB-14459] Improve error for key level endorsement
Add a hint about root cause - application capability V1_3 required. Change-Id: I4c72c4972f31732dff2e6aadd303853d5a1c79e7 Signed-off-by: David Enyeart <enyeart@us.ibm.com>
1 parent 5a403e8 commit eddc776

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/chaincode/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ func (h *Handler) checkMetadataCap(msg *pb.ChaincodeMessage) error {
574574
}
575575

576576
if !ac.Capabilities().KeyLevelEndorsement() {
577-
return errors.New("key level endorsement is not enabled")
577+
return errors.New("key level endorsement is not enabled, channel application capability of V1_3 or later is required")
578578
}
579579
return nil
580580
}

core/chaincode/handler_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ var _ = Describe("Handler", func() {
697697

698698
It("returns an error", func() {
699699
_, err := handler.HandlePutStateMetadata(incomingMessage, txContext)
700-
Expect(err).To(MatchError("key level endorsement is not enabled"))
700+
Expect(err).To(MatchError("key level endorsement is not enabled, channel application capability of V1_3 or later is required"))
701701
})
702702
})
703703

@@ -1244,7 +1244,7 @@ var _ = Describe("Handler", func() {
12441244

12451245
It("returns an error", func() {
12461246
_, err := handler.HandleGetStateMetadata(incomingMessage, txContext)
1247-
Expect(err).To(MatchError("key level endorsement is not enabled"))
1247+
Expect(err).To(MatchError("key level endorsement is not enabled, channel application capability of V1_3 or later is required"))
12481248
})
12491249
})
12501250

0 commit comments

Comments
 (0)