HomePhabricator

[Cashtab] Improve multisend validation

Description

[Cashtab] Improve multisend validation

Summary:
Improve validation functions supporting xec multisend.

  • Do not .split() more than once
  • Do not accept decimal markers other than '.'
  • Throw error if more than one comma per line in expected csv input
  • Do not accept non-digit characters for value input (except '.')

Note: I did not add a check against very large values, as it is still safe in JS to multiple the total supply of XEC by 100. So, I think it's overkill to check for this every time.

Test Plan: npm test

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

Differential Revision: https://reviews.bitcoinabc.org/D14982

Details

Provenance
bytesofmanAuthored on Dec 13 2023, 18:34
bytesofmanPushed on Dec 14 2023, 18:41
Reviewer
Restricted Project
Differential Revision
D14982: [Cashtab] Improve multisend validation
Parents
rABC540195703a20: test: Fix intermittent failure in ChainStateManager tests
Branches
Unknown
Tags
Unknown