Responding to feedback
- Queries
- All Stories
- Search
- Advanced Search
- Transactions
- Transaction Logs
Advanced Search
Jul 31 2023
updated wording nit
rebase
rebase
I'm talking about the MockChronikClient class
Without the MockChronikClient class you won't be able to trigger a mock Confirmed ws event, which leads to the infinite async loop of txConfListener() reconnecting yearning for a confirmation after npm test has concluded.
In D14326#320847, @tobias_ruck wrote:This doesn't have to be in the client library though, it can be in the code for the airdrop.
This slows down everyone that just wants to have token ticker / token name / token decimals.
Updated alias taken notification to include address
Updated flow logic
In D14326#320828, @Fabien wrote:what's the use case for this ?
In D14325#320825, @Fabien wrote:You should split the mock refactor out of this diff, this makes it very noisy.
Jul 30 2023
At a high level, the key design changes are:
- _get and _post now both reside inside the ChronikClient class
- _post now updated in this same diff to reduce unnecessary complexity
- _get and _post functions are now using the url(s) initialized in the ChronikClient constructor as the single source of truth
- _get and _post calls a newly created _callAxios function that handles the axios calls
- In order for ScriptEndpoint's utxo() and history() functions to call the same _get and _post functions from inside ChronikClient, a reference to the ChronikClient instance is passed into ScriptEndpoint's constructor
Updated README
As per feedback above.
Responding to feedback
Double checking with Joey on any caching related edge cases previously encountered during wallet cache migrations before landing this
Jul 29 2023
Removed redundant isValidAliasPricing function and its corresponding unit tests as Cashtab is now exclusively using the /alias endpoint for pricing and no longer has a need for the /pricing endpoint
Refactored to align with the revised alias endpoint where unregistered aliases returns an object containing the new registrationFeeSats param.
Key changes include:
- Removed full pricing tier retrieval at page load
- Instead of showing updated pricing for each character entered into the registration input field, the final price will be displayed via the preview modal via one single API call. This is to avoid making an API call for every single character input.
- The one single API call being made is at the point of retrieving alias price for the preview modal
In D14269#320622, @bytesofman wrote:waiting to hear from @tobias_ruck on this one but as this is backward compatible and useful for both ecash and lotus users I don't think we'll have the same objections, @emack please proceed with this diff
Jul 28 2023
^ @Fabien thoughts on comment above and whether we can explore this in a separate diff?
Simplified contact address alias validation
I was referring to a similar reluctance expected on merging changes to chronik-client (in this case, moving all functions into the ChronikClient class, redesign how the script().* APIs would work as a consequence and implementing array urls) ahead of his upcoming refactor of Chronik-client to support the in-node version. If D14257 was already considered overcomplicating the API then the refactor needed to land this diff is significantly more involved.
Jul 27 2023
In D14269#320433, @Fabien wrote:ping ?
Jul 25 2023
Responding to feedback
Jul 23 2023
Also verified via local npm installation of this diff on a test script
npm install ./chronik-client
Rebased to D14271 and executed npm run build
Responding to feedback
Jul 22 2023
Disabled register alias button upon server error regardless of new inputs
In D14266#319987, @Fabien wrote:That's because you are not unit testing the feature. Your input is a giant handler, if you cut it into pieces that becomes much more manageable. You don't want to test user input or the query or the UI rendering, but the logic in between: if the requested alias doesn't exist, it doesn't return an address but an error.
Jul 21 2023
Using unit tests to simulate frontend alias input into the address field, mocking the API response then validating the subsequent frontend error is proving to be a bit of a head scratcher, even with the react testing library. Will keep chipping away at this. So far the screen and renderhook approaches have not yielded any results.
Jul 20 2023
Jul 19 2023
Updated per feedback
Jul 18 2023
Will implement websocket in separate diff
- Removed registerAliasButton state var and updated the register alias button's disabled prop to depend on aliasServerError
- Default value of aliasServerError changed from '' to false to simplify usage
React/Jest dynamically generates the ((cov_1erx5eord5(...).s[16]++) portion of the expected error message Cannot destructure property 'wallet' of ((cov_1erx5eord5(...).s[16]++) _react.default.useContext(...)) as it is undefined. at the time of test execution, hence updating the error test case to check that the error message string contains Cannot destructure property 'wallet' as that is the core aspect being validated
Added error test cases
Getting cherry pick failures, probably needs rebase after D14270 landed yesterday
Removed unrelated change to _post()
- Constructor updated to take in an array of chronik urls when building the client
- _get() function updated to take in an array of chronik urls initialized by the constructor
- If the chronik instance keels over it cycles to the next url until a successful call is made. If all urls are non-responsive the _get() call throws error
- Diffused fork bomb and added unit test to check scenarios where all urls are invalid
@bytesofman - does this diff need to wait till D14271 lands, followed by running npm publish?
Updated nits and typo
Fixed linting errors
Added missing unit test to verify component state at initialization
Perma-disables Register Alias button upon server outage, even after new inputs
Jul 17 2023
Why is there no test change ?
When pushing this diff the aliasEnabled flag in Ticker.js is set to false, so that landing this diff does not prematurely publish this particular alias UI function. If the flag is enabled to true, then npm test will pick up on the UI changes and result in updates to the snapshots for this component.
What I'll do is add some additional unit tests that checks the state of this component.
Jul 16 2023
Jul 15 2023
FYI this will also mean Cashtab has to make a separate API call to get the tipheight everytime it calls the pricing endpoint.
Updated error handling per feedback