Page MenuHomePhabricator

[Cashtab] [bugfix] Make sure you account for all requiredSats when getting agora fuel inputs
AbandonedPublicDraft

Authored by bytesofman on Sun, Jan 5, 23:13.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

Discovered this while working on D17466

When we accept an agora offer, we need to have enough satoshis for the tx fee and the price of the token.

We also need 546 satoshis to cover the dust that will send the token to us.

Add this in the function.

Note: missed this for so long as most fuel inputs will still happen to cover the extra 546 sats. starting testing edge case of 1 utxo exactly big enough to accept a tx (according to the bug formula) and started running into errors in broadcasting the tx. So, easy to miss, but more benefits of having so many tests in general.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Branch
patch-bug-agora-accept-fee-calc
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 31925
Build 63342: Build Diffcashtab-tests
Build 63341: arc lint + arc unit

Event Timeline

this isn't a bug. the tx was using a 546-sat token utxo in the test, which confused me into thinking the 546 was missing from this function