Adding prefix validation on Friday broke case of valid cash address with no prefix. This accepts valid addresses without a prefix, as provided by Coinex.
Details
Details
- Reviewers
Fabien - Group Reviewers
Restricted Project - Commits
- rABCb17877968ed6: [Cashtab] support valid addresses if no prefix included
npm test includes this test case. Can try depositing at your Coinex BCHA address to confirm with real money.
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Build Bitcoin ABC Diffs / Diff Testing (cashtab-tests) failed.
Failed tests logs:
====== CashTab Unit Tests: toLegacy throws error if input address has invalid prefix ====== Error: expect(received).toStrictEqual(expected) // deep equality Expected: [Error: Address prefix is not in Ticker.prefixes array] Received: [Error: Address prefix is not a valid cash address with a prefix form the Ticker.prefixes array] at Object.<anonymous> (/work/web/cashtab/src/components/Common/__tests__/Ticker.test.js:85:20) at Object.asyncJestTest (/work/web/cashtab/node_modules/jest-jasmine2/build/jasmineAsyncInstall.js:106:37) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:45:12 at new Promise (<anonymous>) at mapper (/work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:28:19) at /work/web/cashtab/node_modules/jest-jasmine2/build/queueRunner.js:75:41 at processTicksAndRejections (node:internal/process/task_queues:93:5)
Each failure log is accessible here:
CashTab Unit Tests: toLegacy throws error if input address has invalid prefix
web/cashtab/src/components/Common/Ticker.js | ||
---|---|---|
66 ↗ | (On Diff #27040) | form => from |
web/cashtab/src/components/Send/Send.js | ||
186 ↗ | (On Diff #27040) | This is a bad name because it doesn't check if the address has a prefix. foo:bar has a prefix. |
200 ↗ | (On Diff #27040) | Something like Destination is not a valid BCHA address makes more sense imo. |
web/cashtab/src/components/Send/Send.js | ||
---|---|---|
188 ↗ | (On Diff #27043) | Would be a good idea to make it a constant (another diff) |