Currently when a contract uses app.execute_contract in cw-multi-test, there is no way to get the resulting Response returned by the contract. cw-multi-test parses the responding messages and only returns the events and data from the result of the execution.
This is the relevant code that needs to be exposed somehow:
|
let res = self.call_execute( |
|
api, |
|
storage, |
|
contract_addr.clone(), |
|
router, |
|
block, |
|
info, |
|
msg.to_vec(), |
|
)?; |
Currently process_response will lose the reference to the Response, as can be seen here:
|
// recurse in all messages |
|
let data = messages.into_iter().try_fold(data, |data, resend| { |
|
let subres = |
|
self.execute_submsg(api, router, storage, block, contract.clone(), resend)?; |
|
events.extend_from_slice(&subres.events); |
|
Ok::<_, anyhow::Error>(subres.data.or(data)) |
|
})?; |
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.
Currently when a contract uses
app.execute_contractincw-multi-test, there is no way to get the resultingResponsereturned by the contract.cw-multi-testparses the responding messages and only returns theeventsanddatafrom 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_responsewill 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
Responsereturned 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.