This repository has been archived by the owner on Oct 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
ModuleActionWithData
variant to Proxy (#369)
* add a `ModuleExecuteResponse` endpoint that captures the response data * rename action and add helper on executor * cleanup * update reply to parse data and forward execution data exclusively * use if let Some
- Loading branch information
1 parent
38fdaf6
commit e894b71
Showing
13 changed files
with
222 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ mod commands; | |
pub mod contract; | ||
mod error; | ||
mod queries; | ||
pub mod reply; | ||
|
||
#[cfg(test)] | ||
mod test_common { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use cosmwasm_std::Reply; | ||
|
||
use crate::contract::{ProxyResponse, ProxyResult}; | ||
|
||
/// Add the message's data to the response | ||
pub fn forward_response_data(result: Reply) -> ProxyResult { | ||
// get the result from the reply | ||
let resp = cw_utils::parse_reply_execute_data(result)?; | ||
|
||
// log and add data if needed | ||
let resp = if let Some(data) = resp.data { | ||
ProxyResponse::new( | ||
"forward_response_data_reply", | ||
vec![("response_data", "true")], | ||
) | ||
.set_data(data) | ||
} else { | ||
ProxyResponse::new( | ||
"forward_response_data_reply", | ||
vec![("response_data", "false")], | ||
) | ||
}; | ||
|
||
Ok(resp) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.