Skip to content

Commit

Permalink
fix: fix typo
Browse files Browse the repository at this point in the history
Signed-off-by: zhj0811 <1530005648@qq.com>
  • Loading branch information
zhj0811 authored and ale-linux committed Apr 7, 2021
1 parent dead74f commit ba7e923
Show file tree
Hide file tree
Showing 76 changed files with 179 additions and 179 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions bccsp/pkcs11/pkcs11.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion cmd/common/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmd/common/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions cmd/configtxgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions cmd/configtxlator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmd/cryptogen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/osnadmin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion common/cauthdsl/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
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 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)
Expand Down
2 changes: 1 addition & 1 deletion common/channelconfig/standardvalues.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions common/deliver/deliver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
})
Expand Down Expand Up @@ -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")
})
Expand Down Expand Up @@ -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")
})
Expand Down
8 changes: 4 additions & 4 deletions common/ledger/blkstorage/blockindex.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion common/ledger/blkstorage/blockstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions common/ledger/testutil/test_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion common/policies/implicitmeta.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion common/policies/implicitmeta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions common/policies/inquire/compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion common/policies/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion core/cclifecycle/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/accesscontrol/access.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/accesscontrol/access_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions core/chaincode/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
})
Expand Down Expand Up @@ -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")
})
Expand Down Expand Up @@ -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")
})
Expand Down Expand Up @@ -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")
})
Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/lifecycle/scc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/lifecycle/serializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion core/chaincode/lifecycle/serializer_test.go
Original file line number Diff line number Diff line change
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 unmarshaling metadata for key namespaces/metadata/bad: unexpected EOF"))
Expect(err).To(MatchError("error unmarshalling metadata for key namespaces/metadata/bad: unexpected EOF"))
})
})
})
Expand Down
2 changes: 1 addition & 1 deletion core/committer/txvalidator/v14/vscc_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/dispatcher/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit ba7e923

Please sign in to comment.