Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Default impl for IbcReceiveResponse #1942

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,15 @@ and this project adheres to
`ConversionOverflowError` and `DivideByZeroError`. ([#1896])
- cosmwasm-std: Remove old IBC version and make v3 the default. ([#1875])
- cosmwasm-storage: Removed, use [cw-storage-plus] instead. ([#1936])
- cosmwasm-std: Remove `IbcReceiveResponse`'s `Default` implementation. Use
`IbcReceiveResponse::new` instead. ([#1942])

[cw-storage-plus]: https://github.com/CosmWasm/cw-storage-plus
[#1875]: https://github.com/CosmWasm/cosmwasm/pull/1875
[#1890]: https://github.com/CosmWasm/cosmwasm/pull/1890
[#1896]: https://github.com/CosmWasm/cosmwasm/pull/1896
[#1936]: https://github.com/CosmWasm/cosmwasm/pull/1936
[#1942]: https://github.com/CosmWasm/cosmwasm/pull/1942

## [1.5.0] - 2023-10-31

Expand Down
11 changes: 7 additions & 4 deletions MIGRATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,15 @@ major releases of `cosmwasm`. Note that you can also view the
+const item: Item<Uint128> = Item::new("item");
```

- Replace all uses of `IbcReceiveResponse::set_ack` with calls to
`IbcReceiveResponse::new`:
- Replace all uses of `IbcReceiveResponse::set_ack` and
`IbcReceiveResponse::default` with calls to `IbcReceiveResponse::new`:

```diff
- Ok(IbcReceiveResponse::new().set_ack(b"{}"))
+ Ok(IbcReceiveResponse::new(b"{}"))
-Ok(IbcReceiveResponse::new().set_ack(b"{}"))
+Ok(IbcReceiveResponse::new(b"{}"))

-Ok(IbcReceiveResponse::default())
+Ok(IbcReceiveResponse::new(b""))
```

## 1.4.x -> 1.5.0
Expand Down
12 changes: 0 additions & 12 deletions packages/std/src/ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,18 +623,6 @@ pub struct IbcReceiveResponse<T = Empty> {
pub events: Vec<Event>,
}

// Custom implementation in order to implement it for all `T`, even if `T` is not `Default`.
impl<T> Default for IbcReceiveResponse<T> {
fn default() -> Self {
IbcReceiveResponse {
acknowledgement: Binary::default(),
messages: vec![],
attributes: vec![],
events: vec![],
}
}
}

impl<T> IbcReceiveResponse<T> {
/// Create a new response with the given acknowledgement.
///
Expand Down
Loading