HomePhabricator

[Cashtab] Consolidate send xec validation functions

Description

[Cashtab] Consolidate send xec validation functions

Summary:
Cashtab send xec validation is ambiguous. We have one function, shouldRejectAmountInput, that specifically validates the user input of the SendXec field. We have another function, isValidXecSendAmount, that validates XEC send amounts for multi-send or param passing input. The rules in both cases are the same, so we should have one function.

Consolidate to a single function, isValidXecSendAmount, and implement everywhere we validate xec send amounts. Implement the new fiatToSatoshis function to replace legacy fiatToCrypto, a dependency of legacy validation approach.

Test Plan: npm test

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

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

Details

Provenance
bytesofmanAuthored on Mar 11 2024, 17:21
bytesofmanPushed on Mar 12 2024, 14:30
Reviewer
Restricted Project
Differential Revision
D15676: [Cashtab] Consolidate send xec validation functions
Parents
rABC58c73bcf68fb: Extend bilingual_str support for tinyformat
Branches
Unknown
Tags
Unknown