-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose Response
from contract in cw-multi-test execute
#763
Comments
This is not the purpose of multitest. First of all - Attributes are even easier testable, you just need to understand how they work. There is no notion of arbitrary attributes on contract response. When you call If you want to test just your function calls without blockchain simulation, you don't need multiitest - just unit test your functions (you can find unit tests utilities for creating |
Sure, it's good to execute them - it gives a deeper layer of understanding in tests. However, it's still appropriate to want the original
The whole point of multi-test is that it can do those deeper tests where your contract needs to do external queries, external contract executions, etc - that's why "function calls without blockchain simulation" to get the Here's an example use-case: Adding the feature I describe will allow the best of both worlds - we get to execute the submessages and check for success, and we also get to test that our contract returned a |
Hi @hashedone, looking forward to your response! |
Currently when a contract uses
app.execute_contract
incw-multi-test
, there is no way to get the resultingResponse
returned by the contract.cw-multi-test
parses the responding messages and only returns theevents
anddata
from the result of the execution.This is the relevant code that needs to be exposed somehow:
cw-plus/packages/multi-test/src/wasm.rs
Lines 360 to 368 in d0b68db
Currently
process_response
will lose the reference to theResponse
, as can be seen here:cw-plus/packages/multi-test/src/wasm.rs
Lines 626 to 632 in d0b68db
It is beneficial to expose the
Response
returned by the executing function as it allows developers to test the SubMsgs (currently not testable) and attributes that is returned by the execute function in an easier manner than parsing the events vec.The text was updated successfully, but these errors were encountered: