T3216
Following the removal of caching-driven registration status checks in D14318, this diff implements this check using the alias-server /alias endpoint.
This API call is only made if the contact address input is parsed to be a valid alias format.
Differential D14324
[Cashtab][Alias] Add alias status check to wallet contacts Authored by emack on Jul 29 2023, 15:50.
Details
T3216 Following the removal of caching-driven registration status checks in D14318, this diff implements this check using the alias-server /alias endpoint. This API call is only made if the contact address input is parsed to be a valid alias format.
Diff Detail
Event Timeline
Comment Actions Code looks good. Now the elephant in the room:
Comment Actions
Configure should probably be renamed to Settings to align with the frontend. (I can throw a diff up for this)
This is similar to SendToken.js where internal functions (i.e. handleManualContactAddressInput in this case) in a React component (classes that render things) can't be accessed directly. You can only test the initial state and props upon initialization but cases where you're looking to simulate a user input (entering a contact address) and then verifying it's reaction to that input is a challenge with Cashtab. In general, this type of testing can usually be achieved by:
Hence why these types of diffs are manually tested for the time being. Comment Actions I totally agree that it doesn't belong in any of these files either. But it's not a configuration, nor a setting.
Or you can keep it simple, create a function isValidRecipient(value) -> bool that takes either an address or an alias and call it from the handler like setManualContactAddressIsValid(isValidRecipient(value)). This isValidRecipient() function can be unit tested easily as it only requires a mock for the alias server query. Obviously the new function doesn't belong to Configure.js either. Comment Actions
makes sense, will move it (T3254) in a separate diff as a new component accessed via the hamburger
damn... that is simpler... will give that a go Comment Actions Updated for all feedback except the boolean return statement
| |||||||||||||||||||||||||||||||