Osmosis Integration Tests + Improvements#27
Conversation
|
Is it possible to see balances of wallets on both the chains? At the minimum we need to make evident which chain this wallet belongs to. |
Just made the change. Here's what the logs look like now: Shows the balance for each in/out asset in all legs in the route, with the chain of the provider indicated. |
|
This PR also updates the local-ic docker images. |
bekauz
left a comment
There was a problem hiding this comment.
overall this looks good! it would help a lot with the review if you could add a few comments around some of the python-unique syntax oneliners, and general logic flow (e.g. early return conditions, prefix logic, etc).
I think I understand what's happening, but would be great to be a bit more certain.
| assets = [leg.in_asset(), leg.out_asset()] | ||
|
|
||
| return [ | ||
| x for x in (asset_balance_prefix(leg, asset) for asset in assets) if x |
There was a problem hiding this comment.
would be nice to get some comments around oneliners like this
| async def query_denom_route( | ||
| self, query: DenomRouteQuery | ||
| ) -> Optional[list[DenomRouteLeg]]: | ||
| if self.denom_routes and query in self.denom_routes: |
There was a problem hiding this comment.
do we exit early here in case we already have a response stored? would be nice to add a comment
This PR finalizes Osmosis local-ic integration test implementation. This was achieved by centralizing Skip queries in the Context, allowing for injection of IBC paths and denom info. Furthermore, several bug fixes were made in the process, allowing for these tests to pass, including the addition of route reevaluation (updating quantities in the execution plan in accordance with slight slippage at any step of the plan that would cause it to be invalidated), and a binary search based execution planner (allowing for tighter execution plan-wallet balance differences, and maximizing profit per trade). Furthermore, several other quality of life improvements were made, including leg balance prefixing in route logs, which assists in debugging.
An example of this is as follows:
2024-10-04 15:18:21 INFO balance[neutron-1](untrn): 15503863 balance[neutron-1](factory/neut): 5681 r2- Route has possible execution plan: [5681]