Skip to content

Commit

Permalink
chore: fix some comments (#116)
Browse files Browse the repository at this point in the history
Signed-off-by: riskrose <[email protected]>
  • Loading branch information
riskrose authored Aug 2, 2024
1 parent cd34efb commit a356b32
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/statebased/statebasedimpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (s *stateEP) ListOrgs() []string {
func (s *stateEP) setMSPIDsFromSP(sp *common.SignaturePolicyEnvelope) error {
// iterate over the identities in this envelope
for _, identity := range sp.Identities {
// this imlementation only supports the ROLE type
// this implementation only supports the ROLE type
if identity.PrincipalClassification == msp.MSPPrincipal_ROLE {
msprole := &msp.MSPRole{}
err := proto.Unmarshal(identity.Principal, msprole)
Expand Down
8 changes: 4 additions & 4 deletions shim/internal/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ func TestMessageSizes(t *testing.T) {
regClient, err := NewRegisterClient(client)
assert.NoError(t, err, "failed to create register client")

t.Run("acceptable messaages", func(t *testing.T) {
t.Run("acceptable messages", func(t *testing.T) {
acceptableMessage := &peer.ChaincodeMessage{
Payload: make([]byte, maxSendMessageSize-100),
}
sendMessages <- acceptableMessage
err = regClient.Send(acceptableMessage)
assert.NoError(t, err, "sending messge below size threshold failed")
assert.NoError(t, err, "sending message below size threshold failed")

select {
case m := <-receivedMessages:
Expand All @@ -103,7 +103,7 @@ func TestMessageSizes(t *testing.T) {
Payload: make([]byte, maxSendMessageSize+1),
}
err = regClient.Send(&peer.ChaincodeMessage{})
assert.NoError(t, err, "sending messge below size threshold should succeed")
assert.NoError(t, err, "sending message below size threshold should succeed")

select {
case m := <-receivedMessages:
Expand All @@ -121,7 +121,7 @@ func TestMessageSizes(t *testing.T) {
Payload: make([]byte, maxSendMessageSize+1),
}
err = regClient.Send(tooBig)
assert.Error(t, err, "sending messge above size threshold should fail")
assert.Error(t, err, "sending message above size threshold should fail")
})

err = lis.Close()
Expand Down
4 changes: 2 additions & 2 deletions shim/stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func newChaincodeStub(handler *Handler, channelID, txid string, input *peer.Chai
}
stub.creator = shdr.GetCreator()

// extract trasient data from proposal payload
// extract transient data from proposal payload
payload := &peer.ChaincodeProposalPayload{}
if err := proto.Unmarshal(stub.proposal.GetPayload(), payload); err != nil {
return nil, fmt.Errorf("failed to extract proposal payload: %s", err)
Expand Down Expand Up @@ -493,7 +493,7 @@ func validateCompositeKeyAttribute(str string) error {

// To ensure that simple keys do not go into composite key namespace,
// we validate simplekey to check whether the key starts with 0x00 (which
// is the namespace for compositeKey). This helps in avoding simple/composite
// is the namespace for compositeKey). This helps in avoiding simple/composite
// key collisions.
func validateSimpleKeys(simpleKeys ...string) error {
for _, key := range simpleKeys {
Expand Down

0 comments on commit a356b32

Please sign in to comment.