Conversation
xlc
left a comment
There was a problem hiding this comment.
Better to have some integration test to cover this kind of errors.
Also should use saturated add
|
added integration tests. I don't think saturated add is the right semantics here because we do want to ensure the converted back balance >= the original balance. This means if +1 is an overflow, it should fail. |
|
But you are using |
|
Yeah, but when it becomes |
|
ok. in that case can you add some comments in the code to explain why return 0 on edge case is better? also should use |
Co-authored-by: Xiliang Chen <xlchen1291@gmail.com>
* origin/master: (102 commits) Fix collect_fee (#1754) Update HEADER-GPL3 Update extrinsic-ordering-check-from-bin.yml (#1752) Update HEADER-GPL3 bump version (#1751) Remove homa-lite from karura runtime (#1744) off-by-one (#1747) Revert "simulate exchange rate (#1742)" (#1746) simulate exchange rate (#1742) bump version (#1743) refactor homa (#1648) Update stable asset (#1741) add more info to events (#1740) Fix mandala swap path error (#1736) update stable asset (#1738) remove unnecessary code (#1735) fix currency id testing (#1733) rework fee payment (#1687) Add Deposit for Setting Alternative Fee Swap Path (#1730) Add register_erc20_asset and update_erc20_asset (#1731) ... # Conflicts: # .github/workflows/coverage.yml.disabled # Cargo.lock # Cargo.toml
always transfer one more ksm to fix rounding issue
@shengda