Skip to content

Commit

Permalink
Add gas_used to Reply
Browse files Browse the repository at this point in the history
  • Loading branch information
chipshort committed Nov 17, 2023
1 parent 8a652d7 commit 4d24d21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions SEMANTICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,12 @@ pub fn reply(deps: DepsMut, env: Env, msg: Reply) -> Result<Response, ContractEr

pub struct Reply {
pub id: u64,
/// ContractResult is just a nicely serializable version of `Result<SubcallResponse, String>`
pub result: ContractResult<SubcallResponse>,
pub gas_used: u64,
/// SubMsgResult is just a nicely serializable version of `Result<SubMsgResponse, String>`
pub result: SubMsgResult,
}

pub struct SubcallResponse {
pub struct SubMsgResponse {
pub events: Vec<Event>,
pub data: Option<Binary>,
}
Expand Down
2 changes: 1 addition & 1 deletion packages/go-gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ mod schema;
mod utils;

fn main() -> Result<()> {
let root = cosmwasm_schema::schema_for!(cosmwasm_std::BankQuery);
let root = cosmwasm_schema::schema_for!(cosmwasm_std::Reply);

let code = generate_go(root)?;
println!("{}", code);
Expand Down
3 changes: 3 additions & 0 deletions packages/std/src/results/submessages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ pub struct Reply {
/// The ID that the contract set when emitting the `SubMsg`.
/// Use this to identify which submessage triggered the `reply`.
pub id: u64,
/// The amount of gas used by the submessage,
/// measured in [Cosmos SDK gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md).
pub gas_used: u64,
pub result: SubMsgResult,
}

Expand Down

0 comments on commit 4d24d21

Please sign in to comment.