[ecash-agora] Add validation to _acceptTxBuilder to prevent creation of unspendable offers
Summary:
It's possible for an agora partial offer to be accepted in such a way that the remaining quantity is no longer possible to accept. This could happen in 2 ways.
- The remaining quantity is below the contract min accepted qty.
- The remaining quantity costs less than dust. (Probably still possible to accept this? Though only by overpaying).
Add validation to prevent this type of accept. App devs should also include this type of validation in the front end.
The validation can be disabled by overriding a default param. This is helpful for integration tests, and also allows this lib to cover the full features of the protocol.
Test Plan: npm test, CI
Reviewers: #bitcoin_abc, emack, tobias_ruck
Reviewed By: #bitcoin_abc, emack, tobias_ruck
Subscribers: tobias_ruck, emack
Differential Revision: https://reviews.bitcoinabc.org/D16944