menu-voucherlist #101
Merged
lash
merged 63 commits from 2024-10-25 15:59:47 +02:00
menu-voucherlist into master
Labels
Clear labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
cleanup
devops
documentation
easypeasy
exchange
i18n
legacy
meta
migration
optimization
privilege
refactor
smell
support
tooling
ux
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Activity
Doing
An item actively being worked on currently
Activity
Hold
Not being actively worked on
Activity
Proposal
A proposal for a new feature or enhancement
Activity
QA
Ready for QA testing
Activity
Validate
Dev team validating changes
Runner
AT
Runner
CLI
Runner
HTTP
Runner
SSH
A task that can be completed with little effort
relating to swapping of assets and offramps
Languages and translations
Legacy features from the old ussd system to be ported
container for other issues
features that have to do with special, privileged axx
Code smell
transparency and help with exception states
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Depends on
#86 Voucher list menu item
urdt/ussd
Reference: urdt/ussd#101
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
@@ -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 symactiveSym, 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 gdbms/gdbm/db/
@@ -1003,0 +1027,4 @@var numberedSymbols []stringvar numberedBalances []stringfor 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 stringsvoucherSymbols := 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 modelstype 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.
will resolve #114
@@ -655,2 +641,3 @@activeSym, err := store.ReadEntry(ctx, sessionId, utils.DATA_ACTIVE_SYM)if err != nil {return res, errres.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 storestore := h.userdataStoreprefixdb := storage.NewSubPrefixDb(store, []byte("pfx"))Not a very descriptive prefix?