fix(TPU): add trade fee estimation for TPU code
Before this PR, the legacy swap functions were used to estimate trade fees (tx fees) for TPU swaps, so those estimations may not have been quite accurate.
This PR adds trade fee estimation functions for TPU swap steps (like send taker funding, spend taker funding, send maker payment etc).
As refactoring, a new SwapTotalFeeHelper trait is added to abstract getting fees for balance checking in swaps.
TODO: add more tests to validate taker and maker max_volume/trade_preimage estimations for TPU swap fee estimations added in this PR.
Is thing pending for a review?
Is thing pending for a review?
I ll resolve the conflicts first
Conflicts resolved, PR is ready for review
Conflicts resolved, PR is ready for review
One important test fails. To draft for now..
Conflicts resolved, PR is ready for review
One important test fails. To draft for now..
Looks like tests are okay now.
I saw once failure of test_update_maker_order in a CI workflow run (which is worrying). I ran this test multiple times on my PC and a VPC but the failure never repeated itself. I noticed that when the failed test was running the RICK coin balance was unusual (so it may be some activity in the chain affected the test results).
I tried this test with different balances, including the one from the failed test, but all runs were okay.
So I am converting the PR to ready now.
@shamardy
Please review it again.