Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add improved homa lite redeem match (#1626)
* Added a new mock that costs no fees. This can be used to test economic model more easily for HomaLite Added basic unit tests using the feeless mock. * Fixed a bug where total_staking is not changed when redeeming from available-staking-balances Added more tests and modified existing tests * Added one more test * Updated comments * Added one more test * Updated homalite redeem logic so if redeemer doesn't enough reserve balance, mint/adjust_available_staking_balance will not fail, and will skip the request instead Added corresponding unit test. * Fixed a clippy errot * Added function that iterates redeem request from a starting element. Starting element is read from storage Added unit test to test that function * Replaced redeem logic to iterate from the "Next" item When updating redeem requests, remember the "next" item Added unit tests to test the new logic * Improved the way iterator from next element * Changed the storage of NextRedeemRequestToMatch to store the last redeem request key Iteration now start from and exclude the key Update tests. * Improved how "first element" is handled iterate_from_next_redeem_request now also updates storage * Improved coding structure for homalite redeem Modification and removal of redeem requests storage now happens within the same function * Refactored the way functions are structured in HomaLite Removed the use of closures Storage mutation and deletion now all happens within the same function and synchronously. `redeem_from_previous_redeem_request` now iterates and redeem requests depending on input parameter. * Fixed a benchmarking test * refactor * Fixed unit tests * Tidied up how events are asserted in HomaLite unit tests * Tidied up how events are asserted * minor comments update * Added System::reset_events to make event assert clearer * Fixed clippy Fixed benchmarking tests * Update modules/homa-lite/src/lib.rs Co-authored-by: Roy Yang <[email protected]> Co-authored-by: Bryan Chen <[email protected]>
- Loading branch information