From ba7e92358b182995fb1cbea3b0c5c31361321d72 Mon Sep 17 00:00:00 2001 From: zhj0811 <1530005648@qq.com> Date: Wed, 7 Apr 2021 11:35:30 +0800 Subject: [PATCH] fix: fix typo Signed-off-by: zhj0811 <1530005648@qq.com> --- CHANGELOG.md | 2 +- bccsp/pkcs11/pkcs11.go | 6 +-- cmd/common/config.go | 2 +- cmd/common/config_test.go | 2 +- cmd/configtxgen/main.go | 4 +- cmd/configtxlator/main.go | 6 +-- cmd/cryptogen/main.go | 2 +- cmd/osnadmin/main.go | 2 +- common/cauthdsl/policy.go | 2 +- common/cauthdsl/policy_test.go | 2 +- common/channelconfig/standardvalues.go | 2 +- common/deliver/deliver_test.go | 6 +-- common/ledger/blkstorage/blockindex.go | 8 ++-- common/ledger/blkstorage/blockstore_test.go | 2 +- common/ledger/testutil/test_helper.go | 4 +- common/policies/implicitmeta.go | 2 +- common/policies/implicitmeta_test.go | 2 +- common/policies/inquire/compare.go | 4 +- common/policies/policy.go | 2 +- core/cclifecycle/util.go | 2 +- core/chaincode/accesscontrol/access.go | 2 +- core/chaincode/accesscontrol/access_test.go | 2 +- core/chaincode/handler_test.go | 8 ++-- core/chaincode/lifecycle/scc.go | 2 +- core/chaincode/lifecycle/serializer.go | 2 +- core/chaincode/lifecycle/serializer_test.go | 2 +- .../txvalidator/v14/vscc_validator.go | 2 +- core/dispatcher/dispatcher.go | 2 +- core/endorser/endorser_test.go | 6 +-- core/endorser/msgvalidation_test.go | 14 +++---- .../builtin/v12/validation_logic_test.go | 2 +- .../builtin/v13/validation_logic_test.go | 2 +- .../kvledger/channelinfo_provider_test.go | 2 +- core/ledger/kvledger/kv_ledger.go | 2 +- core/ledger/kvledger/snapshot.go | 6 +-- core/ledger/kvledger/snapshot_test.go | 4 +- core/scc/lscc/lscc.go | 2 +- core/scc/lscc/lscc_test.go | 2 +- core/tx/endorser/parser_test.go | 10 ++--- core/tx/processor_factory_test.go | 8 ++-- discovery/client/client.go | 10 ++--- discovery/support/chaincode/support.go | 4 +- discovery/support/config/support.go | 4 +- gossip/protoext/signing.go | 2 +- gossip/state/state.go | 2 +- integration/discovery/discovery_test.go | 2 +- integration/pkcs11/pkcs11_test.go | 2 +- internal/configtxgen/genesisconfig/config.go | 2 +- .../rest/configtxlator_handlers.go | 2 +- internal/peer/chaincode/common.go | 4 +- internal/peer/common/common.go | 2 +- internal/peer/common/common_test.go | 2 +- internal/peer/common/networkconfig.go | 2 +- .../chaincode/client_connections_test.go | 2 +- internal/pkg/gateway/api_test.go | 2 +- orderer/common/cluster/replication_test.go | 20 +++++----- orderer/common/cluster/util.go | 4 +- orderer/common/cluster/util_test.go | 12 +++--- orderer/common/localconfig/config.go | 2 +- .../common/msgprocessor/maintenancefilter.go | 4 +- .../msgprocessor/maintenancefilter_test.go | 6 +-- orderer/common/msgprocessor/systemchannel.go | 8 ++-- .../common/msgprocessor/systemchannel_test.go | 6 +-- .../msgprocessor/systemchannelfilter.go | 6 +-- .../msgprocessor/systemchannelfilter_test.go | 6 +-- orderer/common/multichannel/registrar.go | 2 +- orderer/consensus/etcdraft/consenter_test.go | 2 +- orderer/consensus/etcdraft/util_test.go | 2 +- protoutil/blockutils.go | 4 +- protoutil/blockutils_test.go | 8 ++-- protoutil/commonutils.go | 6 +-- protoutil/commonutils_test.go | 22 +++++----- protoutil/proputils.go | 2 +- protoutil/txutils.go | 2 +- protoutil/txutils_test.go | 4 +- protoutil/unmarshalers.go | 40 +++++++++---------- 76 files changed, 179 insertions(+), 179 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e78791c6cb9..673196ab960 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5083,7 +5083,7 @@ Fri Jun 23 14:53:05 EDT 2017 * [0a72230b](https://github.com/hyperledger/fabric/commit/0a72230b) [FAB-2487](https://jira.hyperledger.org/browse/FAB-2487) Change test string to comply with rule * [e02053c9](https://github.com/hyperledger/fabric/commit/e02053c9) [FAB-4473](https://jira.hyperledger.org/browse/FAB-4473) mod cc cache strategy to store minimal data * [49b3851b](https://github.com/hyperledger/fabric/commit/49b3851b) [FAB-4500](https://jira.hyperledger.org/browse/FAB-4500) Fix words in orderer.yaml -* [9c4cb515](https://github.com/hyperledger/fabric/commit/9c4cb515) [FAB-4616](https://jira.hyperledger.org/browse/FAB-4616) Skip type switch on unmarshaling error +* [9c4cb515](https://github.com/hyperledger/fabric/commit/9c4cb515) [FAB-4616](https://jira.hyperledger.org/browse/FAB-4616) Skip type switch on unmarshalling error * [ad608166](https://github.com/hyperledger/fabric/commit/ad608166) [FAB-4176](https://jira.hyperledger.org/browse/FAB-4176) Weekly Test Runs for Auction App * [abc81afb](https://github.com/hyperledger/fabric/commit/abc81afb) [FAB-3934](https://jira.hyperledger.org/browse/FAB-3934) Daily Test Runs for Auction App * [03d43c36](https://github.com/hyperledger/fabric/commit/03d43c36) [FAB-2487](https://jira.hyperledger.org/browse/FAB-2487) Cleanup couchdb name translation logic diff --git a/bccsp/pkcs11/pkcs11.go b/bccsp/pkcs11/pkcs11.go index 139ad1fafd9..caf9a604a4f 100644 --- a/bccsp/pkcs11/pkcs11.go +++ b/bccsp/pkcs11/pkcs11.go @@ -421,7 +421,7 @@ func (csp *Provider) getECKey(ski []byte) (pubKey *ecdsa.PublicKey, isPriv bool, curveOid := new(asn1.ObjectIdentifier) _, err = asn1.Unmarshal(marshaledOid, curveOid) if err != nil { - return nil, false, fmt.Errorf("failed Unmarshaling Curve OID [%s]\n%s", err.Error(), hex.EncodeToString(marshaledOid)) + return nil, false, fmt.Errorf("failed Unmarshalling Curve OID [%s]\n%s", err.Error(), hex.EncodeToString(marshaledOid)) } curve := namedCurveFromOID(*curveOid) @@ -430,7 +430,7 @@ func (csp *Provider) getECKey(ski []byte) (pubKey *ecdsa.PublicKey, isPriv bool, } x, y := elliptic.Unmarshal(curve, ecpt) if x == nil { - return nil, false, fmt.Errorf("failed Unmarshaling Public Key") + return nil, false, fmt.Errorf("failed Unmarshalling Public Key") } pubKey = &ecdsa.PublicKey{Curve: curve, X: x, Y: y} @@ -590,7 +590,7 @@ func (csp *Provider) generateECKey(curve asn1.ObjectIdentifier, ephemeral bool) } x, y := elliptic.Unmarshal(nistCurve, ecpt) if x == nil { - return nil, nil, fmt.Errorf("Failed Unmarshaling Public Key") + return nil, nil, fmt.Errorf("Failed Unmarshalling Public Key") } pubGoKey := &ecdsa.PublicKey{Curve: nistCurve, X: x, Y: y} diff --git a/cmd/common/config.go b/cmd/common/config.go index f4304f13bf6..1c2e5d3274d 100644 --- a/cmd/common/config.go +++ b/cmd/common/config.go @@ -31,7 +31,7 @@ func ConfigFromFile(file string) (Config, error) { config := Config{} if err := yaml.Unmarshal([]byte(configData), &config); err != nil { - return Config{}, errors.Errorf("error unmarshaling YAML file %s: %s", file, err) + return Config{}, errors.Errorf("error unmarshalling YAML file %s: %s", file, err) } return config, validateConfig(config) diff --git a/cmd/common/config_test.go b/cmd/common/config_test.go index 6044e5566cf..8145192dbe3 100644 --- a/cmd/common/config_test.go +++ b/cmd/common/config_test.go @@ -55,7 +55,7 @@ func TestConfig(t *testing.T) { t.Run("bad config isn't loaded", func(t *testing.T) { _, err := ConfigFromFile(filepath.Join("testdata", "not_a_yaml.yaml")) - require.Contains(t, err.Error(), "error unmarshaling YAML file") + require.Contains(t, err.Error(), "error unmarshalling YAML file") }) t.Run("file that doesn't exist isn't loaded", func(t *testing.T) { diff --git a/cmd/configtxgen/main.go b/cmd/configtxgen/main.go index 8ad10a57096..5bb2949d893 100644 --- a/cmd/configtxgen/main.go +++ b/cmd/configtxgen/main.go @@ -141,7 +141,7 @@ func doInspectBlock(inspectBlock string) error { logger.Info("Parsing genesis block") block, err := protoutil.UnmarshalBlock(data) if err != nil { - return fmt.Errorf("error unmarshaling to block: %s", err) + return fmt.Errorf("error unmarshalling to block: %s", err) } err = protolator.DeepMarshalJSON(os.Stdout, block) if err != nil { @@ -160,7 +160,7 @@ func doInspectChannelCreateTx(inspectChannelCreateTx string) error { logger.Info("Parsing transaction") env, err := protoutil.UnmarshalEnvelope(data) if err != nil { - return fmt.Errorf("Error unmarshaling envelope: %s", err) + return fmt.Errorf("Error unmarshalling envelope: %s", err) } err = protolator.DeepMarshalJSON(os.Stdout, env) diff --git a/cmd/configtxlator/main.go b/cmd/configtxlator/main.go index 3f2964f8df3..4a10f5a5bcd 100644 --- a/cmd/configtxlator/main.go +++ b/cmd/configtxlator/main.go @@ -163,7 +163,7 @@ func decodeProto(msgName string, input, output *os.File) error { err = proto.Unmarshal(in, msg) if err != nil { - return errors.Wrapf(err, "error unmarshaling") + return errors.Wrapf(err, "error unmarshalling") } err = protolator.DeepMarshalJSON(output, msg) @@ -183,7 +183,7 @@ func computeUpdt(original, updated, output *os.File, channelID string) error { origConf := &cb.Config{} err = proto.Unmarshal(origIn, origConf) if err != nil { - return errors.Wrapf(err, "error unmarshaling original config") + return errors.Wrapf(err, "error unmarshalling original config") } updtIn, err := ioutil.ReadAll(updated) @@ -194,7 +194,7 @@ func computeUpdt(original, updated, output *os.File, channelID string) error { updtConf := &cb.Config{} err = proto.Unmarshal(updtIn, updtConf) if err != nil { - return errors.Wrapf(err, "error unmarshaling updated config") + return errors.Wrapf(err, "error unmarshalling updated config") } cu, err := update.Compute(origConf, updtConf) diff --git a/cmd/cryptogen/main.go b/cmd/cryptogen/main.go index 7b457a008b1..95dddeca470 100644 --- a/cmd/cryptogen/main.go +++ b/cmd/cryptogen/main.go @@ -261,7 +261,7 @@ func getConfig() (*Config, error) { config := &Config{} err := yaml.Unmarshal([]byte(configData), &config) if err != nil { - return nil, fmt.Errorf("Error Unmarshaling YAML: %s", err) + return nil, fmt.Errorf("Error Unmarshalling YAML: %s", err) } return config, nil diff --git a/cmd/osnadmin/main.go b/cmd/osnadmin/main.go index a47ab36f31a..3f89d1fec41 100644 --- a/cmd/osnadmin/main.go +++ b/cmd/osnadmin/main.go @@ -170,7 +170,7 @@ func validateBlockChannelID(blockBytes []byte, channelID string) error { block := &common.Block{} err := proto.Unmarshal(blockBytes, block) if err != nil { - return fmt.Errorf("unmarshaling block: %s", err) + return fmt.Errorf("unmarshalling block: %s", err) } blockChannelID, err := protoutil.GetChannelIDFromBlock(block) diff --git a/common/cauthdsl/policy.go b/common/cauthdsl/policy.go index 2b5a1bfabe2..98ad163b302 100644 --- a/common/cauthdsl/policy.go +++ b/common/cauthdsl/policy.go @@ -32,7 +32,7 @@ func NewPolicyProvider(deserializer msp.IdentityDeserializer) policies.Provider func (pr *provider) NewPolicy(data []byte) (policies.Policy, proto.Message, error) { sigPolicy := &cb.SignaturePolicyEnvelope{} if err := proto.Unmarshal(data, sigPolicy); err != nil { - return nil, nil, fmt.Errorf("Error unmarshaling to SignaturePolicy: %s", err) + return nil, nil, fmt.Errorf("Error unmarshalling to SignaturePolicy: %s", err) } if sigPolicy.Version != 0 { diff --git a/common/cauthdsl/policy_test.go b/common/cauthdsl/policy_test.go index 964e7b708c2..196f823800d 100644 --- a/common/cauthdsl/policy_test.go +++ b/common/cauthdsl/policy_test.go @@ -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 unmarshaling to SignaturePolicy: proto: common.SignaturePolicyEnvelope: illegal tag 0 (wire type 0)") + require.EqualError(t, err1, "Error unmarshalling to SignaturePolicy: proto: common.SignaturePolicyEnvelope: illegal tag 0 (wire type 0)") sigPolicy2 := &cb.SignaturePolicyEnvelope{Version: -1} data2 := marshalOrPanic(sigPolicy2) diff --git a/common/channelconfig/standardvalues.go b/common/channelconfig/standardvalues.go index 5bf1f86a1f9..85cf606cd7a 100644 --- a/common/channelconfig/standardvalues.go +++ b/common/channelconfig/standardvalues.go @@ -55,7 +55,7 @@ func NewStandardValues(protosStructs ...interface{}) (*StandardValues, error) { // Deserialize looks up the backing Values proto of the given name, unmarshals the given bytes // to populate the backing message structure, and returns a referenced to the retained deserialized -// message (or an error, either because the key did not exist, or there was an an error unmarshaling +// message (or an error, either because the key did not exist, or there was an an error unmarshalling func (sv *StandardValues) Deserialize(key string, value []byte) (proto.Message, error) { msg, ok := sv.lookup[key] if !ok { diff --git a/common/deliver/deliver_test.go b/common/deliver/deliver_test.go index 662a79387e8..986d8f97fb1 100644 --- a/common/deliver/deliver_test.go +++ b/common/deliver/deliver_test.go @@ -673,7 +673,7 @@ var _ = Describe("Deliver", func() { }) }) - Context("when unmarshaling the payload fails", func() { + Context("when unmarshalling the payload fails", func() { BeforeEach(func() { envelope.Payload = []byte("completely-bogus-data") }) @@ -705,7 +705,7 @@ var _ = Describe("Deliver", func() { }) }) - Context("when unmarshaling the channel header fails", func() { + Context("when unmarshalling the channel header fails", func() { BeforeEach(func() { channelHeaderPayload = []byte("complete-nonsense") }) @@ -922,7 +922,7 @@ var _ = Describe("Deliver", func() { }) }) - Context("when unmarshaling seek info fails", func() { + Context("when unmarshalling seek info fails", func() { BeforeEach(func() { seekInfoPayload = []byte("complete-nonsense") }) diff --git a/common/ledger/blkstorage/blockindex.go b/common/ledger/blkstorage/blockindex.go index 71e7740086f..cf57e89862c 100644 --- a/common/ledger/blkstorage/blockindex.go +++ b/common/ledger/blkstorage/blockindex.go @@ -269,7 +269,7 @@ func (index *blockIndex) getTxIDVal(txID string) (*TxIDIndexValue, error) { } val := &TxIDIndexValue{} if err := proto.Unmarshal(valBytes, val); err != nil { - return nil, errors.Wrapf(err, "unexpected error while unmarshaling bytes [%#v] into TxIDIndexValProto", valBytes) + return nil, errors.Wrapf(err, "unexpected error while unmarshalling bytes [%#v] into TxIDIndexValProto", valBytes) } return val, nil } @@ -521,18 +521,18 @@ func (flp *fileLocPointer) unmarshal(b []byte) error { buffer := proto.NewBuffer(b) i, e := buffer.DecodeVarint() if e != nil { - return errors.Wrapf(e, "unexpected error while unmarshaling bytes [%#v] into fileLocPointer", b) + return errors.Wrapf(e, "unexpected error while unmarshalling bytes [%#v] into fileLocPointer", b) } flp.fileSuffixNum = int(i) i, e = buffer.DecodeVarint() if e != nil { - return errors.Wrapf(e, "unexpected error while unmarshaling bytes [%#v] into fileLocPointer", b) + return errors.Wrapf(e, "unexpected error while unmarshalling bytes [%#v] into fileLocPointer", b) } flp.offset = int(i) i, e = buffer.DecodeVarint() if e != nil { - return errors.Wrapf(e, "unexpected error while unmarshaling bytes [%#v] into fileLocPointer", b) + return errors.Wrapf(e, "unexpected error while unmarshalling bytes [%#v] into fileLocPointer", b) } flp.bytesLength = int(i) return nil diff --git a/common/ledger/blkstorage/blockstore_test.go b/common/ledger/blkstorage/blockstore_test.go index 40aa614bfee..d84a9d63d7c 100644 --- a/common/ledger/blkstorage/blockstore_test.go +++ b/common/ledger/blkstorage/blockstore_test.go @@ -66,7 +66,7 @@ func TestTxIDIndexErrorPropagations(t *testing.T) { []byte("junkValue"), false, ) - expectedErrMsg := fmt.Sprintf("unexpected error while unmarshaling bytes [%#v] into TxIDIndexValProto:", []byte("junkValue")) + expectedErrMsg := fmt.Sprintf("unexpected error while unmarshalling bytes [%#v] into TxIDIndexValProto:", []byte("junkValue")) for _, f := range txIDBasedFunctions { err := f() require.Error(t, err) diff --git a/common/ledger/testutil/test_helper.go b/common/ledger/testutil/test_helper.go index 69f39bd5816..dff7138616d 100644 --- a/common/ledger/testutil/test_helper.go +++ b/common/ledger/testutil/test_helper.go @@ -460,7 +460,7 @@ func SetTxID(t *testing.T, block *common.Block, txNum int, txID string) { envelopeBytes := block.Data.Data[txNum] envelope, err := protoutil.UnmarshalEnvelope(envelopeBytes) if err != nil { - t.Fatalf("error unmarshaling envelope: %s", err) + t.Fatalf("error unmarshalling envelope: %s", err) } payload, err := protoutil.UnmarshalPayload(envelope.Payload) @@ -470,7 +470,7 @@ func SetTxID(t *testing.T, block *common.Block, txNum int, txID string) { channelHeader, err := protoutil.UnmarshalChannelHeader(payload.Header.ChannelHeader) if err != nil { - t.Fatalf("error unmarshaling channel header: %s", err) + t.Fatalf("error unmarshalling channel header: %s", err) } channelHeader.TxId = txID channelHeaderBytes, err := proto.Marshal(channelHeader) diff --git a/common/policies/implicitmeta.go b/common/policies/implicitmeta.go index d00a7aad6df..3e1d7886ca9 100644 --- a/common/policies/implicitmeta.go +++ b/common/policies/implicitmeta.go @@ -30,7 +30,7 @@ type ImplicitMetaPolicy struct { func NewImplicitMetaPolicy(data []byte, managers map[string]*ManagerImpl) (*ImplicitMetaPolicy, error) { definition := &cb.ImplicitMetaPolicy{} if err := proto.Unmarshal(data, definition); err != nil { - return nil, fmt.Errorf("Error unmarshaling to ImplicitMetaPolicy: %s", err) + return nil, fmt.Errorf("Error unmarshalling to ImplicitMetaPolicy: %s", err) } subPolicies := make([]Policy, len(managers)) diff --git a/common/policies/implicitmeta_test.go b/common/policies/implicitmeta_test.go index c38f45e9ea3..2ecfc7fd6af 100644 --- a/common/policies/implicitmeta_test.go +++ b/common/policies/implicitmeta_test.go @@ -31,7 +31,7 @@ func (ap acceptPolicy) EvaluateIdentities(identity []msp.Identity) error { func TestImplicitMarshalError(t *testing.T) { _, err := NewImplicitMetaPolicy([]byte("GARBAGE"), nil) - require.Error(t, err, "Should have errored unmarshaling garbage") + require.Error(t, err, "Should have errored unmarshalling garbage") } func makeManagers(count, passing int) map[string]*ManagerImpl { diff --git a/common/policies/inquire/compare.go b/common/policies/inquire/compare.go index b74ecd34a34..53272de6d7d 100644 --- a/common/policies/inquire/compare.go +++ b/common/policies/inquire/compare.go @@ -111,7 +111,7 @@ func (cp *ComparablePrincipal) ToOURole() *ComparablePrincipal { ouRole := &msp.OrganizationUnit{} err := proto.Unmarshal(cp.principal.Principal, ouRole) if err != nil { - logger.Warning("Failed unmarshaling principal:", err) + logger.Warning("Failed unmarshalling principal:", err) return nil } cp.mspID = ouRole.MspIdentifier @@ -124,7 +124,7 @@ func (cp *ComparablePrincipal) ToRole() *ComparablePrincipal { mspRole := &msp.MSPRole{} err := proto.Unmarshal(cp.principal.Principal, mspRole) if err != nil { - logger.Warning("Failed unmarshaling principal:", err) + logger.Warning("Failed unmarshalling principal:", err) return nil } cp.mspID = mspRole.MspIdentifier diff --git a/common/policies/policy.go b/common/policies/policy.go index 1012fbce941..516cc97f325 100644 --- a/common/policies/policy.go +++ b/common/policies/policy.go @@ -405,7 +405,7 @@ func logMessageForSerializedIdentity(serializedIdentity []byte) (string, error) id := &msp.SerializedIdentity{} err := proto.Unmarshal(serializedIdentity, id) if err != nil { - return "", errors.Wrap(err, "unmarshaling serialized identity") + return "", errors.Wrap(err, "unmarshalling serialized identity") } pemBlock, _ := pem.Decode(id.IdBytes) if pemBlock == nil { diff --git a/core/cclifecycle/util.go b/core/cclifecycle/util.go index 1251a2e952a..d2e9e1ff501 100644 --- a/core/cclifecycle/util.go +++ b/core/cclifecycle/util.go @@ -91,7 +91,7 @@ func deployedCCToNameVersion(cc chaincode.Metadata) nameVersion { func extractCCInfo(data []byte) (*ccprovider.ChaincodeData, error) { cd := &ccprovider.ChaincodeData{} if err := proto.Unmarshal(data, cd); err != nil { - return nil, errors.Wrap(err, "failed unmarshaling lscc read value into ChaincodeData") + return nil, errors.Wrap(err, "failed unmarshalling lscc read value into ChaincodeData") } return cd, nil } diff --git a/core/chaincode/accesscontrol/access.go b/core/chaincode/accesscontrol/access.go index c0ce824fe25..1a8a4b887a1 100644 --- a/core/chaincode/accesscontrol/access.go +++ b/core/chaincode/accesscontrol/access.go @@ -66,7 +66,7 @@ func (ac *Authenticator) authenticate(msg *pb.ChaincodeMessage, stream grpc.Serv chaincodeID := &pb.ChaincodeID{} err := proto.Unmarshal(msg.Payload, chaincodeID) if err != nil { - logger.Warning("Failed unmarshaling message:", err) + logger.Warning("Failed unmarshalling message:", err) return err } ccName := chaincodeID.Name diff --git a/core/chaincode/accesscontrol/access_test.go b/core/chaincode/accesscontrol/access_test.go index 4f72759cc47..f98b86bd63d 100644 --- a/core/chaincode/accesscontrol/access_test.go +++ b/core/chaincode/accesscontrol/access_test.go @@ -259,7 +259,7 @@ func TestAccessControl(t *testing.T) { malformedMessageCC.sendMsg(registerMsg) malformedMessageCC.sendMsg(putStateMsg) require.Nil(t, malformedMessageCC.recv()) - assertLogContains(t, recorder, "Failed unmarshaling message") + assertLogContains(t, recorder, "Failed unmarshalling message") // Recover old payload registerMsg.Payload = originalPayload diff --git a/core/chaincode/handler_test.go b/core/chaincode/handler_test.go index 5d96cea09f0..a45e26b6999 100644 --- a/core/chaincode/handler_test.go +++ b/core/chaincode/handler_test.go @@ -522,7 +522,7 @@ var _ = Describe("Handler", func() { })) }) - Context("when unmarshaling the request fails", func() { + Context("when unmarshalling the request fails", func() { BeforeEach(func() { incomingMessage.Payload = []byte("this-is-a-bogus-payload") }) @@ -680,7 +680,7 @@ var _ = Describe("Handler", func() { }) }) - Context("when unmarshaling the request fails", func() { + Context("when unmarshalling the request fails", func() { BeforeEach(func() { incomingMessage.Payload = []byte("this-is-a-bogus-payload") }) @@ -2341,7 +2341,7 @@ var _ = Describe("Handler", func() { }) }) - Context("when unmarshaling the request fails", func() { + Context("when unmarshalling the request fails", func() { BeforeEach(func() { incomingMessage.Payload = []byte("this-is-a-bogus-payload") }) @@ -2704,7 +2704,7 @@ var _ = Describe("Handler", func() { }) }) - Context("when unmarshaling the request fails", func() { + Context("when unmarshalling the request fails", func() { BeforeEach(func() { incomingMessage.Payload = []byte("this-is-a-bogus-payload") }) diff --git a/core/chaincode/lifecycle/scc.go b/core/chaincode/lifecycle/scc.go index 65e1499e367..b51abfeeffe 100644 --- a/core/chaincode/lifecycle/scc.go +++ b/core/chaincode/lifecycle/scc.go @@ -151,7 +151,7 @@ type SCC struct { // Functions provides the backing implementation of lifecycle. Functions SCCFunctions - // Dispatcher handles the rote protobuf boilerplate for unmarshaling/marshaling + // Dispatcher handles the rote protobuf boilerplate for unmarshalling/marshaling // the inputs and outputs of the SCC functions. Dispatcher *dispatcher.Dispatcher } diff --git a/core/chaincode/lifecycle/serializer.go b/core/chaincode/lifecycle/serializer.go index 24bb9b8a14d..4bc83dc764d 100644 --- a/core/chaincode/lifecycle/serializer.go +++ b/core/chaincode/lifecycle/serializer.go @@ -460,7 +460,7 @@ func (s *Serializer) DeserializeAllMetadata(namespace string, state RangeableSta metadata := &lb.StateMetadata{} err = proto.Unmarshal(value, metadata) if err != nil { - return nil, errors.Wrapf(err, "error unmarshaling metadata for key %s", key) + return nil, errors.Wrapf(err, "error unmarshalling metadata for key %s", key) } result[name] = metadata } diff --git a/core/chaincode/lifecycle/serializer_test.go b/core/chaincode/lifecycle/serializer_test.go index 1a6c67299d8..939228140ea 100644 --- a/core/chaincode/lifecycle/serializer_test.go +++ b/core/chaincode/lifecycle/serializer_test.go @@ -815,7 +815,7 @@ var _ = Describe("Serializer", func() { It("returns an error", func() { _, err := s.DeserializeAllMetadata("namespaces", fakeState) - Expect(err).To(MatchError("error unmarshaling metadata for key namespaces/metadata/bad: unexpected EOF")) + Expect(err).To(MatchError("error unmarshalling metadata for key namespaces/metadata/bad: unexpected EOF")) }) }) }) diff --git a/core/committer/txvalidator/v14/vscc_validator.go b/core/committer/txvalidator/v14/vscc_validator.go index dc94cbccc4d..2e23a7abcb3 100644 --- a/core/committer/txvalidator/v14/vscc_validator.go +++ b/core/committer/txvalidator/v14/vscc_validator.go @@ -47,7 +47,7 @@ func getChaincodeHeaderExtension(hdr *common.Header) (*peer.ChaincodeHeaderExten chaincodeHdrExt := &peer.ChaincodeHeaderExtension{} err = proto.Unmarshal(chdr.Extension, chaincodeHdrExt) - return chaincodeHdrExt, errors.Wrap(err, "error unmarshaling ChaincodeHeaderExtension") + return chaincodeHdrExt, errors.Wrap(err, "error unmarshalling ChaincodeHeaderExtension") } // VSCCValidateTx executes vscc validation for transaction diff --git a/core/dispatcher/dispatcher.go b/core/dispatcher/dispatcher.go index 593171d1fa9..b8e49f3c4f3 100644 --- a/core/dispatcher/dispatcher.go +++ b/core/dispatcher/dispatcher.go @@ -13,7 +13,7 @@ import ( "github.com/pkg/errors" ) -// Dispatcher is used to handle the boilerplate proto tasks of unmarshaling inputs and remarshaling outputs +// Dispatcher is used to handle the boilerplate proto tasks of unmarshalling inputs and remarshaling outputs // so that the receiver may focus on the implementation details rather than the proto hassles. type Dispatcher struct { // Protobuf should pass through to Google Protobuf in production paths diff --git a/core/endorser/endorser_test.go b/core/endorser/endorser_test.go index 19d3b27083a..e23db8db179 100644 --- a/core/endorser/endorser_test.go +++ b/core/endorser/endorser_test.go @@ -714,11 +714,11 @@ var _ = Describe("Endorser", func() { It("wraps and returns an error and responds to the client", func() { proposalResponse, err := e.ProcessProposal(context.Background(), signedProposal) - Expect(err).To(MatchError("error unmarshaling Proposal: proto: can't skip unknown wire type 7")) + Expect(err).To(MatchError("error unmarshalling Proposal: proto: can't skip unknown wire type 7")) Expect(proposalResponse).To(Equal(&pb.ProposalResponse{ Response: &pb.Response{ Status: 500, - Message: "error unmarshaling Proposal: proto: can't skip unknown wire type 7", + Message: "error unmarshalling Proposal: proto: can't skip unknown wire type 7", }, })) }) @@ -974,7 +974,7 @@ var _ = Describe("Endorser", func() { Expect(err).NotTo(HaveOccurred()) Expect(proposalResponse.Response).To(Equal(&pb.Response{ Status: 500, - Message: "error in simulation: error unmarshaling ChaincodeDeploymentSpec: unexpected EOF", + Message: "error in simulation: error unmarshalling ChaincodeDeploymentSpec: unexpected EOF", })) Expect(fakeSimulateFailure.AddCallCount()).To(Equal(1)) }) diff --git a/core/endorser/msgvalidation_test.go b/core/endorser/msgvalidation_test.go index cee0a9a7fa1..198b81c12f8 100644 --- a/core/endorser/msgvalidation_test.go +++ b/core/endorser/msgvalidation_test.go @@ -172,7 +172,7 @@ var _ = Describe("UnpackProposal", func() { It("wraps and returns an error", func() { _, err := endorser.UnpackProposal(signedProposal) - Expect(err).To(MatchError("error unmarshaling Proposal: proto: can't skip unknown wire type 7")) + Expect(err).To(MatchError("error unmarshalling Proposal: proto: can't skip unknown wire type 7")) }) }) @@ -185,7 +185,7 @@ var _ = Describe("UnpackProposal", func() { It("wraps and returns the error", func() { _, err := endorser.UnpackProposal(signedProposal) - Expect(err).To(MatchError("error unmarshaling Header: proto: can't skip unknown wire type 7")) + Expect(err).To(MatchError("error unmarshalling Header: proto: can't skip unknown wire type 7")) }) }) @@ -198,7 +198,7 @@ var _ = Describe("UnpackProposal", func() { It("wraps and returns an error", func() { _, err := endorser.UnpackProposal(signedProposal) - Expect(err).To(MatchError("error unmarshaling ChannelHeader: proto: can't skip unknown wire type 7")) + Expect(err).To(MatchError("error unmarshalling ChannelHeader: proto: can't skip unknown wire type 7")) }) }) @@ -211,7 +211,7 @@ var _ = Describe("UnpackProposal", func() { It("wraps and returns an error", func() { _, err := endorser.UnpackProposal(signedProposal) - Expect(err).To(MatchError("error unmarshaling SignatureHeader: proto: can't skip unknown wire type 7")) + Expect(err).To(MatchError("error unmarshalling SignatureHeader: proto: can't skip unknown wire type 7")) }) }) @@ -224,7 +224,7 @@ var _ = Describe("UnpackProposal", func() { It("wraps and returns an error", func() { _, err := endorser.UnpackProposal(signedProposal) - Expect(err).To(MatchError("error unmarshaling ChaincodeHeaderExtension: proto: can't skip unknown wire type 7")) + Expect(err).To(MatchError("error unmarshalling ChaincodeHeaderExtension: proto: can't skip unknown wire type 7")) }) }) @@ -237,7 +237,7 @@ var _ = Describe("UnpackProposal", func() { It("wraps and returns an error", func() { _, err := endorser.UnpackProposal(signedProposal) - Expect(err).To(MatchError("error unmarshaling ChaincodeProposalPayload: proto: can't skip unknown wire type 7")) + Expect(err).To(MatchError("error unmarshalling ChaincodeProposalPayload: proto: can't skip unknown wire type 7")) }) }) @@ -272,7 +272,7 @@ var _ = Describe("UnpackProposal", func() { It("wraps and returns an error", func() { _, err := endorser.UnpackProposal(signedProposal) - Expect(err).To(MatchError("error unmarshaling ChaincodeInvocationSpec: proto: can't skip unknown wire type 7")) + Expect(err).To(MatchError("error unmarshalling ChaincodeInvocationSpec: proto: can't skip unknown wire type 7")) }) }) diff --git a/core/handlers/validation/builtin/v12/validation_logic_test.go b/core/handlers/validation/builtin/v12/validation_logic_test.go index 2e4d1e07df9..22c019094aa 100644 --- a/core/handlers/validation/builtin/v12/validation_logic_test.go +++ b/core/handlers/validation/builtin/v12/validation_logic_test.go @@ -577,7 +577,7 @@ func TestValidateDeployFail(t *testing.T) { b = &common.Block{Data: &common.BlockData{Data: [][]byte{envBytes}}} err = v.Validate(b, "lscc", 0, 0, policy) - require.EqualError(t, err, "GetChaincodeDeploymentSpec error error unmarshaling ChaincodeDeploymentSpec: unexpected EOF") + require.EqualError(t, err, "GetChaincodeDeploymentSpec error error unmarshalling ChaincodeDeploymentSpec: unexpected EOF") /***********************/ /* test bad cc version */ diff --git a/core/handlers/validation/builtin/v13/validation_logic_test.go b/core/handlers/validation/builtin/v13/validation_logic_test.go index c35c4a8446f..6bb25997b42 100644 --- a/core/handlers/validation/builtin/v13/validation_logic_test.go +++ b/core/handlers/validation/builtin/v13/validation_logic_test.go @@ -548,7 +548,7 @@ func TestValidateDeployFail(t *testing.T) { b = &common.Block{Data: &common.BlockData{Data: [][]byte{envBytes}}, Header: &common.BlockHeader{}} err = v.Validate(b, "lscc", 0, 0, policy) - require.EqualError(t, err, "GetChaincodeDeploymentSpec error error unmarshaling ChaincodeDeploymentSpec: unexpected EOF") + require.EqualError(t, err, "GetChaincodeDeploymentSpec error error unmarshalling ChaincodeDeploymentSpec: unexpected EOF") /***********************/ /* test bad cc version */ diff --git a/core/ledger/kvledger/channelinfo_provider_test.go b/core/ledger/kvledger/channelinfo_provider_test.go index b8c58ed1ed9..9302f84957e 100644 --- a/core/ledger/kvledger/channelinfo_provider_test.go +++ b/core/ledger/kvledger/channelinfo_provider_test.go @@ -210,7 +210,7 @@ func TestGetAllMSPIDs_NegativeTests(t *testing.T) { configBlock.Metadata.Metadata[cb.BlockMetadataIndex_SIGNATURES] = []byte("invalid_bytes") require.NoError(t, blkStore.AddBlock(configBlock)) _, err = channelInfoProvider.getAllMSPIDs() - require.EqualError(t, err, "failed to retrieve metadata: error unmarshaling metadata at index [SIGNATURES]: unexpected EOF") + require.EqualError(t, err, "failed to retrieve metadata: error unmarshalling metadata at index [SIGNATURES]: unexpected EOF") // test RetrieveBlockByNumber error (before calling GetLastConfigIndexFromBlock) by closing block store provider blkStoreProvider.Close() diff --git a/core/ledger/kvledger/kv_ledger.go b/core/ledger/kvledger/kv_ledger.go index ffae4167263..288ce431ec2 100644 --- a/core/ledger/kvledger/kv_ledger.go +++ b/core/ledger/kvledger/kv_ledger.go @@ -332,7 +332,7 @@ func (l *kvLedger) lastPersistedCommitHash() ([]byte, error) { commitHash := &common.Metadata{} err = proto.Unmarshal(block.Metadata.Metadata[common.BlockMetadataIndex_COMMIT_HASH], commitHash) if err != nil { - return nil, errors.Wrap(err, "error unmarshaling last persisted commit hash") + return nil, errors.Wrap(err, "error unmarshalling last persisted commit hash") } return commitHash.Value, nil } diff --git a/core/ledger/kvledger/snapshot.go b/core/ledger/kvledger/snapshot.go index 0043ff25f98..e25b8d5e1ce 100644 --- a/core/ledger/kvledger/snapshot.go +++ b/core/ledger/kvledger/snapshot.go @@ -76,12 +76,12 @@ type snapshotMetadataJSONs struct { func (j *snapshotMetadataJSONs) toMetadata() (*snapshotMetadata, error) { metadata := &snapshotSignableMetadata{} if err := json.Unmarshal([]byte(j.signableMetadata), metadata); err != nil { - return nil, errors.Wrap(err, "error while unmarshaling signable metadata") + return nil, errors.Wrap(err, "error while unmarshalling signable metadata") } additionalMetadata := &snapshotAdditionalMetadata{} if err := json.Unmarshal([]byte(j.additionalMetadata), additionalMetadata); err != nil { - return nil, errors.Wrap(err, "error while unmarshaling additional metadata") + return nil, errors.Wrap(err, "error while unmarshalling additional metadata") } return &snapshotMetadata{ snapshotSignableMetadata: metadata, @@ -228,7 +228,7 @@ func (p *Provider) CreateFromSnapshot(snapshotDir string) (ledger.PeerLedger, st metadata, err := metadataJSONs.toMetadata() if err != nil { - return nil, "", errors.WithMessagef(err, "error while unmarshaling metadata") + return nil, "", errors.WithMessagef(err, "error while unmarshalling metadata") } if err := verifySnapshot(snapshotDir, metadata, p.initializer.HashProvider); err != nil { diff --git a/core/ledger/kvledger/snapshot_test.go b/core/ledger/kvledger/snapshot_test.go index 447a10472ed..0b8717905c1 100644 --- a/core/ledger/kvledger/snapshot_test.go +++ b/core/ledger/kvledger/snapshot_test.go @@ -709,7 +709,7 @@ func testCreateLedgerFromSnapshotErrorPaths(t *testing.T, originalSnapshotDir st _, _, err := provider.CreateFromSnapshot(snapshotDirForTest) require.EqualError(t, err, - "error while unmarshaling metadata: error while unmarshaling signable metadata: unexpected end of JSON input", + "error while unmarshalling metadata: error while unmarshalling signable metadata: unexpected end of JSON input", ) verifyLedgerDoesNotExist(t, provider, metadata.ChannelName) }) @@ -722,7 +722,7 @@ func testCreateLedgerFromSnapshotErrorPaths(t *testing.T, originalSnapshotDir st _, _, err := provider.CreateFromSnapshot(snapshotDirForTest) require.EqualError(t, err, - "error while unmarshaling metadata: error while unmarshaling additional metadata: unexpected end of JSON input", + "error while unmarshalling metadata: error while unmarshalling additional metadata: unexpected end of JSON input", ) verifyLedgerDoesNotExist(t, provider, metadata.ChannelName) }) diff --git a/core/scc/lscc/lscc.go b/core/scc/lscc/lscc.go index 539968e146d..c736d9aaf0e 100644 --- a/core/scc/lscc/lscc.go +++ b/core/scc/lscc/lscc.go @@ -1013,7 +1013,7 @@ func (lscc *SCC) Invoke(stub shim.ChaincodeStubInterface) pb.Response { cds := &pb.ChaincodeDeploymentSpec{} err := proto.Unmarshal(depSpec, cds) if err != nil { - return shim.Error(fmt.Sprintf("error unmarshaling ChaincodeDeploymentSpec: %s", err)) + return shim.Error(fmt.Sprintf("error unmarshalling ChaincodeDeploymentSpec: %s", err)) } // optional arguments here (they can each be nil and may or may not be present) diff --git a/core/scc/lscc/lscc_test.go b/core/scc/lscc/lscc_test.go index 8a7377b0e7c..11233c381c2 100644 --- a/core/scc/lscc/lscc_test.go +++ b/core/scc/lscc/lscc_test.go @@ -316,7 +316,7 @@ func TestDeploy(t *testing.T) { res = stub.MockInvokeWithSignedProposal("1", [][]byte{[]byte("deploy"), []byte("chain"), []byte("barf")}, nil) require.NotEqual(t, int32(shim.OK), res.Status) - require.Equal(t, "error unmarshaling ChaincodeDeploymentSpec: unexpected EOF", res.Message) + require.Equal(t, "error unmarshalling ChaincodeDeploymentSpec: unexpected EOF", res.Message) testDeploy(t, "example02", "1.0", path, false, false, true, "", scc, stub, nil) testDeploy(t, "example02", "1.0", path, false, false, true, "chaincode with name 'example02' already exists", scc, stub, nil) diff --git a/core/tx/endorser/parser_test.go b/core/tx/endorser/parser_test.go index 09b5bdfbbaa..85deba93236 100644 --- a/core/tx/endorser/parser_test.go +++ b/core/tx/endorser/parser_test.go @@ -107,7 +107,7 @@ var _ = Describe("Parser", func() { It("returns an error", func() { pe, err := endorsertx.UnmarshalEndorserTxAndValidate(txenv) - Expect(err).To(MatchError("error unmarshaling Transaction: unexpected EOF")) + Expect(err).To(MatchError("error unmarshalling Transaction: unexpected EOF")) Expect(pe).To(BeNil()) }) }) @@ -149,7 +149,7 @@ var _ = Describe("Parser", func() { It("returns an error", func() { pe, err := endorsertx.UnmarshalEndorserTxAndValidate(txenv) - Expect(err).To(MatchError("error unmarshaling ChaincodeActionPayload: unexpected EOF")) + Expect(err).To(MatchError("error unmarshalling ChaincodeActionPayload: unexpected EOF")) Expect(pe).To(BeNil()) }) }) @@ -196,7 +196,7 @@ var _ = Describe("Parser", func() { It("returns an error", func() { pe, err := endorsertx.UnmarshalEndorserTxAndValidate(txenv) - Expect(err).To(MatchError("error unmarshaling ChaincodeHeaderExtension: unexpected EOF")) + Expect(err).To(MatchError("error unmarshalling ChaincodeHeaderExtension: unexpected EOF")) Expect(pe).To(BeNil()) }) }) @@ -220,7 +220,7 @@ var _ = Describe("Parser", func() { It("returns an error", func() { pe, err := endorsertx.UnmarshalEndorserTxAndValidate(txenv) - Expect(err).To(MatchError("error unmarshaling ProposalResponsePayload: unexpected EOF")) + Expect(err).To(MatchError("error unmarshalling ProposalResponsePayload: unexpected EOF")) Expect(pe).To(BeNil()) }) }) @@ -244,7 +244,7 @@ var _ = Describe("Parser", func() { It("returns an error", func() { pe, err := endorsertx.UnmarshalEndorserTxAndValidate(txenv) - Expect(err).To(MatchError("error unmarshaling ChaincodeAction: unexpected EOF")) + Expect(err).To(MatchError("error unmarshalling ChaincodeAction: unexpected EOF")) Expect(pe).To(BeNil()) }) }) diff --git a/core/tx/processor_factory_test.go b/core/tx/processor_factory_test.go index 438ea67775a..140e1fbc06f 100644 --- a/core/tx/processor_factory_test.go +++ b/core/tx/processor_factory_test.go @@ -45,13 +45,13 @@ func TestBasicTxValidity(t *testing.T) { }, { []byte("bad env"), &pkgtx.InvalidErr{ - ActualErr: errors.New("error unmarshaling Envelope: unexpected EOF"), + ActualErr: errors.New("error unmarshalling Envelope: unexpected EOF"), ValidationCode: peer.TxValidationCode_INVALID_OTHER_REASON, }, }, { protoutil.MarshalOrPanic(&common.Envelope{Payload: []byte("bad payload"), Signature: []byte("signature")}), &pkgtx.InvalidErr{ - ActualErr: errors.New("error unmarshaling Payload: unexpected EOF"), + ActualErr: errors.New("error unmarshalling Payload: unexpected EOF"), ValidationCode: peer.TxValidationCode_BAD_PAYLOAD, }, }, @@ -81,13 +81,13 @@ func TestBasicTxValidity(t *testing.T) { }, { protoutil.MarshalOrPanic(&common.Envelope{Payload: protoutil.MarshalOrPanic(&common.Payload{Header: &common.Header{ChannelHeader: []byte("bad channel header"), SignatureHeader: protoutil.MarshalOrPanic(&common.SignatureHeader{Creator: []byte("creator"), Nonce: []byte("nonce")})}}), Signature: []byte("signature")}), &pkgtx.InvalidErr{ - ActualErr: errors.New("error unmarshaling ChannelHeader: unexpected EOF"), + ActualErr: errors.New("error unmarshalling ChannelHeader: unexpected EOF"), ValidationCode: peer.TxValidationCode_BAD_PAYLOAD, }, }, { protoutil.MarshalOrPanic(&common.Envelope{Payload: protoutil.MarshalOrPanic(&common.Payload{Header: &common.Header{ChannelHeader: protoutil.MarshalOrPanic(&common.ChannelHeader{ChannelId: "myc", TxId: "tid"}), SignatureHeader: []byte("bad sig hdr")}}), Signature: []byte("signature")}), &pkgtx.InvalidErr{ - ActualErr: errors.New("error unmarshaling SignatureHeader: unexpected EOF"), + ActualErr: errors.New("error unmarshalling SignatureHeader: unexpected EOF"), ValidationCode: peer.TxValidationCode_BAD_PAYLOAD, }, }, diff --git a/discovery/client/client.go b/discovery/client/client.go index be7d52a68a8..3afd681e91f 100644 --- a/discovery/client/client.go +++ b/discovery/client/client.go @@ -412,13 +412,13 @@ func peersForChannel(membersRes *discovery.PeerMembershipResult, qt protoext.Que for _, peer := range peersOfCurrentOrg.Peers { aliveMsg, err := gprotoext.EnvelopeToGossipMessage(peer.MembershipInfo) if err != nil { - return nil, errors.Wrap(err, "failed unmarshaling alive message") + return nil, errors.Wrap(err, "failed unmarshalling alive message") } var stateInfoMsg *gprotoext.SignedGossipMessage if isStateInfoExpected(qt) { stateInfoMsg, err = gprotoext.EnvelopeToGossipMessage(peer.StateInfo) if err != nil { - return nil, errors.Wrap(err, "failed unmarshaling stateInfo message") + return nil, errors.Wrap(err, "failed unmarshalling stateInfo message") } if err := validateStateInfoMessage(stateInfoMsg); err != nil { return nil, errors.Wrap(err, "failed validating stateInfo message") @@ -530,11 +530,11 @@ func endorser(peer *discovery.Peer, chaincode, channel string) (*Peer, error) { } aliveMsg, err := gprotoext.EnvelopeToGossipMessage(peer.MembershipInfo) if err != nil { - return nil, errors.Wrap(err, "failed unmarshaling gossip envelope to alive message") + return nil, errors.Wrap(err, "failed unmarshalling gossip envelope to alive message") } stateInfMsg, err := gprotoext.EnvelopeToGossipMessage(peer.StateInfo) if err != nil { - return nil, errors.Wrap(err, "failed unmarshaling gossip envelope to state info message") + return nil, errors.Wrap(err, "failed unmarshalling gossip envelope to state info message") } if err := validateAliveMessage(aliveMsg); err != nil { return nil, errors.Wrap(err, "failed validating alive message") @@ -544,7 +544,7 @@ func endorser(peer *discovery.Peer, chaincode, channel string) (*Peer, error) { } sID := &msp.SerializedIdentity{} if err := proto.Unmarshal(peer.Identity, sID); err != nil { - return nil, errors.Wrap(err, "failed unmarshaling peer's identity") + return nil, errors.Wrap(err, "failed unmarshalling peer's identity") } return &Peer{ Identity: peer.Identity, diff --git a/discovery/support/chaincode/support.go b/discovery/support/chaincode/support.go index fca4388f5f5..a837dbeb372 100644 --- a/discovery/support/chaincode/support.go +++ b/discovery/support/chaincode/support.go @@ -45,7 +45,7 @@ func (s *DiscoverySupport) PoliciesByChaincode(channel string, cc string, collec // chaincode policy pol := &common2.SignaturePolicyEnvelope{} if err := proto.Unmarshal(chaincodeData.Policy, pol); err != nil { - logger.Errorf("Failed unmarshaling policy for chaincode '%s': %s", cc, err) + logger.Errorf("Failed unmarshalling policy for chaincode '%s': %s", cc, err) return nil } if len(pol.Identities) == 0 || pol.Rule == nil { @@ -76,7 +76,7 @@ func (s *DiscoverySupport) PoliciesByChaincode(channel string, cc string, collec collectionPolicy := chaincodeData.CollectionPolicies[collectionName] pol := &common2.SignaturePolicyEnvelope{} if err := proto.Unmarshal(collectionPolicy, pol); err != nil { - logger.Errorf("Failed unmarshaling collection policy for chaincode '%s' collection '%s': %s", cc, collectionName, err) + logger.Errorf("Failed unmarshalling collection policy for chaincode '%s' collection '%s': %s", cc, collectionName, err) return nil } if len(pol.Identities) == 0 || pol.Rule == nil { diff --git a/discovery/support/config/support.go b/discovery/support/config/support.go index d17c44a52b0..c8cd4c4d187 100644 --- a/discovery/support/config/support.go +++ b/discovery/support/config/support.go @@ -73,7 +73,7 @@ func (s *DiscoverySupport) Config(channel string) (*discovery.ConfigResult, erro if globalOrderers != nil { ordererAddressesConfig := &common.OrdererAddresses{} if err := proto.Unmarshal(globalOrderers.Value, ordererAddressesConfig); err != nil { - return nil, errors.Wrap(err, "failed unmarshaling orderer addresses") + return nil, errors.Wrap(err, "failed unmarshalling orderer addresses") } globalEndpoints = ordererAddressesConfig.Addresses } @@ -167,7 +167,7 @@ func perOrgEndpointsByMSPID(ordererGrp map[string]*common.ConfigGroup) (map[stri if perOrgAddresses := group.Values[channelconfig.EndpointsKey]; perOrgAddresses != nil { ordererEndpoints := &common.OrdererAddresses{} if err := proto.Unmarshal(perOrgAddresses.Value, ordererEndpoints); err != nil { - return nil, errors.Wrap(err, "failed unmarshaling orderer addresses") + return nil, errors.Wrap(err, "failed unmarshalling orderer addresses") } // Override the mapping because this orderer org config contains org-specific endpoints. res[fabricConfig.Name] = ordererEndpoints.Addresses diff --git a/gossip/protoext/signing.go b/gossip/protoext/signing.go index 19b91920cb9..04200951fd4 100644 --- a/gossip/protoext/signing.go +++ b/gossip/protoext/signing.go @@ -61,7 +61,7 @@ func EnvelopeToGossipMessage(e *gossip.Envelope) (*SignedGossipMessage, error) { msg := &gossip.GossipMessage{} err := proto.Unmarshal(e.Payload, msg) if err != nil { - return nil, fmt.Errorf("Failed unmarshaling GossipMessage from envelope: %v", err) + return nil, fmt.Errorf("Failed unmarshalling GossipMessage from envelope: %v", err) } return &SignedGossipMessage{ GossipMessage: msg, diff --git a/gossip/state/state.go b/gossip/state/state.go index 52fbecf6b4d..a71cc27fc8b 100644 --- a/gossip/state/state.go +++ b/gossip/state/state.go @@ -503,7 +503,7 @@ func (s *GossipStateProviderImpl) handleStateResponse(msg protoext.ReceivedMessa s.logger.Debugf("Received payload with sequence number %d.", payload.SeqNum) block, err := protoutil.UnmarshalBlock(payload.Data) if err != nil { - s.logger.Warningf("Error unmarshaling payload to block for sequence number %d, due to %+v", payload.SeqNum, err) + s.logger.Warningf("Error unmarshalling payload to block for sequence number %d, due to %+v", payload.SeqNum, err) return uint64(0), err } diff --git a/integration/discovery/discovery_test.go b/integration/discovery/discovery_test.go index d4282dd5124..8b1ef3adadf 100644 --- a/integration/discovery/discovery_test.go +++ b/integration/discovery/discovery_test.go @@ -742,7 +742,7 @@ func discoverConfiguration(n *nwo.Network, peer *nwo.Peer) *discovery.ConfigResu Expect(err).NotTo(HaveOccurred()) Eventually(sess, n.EventuallyTimeout).Should(gexec.Exit(0)) - By("unmarshaling the response") + By("unmarshalling the response") discoveredConfig := &discovery.ConfigResult{} err = json.Unmarshal(sess.Out.Contents(), &discoveredConfig) Expect(err).NotTo(HaveOccurred()) diff --git a/integration/pkcs11/pkcs11_test.go b/integration/pkcs11/pkcs11_test.go index 1375a9b5371..9cfeaa8ffae 100644 --- a/integration/pkcs11/pkcs11_test.go +++ b/integration/pkcs11/pkcs11_test.go @@ -417,7 +417,7 @@ func generateKeyPair(ctx *pkcs11.Ctx, sess pkcs11.SessionHandle) (*ecdsa.PublicK nistCurve := elliptic.P256() x, y := elliptic.Unmarshal(nistCurve, ecpt) if x == nil { - Expect(x).NotTo(BeNil(), "Failed Unmarshaling Public Key") + Expect(x).NotTo(BeNil(), "Failed Unmarshalling Public Key") } pubKey := &ecdsa.PublicKey{Curve: nistCurve, X: x, Y: y} diff --git a/internal/configtxgen/genesisconfig/config.go b/internal/configtxgen/genesisconfig/config.go index 6c7d869e197..92643113fa4 100644 --- a/internal/configtxgen/genesisconfig/config.go +++ b/internal/configtxgen/genesisconfig/config.go @@ -438,7 +438,7 @@ func (c *configCache) load(config *viperutil.ConfigParser, configPath string) (* if !ok { err := config.EnhancedExactUnmarshal(conf) if err != nil { - return nil, fmt.Errorf("Error unmarshaling config into struct: %s", err) + return nil, fmt.Errorf("Error unmarshalling config into struct: %s", err) } serializedConf, err = json.Marshal(conf) diff --git a/internal/configtxlator/rest/configtxlator_handlers.go b/internal/configtxlator/rest/configtxlator_handlers.go index 9bb331b6326..e78eb4ccbf3 100644 --- a/internal/configtxlator/rest/configtxlator_handlers.go +++ b/internal/configtxlator/rest/configtxlator_handlers.go @@ -35,7 +35,7 @@ func fieldConfigProto(fieldName string, r *http.Request) (*cb.Config, error) { config := &cb.Config{} err = proto.Unmarshal(fieldBytes, config) if err != nil { - return nil, fmt.Errorf("error unmarshaling field bytes: %s", err) + return nil, fmt.Errorf("error unmarshalling field bytes: %s", err) } return config, nil diff --git a/internal/peer/chaincode/common.go b/internal/peer/chaincode/common.go index 398d0844c76..e49a32bed9d 100644 --- a/internal/peer/chaincode/common.go +++ b/internal/peer/chaincode/common.go @@ -147,11 +147,11 @@ func chaincodeInvokeOrQuery(cmd *cobra.Command, invoke bool, cf *ChaincodeCmdFac logger.Debugf("ESCC invoke result: %v", proposalResp) pRespPayload, err := protoutil.UnmarshalProposalResponsePayload(proposalResp.Payload) if err != nil { - return errors.WithMessage(err, "error while unmarshaling proposal response payload") + return errors.WithMessage(err, "error while unmarshalling proposal response payload") } ca, err := protoutil.UnmarshalChaincodeAction(pRespPayload.Extension) if err != nil { - return errors.WithMessage(err, "error while unmarshaling chaincode action") + return errors.WithMessage(err, "error while unmarshalling chaincode action") } if proposalResp.Endorsement == nil { return errors.Errorf("endorsement failure during invoke. response: %v", proposalResp.Response) diff --git a/internal/peer/common/common.go b/internal/peer/common/common.go index 6c7035a4a7f..cf76be9e976 100644 --- a/internal/peer/common/common.go +++ b/internal/peer/common/common.go @@ -245,7 +245,7 @@ func GetOrdererEndpointOfChain(chainID string, signer Signer, endorserClient pb. // parse config channelConfig := &pcommon.Config{} if err := proto.Unmarshal(proposalResp.Response.Payload, channelConfig); err != nil { - return nil, errors.WithMessage(err, "error unmarshaling channel config") + return nil, errors.WithMessage(err, "error unmarshalling channel config") } bundle, err := channelconfig.NewBundle(chainID, channelConfig, cryptoProvider) diff --git a/internal/peer/common/common_test.go b/internal/peer/common/common_test.go index 58a000d4d10..a3011ff842e 100644 --- a/internal/peer/common/common_test.go +++ b/internal/peer/common/common_test.go @@ -334,7 +334,7 @@ func TestGetOrdererEndpointFromConfigTx(t *testing.T) { nil, ) _, err := common.GetOrdererEndpointOfChain("test-channel", signer, mockEndorserClient, cryptoProvider) - require.EqualError(t, err, "error unmarshaling channel config: unexpected EOF") + require.EqualError(t, err, "error unmarshalling channel config: unexpected EOF") }) t.Run("unloadable-config", func(t *testing.T) { diff --git a/internal/peer/common/networkconfig.go b/internal/peer/common/networkconfig.go index cda2efd84aa..d49c1a3316d 100644 --- a/internal/peer/common/networkconfig.go +++ b/internal/peer/common/networkconfig.go @@ -169,7 +169,7 @@ func GetConfig(fileName string) (*NetworkConfig, error) { config := &NetworkConfig{} err = yaml.Unmarshal([]byte(configData), &config) if err != nil { - return nil, errors.Wrap(err, "error unmarshaling YAML") + return nil, errors.Wrap(err, "error unmarshalling YAML") } return config, nil diff --git a/internal/peer/lifecycle/chaincode/client_connections_test.go b/internal/peer/lifecycle/chaincode/client_connections_test.go index 15c265105b2..e7de47416e1 100644 --- a/internal/peer/lifecycle/chaincode/client_connections_test.go +++ b/internal/peer/lifecycle/chaincode/client_connections_test.go @@ -28,7 +28,7 @@ func TestNewClientConnections(t *testing.T) { c, err := NewClientConnections(input, cryptoProvider) require.Nil(c) require.Error(err) - require.Contains(err.Error(), "failed to validate peer connection parameters: error unmarshaling YAML") + require.Contains(err.Error(), "failed to validate peer connection parameters: error unmarshalling YAML") }) t.Run("uneven connection profile", func(t *testing.T) { diff --git a/internal/pkg/gateway/api_test.go b/internal/pkg/gateway/api_test.go index b0b3d80b8cf..e25f721ac54 100644 --- a/internal/pkg/gateway/api_test.go +++ b/internal/pkg/gateway/api_test.go @@ -633,7 +633,7 @@ func TestNilArgs(t *testing.T) { require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "the proposed transaction must contain a signed proposal")) _, err = server.Endorse(ctx, &pb.EndorseRequest{ProposedTransaction: &peer.SignedProposal{ProposalBytes: []byte("jibberish")}}) - require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "failed to unpack transaction proposal: error unmarshaling Proposal: unexpected EOF")) + require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "failed to unpack transaction proposal: error unmarshalling Proposal: unexpected EOF")) _, err = server.Submit(ctx, nil) require.ErrorIs(t, err, status.Error(codes.InvalidArgument, "a submit request is required")) diff --git a/orderer/common/cluster/replication_test.go b/orderer/common/cluster/replication_test.go index 28ff98ee4fe..f8c2a046530 100644 --- a/orderer/common/cluster/replication_test.go +++ b/orderer/common/cluster/replication_test.go @@ -751,7 +751,7 @@ func TestParticipant(t *testing.T) { Metadata: [][]byte{{1, 2, 3}}, }, }, - expectedError: "failed to retrieve metadata: error unmarshaling metadata" + + expectedError: "failed to retrieve metadata: error unmarshalling metadata" + " at index [SIGNATURES]: proto: common.Metadata: illegal tag 0 (wire type 1)", }, { @@ -765,7 +765,7 @@ func TestParticipant(t *testing.T) { Metadata: [][]byte{{}, {1, 2, 3}}, }, }, - expectedError: "failed to retrieve metadata: error unmarshaling metadata" + + expectedError: "failed to retrieve metadata: error unmarshalling metadata" + " at index [LAST_CONFIG]: proto: common.Metadata: illegal tag 0 (wire type 1)", }, { @@ -869,7 +869,7 @@ func TestBlockPullerFromConfigBlockFailures(t *testing.T) { name: "bad envelope inside block", expectedErr: "failed extracting bundle from envelope: " + "failed to unmarshal payload from envelope: " + - "error unmarshaling Payload: " + + "error unmarshalling Payload: " + "proto: common.Payload: illegal tag 0 (wire type 1)", block: &common.Block{ Data: &common.BlockData{ @@ -1149,7 +1149,7 @@ func TestExtractGenesisBlock(t *testing.T) { { name: "corrupt envelope in block", expectedErr: "block data does not carry an" + - " envelope at index 0: error unmarshaling Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)", + " envelope at index 0: error unmarshalling Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)", block: &common.Block{ Data: &common.BlockData{ Data: [][]byte{{1, 2, 3}}, @@ -1158,7 +1158,7 @@ func TestExtractGenesisBlock(t *testing.T) { }, { name: "corrupt payload in envelope", - expectedErr: "error unmarshaling Payload: proto: common.Payload: illegal tag 0 (wire type 1)", + expectedErr: "error unmarshalling Payload: proto: common.Payload: illegal tag 0 (wire type 1)", block: &common.Block{ Data: &common.BlockData{ Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ @@ -1180,7 +1180,7 @@ func TestExtractGenesisBlock(t *testing.T) { }, { name: "corrupt channel header", - expectedErr: "error unmarshaling ChannelHeader:" + + expectedErr: "error unmarshalling ChannelHeader:" + " proto: common.ChannelHeader: illegal tag 0 (wire type 1)", block: &common.Block{ Data: &common.BlockData{ @@ -1213,7 +1213,7 @@ func TestExtractGenesisBlock(t *testing.T) { }, { name: "orderer transaction with corrupt inner envelope", - expectedErr: "error unmarshaling Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)", + expectedErr: "error unmarshalling Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)", block: &common.Block{ Data: &common.BlockData{ Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ @@ -1231,7 +1231,7 @@ func TestExtractGenesisBlock(t *testing.T) { }, { name: "orderer transaction with corrupt inner payload", - expectedErr: "error unmarshaling Payload: proto: common.Payload: illegal tag 0 (wire type 1)", + expectedErr: "error unmarshalling Payload: proto: common.Payload: illegal tag 0 (wire type 1)", block: &common.Block{ Data: &common.BlockData{ Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ @@ -1271,7 +1271,7 @@ func TestExtractGenesisBlock(t *testing.T) { }, { name: "orderer transaction with corrupt inner channel header", - expectedErr: "error unmarshaling ChannelHeader: proto: common.ChannelHeader: illegal tag 0 (wire type 1)", + expectedErr: "error unmarshalling ChannelHeader: proto: common.ChannelHeader: illegal tag 0 (wire type 1)", block: &common.Block{ Data: &common.BlockData{ Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ @@ -1495,7 +1495,7 @@ func TestChannels(t *testing.T) { }, assertion: func(t *testing.T, ci *cluster.ChainInspector) { panicValue := "Failed extracting channel genesis block from config block: " + - "block data does not carry an envelope at index 0: error unmarshaling " + + "block data does not carry an envelope at index 0: error unmarshalling " + "Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)" require.PanicsWithValue(t, panicValue, func() { ci.Channels() diff --git a/orderer/common/cluster/util.go b/orderer/common/cluster/util.go index 745f4815f75..814e040f7dd 100644 --- a/orderer/common/cluster/util.go +++ b/orderer/common/cluster/util.go @@ -333,14 +333,14 @@ func SignatureSetFromBlock(block *common.Block) ([]*protoutil.SignedData, error) } metadata, err := protoutil.GetMetadataFromBlock(block, common.BlockMetadataIndex_SIGNATURES) if err != nil { - return nil, errors.Errorf("failed unmarshaling medatata for signatures: %v", err) + return nil, errors.Errorf("failed unmarshalling medatata for signatures: %v", err) } var signatureSet []*protoutil.SignedData for _, metadataSignature := range metadata.Signatures { sigHdr, err := protoutil.UnmarshalSignatureHeader(metadataSignature.SignatureHeader) if err != nil { - return nil, errors.Errorf("failed unmarshaling signature header for block with id %d: %v", + return nil, errors.Errorf("failed unmarshalling signature header for block with id %d: %v", block.Header.Number, err) } signatureSet = append(signatureSet, diff --git a/orderer/common/cluster/util_test.go b/orderer/common/cluster/util_test.go index 60edb057166..991d6db6c3a 100644 --- a/orderer/common/cluster/util_test.go +++ b/orderer/common/cluster/util_test.go @@ -212,7 +212,7 @@ func TestVerifyBlockSignature(t *testing.T) { }, { name: "nil metadata", - errorContains: "failed unmarshaling medatata for signatures", + errorContains: "failed unmarshalling medatata for signatures", mutateBlock: func(block *common.Block) *common.Block { block.Metadata.Metadata[0] = []byte{1, 2, 3} return block @@ -220,7 +220,7 @@ func TestVerifyBlockSignature(t *testing.T) { }, { name: "bad signature header", - errorContains: "failed unmarshaling signature header", + errorContains: "failed unmarshalling signature header", mutateBlock: func(block *common.Block) *common.Block { metadata := protoutil.GetMetadataFromBlockOrPanic(block, common.BlockMetadataIndex_SIGNATURES) metadata.Signatures[0].SignatureHeader = []byte{1, 2, 3} @@ -691,7 +691,7 @@ func TestConfigFromBlockBadInput(t *testing.T) { }, { name: "invalid payload", - expectedError: "error unmarshaling Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)", + expectedError: "error unmarshalling Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)", block: &common.Block{Data: &common.BlockData{Data: [][]byte{{1, 2, 3}}}}, }, { @@ -707,19 +707,19 @@ func TestConfigFromBlockBadInput(t *testing.T) { }, { name: "invalid envelope in block", - expectedError: "error unmarshaling Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)", + expectedError: "error unmarshalling Envelope: proto: common.Envelope: illegal tag 0 (wire type 1)", block: &common.Block{Data: &common.BlockData{Data: [][]byte{{1, 2, 3}}}}, }, { name: "invalid payload in block envelope", - expectedError: "error unmarshaling Payload: proto: common.Payload: illegal tag 0 (wire type 1)", + expectedError: "error unmarshalling Payload: proto: common.Payload: illegal tag 0 (wire type 1)", block: &common.Block{Data: &common.BlockData{Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ Payload: []byte{1, 2, 3}, })}}}, }, { name: "invalid channel header", - expectedError: "error unmarshaling ChannelHeader: proto: common.ChannelHeader: illegal tag 0 (wire type 1)", + expectedError: "error unmarshalling ChannelHeader: proto: common.ChannelHeader: illegal tag 0 (wire type 1)", block: &common.Block{ Header: &common.BlockHeader{Number: 1}, Data: &common.BlockData{Data: [][]byte{protoutil.MarshalOrPanic(&common.Envelope{ diff --git a/orderer/common/localconfig/config.go b/orderer/common/localconfig/config.go index e28c462d406..a9b164d9f0e 100644 --- a/orderer/common/localconfig/config.go +++ b/orderer/common/localconfig/config.go @@ -328,7 +328,7 @@ func (c *configCache) load() (*TopLevel, error) { if !ok { err := config.EnhancedExactUnmarshal(&uconf) if err != nil { - return nil, fmt.Errorf("Error unmarshaling config into struct: %s", err) + return nil, fmt.Errorf("Error unmarshalling config into struct: %s", err) } serializedConf, err = json.Marshal(uconf) diff --git a/orderer/common/msgprocessor/maintenancefilter.go b/orderer/common/msgprocessor/maintenancefilter.go index bcc0ae618fd..d6a6f696de6 100644 --- a/orderer/common/msgprocessor/maintenancefilter.go +++ b/orderer/common/msgprocessor/maintenancefilter.go @@ -158,12 +158,12 @@ func (mf *MaintenanceFilter) inspect(configEnvelope *cb.ConfigEnvelope, ordererC func (mf *MaintenanceFilter) ensureConsensusTypeChangeOnly(configEnvelope *cb.ConfigEnvelope) error { configUpdateEnv, err := protoutil.EnvelopeToConfigUpdate(configEnvelope.LastUpdate) if err != nil { - return errors.Wrap(err, "envelope to config update unmarshaling error") + return errors.Wrap(err, "envelope to config update unmarshalling error") } configUpdate, err := configtx.UnmarshalConfigUpdate(configUpdateEnv.ConfigUpdate) if err != nil { - return errors.Wrap(err, "config update unmarshaling error") + return errors.Wrap(err, "config update unmarshalling error") } if len(configUpdate.WriteSet.Groups) == 0 { diff --git a/orderer/common/msgprocessor/maintenancefilter_test.go b/orderer/common/msgprocessor/maintenancefilter_test.go index ccced4d261d..d233bbd723c 100644 --- a/orderer/common/msgprocessor/maintenancefilter_test.go +++ b/orderer/common/msgprocessor/maintenancefilter_test.go @@ -104,7 +104,7 @@ func TestMaintenanceParseEnvelope(t *testing.T) { { name: "Bad payload", envelope: &common.Envelope{Payload: badBytes}, - errMsg: "envelope unmarshalling failed: error unmarshaling Payload", + errMsg: "envelope unmarshalling failed: error unmarshalling Payload", }, { name: "Bad ChannelHeader", @@ -115,7 +115,7 @@ func TestMaintenanceParseEnvelope(t *testing.T) { }, }), }, - errMsg: "envelope unmarshalling failed: error unmarshaling ChannelHeader", + errMsg: "envelope unmarshalling failed: error unmarshalling ChannelHeader", }, { name: "Bad ChannelHeader Type", @@ -144,7 +144,7 @@ func TestMaintenanceParseEnvelope(t *testing.T) { Data: badBytes, }), }, - errMsg: "envelope unmarshalling failed: error unmarshaling message for type CONFIG", + errMsg: "envelope unmarshalling failed: error unmarshalling message for type CONFIG", }, } diff --git a/orderer/common/msgprocessor/systemchannel.go b/orderer/common/msgprocessor/systemchannel.go index 0db0bc9d64e..fb2f0e873bd 100644 --- a/orderer/common/msgprocessor/systemchannel.go +++ b/orderer/common/msgprocessor/systemchannel.go @@ -229,12 +229,12 @@ func NewDefaultTemplator(support DefaultTemplatorSupport, bccsp bccsp.BCCSP) *De func (dt *DefaultTemplator) NewChannelConfig(envConfigUpdate *cb.Envelope) (channelconfig.Resources, error) { configUpdatePayload, err := protoutil.UnmarshalPayload(envConfigUpdate.Payload) if err != nil { - return nil, fmt.Errorf("Failing initial channel config creation because of payload unmarshaling error: %s", err) + return nil, fmt.Errorf("Failing initial channel config creation because of payload unmarshalling error: %s", err) } configUpdateEnv, err := configtx.UnmarshalConfigUpdateEnvelope(configUpdatePayload.Data) if err != nil { - return nil, fmt.Errorf("Failing initial channel config creation because of config update envelope unmarshaling error: %s", err) + return nil, fmt.Errorf("Failing initial channel config creation because of config update envelope unmarshalling error: %s", err) } if configUpdatePayload.Header == nil { @@ -248,7 +248,7 @@ func (dt *DefaultTemplator) NewChannelConfig(envConfigUpdate *cb.Envelope) (chan configUpdate, err := configtx.UnmarshalConfigUpdate(configUpdateEnv.ConfigUpdate) if err != nil { - return nil, fmt.Errorf("Failing initial channel config creation because of config update unmarshaling error: %s", err) + return nil, fmt.Errorf("Failing initial channel config creation because of config update unmarshalling error: %s", err) } if configUpdate.ChannelId != channelHeader.ChannelId { @@ -275,7 +275,7 @@ func (dt *DefaultTemplator) NewChannelConfig(envConfigUpdate *cb.Envelope) (chan consortium := &cb.Consortium{} err = proto.Unmarshal(consortiumConfigValue.Value, consortium) if err != nil { - return nil, fmt.Errorf("Error reading unmarshaling consortium name: %s", err) + return nil, fmt.Errorf("Error reading unmarshalling consortium name: %s", err) } applicationGroup := protoutil.NewConfigGroup() diff --git a/orderer/common/msgprocessor/systemchannel_test.go b/orderer/common/msgprocessor/systemchannel_test.go index 8d6f6f49431..9d5f568fda0 100644 --- a/orderer/common/msgprocessor/systemchannel_test.go +++ b/orderer/common/msgprocessor/systemchannel_test.go @@ -513,7 +513,7 @@ func TestNewChannelConfig(t *testing.T) { &cb.Payload{ Data: []byte("bad payload data"), }, - "^Failing initial channel config creation because of config update envelope unmarshaling error:", + "^Failing initial channel config creation because of config update envelope unmarshalling error:", }, { "BadConfigUpdate", @@ -523,7 +523,7 @@ func TestNewChannelConfig(t *testing.T) { ConfigUpdate: []byte("bad config update envelope data"), }), }, - "^Failing initial channel config creation because of config update unmarshaling error:", + "^Failing initial channel config creation because of config update unmarshalling error:", }, { "MismatchedChannelID", @@ -645,7 +645,7 @@ func TestNewChannelConfig(t *testing.T) { ), }), }, - "^Error reading unmarshaling consortium name:", + "^Error reading unmarshalling consortium name:", }, { "UnknownConsortiumName", diff --git a/orderer/common/msgprocessor/systemchannelfilter.go b/orderer/common/msgprocessor/systemchannelfilter.go index 17f025f8e03..b1fea5260da 100644 --- a/orderer/common/msgprocessor/systemchannelfilter.go +++ b/orderer/common/msgprocessor/systemchannelfilter.go @@ -90,7 +90,7 @@ func (scf *SystemChainFilter) Apply(env *cb.Envelope) error { configTx := &cb.Envelope{} err = proto.Unmarshal(msgData.Data, configTx) if err != nil { - return errors.Errorf("payload data error unmarshaling to envelope: %s", err) + return errors.Errorf("payload data error unmarshalling to envelope: %s", err) } return scf.authorizeAndInspect(configTx) @@ -100,7 +100,7 @@ func (scf *SystemChainFilter) authorizeAndInspect(configTx *cb.Envelope) error { payload := &cb.Payload{} err := proto.Unmarshal(configTx.Payload, payload) if err != nil { - return errors.Errorf("error unmarshaling wrapped configtx envelope payload: %s", err) + return errors.Errorf("error unmarshalling wrapped configtx envelope payload: %s", err) } if payload.Header == nil { @@ -109,7 +109,7 @@ func (scf *SystemChainFilter) authorizeAndInspect(configTx *cb.Envelope) error { chdr, err := protoutil.UnmarshalChannelHeader(payload.Header.ChannelHeader) if err != nil { - return errors.Errorf("error unmarshaling wrapped configtx envelope channel header: %s", err) + return errors.Errorf("error unmarshalling wrapped configtx envelope channel header: %s", err) } if chdr.Type != int32(cb.HeaderType_CONFIG) { diff --git a/orderer/common/msgprocessor/systemchannelfilter_test.go b/orderer/common/msgprocessor/systemchannelfilter_test.go index 3cc8c22eac1..ce3b26248de 100644 --- a/orderer/common/msgprocessor/systemchannelfilter_test.go +++ b/orderer/common/msgprocessor/systemchannelfilter_test.go @@ -271,7 +271,7 @@ func TestBadProposal(t *testing.T) { }, Data: []byte("bad configTx"), }, - "payload data error unmarshaling to envelope", + "payload data error unmarshalling to envelope", }, { "BadConfigTxPayload", @@ -289,7 +289,7 @@ func TestBadProposal(t *testing.T) { }, ), }, - "error unmarshaling wrapped configtx envelope payload", + "error unmarshalling wrapped configtx envelope payload", }, { "MissingConfigTxChannelHeader", @@ -333,7 +333,7 @@ func TestBadProposal(t *testing.T) { }, ), }, - "error unmarshaling wrapped configtx envelope channel header", + "error unmarshalling wrapped configtx envelope channel header", }, { "BadConfigTxChannelHeaderType", diff --git a/orderer/common/multichannel/registrar.go b/orderer/common/multichannel/registrar.go index 99b415012af..1ba722b47ea 100644 --- a/orderer/common/multichannel/registrar.go +++ b/orderer/common/multichannel/registrar.go @@ -493,7 +493,7 @@ func (r *Registrar) newLedgerResources(configTx *cb.Envelope) (*ledgerResources, chdr, err := protoutil.UnmarshalChannelHeader(payload.Header.ChannelHeader) if err != nil { - return nil, errors.WithMessage(err, "error unmarshaling channel header") + return nil, errors.WithMessage(err, "error unmarshalling channel header") } configEnvelope, err := configtx.UnmarshalConfigEnvelope(payload.Data) diff --git a/orderer/consensus/etcdraft/consenter_test.go b/orderer/consensus/etcdraft/consenter_test.go index 109c3e05c65..08888fad12f 100644 --- a/orderer/consensus/etcdraft/consenter_test.go +++ b/orderer/consensus/etcdraft/consenter_test.go @@ -149,7 +149,7 @@ var _ = Describe("Consenter", func() { block.Data.Data = [][]byte{{1, 2, 3, 4}, {5, 6, 7, 8}} return block }(), - MatchError(HavePrefix("block data does not carry an envelope at index 0: error unmarshaling Envelope: proto:"))), + MatchError(HavePrefix("block data does not carry an envelope at index 0: error unmarshalling Envelope: proto:"))), ) When("the consenter is asked about join-block membership", func() { diff --git a/orderer/consensus/etcdraft/util_test.go b/orderer/consensus/etcdraft/util_test.go index b7ca5f26c45..b1463aef977 100644 --- a/orderer/consensus/etcdraft/util_test.go +++ b/orderer/consensus/etcdraft/util_test.go @@ -82,7 +82,7 @@ func TestIsConsenterOfChannel(t *testing.T) { { name: "invalid envelope inside block", expectedError: "failed to unmarshal payload from envelope:" + - " error unmarshaling Payload: proto: common.Payload: illegal tag 0 (wire type 1)", + " error unmarshalling Payload: proto: common.Payload: illegal tag 0 (wire type 1)", configBlock: &common.Block{ Header: &common.BlockHeader{}, Data: &common.BlockData{ diff --git a/protoutil/blockutils.go b/protoutil/blockutils.go index eec72e8ecf4..4217015d643 100644 --- a/protoutil/blockutils.go +++ b/protoutil/blockutils.go @@ -117,7 +117,7 @@ func GetMetadataFromBlock(block *cb.Block, index cb.BlockMetadataIndex) (*cb.Met md := &cb.Metadata{} err := proto.Unmarshal(block.Metadata.Metadata[index], md) if err != nil { - return nil, errors.Wrapf(err, "error unmarshaling metadata at index [%s]", index) + return nil, errors.Wrapf(err, "error unmarshalling metadata at index [%s]", index) } return md, nil } @@ -177,7 +177,7 @@ func GetLastConfigIndexFromBlock(block *cb.Block) (uint64, error) { lc := &cb.LastConfig{} err = proto.Unmarshal(m.Value, lc) if err != nil { - return 0, errors.Wrap(err, "error unmarshaling LastConfig") + return 0, errors.Wrap(err, "error unmarshalling LastConfig") } return lc.Index, nil } diff --git a/protoutil/blockutils_test.go b/protoutil/blockutils_test.go index 77f5018ac87..a57f1aed80c 100644 --- a/protoutil/blockutils_test.go +++ b/protoutil/blockutils_test.go @@ -200,7 +200,7 @@ func TestGetMetadataFromBlock(t *testing.T) { block.Metadata.Metadata[cb.BlockMetadataIndex_ORDERER] = []byte("bad metadata") _, err := protoutil.GetMetadataFromBlock(block, cb.BlockMetadataIndex_ORDERER) require.Error(t, err, "Expected error with malformed metadata") - require.Contains(t, err.Error(), "error unmarshaling metadata at index [ORDERER]") + require.Contains(t, err.Error(), "error unmarshalling metadata at index [ORDERER]") require.Panics(t, func() { _ = protoutil.GetMetadataFromBlockOrPanic(block, cb.BlockMetadataIndex_ORDERER) }, "Expected panic with malformed metadata") @@ -329,7 +329,7 @@ func TestGetLastConfigIndexFromBlock(t *testing.T) { block.Metadata.Metadata[cb.BlockMetadataIndex_SIGNATURES] = []byte("apple") _, err := protoutil.GetLastConfigIndexFromBlock(block) require.Error(t, err) - require.Contains(t, err.Error(), "failed to retrieve metadata: error unmarshaling metadata at index [SIGNATURES]") + require.Contains(t, err.Error(), "failed to retrieve metadata: error unmarshalling metadata at index [SIGNATURES]") }) t.Run("block with malformed orderer block metadata", func(t *testing.T) { @@ -359,7 +359,7 @@ func TestGetLastConfigIndexFromBlock(t *testing.T) { block.Metadata.Metadata[cb.BlockMetadataIndex_LAST_CONFIG] = []byte("bad metadata") _, err := protoutil.GetLastConfigIndexFromBlock(block) require.Error(t, err) - require.Contains(t, err.Error(), "failed to retrieve metadata: error unmarshaling metadata at index [LAST_CONFIG]") + require.Contains(t, err.Error(), "failed to retrieve metadata: error unmarshalling metadata at index [LAST_CONFIG]") }) t.Run("malformed last config", func(t *testing.T) { @@ -368,7 +368,7 @@ func TestGetLastConfigIndexFromBlock(t *testing.T) { }) _, err := protoutil.GetLastConfigIndexFromBlock(block) require.Error(t, err, "Expected error with malformed last config metadata") - require.Contains(t, err.Error(), "error unmarshaling LastConfig") + require.Contains(t, err.Error(), "error unmarshalling LastConfig") require.Panics(t, func() { _ = protoutil.GetLastConfigIndexFromBlockOrPanic(block) }, "Expected panic with malformed last config metadata") diff --git a/protoutil/commonutils.go b/protoutil/commonutils.go index 4b4874682fd..cc462305e17 100644 --- a/protoutil/commonutils.go +++ b/protoutil/commonutils.go @@ -50,7 +50,7 @@ func CreateNonce() ([]byte, error) { } // UnmarshalEnvelopeOfType unmarshals an envelope of the specified type, -// including unmarshaling the payload data +// including unmarshalling the payload data func UnmarshalEnvelopeOfType(envelope *cb.Envelope, headerType cb.HeaderType, message proto.Message) (*cb.ChannelHeader, error) { payload, err := UnmarshalPayload(envelope.Payload) if err != nil { @@ -71,7 +71,7 @@ func UnmarshalEnvelopeOfType(envelope *cb.Envelope, headerType cb.HeaderType, me } err = proto.Unmarshal(payload.Data, message) - err = errors.Wrapf(err, "error unmarshaling message for type %s", headerType) + err = errors.Wrapf(err, "error unmarshalling message for type %s", headerType) return chdr, err } @@ -227,7 +227,7 @@ func ChannelHeader(env *cb.Envelope) (*cb.ChannelHeader, error) { chdr, err := UnmarshalChannelHeader(envPayload.Header.ChannelHeader) if err != nil { - return nil, errors.WithMessage(err, "error unmarshaling channel header") + return nil, errors.WithMessage(err, "error unmarshalling channel header") } return chdr, nil diff --git a/protoutil/commonutils_test.go b/protoutil/commonutils_test.go index 95c38cf8f97..ba58f33310a 100644 --- a/protoutil/commonutils_test.go +++ b/protoutil/commonutils_test.go @@ -57,7 +57,7 @@ func TestUnmarshalPayload(t *testing.T) { Data: []byte("payload"), }) payload, err := UnmarshalPayload(good) - require.NoError(t, err, "Unexpected error unmarshaling payload") + require.NoError(t, err, "Unexpected error unmarshalling payload") require.NotNil(t, payload, "Payload should not be nil") payload = UnmarshalPayloadOrPanic(good) require.NotNil(t, payload, "Payload should not be nil") @@ -65,21 +65,21 @@ func TestUnmarshalPayload(t *testing.T) { bad := []byte("bad payload") require.Panics(t, func() { _ = UnmarshalPayloadOrPanic(bad) - }, "Expected panic unmarshaling malformed payload") + }, "Expected panic unmarshalling malformed payload") } func TestUnmarshalSignatureHeader(t *testing.T) { t.Run("invalid header", func(t *testing.T) { sighdrBytes := []byte("invalid signature header") _, err := UnmarshalSignatureHeader(sighdrBytes) - require.Error(t, err, "Expected unmarshaling error") + require.Error(t, err, "Expected unmarshalling error") }) t.Run("valid empty header", func(t *testing.T) { sighdr := &cb.SignatureHeader{} sighdrBytes := MarshalOrPanic(sighdr) sighdr, err := UnmarshalSignatureHeader(sighdrBytes) - require.NoError(t, err, "Unexpected error unmarshaling signature header") + require.NoError(t, err, "Unexpected error unmarshalling signature header") require.Nil(t, sighdr.Creator) require.Nil(t, sighdr.Nonce) }) @@ -91,7 +91,7 @@ func TestUnmarshalSignatureHeader(t *testing.T) { } sighdrBytes := MarshalOrPanic(sighdr) sighdr, err := UnmarshalSignatureHeader(sighdrBytes) - require.NoError(t, err, "Unexpected error unmarshaling signature header") + require.NoError(t, err, "Unexpected error unmarshalling signature header") require.Equal(t, []byte("creator"), sighdr.Creator) require.Equal(t, []byte("nonce"), sighdr.Nonce) }) @@ -118,7 +118,7 @@ func TestUnmarshalEnvelope(t *testing.T) { var env *cb.Envelope good, _ := proto.Marshal(&cb.Envelope{}) env, err := UnmarshalEnvelope(good) - require.NoError(t, err, "Unexpected error unmarshaling envelope") + require.NoError(t, err, "Unexpected error unmarshalling envelope") require.NotNil(t, env, "Envelope should not be nil") env = UnmarshalEnvelopeOrPanic(good) require.NotNil(t, env, "Envelope should not be nil") @@ -126,14 +126,14 @@ func TestUnmarshalEnvelope(t *testing.T) { bad := []byte("bad envelope") require.Panics(t, func() { _ = UnmarshalEnvelopeOrPanic(bad) - }, "Expected panic unmarshaling malformed envelope") + }, "Expected panic unmarshalling malformed envelope") } func TestUnmarshalBlock(t *testing.T) { var env *cb.Block good, _ := proto.Marshal(&cb.Block{}) env, err := UnmarshalBlock(good) - require.NoError(t, err, "Unexpected error unmarshaling block") + require.NoError(t, err, "Unexpected error unmarshalling block") require.NotNil(t, env, "Block should not be nil") env = UnmarshalBlockOrPanic(good) require.NotNil(t, env, "Block should not be nil") @@ -141,7 +141,7 @@ func TestUnmarshalBlock(t *testing.T) { bad := []byte("bad block") require.Panics(t, func() { _ = UnmarshalBlockOrPanic(bad) - }, "Expected panic unmarshaling malformed block") + }, "Expected panic unmarshalling malformed block") } func TestUnmarshalEnvelopeOfType(t *testing.T) { @@ -149,7 +149,7 @@ func TestUnmarshalEnvelopeOfType(t *testing.T) { env.Payload = []byte("bad payload") _, err := UnmarshalEnvelopeOfType(env, cb.HeaderType_CONFIG, nil) - require.Error(t, err, "Expected error unmarshaling malformed envelope") + require.Error(t, err, "Expected error unmarshalling malformed envelope") payload, _ := proto.Marshal(&cb.Payload{ Header: nil, @@ -204,7 +204,7 @@ func TestUnmarshalEnvelopeOfType(t *testing.T) { }) env.Payload = payload _, err = UnmarshalEnvelopeOfType(env, cb.HeaderType_CONFIG, &cb.ConfigEnvelope{}) - require.NoError(t, err, "Unexpected error unmarshaling envelope") + require.NoError(t, err, "Unexpected error unmarshalling envelope") } func TestExtractEnvelopeNilData(t *testing.T) { diff --git a/protoutil/proputils.go b/protoutil/proputils.go index 25e042bddb3..16bbbf9360d 100644 --- a/protoutil/proputils.go +++ b/protoutil/proputils.go @@ -183,7 +183,7 @@ func GetBytesSignatureHeader(hdr *common.SignatureHeader) ([]byte, error) { // GetBytesTransaction get the bytes of Transaction from the message func GetBytesTransaction(tx *peer.Transaction) ([]byte, error) { bytes, err := proto.Marshal(tx) - return bytes, errors.Wrap(err, "error unmarshaling Transaction") + return bytes, errors.Wrap(err, "error unmarshalling Transaction") } // GetBytesPayload get the bytes of Payload from the message diff --git a/protoutil/txutils.go b/protoutil/txutils.go index 1cfe006c615..a19987dc9de 100644 --- a/protoutil/txutils.go +++ b/protoutil/txutils.go @@ -50,7 +50,7 @@ func GetEnvelopeFromBlock(data []byte) (*common.Envelope, error) { var err error env := &common.Envelope{} if err = proto.Unmarshal(data, env); err != nil { - return nil, errors.Wrap(err, "error unmarshaling Envelope") + return nil, errors.Wrap(err, "error unmarshalling Envelope") } return env, nil diff --git a/protoutil/txutils_test.go b/protoutil/txutils_test.go index 8d7bcad2a96..a0e70e22d7e 100644 --- a/protoutil/txutils_test.go +++ b/protoutil/txutils_test.go @@ -515,9 +515,9 @@ func TestCreateProposalResponseFailure(t *testing.T) { require.Equal(t, int32(502), prespFailure.Response.Status) // drilldown into the response to find the chaincode response pRespPayload, err := protoutil.UnmarshalProposalResponsePayload(prespFailure.Payload) - require.NoError(t, err, "Error while unmarshaling proposal response payload: %s", err) + require.NoError(t, err, "Error while unmarshalling proposal response payload: %s", err) ca, err := protoutil.UnmarshalChaincodeAction(pRespPayload.Extension) - require.NoError(t, err, "Error while unmarshaling chaincode action: %s", err) + require.NoError(t, err, "Error while unmarshalling chaincode action: %s", err) require.Equal(t, int32(502), ca.Response.Status) require.Equal(t, "Invalid function name", string(ca.Response.Payload)) diff --git a/protoutil/unmarshalers.go b/protoutil/unmarshalers.go index 5999cc58c78..be1819b4b4a 100644 --- a/protoutil/unmarshalers.go +++ b/protoutil/unmarshalers.go @@ -21,139 +21,139 @@ import ( func UnmarshalBlock(encoded []byte) (*common.Block, error) { block := &common.Block{} err := proto.Unmarshal(encoded, block) - return block, errors.Wrap(err, "error unmarshaling Block") + return block, errors.Wrap(err, "error unmarshalling Block") } // UnmarshalChaincodeDeploymentSpec unmarshals bytes to a ChaincodeDeploymentSpec func UnmarshalChaincodeDeploymentSpec(code []byte) (*peer.ChaincodeDeploymentSpec, error) { cds := &peer.ChaincodeDeploymentSpec{} err := proto.Unmarshal(code, cds) - return cds, errors.Wrap(err, "error unmarshaling ChaincodeDeploymentSpec") + return cds, errors.Wrap(err, "error unmarshalling ChaincodeDeploymentSpec") } // UnmarshalChaincodeInvocationSpec unmarshals bytes to a ChaincodeInvocationSpec func UnmarshalChaincodeInvocationSpec(encoded []byte) (*peer.ChaincodeInvocationSpec, error) { cis := &peer.ChaincodeInvocationSpec{} err := proto.Unmarshal(encoded, cis) - return cis, errors.Wrap(err, "error unmarshaling ChaincodeInvocationSpec") + return cis, errors.Wrap(err, "error unmarshalling ChaincodeInvocationSpec") } // UnmarshalPayload unmarshals bytes to a Payload func UnmarshalPayload(encoded []byte) (*common.Payload, error) { payload := &common.Payload{} err := proto.Unmarshal(encoded, payload) - return payload, errors.Wrap(err, "error unmarshaling Payload") + return payload, errors.Wrap(err, "error unmarshalling Payload") } // UnmarshalEnvelope unmarshals bytes to a Envelope func UnmarshalEnvelope(encoded []byte) (*common.Envelope, error) { envelope := &common.Envelope{} err := proto.Unmarshal(encoded, envelope) - return envelope, errors.Wrap(err, "error unmarshaling Envelope") + return envelope, errors.Wrap(err, "error unmarshalling Envelope") } // UnmarshalChannelHeader unmarshals bytes to a ChannelHeader func UnmarshalChannelHeader(bytes []byte) (*common.ChannelHeader, error) { chdr := &common.ChannelHeader{} err := proto.Unmarshal(bytes, chdr) - return chdr, errors.Wrap(err, "error unmarshaling ChannelHeader") + return chdr, errors.Wrap(err, "error unmarshalling ChannelHeader") } // UnmarshalChaincodeID unmarshals bytes to a ChaincodeID func UnmarshalChaincodeID(bytes []byte) (*peer.ChaincodeID, error) { ccid := &peer.ChaincodeID{} err := proto.Unmarshal(bytes, ccid) - return ccid, errors.Wrap(err, "error unmarshaling ChaincodeID") + return ccid, errors.Wrap(err, "error unmarshalling ChaincodeID") } // UnmarshalSignatureHeader unmarshals bytes to a SignatureHeader func UnmarshalSignatureHeader(bytes []byte) (*common.SignatureHeader, error) { sh := &common.SignatureHeader{} err := proto.Unmarshal(bytes, sh) - return sh, errors.Wrap(err, "error unmarshaling SignatureHeader") + return sh, errors.Wrap(err, "error unmarshalling SignatureHeader") } func UnmarshalSerializedIdentity(bytes []byte) (*msp.SerializedIdentity, error) { sid := &msp.SerializedIdentity{} err := proto.Unmarshal(bytes, sid) - return sid, errors.Wrap(err, "error unmarshaling SerializedIdentity") + return sid, errors.Wrap(err, "error unmarshalling SerializedIdentity") } // UnmarshalHeader unmarshals bytes to a Header func UnmarshalHeader(bytes []byte) (*common.Header, error) { hdr := &common.Header{} err := proto.Unmarshal(bytes, hdr) - return hdr, errors.Wrap(err, "error unmarshaling Header") + return hdr, errors.Wrap(err, "error unmarshalling Header") } // UnmarshalChaincodeHeaderExtension unmarshals bytes to a ChaincodeHeaderExtension func UnmarshalChaincodeHeaderExtension(hdrExtension []byte) (*peer.ChaincodeHeaderExtension, error) { chaincodeHdrExt := &peer.ChaincodeHeaderExtension{} err := proto.Unmarshal(hdrExtension, chaincodeHdrExt) - return chaincodeHdrExt, errors.Wrap(err, "error unmarshaling ChaincodeHeaderExtension") + return chaincodeHdrExt, errors.Wrap(err, "error unmarshalling ChaincodeHeaderExtension") } // UnmarshalProposalResponse unmarshals bytes to a ProposalResponse func UnmarshalProposalResponse(prBytes []byte) (*peer.ProposalResponse, error) { proposalResponse := &peer.ProposalResponse{} err := proto.Unmarshal(prBytes, proposalResponse) - return proposalResponse, errors.Wrap(err, "error unmarshaling ProposalResponse") + return proposalResponse, errors.Wrap(err, "error unmarshalling ProposalResponse") } // UnmarshalChaincodeAction unmarshals bytes to a ChaincodeAction func UnmarshalChaincodeAction(caBytes []byte) (*peer.ChaincodeAction, error) { chaincodeAction := &peer.ChaincodeAction{} err := proto.Unmarshal(caBytes, chaincodeAction) - return chaincodeAction, errors.Wrap(err, "error unmarshaling ChaincodeAction") + return chaincodeAction, errors.Wrap(err, "error unmarshalling ChaincodeAction") } // UnmarshalResponse unmarshals bytes to a Response func UnmarshalResponse(resBytes []byte) (*peer.Response, error) { response := &peer.Response{} err := proto.Unmarshal(resBytes, response) - return response, errors.Wrap(err, "error unmarshaling Response") + return response, errors.Wrap(err, "error unmarshalling Response") } // UnmarshalChaincodeEvents unmarshals bytes to a ChaincodeEvent func UnmarshalChaincodeEvents(eBytes []byte) (*peer.ChaincodeEvent, error) { chaincodeEvent := &peer.ChaincodeEvent{} err := proto.Unmarshal(eBytes, chaincodeEvent) - return chaincodeEvent, errors.Wrap(err, "error unmarshaling ChaicnodeEvent") + return chaincodeEvent, errors.Wrap(err, "error unmarshalling ChaicnodeEvent") } // UnmarshalProposalResponsePayload unmarshals bytes to a ProposalResponsePayload func UnmarshalProposalResponsePayload(prpBytes []byte) (*peer.ProposalResponsePayload, error) { prp := &peer.ProposalResponsePayload{} err := proto.Unmarshal(prpBytes, prp) - return prp, errors.Wrap(err, "error unmarshaling ProposalResponsePayload") + return prp, errors.Wrap(err, "error unmarshalling ProposalResponsePayload") } // UnmarshalProposal unmarshals bytes to a Proposal func UnmarshalProposal(propBytes []byte) (*peer.Proposal, error) { prop := &peer.Proposal{} err := proto.Unmarshal(propBytes, prop) - return prop, errors.Wrap(err, "error unmarshaling Proposal") + return prop, errors.Wrap(err, "error unmarshalling Proposal") } // UnmarshalTransaction unmarshals bytes to a Transaction func UnmarshalTransaction(txBytes []byte) (*peer.Transaction, error) { tx := &peer.Transaction{} err := proto.Unmarshal(txBytes, tx) - return tx, errors.Wrap(err, "error unmarshaling Transaction") + return tx, errors.Wrap(err, "error unmarshalling Transaction") } // UnmarshalChaincodeActionPayload unmarshals bytes to a ChaincodeActionPayload func UnmarshalChaincodeActionPayload(capBytes []byte) (*peer.ChaincodeActionPayload, error) { cap := &peer.ChaincodeActionPayload{} err := proto.Unmarshal(capBytes, cap) - return cap, errors.Wrap(err, "error unmarshaling ChaincodeActionPayload") + return cap, errors.Wrap(err, "error unmarshalling ChaincodeActionPayload") } // UnmarshalChaincodeProposalPayload unmarshals bytes to a ChaincodeProposalPayload func UnmarshalChaincodeProposalPayload(bytes []byte) (*peer.ChaincodeProposalPayload, error) { cpp := &peer.ChaincodeProposalPayload{} err := proto.Unmarshal(bytes, cpp) - return cpp, errors.Wrap(err, "error unmarshaling ChaincodeProposalPayload") + return cpp, errors.Wrap(err, "error unmarshalling ChaincodeProposalPayload") } // UnmarshalPayloadOrPanic unmarshals bytes to a Payload structure or panics