Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Commit

Permalink
chore: rename countIncorrectPINAttempts to incrementIncorrectPINAttempts
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlosokumu committed Jan 8, 2025
1 parent 477b4cf commit 2ff9fed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions internal/handlers/ussd/menuhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ func (h *Handlers) Authorize(ctx context.Context, sym string, input []byte) (res
}
}
} else {
err := h.countIncorrectPINAttempts(ctx, sessionId)
err := h.incrementIncorrectPINAttempts(ctx, sessionId)
if err != nil {
return res, err
}
Expand Down Expand Up @@ -884,7 +884,7 @@ func (h *Handlers) ShowBlockedAccount(ctx context.Context, sym string, input []b
code := codeFromCtx(ctx)
l := gotext.NewLocale(translationDir, code)
l.AddDomain("default")
res.Content = l.Get("Your account has been locked.For help on how to unblock your account,contact support at: 0757628885")
res.Content = l.Get("Your account has been locked.For help on how to unblock your account, contact support at: 0757628885")
return res, nil
}

Expand Down Expand Up @@ -2124,8 +2124,8 @@ func (h *Handlers) UpdateAllProfileItems(ctx context.Context, sym string, input
return res, nil
}

// countIncorrectPINAttempts keeps track of the number of incorrect PIN attempts
func (h *Handlers) countIncorrectPINAttempts(ctx context.Context, sessionId string) error {
// incrementIncorrectPINAttempts keeps track of the number of incorrect PIN attempts
func (h *Handlers) incrementIncorrectPINAttempts(ctx context.Context, sessionId string) error {
var pinAttemptsCount uint8
store := h.userdataStore

Expand Down
2 changes: 1 addition & 1 deletion internal/handlers/ussd/menuhandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2247,7 +2247,7 @@ func TestCountIncorrectPINAttempts(t *testing.T) {
if err != nil {
t.Logf(err.Error())
}
err = h.countIncorrectPINAttempts(ctx, sessionId)
err = h.incrementIncorrectPINAttempts(ctx, sessionId)
if err != nil {
t.Logf(err.Error())
}
Expand Down

0 comments on commit 2ff9fed

Please sign in to comment.