Page MenuHomePhabricator

[Cashtab] Patch send to many with improved validation
ClosedPublic

Authored by bytesofman on Mar 29 2024, 20:48.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABC9f69b3db096e: [Cashtab] Patch send to many with improved validation
Summary

Broke send to many in D15776, as the send button will be disabled even if user input is correct.

Update validation function for disabling send button. Add an integration test for multisend to prevent this kind of oversight in the future.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rebase, update test for new switch

minor version bump (and extension) as this brings feature back online

emack requested changes to this revision.Mar 30 2024, 07:19
emack added a subscriber: emack.

It current enables the Send button when the aggregate send amount is exactly the same as the wallet balance, which shouldn't be the case because then there wouldn't be enough to pay for the txFee.

image.png (489×535 px, 56 KB)

cashtab/src/components/Send/__tests__/SendXec.test.js
1531 ↗(On Diff #46611)

[insert Fabien's porno reaction about file size]

cashtab/src/validation/fixtures/vectors.js
118 ↗(On Diff #46611)

Needs an additional one where the aggregate multi send value exceeds balanceSats, or even just equals balanceSats as you'd need to factor in txFee.

This revision now requires changes to proceed.Mar 30 2024, 07:19

It current enables the Send button when the aggregate send amount is exactly the same as the wallet balance, which shouldn't be the case because then there wouldn't be enough to pay for the txFee.

This is true, but this is also an existing issue that also applies to send-to-one. Since multisend is currently broken in prod, this should be handled separately.

bytesofman marked 2 inline comments as done.
bytesofman added inline comments.
cashtab/src/validation/fixtures/vectors.js
118 ↗(On Diff #46611)

true but will do this in another diff. this is already an existing issue.

this diff is really just "fix multisend in prod"

This revision is now accepted and ready to land.Mar 30 2024, 14:29
This revision was automatically updated to reflect the committed changes.
bytesofman marked an inline comment as done.