Every time we need token info that can be cached, we should get it from the cache. If it is not from the cache, we add it to the cache.
The airdrop calculator is still getting this info manually.
Implement standardized Cashtab practice.
Differential D15969
[Cashtab] Get token info from cache in airdrop calc screen bytesofman on Apr 12 2024, 22:47. Authored by Tags None Subscribers None
Details
Every time we need token info that can be cached, we should get it from the cache. If it is not from the cache, we add it to the cache. The airdrop calculator is still getting this info manually. Implement standardized Cashtab practice. npm test
Diff Detail
Event TimelineComment Actions Build Bitcoin ABC Diffs / Diff Testing (cashtab-tests) failed.
Failed tests logs: ====== CashTab Unit Tests: <Airdrop /> We can send a pro-rata airdrop and equal tx to a tokenId not in our cache using custom settings ====== TestingLibraryElementError: Unable to find an element with the placeholder text of: Enter the eToken ID Ignored nodes: comments, script, style <body> <div /> </body> at Object.getElementError (/work/cashtab/node_modules/@testing-library/dom/dist/config.js:37:19) at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:76:38 at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:52:17 at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:95:19 at Object.getByPlaceholderText (/work/cashtab/src/components/Airdrop/__tests__/Airdrop.test.js:120:20) ====== CashTab Unit Tests: <Airdrop /> We can ignore addresses with less than a token balance for a token with decimals ====== TestingLibraryElementError: Unable to find an element with the placeholder text of: Enter the eToken ID Ignored nodes: comments, script, style <body> <div /> </body> at Object.getElementError (/work/cashtab/node_modules/@testing-library/dom/dist/config.js:37:19) at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:76:38 at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:52:17 at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:95:19 at Object.getByPlaceholderText (/work/cashtab/src/components/Airdrop/__tests__/Airdrop.test.js:224:20) ====== CashTab Unit Tests: <App /> Navigation menu routes to expected components ====== ReferenceError: Cannot access 'formData' before initialization at formData (/work/cashtab/src/components/Airdrop/Airdrop.js:93:9) at renderWithHooks (/work/cashtab/node_modules/react-dom/cjs/react-dom.development.js:16305:18) at mountIndeterminateComponent (/work/cashtab/node_modules/react-dom/cjs/react-dom.development.js:20074:13) at beginWork (/work/cashtab/node_modules/react-dom/cjs/react-dom.development.js:21587:16) at beginWork$1 (/work/cashtab/node_modules/react-dom/cjs/react-dom.development.js:27426:14) at performUnitOfWork (/work/cashtab/node_modules/react-dom/cjs/react-dom.development.js:26560:12) at workLoopSync (/work/cashtab/node_modules/react-dom/cjs/react-dom.development.js:26466:5) at renderRootSync (/work/cashtab/node_modules/react-dom/cjs/react-dom.development.js:26434:7) at recoverFromConcurrentError (/work/cashtab/node_modules/react-dom/cjs/react-dom.development.js:25850:20) at performSyncWorkOnRoot (/work/cashtab/node_modules/react-dom/cjs/react-dom.development.js:26096:20) at flushSyncCallbacks (/work/cashtab/node_modules/react-dom/cjs/react-dom.development.js:12042:22) at flushActQueue (/work/cashtab/node_modules/react/cjs/react.development.js:2667:24) at act (/work/cashtab/node_modules/react/cjs/react.development.js:2582:11) at /work/cashtab/node_modules/@testing-library/react/dist/act-compat.js:46:25 at Object.eventWrapper (/work/cashtab/node_modules/@testing-library/react/dist/pure.js:107:28) at Object.wrapEvent (/work/cashtab/node_modules/@testing-library/user-event/dist/cjs/event/wrapEvent.js:6:28) at Object.dispatchEvent (/work/cashtab/node_modules/@testing-library/user-event/dist/cjs/event/dispatchEvent.js:45:22) at Object.dispatchUIEvent (/work/cashtab/node_modules/@testing-library/user-event/dist/cjs/event/dispatchEvent.js:22:26) at Mouse.up (/work/cashtab/node_modules/@testing-library/user-event/dist/cjs/system/pointer/mouse.js:100:30) at PointerHost.release (/work/cashtab/node_modules/@testing-library/user-event/dist/cjs/system/pointer/index.js:84:28) at pointerAction (/work/cashtab/node_modules/@testing-library/user-event/dist/cjs/pointer/index.js:59:47) at Object.pointer (/work/cashtab/node_modules/@testing-library/user-event/dist/cjs/pointer/index.js:32:9) at Object.asyncWrapper (/work/cashtab/node_modules/@testing-library/react/dist/pure.js:88:22) at Object.<anonymous> (/work/cashtab/src/components/App/__tests__/App.test.js:267:9) Each failure log is accessible here: Comment Actions Build Bitcoin ABC Diffs / Diff Testing (cashtab-tests) failed.
Failed tests logs: ====== CashTab Unit Tests: <Airdrop /> We can ignore addresses with less than a token balance for a token with decimals ====== Error: expect(element).toHaveValue(ecash:qp6qkpeg5xmpcqtu6uc5qkhzexg4sq009sfeekcfk2, 499905.84 ecash:qpmytrdsakt0axrrlswvaj069nat3p9s7cjctmjasj, 94.15) Expected the element to have value: ecash:qp6qkpeg5xmpcqtu6uc5qkhzexg4sq009sfeekcfk2, 499905.84 ecash:qpmytrdsakt0axrrlswvaj069nat3p9s7cjctmjasj, 94.15 Received: ecash:qp6qkpeg5xmpcqtu6uc5qkhzexg4sq009sfeekcfk2, 499894.34 ecash:qpmytrdsakt0axrrlswvaj069nat3p9s7cjctmjasj, 94.15 ecash:qp89xgjhcqdnzzemts0aj378nfe2mhu9yvxj9nhgg6, 11.49 at Object.toHaveValue (/work/cashtab/src/components/Airdrop/__tests__/Airdrop.test.js:274:11) Each failure log is accessible here:
|