Skip to content

Commit 4d24d21

Browse files
committed
Add gas_used to Reply
1 parent 8a652d7 commit 4d24d21

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

SEMANTICS.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,12 @@ pub fn reply(deps: DepsMut, env: Env, msg: Reply) -> Result<Response, ContractEr
286286

287287
pub struct Reply {
288288
pub id: u64,
289-
/// ContractResult is just a nicely serializable version of `Result<SubcallResponse, String>`
290-
pub result: ContractResult<SubcallResponse>,
289+
pub gas_used: u64,
290+
/// SubMsgResult is just a nicely serializable version of `Result<SubMsgResponse, String>`
291+
pub result: SubMsgResult,
291292
}
292293

293-
pub struct SubcallResponse {
294+
pub struct SubMsgResponse {
294295
pub events: Vec<Event>,
295296
pub data: Option<Binary>,
296297
}

packages/go-gen/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ mod schema;
1111
mod utils;
1212

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

1616
let code = generate_go(root)?;
1717
println!("{}", code);

packages/std/src/results/submessages.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ pub struct Reply {
102102
/// The ID that the contract set when emitting the `SubMsg`.
103103
/// Use this to identify which submessage triggered the `reply`.
104104
pub id: u64,
105+
/// The amount of gas used by the submessage,
106+
/// measured in [Cosmos SDK gas](https://github.com/CosmWasm/cosmwasm/blob/main/docs/GAS.md).
107+
pub gas_used: u64,
105108
pub result: SubMsgResult,
106109
}
107110

0 commit comments

Comments
 (0)