Support token send txs with bip21 query strings in Cashtab
Details
- Reviewers
emack - Group Reviewers
Restricted Project - Commits
- rABCabf17c6cc86e: [Cashtab] Support send token txs with bip21 query strings
npm test
This is deployed at the test site. You can also confirm that bip21 link fwding works, e.g.
this is also tested with npm test now tho
Diff Detail
- Repository
- rABC Bitcoin ABC
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
cashtab/src/components/Send/SendXec.tsx | ||
---|---|---|
389 ↗ | (On Diff #51160) | needs an extra check for > '0' quantity |
389 ↗ | (On Diff #51160) | on 2nd thought, is this because you're expecting the UI to guard against 0 quantity? I think given this is a bip21 it could come from anywhere, where we can't control the pre-validation. |
cashtab/src/components/Send/__tests__/SendByUrlParams.test.js | ||
854 ↗ | (On Diff #51160) | add test where token_decimalized_qty is 0 |
cashtab/src/validation/index.ts | ||
802 ↗ | (On Diff #51160) | as above, add check for '0' |
cashtab/src/components/Send/SendXec.tsx | ||
---|---|---|
389 ↗ | (On Diff #51160) | This is handled by form validation. '0' is technically a valid bip21 amount. But cashtab correctly shows that we can't send this tx. desired behavior is to render this as if the user is trying to validly send a token, but show that the tx cannot be sent bc the amount is invalid. |
389 ↗ | (On Diff #51160) | right -- there's another layer here in that the wallet must determine token decimals to validate the quantity. But as long as the bip21 is valid, we can infer this is supposed to be a token send tx, then validate why it is or is not valid. |
cashtab/src/components/Send/__tests__/SendByUrlParams.test.js | ||
854 ↗ | (On Diff #51160) | this is already covered with the extensively tested isValidTokenSendOrBurnAmount |
cashtab/src/validation/index.ts | ||
802 ↗ | (On Diff #51160) | we're ok adding 0 here for the reasons outlined above |