Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protobuf and etcd upgrade #2997

Merged
merged 40 commits into from
Jun 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2a19d3d
Update Protobuf
Dec 2, 2020
6b06256
Fix orderer/common
Dec 2, 2020
cc40a35
Fix orderer/consensus/etcdraft
Dec 2, 2020
55cd6c7
Fix protoutil
Dec 2, 2020
0827590
Fix core/scc
Dec 2, 2020
f551afb
Fix core/endorser
Dec 2, 2020
2d2f519
Fix ledger/snapshotgrpc
Dec 2, 2020
78c09a7
Fix internal/peer
Dec 2, 2020
a4b1dd3
Fix core/dispatcher
Dec 2, 2020
527a2ad
Fix core/chaincode
Dec 2, 2020
95fd19d
Fix common/cauthdsl
Dec 2, 2020
a53d26d
Cleanup
Dec 2, 2020
ad865c9
move to latest etcd
atoulme Oct 26, 2021
7bf4f52
latest vendoring
atoulme Oct 26, 2021
d90a65a
fix formatting
atoulme Oct 26, 2021
9b4c185
remove old etcd brought back by rebase
atoulme Oct 26, 2021
9a7f2f4
go mod tidy
atoulme Oct 26, 2021
4d94849
fix unit tests
atoulme Oct 26, 2021
3448d48
Restore state when joining
atoulme Nov 5, 2021
eb2a0e0
Add fmt.Println to see why CI fails but works locally
atoulme Nov 6, 2021
35caadc
turn on DEBUG for tests
atoulme Nov 6, 2021
92ae125
correct more changes picked up from rebase
atoulme Jan 11, 2022
fde2d6b
fixing more tests
atoulme Jan 11, 2022
6b9400a
make test fail if tx can be signed with no endorsements
atoulme Jan 11, 2022
01c7266
go mod tidy
atoulme Jan 20, 2022
dddb9bb
remove focus on test
atoulme Jan 21, 2022
2a47fc2
Make all protobuf error message tests pass
atoulme Jan 21, 2022
249c545
fix serializer_test errors
atoulme Jan 24, 2022
a86b451
Fix tests
atoulme Jan 24, 2022
8531868
Fix skip caller depth for grpc
atoulme Jan 26, 2022
63c57f9
apply code review recommendations
atoulme Jan 27, 2022
b5547ef
fix conflicts
atoulme Mar 29, 2022
0878fd5
Fix test
atoulme Mar 29, 2022
b80153f
merge with latest
atoulme Mar 29, 2022
7933d80
assign whole ConfState
atoulme Apr 2, 2022
c11ee83
Set raft node inital confstate based on latest snapshot
Param-S May 12, 2022
8a6579d
Set raft node inital confstate based on latest snapshot
Param-S May 12, 2022
57cfcc6
Resolved conflicts
Param-S May 13, 2022
98642ab
Merge branch 'protobuf' of github.com:atoulme/fabric into protobuf
Param-S May 13, 2022
a27ed28
Merge branch 'main' into protobuf
Param-S May 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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