Skip to content

Commit 5f8c8c0

Browse files
authored
Merge pull request #733 from CosmWasm/remove-deprecated-results
Remove InitResult/HandleResult/MigrateResult/QueryResult
2 parents 220e39c + 6b83b14 commit 5f8c8c0

File tree

7 files changed

+10
-44
lines changed

7 files changed

+10
-44
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ and this project adheres to
1919
- cosmwasm-std: Remove `from_address` from `BankMsg::Send`, as it always sends
2020
from the contract address, and this is consistent with other `CosmosMsg`
2121
variants.
22+
- cosmwasm-std: Remove the previously deprecated `InitResult`, `HandleResult`,
23+
`MigrateResult` and `QueryResult` in order to make error type explicit and
24+
encourage migration to custom errors.
2225
- cosmwasm-vm: Avoid serialization of Modules in `InMemoryCache`, for
2326
performance. Also, remove `memory_limit` from `InstanceOptions`, and define it
2427
instead at `Cache` level (same memory limit for all cached instances).
@@ -80,7 +83,7 @@ and this project adheres to
8083
**cosmwasm-std**
8184

8285
- Deprecate `InitResult`, `HandleResult`, `MigrateResult` and `QueryResult` in
83-
order to make error type explicit an encourage migration to custom errors.
86+
order to make error type explicit and encourage migration to custom errors.
8487
- Implement `Deref` for `QuerierWrapper`, such that `QuerierWrapper` behaves
8588
like a smart pointer to `Querier` allowing you to access `Querier` methods
8689
directly.

packages/std/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@ pub use crate::query::{
3939
CustomQuery, Delegation, FullDelegation, QueryRequest, StakingQuery, Validator,
4040
ValidatorsResponse, WasmQuery,
4141
};
42-
#[allow(deprecated)]
4342
pub use crate::results::{
4443
attr, wasm_execute, wasm_instantiate, Attribute, BankMsg, Context, ContractResult, CosmosMsg,
45-
HandleResponse, HandleResult, InitResponse, InitResult, MigrateResponse, MigrateResult,
46-
QueryResponse, QueryResult, StakingMsg, SystemResult, WasmMsg,
44+
HandleResponse, InitResponse, MigrateResponse, QueryResponse, StakingMsg, SystemResult,
45+
WasmMsg,
4746
};
4847
pub use crate::serde::{from_binary, from_slice, to_binary, to_vec};
4948
pub use crate::storage::MemoryStorage;

packages/std/src/results/handle.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use serde::{Deserialize, Serialize};
33
use std::fmt;
44

55
use crate::binary::Binary;
6-
use crate::errors::StdError;
76
use crate::types::Empty;
87

98
use super::attribute::Attribute;
@@ -32,10 +31,3 @@ where
3231
}
3332
}
3433
}
35-
36-
#[deprecated(
37-
since = "0.12.1",
38-
note = "HandleResult is deprecated because it uses StdError, which should be replaced with custom errors in CosmWasm 0.11+. \
39-
Replace this with Result<HandleResponse, StdError> or Result<HandleResponse<U>, StdError> and consider migrating to custom errors from there."
40-
)]
41-
pub type HandleResult<U = Empty> = Result<HandleResponse<U>, StdError>;

packages/std/src/results/init.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use schemars::JsonSchema;
22
use serde::{Deserialize, Serialize};
33
use std::fmt;
44

5-
use crate::errors::StdError;
65
use crate::types::Empty;
76

87
use super::attribute::Attribute;
@@ -30,13 +29,6 @@ where
3029
}
3130
}
3231

33-
#[deprecated(
34-
since = "0.12.1",
35-
note = "InitResult is deprecated because it uses StdError, which should be replaced with custom errors in CosmWasm 0.11+. \
36-
Replace this with Result<InitResponse, StdError> or Result<InitResponse<U>, StdError> and consider migrating to custom errors from there."
37-
)]
38-
pub type InitResult<U = Empty> = Result<InitResponse<U>, StdError>;
39-
4032
#[cfg(test)]
4133
mod tests {
4234
use super::super::BankMsg;

packages/std/src/results/migrate.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use serde::{Deserialize, Serialize};
33
use std::fmt;
44

55
use crate::binary::Binary;
6-
use crate::errors::StdError;
76
use crate::types::Empty;
87

98
use super::attribute::Attribute;
@@ -32,10 +31,3 @@ where
3231
}
3332
}
3433
}
35-
36-
#[deprecated(
37-
since = "0.12.1",
38-
note = "MigrateResult is deprecated because it uses StdError, which should be replaced with custom errors in CosmWasm 0.11+. \
39-
Replace this with Result<MigrateResponse, StdError> or Result<MigrateResponse<U>, StdError> and consider migrating to custom errors from there."
40-
)]
41-
pub type MigrateResult<U = Empty> = Result<MigrateResponse<U>, StdError>;

packages/std/src/results/mod.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,8 @@ pub use attribute::{attr, Attribute};
1414
pub use context::Context;
1515
pub use contract_result::ContractResult;
1616
pub use cosmos_msg::{wasm_execute, wasm_instantiate, BankMsg, CosmosMsg, StakingMsg, WasmMsg};
17-
#[allow(deprecated)]
18-
pub use handle::{HandleResponse, HandleResult};
19-
#[allow(deprecated)]
20-
pub use init::{InitResponse, InitResult};
21-
#[allow(deprecated)]
22-
pub use migrate::{MigrateResponse, MigrateResult};
23-
#[allow(deprecated)]
24-
pub use query::{QueryResponse, QueryResult};
17+
pub use handle::HandleResponse;
18+
pub use init::InitResponse;
19+
pub use migrate::MigrateResponse;
20+
pub use query::QueryResponse;
2521
pub use system_result::SystemResult;

packages/std/src/results/query.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
11
use crate::binary::Binary;
2-
use crate::errors::StdError;
32

43
pub type QueryResponse = Binary;
5-
6-
#[deprecated(
7-
since = "0.12.1",
8-
note = "QueryResult is deprecated because it uses StdError, which should be replaced with custom errors in CosmWasm 0.11+. \
9-
Replace this with Result<QueryResponse, StdError> and consider migrating to custom errors from there."
10-
)]
11-
pub type QueryResult = Result<QueryResponse, StdError>;

0 commit comments

Comments
 (0)