Skip to content

Commit 04a0e52

Browse files
authored
Merge pull request #1967 from CosmWasm/1760-remove-backtrace-feature
Remove backtraces feature
2 parents 8b3037c + ea7d630 commit 04a0e52

35 files changed

+308
-400
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ and this project adheres to
5858
`AnalysisReport::required_capabilities` a `BTreeSet`. ([#1949])
5959
- cosmwasm-std: Add `Checksum` type and change type of
6060
`CodeInfoResponse::checksum` to that. ([#1944])
61+
- cosmwasm-std: Removed `backtraces` feature, use the `RUST_BACKTRACE=1` env
62+
variable instead. Error variants that previously only contained a `backtrace`
63+
field with the feature enabled now always contain it. ([#1967])
64+
- cosmwasm-vm: Removed `backtraces` feature, use the `RUST_BACKTRACE=1` env
65+
variable instead. All `VmError` variants now have a `backtrace` field.
66+
([#1967])
6167

6268
[#1874]: https://github.com/CosmWasm/cosmwasm/pull/1874
6369
[#1876]: https://github.com/CosmWasm/cosmwasm/pull/1876
@@ -73,6 +79,7 @@ and this project adheres to
7379
[#1941]: https://github.com/CosmWasm/cosmwasm/pull/1941
7480
[#1944]: https://github.com/CosmWasm/cosmwasm/pull/1944
7581
[#1949]: https://github.com/CosmWasm/cosmwasm/pull/1949
82+
[#1967]: https://github.com/CosmWasm/cosmwasm/pull/1967
7683

7784
### Removed
7885

MIGRATING.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ major releases of `cosmwasm`. Note that you can also view the
2121

2222
If you were using cosmwasm-std's `ibc3` feature, you can remove it, as it is
2323
the default now. Depending on your usage, you might have to enable the
24-
`stargate` feature instead, since it was previously implied by `ibc3`.
24+
`stargate` feature instead, since it was previously implied by `ibc3`. Also
25+
remove any uses of the `backtraces` feature. You can use a `RUST_BACKTRACE=1`
26+
env variable for this now.
2527

2628
- `ContractInfoResponse::new` now takes all fields of the response as
2729
parameters:
@@ -125,6 +127,14 @@ major releases of `cosmwasm`. Note that you can also view the
125127
+CosmosMsg::Any(AnyMsg { type_url, value })
126128
```
127129

130+
- Replace all direct construction of `StdError` with use of the corresponding
131+
constructor:
132+
133+
```diff
134+
-StdError::GenericErr { msg }
135+
+StdError::generic_err(msg)
136+
```
137+
128138
## 1.4.x -> 1.5.0
129139

130140
- Update `cosmwasm-*` dependencies in Cargo.toml (skip the ones you don't use):

contracts/burner/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ overflow-checks = true
2727
default = []
2828
# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines.
2929
cranelift = ["cosmwasm-vm/cranelift"]
30-
# for quicker tests, cargo test --lib
31-
# for more explicit tests, cargo test --features=backtraces
32-
backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"]
30+
3331

3432
[dependencies]
3533
cosmwasm-schema = { path = "../../packages/schema" }

contracts/crypto-verify/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ overflow-checks = true
2727
default = []
2828
# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines.
2929
cranelift = ["cosmwasm-vm/cranelift"]
30-
# for quicker tests, cargo test --lib
31-
# for more explicit tests, cargo test --features=backtraces
32-
backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"]
3330

3431
[dependencies]
3532
cosmwasm-schema = { path = "../../packages/schema" }

contracts/crypto-verify/src/contract.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,13 @@ mod tests {
317317

318318
let res = query(deps.as_ref(), mock_env(), verify_msg);
319319
assert!(res.is_err());
320-
assert_eq!(
320+
assert!(matches!(
321321
res.unwrap_err(),
322322
StdError::VerificationErr {
323-
source: VerificationError::InvalidPubkeyFormat
323+
source: VerificationError::InvalidPubkeyFormat,
324+
..
324325
}
325-
)
326+
))
326327
}
327328

328329
#[test]
@@ -605,12 +606,13 @@ mod tests {
605606
};
606607
let res = query(deps.as_ref(), mock_env(), verify_msg);
607608
assert!(res.is_err());
608-
assert_eq!(
609+
assert!(matches!(
609610
res.unwrap_err(),
610611
StdError::VerificationErr {
611612
source: VerificationError::InvalidPubkeyFormat,
613+
..
612614
}
613-
)
615+
))
614616
}
615617

616618
#[test]
@@ -670,12 +672,13 @@ mod tests {
670672
};
671673
let res = query(deps.as_ref(), mock_env(), verify_msg);
672674
assert!(res.is_err());
673-
assert_eq!(
675+
assert!(matches!(
674676
res.unwrap_err(),
675677
StdError::VerificationErr {
676-
source: VerificationError::InvalidPubkeyFormat
678+
source: VerificationError::InvalidPubkeyFormat,
679+
..
677680
}
678-
)
681+
))
679682
}
680683

681684
#[test]

contracts/cyberpunk/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ overflow-checks = true
2525
default = []
2626
# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines.
2727
cranelift = ["cosmwasm-vm/cranelift"]
28-
# For quicker tests, cargo test --lib. for more explicit tests, cargo test --features=backtraces
29-
backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"]
3028

3129
[dependencies]
3230
cosmwasm-schema = { path = "../../packages/schema" }

contracts/empty/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ overflow-checks = true
2727
default = []
2828
# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines.
2929
cranelift = ["cosmwasm-vm/cranelift"]
30-
# for quicker tests, cargo test --lib
31-
# for more explicit tests, cargo test --features=backtraces
32-
backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"]
3330

3431
[dependencies]
3532
cosmwasm-schema = { path = "../../packages/schema" }

contracts/floaty/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ overflow-checks = true
2727
default = []
2828
# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines.
2929
cranelift = ["cosmwasm-vm/cranelift"]
30-
# For quicker tests, cargo test --lib. for more explicit tests, cargo test --features=backtraces
31-
backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"]
3230

3331
[dependencies]
3432
cosmwasm-schema = { path = "../../packages/schema" }

contracts/hackatom/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ overflow-checks = true
2727
default = []
2828
# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines.
2929
cranelift = ["cosmwasm-vm/cranelift"]
30-
# For quicker tests, cargo test --lib. for more explicit tests, cargo test --features=backtraces
31-
backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"]
3230

3331
[dependencies]
3432
cosmwasm-schema = { path = "../../packages/schema" }

contracts/ibc-reflect-send/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ overflow-checks = true
2727
default = []
2828
# Use cranelift backend instead of singlepass. This is required for development on 32 bit or ARM machines.
2929
cranelift = ["cosmwasm-vm/cranelift"]
30-
# for quicker tests, cargo test --lib
31-
# for more explicit tests, cargo test --features=backtraces
32-
backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"]
3330

3431
[dependencies]
3532
cosmwasm-schema = { path = "../../packages/schema" }

0 commit comments

Comments
 (0)