From 7d9c3b66a9eae203b2b354aca4747decd19008bc Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Wed, 9 Apr 2025 19:29:40 +0300 Subject: [PATCH] remove unused function reset_valid_pin --- handlers/application/menuhandler.go | 8 -------- handlers/application/menuhandler_test.go | 24 ------------------------ handlers/local.go | 1 - 3 files changed, 33 deletions(-) diff --git a/handlers/application/menuhandler.go b/handlers/application/menuhandler.go index bf0a42e..19cc266 100644 --- a/handlers/application/menuhandler.go +++ b/handlers/application/menuhandler.go @@ -265,14 +265,6 @@ func (h *MenuHandlers) CheckAccountCreated(ctx context.Context, sym string, inpu return res, nil } -// ResetValidPin resets the flag_valid_pin flag. -func (h *MenuHandlers) ResetValidPin(ctx context.Context, sym string, input []byte) (resource.Result, error) { - var res resource.Result - flag_valid_pin, _ := h.flagManager.GetFlag("flag_valid_pin") - res.FlagReset = append(res.FlagReset, flag_valid_pin) - return res, nil -} - // CheckBlockedStatus: // 1. Checks whether the DATA_SELF_PIN_RESET is 1 and sets the flag_account_pin_reset // 2. resets the account blocked flag if the PIN attempts have been reset by an admin. diff --git a/handlers/application/menuhandler_test.go b/handlers/application/menuhandler_test.go index 8547401..d903efc 100644 --- a/handlers/application/menuhandler_test.go +++ b/handlers/application/menuhandler_test.go @@ -3064,30 +3064,6 @@ func TestResetOthersPin(t *testing.T) { assert.NoError(t, err) } -func TestResetValidPin(t *testing.T) { - ctx := context.Background() - - fm, err := NewFlagManager(flagsPath) - if err != nil { - t.Fatal(err) - } - flag_valid_pin, _ := fm.GetFlag("flag_valid_pin") - - expectedResult := resource.Result{ - FlagReset: []uint32{flag_valid_pin}, - } - - h := &MenuHandlers{ - flagManager: fm, - } - - res, err := h.ResetValidPin(ctx, "reset_valid_pin", []byte("")) - - assert.NoError(t, err) - - assert.Equal(t, expectedResult, res) -} - func TestResetUnregisteredNumber(t *testing.T) { ctx := context.Background() diff --git a/handlers/local.go b/handlers/local.go index 507a79c..46a887c 100644 --- a/handlers/local.go +++ b/handlers/local.go @@ -109,7 +109,6 @@ func (ls *LocalHandlerService) GetHandler(accountService remote.AccountService) ls.DbRs.AddLocalFunc("view_voucher", appHandlers.ViewVoucher) ls.DbRs.AddLocalFunc("set_voucher", appHandlers.SetVoucher) ls.DbRs.AddLocalFunc("get_voucher_details", appHandlers.GetVoucherDetails) - ls.DbRs.AddLocalFunc("reset_valid_pin", appHandlers.ResetValidPin) ls.DbRs.AddLocalFunc("validate_blocked_number", appHandlers.ValidateBlockedNumber) ls.DbRs.AddLocalFunc("retrieve_blocked_number", appHandlers.RetrieveBlockedNumber) ls.DbRs.AddLocalFunc("reset_unregistered_number", appHandlers.ResetUnregisteredNumber)