Skip to content

Commit 4c4abd2

Browse files
committed
Rename call -> msg in reflect
1 parent 8827313 commit 4c4abd2

6 files changed

Lines changed: 18 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ and this project adheres to
5252
attributes and instead constructs an empty one
5353
- cosmwasm-std: Rename `Event.kind` to `Event.ty`.
5454
- cosmwasm-std: Rename `SubcallResponse` to `SubMsgExecutionResponse`.
55+
- contracts: Rename `ReflectSubCall` to `ReflectSubMsg` and `SubCallResult` to
56+
`SubCallMsg` in the `reflect` contract.
5557

5658
[#961]: https://github.com/CosmWasm/cosmwasm/pull/961
5759

contracts/reflect/schema/execute_msg.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
{
2929
"type": "object",
3030
"required": [
31-
"reflect_sub_call"
31+
"reflect_sub_msg"
3232
],
3333
"properties": {
34-
"reflect_sub_call": {
34+
"reflect_sub_msg": {
3535
"type": "object",
3636
"required": [
3737
"msgs"

contracts/reflect/schema/query_msg.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@
8282
"additionalProperties": false
8383
},
8484
{
85-
"description": "If there was a previous ReflectSubCall with this ID, returns cosmwasm_std::Reply",
85+
"description": "If there was a previous ReflectSubMsg with this ID, returns cosmwasm_std::Reply",
8686
"type": "object",
8787
"required": [
88-
"sub_call_result"
88+
"sub_msg_result"
8989
],
9090
"properties": {
91-
"sub_call_result": {
91+
"sub_msg_result": {
9292
"type": "object",
9393
"required": [
9494
"id"

contracts/reflect/src/contract.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub fn execute(
3030
) -> Result<Response<CustomMsg>, ReflectError> {
3131
match msg {
3232
ExecuteMsg::ReflectMsg { msgs } => try_reflect(deps, env, info, msgs),
33-
ExecuteMsg::ReflectSubCall { msgs } => try_reflect_subcall(deps, env, info, msgs),
33+
ExecuteMsg::ReflectSubMsg { msgs } => try_reflect_subcall(deps, env, info, msgs),
3434
ExecuteMsg::ChangeOwner { owner } => try_change_owner(deps, env, info, owner),
3535
}
3636
}
@@ -126,7 +126,7 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<QueryResponse> {
126126
QueryMsg::Capitalized { text } => to_binary(&query_capitalized(deps, text)?),
127127
QueryMsg::Chain { request } => to_binary(&query_chain(deps, &request)?),
128128
QueryMsg::Raw { contract, key } => to_binary(&query_raw(deps, contract, key)?),
129-
QueryMsg::SubCallResult { id } => to_binary(&query_subcall(deps, id)?),
129+
QueryMsg::SubMsgResult { id } => to_binary(&query_subcall(deps, id)?),
130130
}
131131
}
132132

@@ -415,7 +415,7 @@ mod tests {
415415
id,
416416
);
417417

418-
let msg = ExecuteMsg::ReflectSubCall {
418+
let msg = ExecuteMsg::ReflectSubMsg {
419419
msgs: vec![payload.clone()],
420420
};
421421
let info = mock_info("creator", &[]);
@@ -449,12 +449,12 @@ mod tests {
449449
let qres = query(
450450
deps.as_ref(),
451451
mock_env(),
452-
QueryMsg::SubCallResult { id: 65432 },
452+
QueryMsg::SubMsgResult { id: 65432 },
453453
);
454454
assert!(qres.is_err());
455455

456456
// query for the real id
457-
let raw = query(deps.as_ref(), mock_env(), QueryMsg::SubCallResult { id }).unwrap();
457+
let raw = query(deps.as_ref(), mock_env(), QueryMsg::SubMsgResult { id }).unwrap();
458458
let qres: Reply = from_binary(&raw).unwrap();
459459
assert_eq!(qres.id, id);
460460
let result = qres.result.unwrap();

contracts/reflect/src/msg.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub struct InstantiateMsg {}
1010
#[serde(rename_all = "snake_case")]
1111
pub enum ExecuteMsg {
1212
ReflectMsg { msgs: Vec<CosmosMsg<CustomMsg>> },
13-
ReflectSubCall { msgs: Vec<SubMsg<CustomMsg>> },
13+
ReflectSubMsg { msgs: Vec<SubMsg<CustomMsg>> },
1414
ChangeOwner { owner: String },
1515
}
1616

@@ -31,8 +31,8 @@ pub enum QueryMsg {
3131
contract: String,
3232
key: Binary,
3333
},
34-
/// If there was a previous ReflectSubCall with this ID, returns cosmwasm_std::Reply
35-
SubCallResult {
34+
/// If there was a previous ReflectSubMsg with this ID, returns cosmwasm_std::Reply
35+
SubMsgResult {
3636
id: u64,
3737
},
3838
}

contracts/reflect/tests/integration.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ fn reflect_subcall() {
204204
id,
205205
);
206206

207-
let msg = ExecuteMsg::ReflectSubCall {
207+
let msg = ExecuteMsg::ReflectSubMsg {
208208
msgs: vec![payload.clone()],
209209
};
210210
let info = mock_info("creator", &[]);
@@ -235,11 +235,11 @@ fn reply_and_query() {
235235
assert_eq!(0, res.messages.len());
236236

237237
// query for a non-existant id
238-
let qres = query(&mut deps, mock_env(), QueryMsg::SubCallResult { id: 65432 });
238+
let qres = query(&mut deps, mock_env(), QueryMsg::SubMsgResult { id: 65432 });
239239
assert!(qres.is_err());
240240

241241
// query for the real id
242-
let raw = query(&mut deps, mock_env(), QueryMsg::SubCallResult { id }).unwrap();
242+
let raw = query(&mut deps, mock_env(), QueryMsg::SubMsgResult { id }).unwrap();
243243
let qres: Reply = from_binary(&raw).unwrap();
244244
assert_eq!(qres.id, id);
245245
let result = qres.result.unwrap();

0 commit comments

Comments
 (0)