Page MenuHomePhabricator

[Cashtab] Set dust param to minimum accepted by backend
AbandonedPublic

Authored by bytesofman on Jan 21 2021, 15:44.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Summary

Previous dust limit set from rest.bitcoin.com limits. The smallest bcha tx that bch-api will broadcast is 546 satoshis. This diff matches the front end validation to the backend limit.

Test Plan

npm start, fill out Amount form on send screen with 0.00000546, observe no error, try 0.00000545, observe validation error, attempt to broadcast a tx of 0.00000546 and observe it successfully broadcasts, or see this example tx: https://explorer.bitcoinabc.org/tx/ff5fe4c631a5dd3e3b1cc74cb12b9eebf04d177c206eaadb8d949cc4fbb6a092

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cashtab-dust-to-min
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 14916
Build 29784: Build Diffcashtab-tests
Build 29783: arc lint + arc unit

Event Timeline

Fabien requested changes to this revision.Jan 21 2021, 17:38
Fabien added a subscriber: Fabien.

The test plan would benefit from being a unit test

This revision now requires changes to proceed.Jan 21 2021, 17:38

Add unit test for dust limit, add catch for dust to sendBCH function as dust error comes from server, implement BigNumber for dust constant

Fabien requested changes to this revision.Jan 21 2021, 19:52

This diff is actually doing several things at a time. Splitting it into pieces and stack them will make the review easier and will help getting this landed faster.

web/cashtab/src/hooks/__tests__/useBCH.test.js
162

The next time this value change, the test will fail, but the validation form under test will be correct.
You should just compute dust - 1 sat to prevent this.

This revision now requires changes to proceed.Jan 21 2021, 19:52