Skip to content

Commit cf25c49

Browse files
authored
Merge pull request #1942 from CosmWasm/1779-remove-default-ibc-receive-response
Remove `Default` impl for `IbcReceiveResponse`
2 parents ab9dff9 + 6c6159d commit cf25c49

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,15 @@ and this project adheres to
6767
`ConversionOverflowError` and `DivideByZeroError`. ([#1896])
6868
- cosmwasm-std: Remove old IBC version and make v3 the default. ([#1875])
6969
- cosmwasm-storage: Removed, use [cw-storage-plus] instead. ([#1936])
70+
- cosmwasm-std: Remove `IbcReceiveResponse`'s `Default` implementation. Use
71+
`IbcReceiveResponse::new` instead. ([#1942])
7072

7173
[cw-storage-plus]: https://github.com/CosmWasm/cw-storage-plus
7274
[#1875]: https://github.com/CosmWasm/cosmwasm/pull/1875
7375
[#1890]: https://github.com/CosmWasm/cosmwasm/pull/1890
7476
[#1896]: https://github.com/CosmWasm/cosmwasm/pull/1896
7577
[#1936]: https://github.com/CosmWasm/cosmwasm/pull/1936
78+
[#1942]: https://github.com/CosmWasm/cosmwasm/pull/1942
7679

7780
## [1.5.0] - 2023-10-31
7881

MIGRATING.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,15 @@ major releases of `cosmwasm`. Note that you can also view the
107107
+const item: Item<Uint128> = Item::new("item");
108108
```
109109

110-
- Replace all uses of `IbcReceiveResponse::set_ack` with calls to
111-
`IbcReceiveResponse::new`:
110+
- Replace all uses of `IbcReceiveResponse::set_ack` and
111+
`IbcReceiveResponse::default` with calls to `IbcReceiveResponse::new`:
112112

113113
```diff
114-
- Ok(IbcReceiveResponse::new().set_ack(b"{}"))
115-
+ Ok(IbcReceiveResponse::new(b"{}"))
114+
-Ok(IbcReceiveResponse::new().set_ack(b"{}"))
115+
+Ok(IbcReceiveResponse::new(b"{}"))
116+
117+
-Ok(IbcReceiveResponse::default())
118+
+Ok(IbcReceiveResponse::new(b""))
116119
```
117120

118121
## 1.4.x -> 1.5.0

packages/std/src/ibc.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -623,18 +623,6 @@ pub struct IbcReceiveResponse<T = Empty> {
623623
pub events: Vec<Event>,
624624
}
625625

626-
// Custom implementation in order to implement it for all `T`, even if `T` is not `Default`.
627-
impl<T> Default for IbcReceiveResponse<T> {
628-
fn default() -> Self {
629-
IbcReceiveResponse {
630-
acknowledgement: Binary::default(),
631-
messages: vec![],
632-
attributes: vec![],
633-
events: vec![],
634-
}
635-
}
636-
}
637-
638626
impl<T> IbcReceiveResponse<T> {
639627
/// Create a new response with the given acknowledgement.
640628
///

0 commit comments

Comments
 (0)