Skip to content

Commit

Permalink
Protobuf and etcd upgrade (#2997)
Browse files Browse the repository at this point in the history
* Update Protobuf

Signed-off-by: Brett Logan <[email protected]>

* Fix orderer/common

Signed-off-by: Brett Logan <[email protected]>

* Fix orderer/consensus/etcdraft

Signed-off-by: Brett Logan <[email protected]>

* Fix protoutil

Signed-off-by: Brett Logan <[email protected]>

* Fix core/scc

Signed-off-by: Brett Logan <[email protected]>

* Fix core/endorser

Signed-off-by: Brett Logan <[email protected]>

* Fix ledger/snapshotgrpc

Signed-off-by: Brett Logan <[email protected]>

* Fix internal/peer

Signed-off-by: Brett Logan <[email protected]>

* Fix core/dispatcher

Signed-off-by: Brett Logan <[email protected]>

* Fix core/chaincode

Signed-off-by: Brett Logan <[email protected]>

* Fix common/cauthdsl

Signed-off-by: Brett Logan <[email protected]>

* Cleanup

Signed-off-by: Brett Logan <[email protected]>

* move to latest etcd

Signed-off-by: Antoine Toulme <[email protected]>

* latest vendoring

Signed-off-by: Antoine Toulme <[email protected]>

* fix formatting

Signed-off-by: Antoine Toulme <[email protected]>

* remove old etcd brought back by rebase

Signed-off-by: Antoine Toulme <[email protected]>

* go mod tidy

Signed-off-by: Antoine Toulme <[email protected]>

* fix unit tests

Signed-off-by: Antoine Toulme <[email protected]>

* Restore state when joining

Signed-off-by: Antoine Toulme <[email protected]>

* Add fmt.Println to see why CI fails but works locally

Signed-off-by: Antoine Toulme <[email protected]>

* turn on DEBUG for tests

Signed-off-by: Antoine Toulme <[email protected]>

* correct more changes picked up from rebase

Signed-off-by: Antoine Toulme <[email protected]>

* fixing more tests

Signed-off-by: Antoine Toulme <[email protected]>

* make test fail if tx can be signed with no endorsements

Signed-off-by: Antoine Toulme <[email protected]>

* go mod tidy

Signed-off-by: Antoine Toulme <[email protected]>

* remove focus on test

Signed-off-by: Antoine Toulme <[email protected]>

* Make all protobuf error message tests pass

Signed-off-by: Antoine Toulme <[email protected]>

* fix serializer_test errors

Signed-off-by: Antoine Toulme <[email protected]>

* Fix tests

Signed-off-by: Antoine Toulme <[email protected]>

* Fix skip caller depth for grpc

Signed-off-by: Antoine Toulme <[email protected]>

* apply code review recommendations

Signed-off-by: Antoine Toulme <[email protected]>

* Fix test

Signed-off-by: Antoine Toulme <[email protected]>

* assign whole ConfState

Signed-off-by: Antoine Toulme <[email protected]>

* Set raft node inital confstate based on latest snapshot

Signed-off-by: Parameswaran Selvam <[email protected]>

* Set raft node inital confstate based on latest snapshot

Signed-off-by: Parameswaran Selvam <[email protected]>

* Resolved conflicts

Signed-off-by: Parameswaran Selvam <[email protected]>

Co-authored-by: Brett Logan <[email protected]>
Co-authored-by: Parameswaran Selvam <[email protected]>
  • Loading branch information
3 people authored Jun 20, 2022
1 parent b5eaaac commit 3dfc0b3
Show file tree
Hide file tree
Showing 573 changed files with 80,509 additions and 25,176 deletions.
2 changes: 1 addition & 1 deletion common/cauthdsl/policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func TestNewPolicyErrorCase(t *testing.T) {
pol1, msg1, err1 := provider.NewPolicy([]byte{0})
require.Nil(t, pol1)
require.Nil(t, msg1)
require.EqualError(t, err1, "Error unmarshalling to SignaturePolicy: proto: common.SignaturePolicyEnvelope: illegal tag 0 (wire type 0)")
require.ErrorContains(t, err1, "Error unmarshalling to SignaturePolicy")

sigPolicy2 := &cb.SignaturePolicyEnvelope{Version: -1}
data2 := marshalOrPanic(sigPolicy2)
Expand Down
2 changes: 1 addition & 1 deletion common/flogging/zap.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func NewZapLogger(core zapcore.Core, options ...zap.Option) *zap.Logger {
func NewGRPCLogger(l *zap.Logger) *zapgrpc.Logger {
l = l.WithOptions(
zap.AddCaller(),
zap.AddCallerSkip(3),
zap.AddCallerSkip(4),
)
return zapgrpc.NewLogger(l, zapgrpc.WithDebug())
}
Expand Down
47 changes: 31 additions & 16 deletions core/chaincode/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ var _ = Describe("Handler", func() {
msg := fakeChatStream.SendArgsForCall(0)
Expect(msg.Type).To(Equal(pb.ChaincodeMessage_ERROR))
Expect(msg.Txid).To(Equal("tx-id"))
Expect(string(msg.Payload)).To(HavePrefix("INVOKE_CHAINCODE failed: transaction ID: tx-id: unmarshal failed: proto: "))
Expect(string(msg.Payload)).To(HavePrefix("INVOKE_CHAINCODE failed: transaction ID: tx-id"))
})
})
})
Expand Down Expand Up @@ -529,7 +529,8 @@ var _ = Describe("Handler", func() {

It("returns an error", func() {
_, err := handler.HandlePutState(incomingMessage, txContext)
Expect(err).To(MatchError("unmarshal failed: proto: can't skip unknown wire type 4"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("unmarshal failed:"))
})
})

Expand Down Expand Up @@ -687,7 +688,8 @@ var _ = Describe("Handler", func() {

It("returns an error", func() {
_, err := handler.HandlePutStateMetadata(incomingMessage, txContext)
Expect(err).To(MatchError("unmarshal failed: proto: can't skip unknown wire type 4"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("unmarshal failed:"))
})
})

Expand Down Expand Up @@ -813,7 +815,8 @@ var _ = Describe("Handler", func() {

It("returns an error", func() {
_, err := handler.HandleDelState(incomingMessage, txContext)
Expect(err).To(MatchError("unmarshal failed: proto: can't skip unknown wire type 4"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("unmarshal failed:"))
})
})

Expand Down Expand Up @@ -932,7 +935,8 @@ var _ = Describe("Handler", func() {

It("returns an error", func() {
_, err := handler.HandleGetState(incomingMessage, txContext)
Expect(err).To(MatchError("unmarshal failed: proto: can't skip unknown wire type 4"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("unmarshal failed:"))
})
})

Expand Down Expand Up @@ -1138,7 +1142,8 @@ var _ = Describe("Handler", func() {

It("returns an error", func() {
_, err := handler.HandleGetPrivateDataHash(incomingMessage, txContext)
Expect(err).To(MatchError("unmarshal failed: proto: can't skip unknown wire type 4"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("unmarshal failed:"))
})
})

Expand Down Expand Up @@ -1231,7 +1236,8 @@ var _ = Describe("Handler", func() {

It("returns an error", func() {
_, err := handler.HandleGetStateMetadata(incomingMessage, txContext)
Expect(err).To(MatchError("unmarshal failed: proto: can't skip unknown wire type 4"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("unmarshal failed:"))
})
})

Expand Down Expand Up @@ -1537,7 +1543,8 @@ var _ = Describe("Handler", func() {

It("returns an error", func() {
_, err := handler.HandleGetStateByRange(incomingMessage, txContext)
Expect(err).To(MatchError("unmarshal failed: proto: can't skip unknown wire type 4"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("unmarshal failed:"))
})
})

Expand Down Expand Up @@ -1649,7 +1656,8 @@ var _ = Describe("Handler", func() {

It("returns an error", func() {
_, err := handler.HandleQueryStateNext(incomingMessage, txContext)
Expect(err).To(MatchError("unmarshal failed: proto: can't skip unknown wire type 4"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("unmarshal failed:"))
})
})

Expand Down Expand Up @@ -1760,7 +1768,8 @@ var _ = Describe("Handler", func() {

It("returns an error", func() {
_, err := handler.HandleQueryStateClose(incomingMessage, txContext)
Expect(err).To(MatchError("unmarshal failed: proto: can't skip unknown wire type 4"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("unmarshal failed:"))
})
})

Expand Down Expand Up @@ -1951,7 +1960,8 @@ var _ = Describe("Handler", func() {

It("returns an error", func() {
_, err := handler.HandleGetQueryResult(incomingMessage, txContext)
Expect(err).To(MatchError("unmarshal failed: proto: can't skip unknown wire type 4"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("unmarshal failed:"))
})
})

Expand All @@ -1962,7 +1972,8 @@ var _ = Describe("Handler", func() {

It("returns an error", func() {
_, err := handler.HandleGetQueryResult(incomingMessage, txContext)
Expect(err).To(MatchError("marshal failed: proto: Marshal called with nil"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("marshal failed:"))
})

It("cleans up the query context", func() {
Expand Down Expand Up @@ -2049,7 +2060,8 @@ var _ = Describe("Handler", func() {

It("returns an error", func() {
_, err := handler.HandleGetHistoryForKey(incomingMessage, txContext)
Expect(err).To(MatchError("unmarshal failed: proto: can't skip unknown wire type 4"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("unmarshal failed:"))
})
})

Expand Down Expand Up @@ -2093,7 +2105,8 @@ var _ = Describe("Handler", func() {

It("returns an error", func() {
_, err := handler.HandleGetHistoryForKey(incomingMessage, txContext)
Expect(err).To(MatchError("marshal failed: proto: Marshal called with nil"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("marshal failed:"))
})

It("cleans up the query context", func() {
Expand Down Expand Up @@ -2348,7 +2361,8 @@ var _ = Describe("Handler", func() {

It("returns an error", func() {
_, err := handler.HandleInvokeChaincode(incomingMessage, txContext)
Expect(err).To(MatchError("unmarshal failed: proto: can't skip unknown wire type 4"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("unmarshal failed"))
})
})

Expand All @@ -2359,7 +2373,8 @@ var _ = Describe("Handler", func() {

It("returns an error", func() {
_, err := handler.HandleInvokeChaincode(incomingMessage, txContext)
Expect(err).To(MatchError("marshal failed: proto: Marshal called with nil"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("marshal failed:"))
})
})
})
Expand Down
15 changes: 10 additions & 5 deletions core/chaincode/lifecycle/deployedcc_infoprovider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,8 @@ var _ = Describe("ValidatorCommitter", func() {

It("wraps and returns that error", func() {
_, err := vc.ChaincodeInfo("channel-name", "cc-name", fakeQueryExecutor)
Expect(err).To(MatchError("could not get info about chaincode: could not deserialize chaincode definition for chaincode cc-name: could not unmarshal state for key namespaces/fields/cc-name/ValidationInfo: proto: can't skip unknown wire type 7"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("could not get info about chaincode: could not deserialize chaincode definition for chaincode cc-name: could not unmarshal state for key namespaces/fields/cc-name/ValidationInfo"))
})
})
})
Expand Down Expand Up @@ -368,7 +369,8 @@ var _ = Describe("ValidatorCommitter", func() {

It("wraps and returns that error", func() {
_, err := vc.AllChaincodesInfo("channel-name", fakeQueryExecutor)
Expect(err).To(MatchError("could not get info about chaincode: could not deserialize chaincode definition for chaincode cc-name: could not unmarshal state for key namespaces/fields/cc-name/ValidationInfo: proto: can't skip unknown wire type 7"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("could not get info about chaincode: could not deserialize chaincode definition for chaincode cc-name: could not unmarshal state for key namespaces/fields/cc-name/ValidationInfo"))
})
})
})
Expand Down Expand Up @@ -437,7 +439,8 @@ var _ = Describe("ValidatorCommitter", func() {

It("wraps and returns that error", func() {
_, err := vc.CollectionInfo("channel-name", "cc-name", "collection-name", fakeQueryExecutor)
Expect(err).To(MatchError("could not get chaincode: could not deserialize chaincode definition for chaincode cc-name: could not unmarshal state for key namespaces/fields/cc-name/ValidationInfo: proto: can't skip unknown wire type 7"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("could not get chaincode: could not deserialize chaincode definition for chaincode cc-name: could not unmarshal state for key namespaces/fields/cc-name/ValidationInfo"))
})
})
})
Expand Down Expand Up @@ -622,7 +625,8 @@ var _ = Describe("ValidatorCommitter", func() {

It("wraps and returns that error", func() {
_, err := vc.AllCollectionsConfigPkg("channel-name", "cc-name", fakeQueryExecutor)
Expect(err).To(MatchError("could not get info about chaincode: could not deserialize chaincode definition for chaincode cc-name: could not unmarshal state for key namespaces/fields/cc-name/ValidationInfo: proto: can't skip unknown wire type 7"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("could not get info about chaincode: could not deserialize chaincode definition for chaincode cc-name: could not unmarshal state for key namespaces/fields/cc-name/ValidationInfo"))
})
})
})
Expand Down Expand Up @@ -685,7 +689,8 @@ var _ = Describe("ValidatorCommitter", func() {

It("wraps and returns that error", func() {
_, _, uerr, _ := vc.ValidationInfo("channel-id", "cc-name", fakeQueryExecutor)
Expect(uerr).To(MatchError("could not get chaincode: could not deserialize chaincode definition for chaincode cc-name: could not unmarshal state for key namespaces/fields/cc-name/ValidationInfo: proto: can't skip unknown wire type 7"))
Expect(uerr).To(Not(BeNil()))
Expect(uerr.Error()).To(HavePrefix("could not get chaincode: could not deserialize chaincode definition for chaincode cc-name: could not unmarshal state for key namespaces/fields/cc-name/ValidationInfo"))
})
})
})
Expand Down
27 changes: 18 additions & 9 deletions core/chaincode/lifecycle/lifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,8 @@ var _ = Describe("ExternalFunctions", func() {

It("returns an error", func() {
err := ef.ApproveChaincodeDefinitionForOrg("my-channel", "cc-name", testDefinition, "hash", fakePublicState, fakeOrgState)
Expect(err).To(MatchError("could not fetch metadata for current definition: could not unmarshal metadata for namespace namespaces/cc-name: proto: can't skip unknown wire type 7"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("could not fetch metadata for current definition: could not unmarshal metadata for namespace namespaces/cc-name"))
})
})

Expand Down Expand Up @@ -865,7 +866,8 @@ var _ = Describe("ExternalFunctions", func() {

It("wraps and returns the error", func() {
err := ef.ApproveChaincodeDefinitionForOrg("my-channel", "cc-name", testDefinition, "hash", fakePublicState, fakeOrgState)
Expect(err).To(MatchError("could not deserialize chaincode-source metadata for cc-name#5: could not unmarshal metadata for namespace chaincode-sources/cc-name#5: proto: can't skip unknown wire type 7"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("could not deserialize chaincode-source metadata for cc-name#5: could not unmarshal metadata for namespace chaincode-sources/cc-name#5"))
})
})

Expand All @@ -876,7 +878,8 @@ var _ = Describe("ExternalFunctions", func() {

It("wraps and returns the error", func() {
err := ef.ApproveChaincodeDefinitionForOrg("my-channel", "cc-name", testDefinition, "hash", fakePublicState, fakeOrgState)
Expect(err).To(MatchError("could not deserialize chaincode package for cc-name#5: could not unmarshal state for key chaincode-sources/fields/cc-name#5/PackageID: proto: can't skip unknown wire type 7"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("could not deserialize chaincode package for cc-name#5: could not unmarshal state for key chaincode-sources/fields/cc-name#5/PackageID"))
})
})
})
Expand Down Expand Up @@ -1248,7 +1251,8 @@ var _ = Describe("ExternalFunctions", func() {

It("wraps and returns the error", func() {
cc, err := ef.QueryApprovedChaincodeDefinition("my-channel", "cc-name", 0, fakePublicState, fakeOrgStates[0])
Expect(err).To(MatchError("could not deserialize namespace metadata for next sequence 5: could not unmarshal metadata for namespace namespaces/cc-name#5: proto: can't skip unknown wire type 7"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("could not deserialize namespace metadata for next sequence 5: could not unmarshal metadata for namespace namespaces/cc-name#5"))
Expect(cc).To(BeNil())
})
})
Expand Down Expand Up @@ -1311,7 +1315,8 @@ var _ = Describe("ExternalFunctions", func() {

It("wraps and returns the error", func() {
cc, err := ef.QueryApprovedChaincodeDefinition("my-channel", "cc-name", 4, fakePublicState, fakeOrgStates[0])
Expect(err).To(MatchError("could not deserialize namespace metadata for cc-name#4: could not unmarshal metadata for namespace namespaces/cc-name#4: proto: can't skip unknown wire type 7"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("could not deserialize namespace metadata for cc-name#4: could not unmarshal metadata for namespace namespaces/cc-name#4"))
Expect(cc).To(BeNil())
})
})
Expand All @@ -1323,7 +1328,8 @@ var _ = Describe("ExternalFunctions", func() {

It("wraps and returns the error", func() {
cc, err := ef.QueryApprovedChaincodeDefinition("my-channel", "cc-name", 4, fakePublicState, fakeOrgStates[0])
Expect(err).To(MatchError("could not deserialize chaincode parameters for cc-name#4: could not unmarshal state for key namespaces/fields/cc-name#4/EndorsementInfo: proto: can't skip unknown wire type 7"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("could not deserialize chaincode parameters for cc-name#4: could not unmarshal state for key namespaces/fields/cc-name#4/EndorsementInfo"))
Expect(cc).To(BeNil())
})
})
Expand All @@ -1335,7 +1341,8 @@ var _ = Describe("ExternalFunctions", func() {

It("wraps and returns the error", func() {
cc, err := ef.QueryApprovedChaincodeDefinition("my-channel", "cc-name", 4, fakePublicState, fakeOrgStates[0])
Expect(err).To(MatchError("could not deserialize chaincode-source metadata for cc-name#4: could not unmarshal metadata for namespace chaincode-sources/cc-name#4: proto: can't skip unknown wire type 7"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("could not deserialize chaincode-source metadata for cc-name#4: could not unmarshal metadata for namespace chaincode-sources/cc-name#4"))
Expect(cc).To(BeNil())
})
})
Expand All @@ -1359,7 +1366,8 @@ var _ = Describe("ExternalFunctions", func() {

It("wraps and returns the error", func() {
cc, err := ef.QueryApprovedChaincodeDefinition("my-channel", "cc-name", 4, fakePublicState, fakeOrgStates[0])
Expect(err).To(MatchError("could not deserialize chaincode package for cc-name#4: could not unmarshal state for key chaincode-sources/fields/cc-name#4/PackageID: proto: can't skip unknown wire type 7"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("could not deserialize chaincode package for cc-name#4: could not unmarshal state for key chaincode-sources/fields/cc-name#4/PackageID"))
Expect(cc).To(BeNil())
})
})
Expand Down Expand Up @@ -1687,7 +1695,8 @@ var _ = Describe("ExternalFunctions", func() {

It("returns an error", func() {
cc, err := ef.QueryChaincodeDefinition("cc-name", fakePublicState)
Expect(err).To(MatchError("could not deserialize namespace cc-name as chaincode: could not unmarshal state for key namespaces/fields/cc-name/EndorsementInfo: proto: can't skip unknown wire type 7"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("could not deserialize namespace cc-name as chaincode: could not unmarshal state for key namespaces/fields/cc-name/EndorsementInfo"))
Expect(cc).To(BeNil())
})
})
Expand Down
15 changes: 8 additions & 7 deletions core/chaincode/lifecycle/serializer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ var _ = Describe("Serializer", func() {

It("wraps and returns the error", func() {
err := s.Serialize("namespaces", "fake", testStruct, fakeState)
Expect(err).To(MatchError("could not deserialize metadata for namespace namespaces/fake: could not unmarshal metadata for namespace namespaces/fake: unexpected EOF"))
Expect(err.Error()).To(ContainSubstring("could not deserialize metadata for namespace namespaces/fake: could not unmarshal metadata for namespace namespaces/fake"))
})
})
})
Expand Down Expand Up @@ -413,7 +413,7 @@ var _ = Describe("Serializer", func() {
It("fails", func() {
testStruct := &TestStruct{}
err := s.Deserialize("namespaces", "fake", metadata, testStruct, fakeState)
Expect(err).To(MatchError("could not unmarshal state for key namespaces/fields/fake/Int: unexpected EOF"))
Expect(err.Error()).To(ContainSubstring("could not unmarshal state for key namespaces/fields/fake/Int"))
})
})

Expand Down Expand Up @@ -815,7 +815,7 @@ var _ = Describe("Serializer", func() {

It("returns an error", func() {
_, err := s.DeserializeAllMetadata("namespaces", fakeState)
Expect(err).To(MatchError("error unmarshalling metadata for key namespaces/metadata/bad: unexpected EOF"))
Expect(err.Error()).To(ContainSubstring("error unmarshalling metadata for key namespaces/metadata/bad"))
})
})
})
Expand Down Expand Up @@ -867,7 +867,7 @@ var _ = Describe("Serializer", func() {

It("returns an error", func() {
_, _, err := s.DeserializeMetadata("namespaces", "fake", fakeState)
Expect(err).To(MatchError("could not unmarshal metadata for namespace namespaces/fake: unexpected EOF"))
Expect(err.Error()).To(ContainSubstring("could not unmarshal metadata for namespace namespaces/fake"))
})
})
})
Expand Down Expand Up @@ -962,7 +962,8 @@ var _ = Describe("Serializer", func() {

It("wraps and returns the error", func() {
err := s.DeserializeFieldAsProto("namespaces", "fake", "field", fakeState, &lb.InstallChaincodeResult{})
Expect(err).To(MatchError("could not unmarshal key namespaces/fields/fake/field to *lifecycle.InstallChaincodeResult: proto: can't skip unknown wire type 7"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("could not unmarshal key namespaces/fields/fake/field to *lifecycle.InstallChaincodeResult"))
})
})
})
Expand Down Expand Up @@ -1013,7 +1014,7 @@ var _ = Describe("Serializer", func() {

It("returns an error", func() {
_, err := s.DeserializeFieldAsInt64("namespaces", "fake", "field", fakeState)
Expect(err).To(MatchError("could not unmarshal state for key namespaces/fields/fake/field: unexpected EOF"))
Expect(err.Error()).To(ContainSubstring("could not unmarshal state for key namespaces/fields/fake/field"))
})
})
})
Expand Down Expand Up @@ -1064,7 +1065,7 @@ var _ = Describe("Serializer", func() {

It("returns an error", func() {
_, err := s.DeserializeFieldAsString("namespaces", "fake", "field", fakeState)
Expect(err).To(MatchError("could not unmarshal state for key namespaces/fields/fake/field: unexpected EOF"))
Expect(err.Error()).To(ContainSubstring("could not unmarshal state for key namespaces/fields/fake/field"))
})
})
})
Expand Down
3 changes: 2 additions & 1 deletion core/dispatcher/dispatcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ var _ = Describe("Dispatcher", func() {
Context("when the input bytes cannot be unmarshaled", func() {
It("wraps and returns the error", func() {
_, err := d.Dispatch([]byte("garbage"), "GoodFunc", testReceiver)
Expect(err).To(MatchError("could not decode input arg for dispatcher_test.TestReceiver.GoodFunc: proto: can't skip unknown wire type 7"))
Expect(err).To(Not(BeNil()))
Expect(err.Error()).To(HavePrefix("could not decode input arg for dispatcher_test.TestReceiver.GoodFunc"))
})
})

Expand Down
Loading

0 comments on commit 3dfc0b3

Please sign in to comment.