zingolabs / zingolib

An API and test-app that exposes zcash functionality for app consumption
MIT License
14 stars 21 forks source link

Fix note selection bugs #1188

Closed zancas closed 3 months ago

zancas commented 3 months ago

@Oscar-Pepper these changes evolved from my review of your fixes. I strongly agree that this needs more test!

Add fns:

-- calculate_remaining_needed -- sweep_dust_into_grace

These are more than simple helpers.

-- calculate_remaining_needed -- generates first calculation of change magnitude. If dust is not swept into a grace input, then this value should hold for the final transaction. -- sweep_dust_into_grace -- adds logic for matching the grace input to the single inputs pool.

TODO: Handle the case of a single input per pool. I will likely get to this tomorrow.

Supersedes #1186