osmosis-labs / isotonic

Smart Contracts for the Lendex Protocol
MIT License
1 stars 0 forks source link

Allow governance to adjust credit agency #96

Closed ueco-jb closed 2 years ago

ueco-jb commented 2 years ago

closes https://github.com/confio/isotonic/issues/49

I guess that proper testing of new sudo messages is blocked by #84, so I tested at least migrate msg in market. I'll add sudo multitests in batch in #93 anyway

ethanfrey commented 2 years ago

I guess that proper testing of new sudo messages is blocked by https://github.com/confio/isotonic/issues/84, so I tested at least migrate msg in market.

You should be able to add any sudo message you want.

The new bindings will allow 3 things:

  1. A proper implementation of a price oracle, that queries a time-weight average price from AMM pools with significant liquidity. This will have the same interface as the mock we use now, and shouldn't block any tests
  2. "Liquidation via AMM". We currently have manual liquidation which tests all the processes well. This will change a bit of the order of logic (no payment, rather swap with collateral to get payment), and is blocked, but good code and tests on the current liquidation will help make this implementation easier
  3. Issuing native tokens that represent LToken shares (with raw balance, not display balance) so they can be traded on an Osmosis AMM.

1 and 3 are relatively small Rust tasks. 2 is rather larger.

These 3 items are blocked by the new bindings. Nothing else should be blocked.

hashedone commented 2 years ago

I think the issue is testing sudo messages in multitests - as I am not sure about the flow of messages (who and how sends them). In Tgrade sudo messages are send by blockchain itself, and I suppose similar is the case for osmosis. The bindings as I assume would include those sudo messages, and when we will provide them, the mechanism for sending them in MT would be implemented.

However actually you should be able to test any kind of sudo messages send directly by other contracts (if this is even possible, now I don't understand difference between sudo and execute), or just in UT manner.

But I think that even in MT we actually can just send sudo (App::wasm_sudo I guess) message in test prepending we are blockchain - it is kind of not this natural as expecting environment is doing it, but actually it is a way to approach such tests.