Skip to content

Commit

Permalink
[FAB-16882]fix some typo error
Browse files Browse the repository at this point in the history
This is fix #16882

Change-Id: Ida45ded935afdb5fde4096ba08cfadc59048dcbc
Signed-off-by: bjzhang03 <[email protected]>
  • Loading branch information
bjzhang03 committed Oct 23, 2019
1 parent 1772f2d commit 72c5197
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions internal/peer/chaincode/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func getChaincodeDeploymentSpec(spec *pb.ChaincodeSpec, crtPkg bool) (*pb.Chainc
return &pb.ChaincodeDeploymentSpec{ChaincodeSpec: spec, CodePackage: codePackageBytes}, nil
}

// getChaincodeSpec get chaincode spec from the cli cmd pramameters
// getChaincodeSpec get chaincode spec from the cli cmd parameters
func getChaincodeSpec(cmd *cobra.Command) (*pb.ChaincodeSpec, error) {
spec := &pb.ChaincodeSpec{}
if err := checkChaincodeCmdParams(cmd); err != nil {
Expand Down Expand Up @@ -408,7 +408,7 @@ func InitCmdFactory(cmdName string, isEndorserRequired, isOrdererRequired bool,
}
certificate, err := common.GetCertificateFnc()
if err != nil {
return nil, errors.WithMessage(err, "error getting client cerificate")
return nil, errors.WithMessage(err, "error getting client certificate")
}

signer, err := common.GetDefaultSignerFnc()
Expand Down
2 changes: 1 addition & 1 deletion msp/mspimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ func (msp *bccspmsp) deserializeIdentityInternal(serializedIdentity []byte) (Ide
return newIdentity(cert, pub, msp)
}

// SatisfiesPrincipal returns null if the identity matches the principal or an error otherwise
// SatisfiesPrincipal returns nil if the identity matches the principal or an error otherwise
func (msp *bccspmsp) SatisfiesPrincipal(id Identity, principal *m.MSPPrincipal) error {
principals, err := collectPrincipals(principal, msp.GetVersion())
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion msp/mspimplsetup.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (msp *bccspmsp) setupCAs(conf *m.FabricMSPConfig) error {
msp.intermediateCerts[i] = id
}

// root CA and intermediate CA certificates are sanitized, they can be reimported
// root CA and intermediate CA certificates are sanitized, they can be re-imported
msp.opts = &x509.VerifyOptions{Roots: x509.NewCertPool(), Intermediates: x509.NewCertPool()}
for _, id := range msp.rootCerts {
msp.opts.Roots.AddCert(id.(*identity).cert)
Expand Down
2 changes: 1 addition & 1 deletion orderer/common/cluster/comm.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (c *Comm) DispatchConsensus(ctx context.Context, request *orderer.Consensus
return c.H.OnConsensus(reqCtx.channel, reqCtx.sender, request)
}

// classifyRequest identifies the sender and channel of the request and returns
// requestContext identifies the sender and channel of the request and returns
// it wrapped in a requestContext
func (c *Comm) requestContext(ctx context.Context, msg proto.Message) (*requestContext, error) {
channel := c.ChanExt.TargetChannel(msg)
Expand Down
4 changes: 2 additions & 2 deletions orderer/common/cluster/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const (
SubmitOperation
)

// Consensus passes the given ConsensusRequest message to the raft.Node instance.
// SendConsensus passes the given ConsensusRequest message to the raft.Node instance.
func (s *RPC) SendConsensus(destination uint64, msg *orderer.ConsensusRequest) error {
if s.Logger.IsEnabledFor(zapcore.DebugLevel) {
defer s.consensusSent(time.Now(), destination, msg)
Expand Down Expand Up @@ -127,7 +127,7 @@ func (s *RPC) consensusSent(start time.Time, to uint64, msg *orderer.ConsensusRe
s.Logger.Debugf("Sending msg of %d bytes to %d on channel %s took %v", len(msg.Payload), to, s.Channel, time.Since(start))
}

// getProposeStream obtains a Submit stream for the given destination node
// getOrCreateStream obtains a Submit stream for the given destination node
func (s *RPC) getOrCreateStream(destination uint64, operationType OperationType) (orderer.Cluster_StepClient, error) {
stream := s.getStream(destination, operationType)
if stream != nil {
Expand Down
2 changes: 1 addition & 1 deletion orderer/consensus/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ type ConsenterSupport interface {
// WriteConfigBlock commits a block to the ledger, and applies the config update inside.
WriteConfigBlock(block *cb.Block, encodedMetadataValue []byte)

// Sequence returns the current config squence.
// Sequence returns the current config sequence.
Sequence() uint64

// ChannelID returns the channel ID this support is associated with.
Expand Down
10 changes: 5 additions & 5 deletions orderer/consensus/kafka/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (chain *chainImpl) Halt() {
select {
case <-chain.haltChan:
// This construct is useful because it allows Halt() to be called
// multiple times (by a single thread) w/o panicking. Recal that a
// multiple times (by a single thread) w/o panicking. Recall that a
// receive from a closed channel returns (the zero value) immediately.
logger.Warningf("[channel: %s] Halting of chain requested again", chain.ChannelID())
default:
Expand Down Expand Up @@ -817,7 +817,7 @@ func (chain *chainImpl) processRegular(regularMessage *ab.KafkaMessageRegular, r
// Any messages coming in here may or may not have been re-validated
// and re-ordered, BUT they are definitely valid here

// advance lastOriginalOffsetProcessed iff message is re-validated and re-ordered
// advance lastOriginalOffsetProcessed if message is re-validated and re-ordered
offset := regularMessage.OriginalOffset
if offset == 0 {
offset = chain.lastOriginalOffsetProcessed
Expand Down Expand Up @@ -851,7 +851,7 @@ func (chain *chainImpl) processRegular(regularMessage *ab.KafkaMessageRegular, r
}

// Somebody resubmitted message at offset X, whereas we didn't. This is due to non-determinism where
// that message was considered invalid by us during revalidation, however somebody else deemed it to
// that message was considered invalid by us during re-validation, however somebody else deemed it to
// be valid, and resubmitted it. We need to advance lastResubmittedConfigOffset in this case in order
// to enforce consistency across the network.
if chain.lastResubmittedConfigOffset < regularMessage.OriginalOffset {
Expand Down Expand Up @@ -883,7 +883,7 @@ func (chain *chainImpl) processRegular(regularMessage *ab.KafkaMessageRegular, r
// Any messages coming in here may or may not have been re-validated
// and re-ordered, BUT they are definitely valid here

// advance lastOriginalOffsetProcessed iff message is re-validated and re-ordered
// advance lastOriginalOffsetProcessed if message is re-validated and re-ordered
offset := regularMessage.OriginalOffset
if offset == 0 {
offset = chain.lastOriginalOffsetProcessed
Expand Down Expand Up @@ -933,7 +933,7 @@ func (chain *chainImpl) WriteBlock(block *cb.Block, metadata *ab.KafkaMetadata)
chain.consenter.Metrics().LastOffsetPersisted.With("channel", chain.ChannelID()).Set(float64(metadata.LastOffsetPersisted))
}

// WriteBlock acts as a wrapper around the consenter support WriteConfigBlock, encoding the metadata,
// WriteConfigBlock acts as a wrapper around the consenter support WriteConfigBlock, encoding the metadata,
// and updating the metrics.
func (chain *chainImpl) WriteConfigBlock(block *cb.Block, metadata *ab.KafkaMetadata) {
chain.ConsenterSupport.WriteConfigBlock(block, protoutil.MarshalOrPanic(metadata))
Expand Down
2 changes: 1 addition & 1 deletion orderer/consensus/kafka/consenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func (consenter *consenterImpl) HandleChain(support consensus.ConsenterSupport,

// commonConsenter allows us to retrieve the configuration options set on the
// consenter object. These will be common across all chain objects derived by
// this consenter. They are set using using local configuration settings. This
// this consenter. They are set using local configuration settings. This
// interface is satisfied by consenterImpl.
type commonConsenter interface {
brokerConfig() *sarama.Config
Expand Down

0 comments on commit 72c5197

Please sign in to comment.