Compare commits

..

No commits in common. "3501a79aea169946c38056d14aa31dcb9ea73198" and "7b33f2f64439d9d0bd5be53ce833eeacbd9498b6" have entirely different histories.

3 changed files with 2 additions and 25 deletions

View File

@ -130,14 +130,10 @@ func (h *Handlers) SetResetSingleEdit(ctx context.Context, sym string, input []b
switch menuOPtion { switch menuOPtion {
case "2": case "2":
fmt.Println("Resetting unlock for update")
res.FlagReset = append(res.FlagSet, models.USERFLAG_UNLOCKFORUPDATE)
res.FlagSet = append(res.FlagSet, models.USERFLAG_SINGLE_EDIT) res.FlagSet = append(res.FlagSet, models.USERFLAG_SINGLE_EDIT)
case "3": case "3":
res.FlagReset = append(res.FlagSet, models.USERFLAG_UNLOCKFORUPDATE)
res.FlagSet = append(res.FlagSet, models.USERFLAG_SINGLE_EDIT) res.FlagSet = append(res.FlagSet, models.USERFLAG_SINGLE_EDIT)
case "4": case "4":
res.FlagReset = append(res.FlagSet, models.USERFLAG_UNLOCKFORUPDATE)
res.FlagSet = append(res.FlagSet, models.USERFLAG_SINGLE_EDIT) res.FlagSet = append(res.FlagSet, models.USERFLAG_SINGLE_EDIT)
default: default:
res.FlagReset = append(res.FlagReset, models.USERFLAG_SINGLE_EDIT) res.FlagReset = append(res.FlagReset, models.USERFLAG_SINGLE_EDIT)
@ -343,8 +339,6 @@ func (h *Handlers) CheckIdentifier(ctx context.Context, sym string, input []byte
return res, nil return res, nil
} }
// Unlock attempts to unlock the next sequential nodes by verifying the provided PIN against the already set PIN.
// It sets the required flags that control the flow.
func (h *Handlers) Unlock(ctx context.Context, sym string, input []byte) (resource.Result, error) { func (h *Handlers) Unlock(ctx context.Context, sym string, input []byte) (resource.Result, error) {
res := resource.Result{} res := resource.Result{}
pin := string(input) pin := string(input)
@ -354,7 +348,7 @@ func (h *Handlers) Unlock(ctx context.Context, sym string, input []byte) (resour
return res, err return res, err
} }
if len(input) == 4 { if len(input) > 1 {
if pin != accountData["AccountPIN"] { if pin != accountData["AccountPIN"] {
res.FlagSet = append(res.FlagSet, models.USERFLAG_INCORRECTPIN) res.FlagSet = append(res.FlagSet, models.USERFLAG_INCORRECTPIN)
res.FlagReset = append(res.FlagReset, models.USERFLAG_ACCOUNT_UNLOCKED) res.FlagReset = append(res.FlagReset, models.USERFLAG_ACCOUNT_UNLOCKED)
@ -365,7 +359,6 @@ func (h *Handlers) Unlock(ctx context.Context, sym string, input []byte) (resour
res.FlagSet = append(res.FlagSet, models.USERFLAG_UNLOCKFORUPDATE) res.FlagSet = append(res.FlagSet, models.USERFLAG_UNLOCKFORUPDATE)
res.FlagSet = append(res.FlagSet, models.USERFLAG_ACCOUNT_UNLOCKED) res.FlagSet = append(res.FlagSet, models.USERFLAG_ACCOUNT_UNLOCKED)
} else { } else {
res.FlagSet = append(res.FlagSet, models.USERFLAG_UNLOCKFORUPDATE)
res.FlagReset = append(res.FlagReset, models.USERFLAG_ACCOUNT_UNLOCKED) res.FlagReset = append(res.FlagReset, models.USERFLAG_ACCOUNT_UNLOCKED)
} }
} }
@ -685,8 +678,6 @@ func (h *Handlers) GetAmount(ctx context.Context, sym string, input []byte) (res
} }
// QuickWithBalance retrieves the balance for a given public key from the custodial balance API endpoint before
// gracefully exiting the session.
func (h *Handlers) QuitWithBalance(ctx context.Context, sym string, input []byte) (resource.Result, error) { func (h *Handlers) QuitWithBalance(ctx context.Context, sym string, input []byte) (resource.Result, error) {
res := resource.Result{} res := resource.Result{}

View File

@ -1,11 +0,0 @@
package ussd
import "testing"
func CreateAccountTest(t *testing.T){
}

View File

@ -1,6 +1,4 @@
LOAD reset_unlocked 16 LOAD reset_unlocked 0
LOAD reset_unlock_for_update 0
RELOAD reset_unlock_for_update
MOUT edit_name 1 MOUT edit_name 1
MOUT edit_gender 2 MOUT edit_gender 2
MOUT edit_yob 3 MOUT edit_yob 3
@ -11,7 +9,6 @@ MOUT back 0
HALT HALT
INCMP _ 0 INCMP _ 0
LOAD set_reset_single_edit 0 LOAD set_reset_single_edit 0
RELOAD set_reset_single_edit
INCMP enter_name 1 INCMP enter_name 1
INCMP select_gender 2 INCMP select_gender 2
INCMP enter_yob 3 INCMP enter_yob 3