Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FI v2: refactor without states (#1698)
* increase & decrease investments * add rest of methods * remove unused code * generalize swapping * Create DecreaseForeignInvestment event * ForeignInvestment trait fully implemented * notify status for fulfilling swaps * simplify storages * implements collected part * minor cleanings and renamings * minor rename * collection refactors * protect agains 0 investment changes * Events computed in both swap directions * protect againts different foreign currency * minor comment * add some notes * fix notify_swap_done * BaseInfo to extract common parts * minor rename * Remove inverse swap optimization * William suggestions * fix redemption tranche tokens * fix collected redemption * minor notes * simplify and collected redemption * fix decrease and fix error in amount denominations * fix redemption condition * minor fixes to mirror legacy implementation * total to pending tranche tokens * determine pool currency from investment id * apply William review * Use apply swap to cancel inverse orders * fix decrement issue * fix apply_swap issue * minor fix * minor foreign trait simplification * minor simplifications. mock compiling * add testing for swaps * add some tests. Fix issue when decreasing after increasing * add tests, remove increment/decrement check * fix amount_reminder for decrease msng, adding the pending increasing amount * add error to handle too much decrease * fulfill test working * decrease after fulfill works * remove inverse swap notifications * Extract notifications from mutable closures * full investment test * collect investment working * minor refactorizations * logic moved to Info structures * split in files * add complex decrease test * correct pending redemption calculation * better swap done split * Improve readability for notifications/swaps * minor renames * add some docs * better naming SwapDone * remove field from InvestmentInfo, computed now from the state * bypassing swapping for the same currencies * test collect redemptions with swaps * nit * chore: enable runtime compilation * chore: expose FI hook impls * clean unused dependencies * remove old benchmark * reduce Config associated types * adapt other tests to last trait changes * fix investment mock * fix clippy issues * fix complex type clippy issues * avoid failing the notification when the investment is not found * fix redemption collection denomination * fix clippy * tests: fix FI v2 integration (#1700) * tests: fix foreign investments v2 * chore: expose ForeignIdToSwapId storage * fix: remove events * chore: add swap_id_from * refactor: use give_pool_role --------- Co-authored-by: William Freudenberger <[email protected]>
- Loading branch information