menu-voucherlist #101
No reviewers
Labels
No Label
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Activity
Doing
Activity
Proposal
Activity
QA
Activity
Validate
Runner
AT
Runner
CLI
Runner
HTTP
Runner
SSH
cleanup
devops
documentation
easypeasy
exchange
i18n
l8ter
legacy
meta
migration
optimization
privilege
refactor
smell
support
tooling
ux
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Depends on
#86 Voucher list menu item
urdt/ussd
Reference: urdt/ussd#101
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "menu-voucherlist"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WIP: menu-voucherlistto menu-voucherlist@ -113,0 +110,4 @@
// FetchVouchers retrieves the token holdings for a given public key from the custodial holdings API endpoint
// Parameters:
// - publicKey: The public key associated with the account.
func (as *AccountService) FetchVouchers(publicKey string) (*models.VoucherHoldingResponse, error) {
Is this in use? Looks like test code?
@ -654,2 +640,3 @@
balance, err := h.accountService.CheckBalance(string(publicKey))
// check if the user has an active sym
activeSym, err := store.ReadEntry(ctx, sessionId, utils.DATA_ACTIVE_SYM)
If no active sym then the user has no vouchers yet, and then no balance should be displayed, I think?
For this, I've added a function that sets the default voucher, (expecting it to be SRF) if no active voucher is set for the user.
This will be loaded on the main.vis, ensuring that one has the default sym if they haven't set their own
@ -803,0 +793,4 @@
if err != nil {
return res, fmt.Errorf("failed to parse active balance: %v", err)
}
} else {
Same here, if there is no symbol there is no balance.
@ -1002,1 +1005,4 @@
}
// CheckVouchers retrieves the token holdings from the API using the "PublicKey" and stores
// them to gdbm
s/gdbm/db/
@ -1003,0 +1027,4 @@
var numberedSymbols []string
var numberedBalances []string
for i, voucher := range vouchersResp.Result.Holdings {
Can we put this in a separate method please (that can be unit-tested with data only)
@ -1003,0 +1082,4 @@
inputStr := string(input)
if inputStr == "0" || inputStr == "99" {
Now this is code smell; we don't want to use menu selectors in branching here.
But I assume it is done because it is necessary to determine whether we are selecting token or merely navigating laterally? If that is the case, I will make an issue for go-vise to provide whether lateral is indeed the case.
This was added because the vise runs the function when we're navigating, instead of prioritizing the INCMP and navigate to the specified node
@ -1003,0 +1102,4 @@
}
// Convert the symbol and balance lists from byte arrays to strings
voucherSymbols := string(voucherSymbolList)
Please put in separate, unit-testable method.
@ -172,3 +172,3 @@
}
func TestSavePin(t *testing.T) {
func TestSaveTemporaryPIn(t *testing.T) {
CAps
@ -0,0 +1,18 @@
package models
type ApiResponse struct {
These should be gotten from the api provider go code instead, #106
Since we are introducing new ones here, may as well go directly to the source.
menu-voucherlistto WIP: menu-voucherlistwill resolve #114
WIP: menu-voucherlistto menu-voucherlist@ -655,2 +641,3 @@
activeSym, err := store.ReadEntry(ctx, sessionId, utils.DATA_ACTIVE_SYM)
if err != nil {
return res, err
res.Content = "0.00"
Why should it be 0.00 when error?
The 0.00 is a placeholder. I set it like this without a symbol since the error indicates no symbol exists.
I have updated this to check the specific db error
@ -1048,0 +1000,4 @@
if err != nil {
if db.IsNotFound(err) {
publicKey, err := store.ReadEntry(ctx, sessionId, utils.DATA_PUBLIC_KEY)
space
Kindly expound on this
@ -1048,0 +1108,4 @@
// Read vouchers from the store
store := h.userdataStore
prefixdb := storage.NewSubPrefixDb(store, []byte("pfx"))
Not a very descriptive prefix?
menu-voucherlistto WIP: menu-voucherlistWIP: menu-voucherlistto menu-voucherlist