osmosis-labs / isotonic

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

Use osmosis-std rather than osmosis-bindings #154

Open ethanfrey opened 1 year ago

ethanfrey commented 1 year ago

When this was written, the suggested way to access custom DEX functionality was osmosis-bindings, which uses the CustomMsg and CustomQuery functionality to access Osmosis-specific functionality.

However, it is one year later (when we open source this) and the standard way to interact with the DEX is osmosis-std. You can see an example here of how to use the osmosis-std types. They implement Into<CosmosMsg>, so they play well with SubMsg::new and Response::add_message.

They have also whitelisted a number of Stargate Queries that can be used to query the Go modules. There should be equivalents for any of the Custom queries used here.

The hardest part is most likely properly testing this. Rather than relying on the mocks from osmosis-bindings, we likely need full-stack tests with test-tube... so it is a major learning (and demo) project.

nicolaslara commented 1 year ago

I've found testing with test-tupe to be pretty straightforward. There's also the option to test by checking that the correct message was added without testing its effects. You can then modify the storage manually and call reply(); but, tbh, I think that's harder to write than just using test-tube