Open ethanfrey opened 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
When this was written, the suggested way to access custom DEX functionality was
osmosis-bindings
, which uses theCustomMsg
andCustomQuery
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 implementInto<CosmosMsg>
, so they play well withSubMsg::new
andResponse::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 withtest-tube
... so it is a major learning (and demo) project.