Skip to content

Commit 9b59e51

Browse files
committed
Use thiserror instead of snafu in std
1 parent 1cc2276 commit 9b59e51

File tree

17 files changed

+104
-53
lines changed

17 files changed

+104
-53
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
- Remove the previously deprecated `StdError::Unauthorized`. Contract specific
88
errors should be implemented using custom error types now (see
99
[migration guide](./MIGRATING.md) 0.10 -> 0.11).
10+
- Use dependency `thiserror` instead of `snafu` to implement `StdError`. Along
11+
with this change, the `backtraces` feature now requires Rust nightly.
12+
- Rename `StdError::ParseErr::source` to `StdError::ParseErr::source_type` and
13+
`StdError::SerializeErr::target` to `StdError::SerializeErr::target_type` to
14+
work around speacial treatment of the field name `source` in thiserror.
1015

1116
**cosmwasm-vm**
1217

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MIGRATING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,25 @@ This guide explains what is needed to upgrade contracts when migrating over
44
major releases of `cosmwasm`. Note that you can also view the
55
[complete CHANGELOG](./CHANGELOG.md) to understand the differences.
66

7+
## 0.11 -> 0.12
8+
9+
- In your contract's `.cargo/config` remove `--features backtraces`, which is
10+
now available in Rust nightly only:
11+
12+
```diff
13+
@@ -1,6 +1,6 @@
14+
[alias]
15+
wasm = "build --release --target wasm32-unknown-unknown"
16+
wasm-debug = "build --target wasm32-unknown-unknown"
17+
-unit-test = "test --lib --features backtraces"
18+
+unit-test = "test --lib"
19+
integration-test = "test --test integration"
20+
schema = "run --example schema"
21+
```
22+
23+
In order to use backtraces for debugging, run
24+
`RUST_BACKTRACE=1 cargo +nightly unit-test --features backtraces`.
25+
726
## 0.10 -> 0.11
827

928
- Contracts now support any custom error type `E: ToString + From<StdError>`.

contracts/burner/.cargo/config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[alias]
22
wasm = "build --release --target wasm32-unknown-unknown"
33
wasm-debug = "build --target wasm32-unknown-unknown"
4-
unit-test = "test --lib --features backtraces"
4+
unit-test = "test --lib"
55
integration-test = "test --test integration"
66
schema = "run --example schema"

contracts/burner/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contracts/hackatom/.cargo/config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[alias]
22
wasm = "build --release --target wasm32-unknown-unknown"
33
wasm-debug = "build --target wasm32-unknown-unknown"
4-
unit-test = "test --lib --features backtraces"
4+
unit-test = "test --lib"
55
integration-test = "test --test integration"
66
schema = "run --example schema"

contracts/hackatom/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contracts/queue/.cargo/config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[alias]
22
wasm = "build --release --target wasm32-unknown-unknown"
33
wasm-debug = "build --target wasm32-unknown-unknown"
4-
unit-test = "test --lib --features backtraces"
4+
unit-test = "test --lib"
55
integration-test = "test --test integration"
66
schema = "run --example schema"

contracts/queue/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

contracts/reflect/.cargo/config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[alias]
22
wasm = "build --release --target wasm32-unknown-unknown"
33
wasm-debug = "build --target wasm32-unknown-unknown"
4-
unit-test = "test --lib --features backtraces"
4+
unit-test = "test --lib"
55
integration-test = "test --test integration"
66
schema = "run --example schema"

0 commit comments

Comments
 (0)