Skip to content

Commit

Permalink
Log message should start with upper case.
Browse files Browse the repository at this point in the history
Error message should start with lower case, unless it's
referring to some special nouns.

Signed-off-by: Jay Guo <guojiannan1101@gmail.com>
  • Loading branch information
guoger authored and denyeart committed Jan 13, 2020
1 parent 58af762 commit d0d935a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions core/chaincode/lifecycle/lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func (ef *ExternalFunctions) CheckCommitReadiness(chname, ccname string, cd *Cha
return nil, err
}

logger.Infof("successfully checked commit readiness of chaincode definition %s, name '%s' on channel '%s'", cd, ccname, chname)
logger.Infof("Successfully checked commit readiness of chaincode definition %s, name '%s' on channel '%s'", cd, ccname, chname)

return approvals, nil
}
Expand All @@ -305,7 +305,7 @@ func (ef *ExternalFunctions) CommitChaincodeDefinition(chname, ccname string, cd
return nil, errors.WithMessage(err, "could not serialize chaincode definition")
}

logger.Infof("successfully committed definition %s, name '%s' on channel '%s'", cd, ccname, chname)
logger.Infof("Successfully committed definition %s, name '%s' on channel '%s'", cd, ccname, chname)

return approvals, nil
}
Expand All @@ -324,7 +324,7 @@ func (ef *ExternalFunctions) DefaultEndorsementPolicyAsBytes(channelID string) (
}

return nil, errors.Errorf(
"Policy '%s' must be defined for channel '%s' before chaincode operations can be attempted",
"policy '%s' must be defined for channel '%s' before chaincode operations can be attempted",
DefaultEndorsementPolicyRef,
channelID,
)
Expand Down Expand Up @@ -479,7 +479,7 @@ func (ef *ExternalFunctions) QueryChaincodeDefinition(name string, publicState R
return nil, errors.WithMessagef(err, "could not deserialize namespace %s as chaincode", name)
}

logger.Infof("successfully queried definition %s, name '%s'", definedChaincode, name)
logger.Infof("Successfully queried definition %s, name '%s'", definedChaincode, name)

return definedChaincode, nil
}
Expand Down Expand Up @@ -536,7 +536,7 @@ func (ef *ExternalFunctions) InstallChaincode(chaincodeInstallPackage []byte) (*
ef.InstallListener.HandleChaincodeInstalled(pkg.Metadata, packageID)
}

logger.Infof("successfully installed chaincode with package ID '%s'", packageID)
logger.Infof("Successfully installed chaincode with package ID '%s'", packageID)

return &chaincode.InstalledChaincode{
PackageID: packageID,
Expand Down
6 changes: 3 additions & 3 deletions core/chaincode/lifecycle/lifecycle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ var _ = Describe("ExternalFunctions", func() {

It("returns an error", func() {
err := ef.ApproveChaincodeDefinitionForOrg("my-channel", "cc-name", testDefinition, "hash", fakePublicState, fakeOrgState)
Expect(err).To(MatchError(ContainSubstring("could not set defaults for chaincode definition in channel my-channel: Policy '/Channel/Application/Endorsement' must be defined for channel 'my-channel' before chaincode operations can be attempted")))
Expect(err).To(MatchError(ContainSubstring("could not set defaults for chaincode definition in channel my-channel: policy '/Channel/Application/Endorsement' must be defined for channel 'my-channel' before chaincode operations can be attempted")))
})
})

Expand Down Expand Up @@ -939,7 +939,7 @@ var _ = Describe("ExternalFunctions", func() {
It("returns an error", func() {
_, err := ef.CheckCommitReadiness("my-channel", "cc-name", testDefinition, fakePublicState, []lifecycle.OpaqueState{fakeOrgStates[0], fakeOrgStates[1]})
Expect(err).To(MatchError(ContainSubstring("could not set defaults for chaincode definition in " +
"channel my-channel: Policy '/Channel/Application/Endorsement' must be defined " +
"channel my-channel: policy '/Channel/Application/Endorsement' must be defined " +
"for channel 'my-channel' before chaincode operations can be attempted")))
})
})
Expand Down Expand Up @@ -1108,7 +1108,7 @@ var _ = Describe("ExternalFunctions", func() {
It("returns an error", func() {
_, err := ef.CommitChaincodeDefinition("my-channel", "cc-name", testDefinition, fakePublicState, []lifecycle.OpaqueState{fakeOrgStates[0], fakeOrgStates[1]})
Expect(err).To(MatchError(ContainSubstring("could not set defaults for chaincode definition in " +
"channel my-channel: Policy '/Channel/Application/Endorsement' must be defined " +
"channel my-channel: policy '/Channel/Application/Endorsement' must be defined " +
"for channel 'my-channel' before chaincode operations can be attempted")))
})
})
Expand Down

0 comments on commit d0d935a

Please sign in to comment.