Page MenuHomePhabricator

[Cashtab] Reject transactions lower than backend dust limit
ClosedPublic

Authored by bytesofman on Jan 21 2021, 20:11.

Details

Summary

Cashtab minimum send is currently set to 0.00001 BCHA. The theoretical minimum of the backend is 546 satoshis, or 0.00000546. This diff rejects attempted sends before the tx is broadcast to the backend if they are for less than the backend dust limit, and adds a unit test. Because the app dust limit is still higher than 0.00000546, there is no impact on the app functionality. This is a preliminary step for matching the app limit to the backend limit.

Test Plan

npm test

Diff Detail

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

Event Timeline

The figure 0.00000546 is the dust limit of the bch-api backend. If the app attempts to broadcast a transaction sending less then 0.00000546 BCHA, an error will be returned from the API. These hard coded 546-sat figures will be replaced by currency.ticker once the app sending limit is brought in line with the backend limit in a future diff.

Using the currency.ticker constant instead of 0.00000546 now would cause unit tests to fail, as the app currently has a unit test mocking a transaction sent at this theoretical dust limit.

This revision is now accepted and ready to land.Jan 21 2021, 20:37