Skip to content

Commit

Permalink
Merge pull request #1920 from CosmWasm/migration-docs
Browse files Browse the repository at this point in the history
Add 2.0 MIGRATING entry
  • Loading branch information
chipshort authored Oct 17, 2023
2 parents 4d93721 + 303a3fa commit e5244e1
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions MIGRATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,72 @@ This guide explains what is needed to upgrade contracts when migrating over
major releases of `cosmwasm`. Note that you can also view the
[complete CHANGELOG](./CHANGELOG.md) to understand the differences.

## 1.5.x -> 2.0.0

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

```toml
[dependencies]
cosmwasm-std = "2.0.0"
# ...

[dev-dependencies]
cosmwasm-schema = "2.0.0"
cosmwasm-vm = "2.0.0"
# ...
```

- `ContractInfoResponse::new` now takes all fields of the response as
parameters:

```diff
-ContractInfoResponse::new(code_id, creator)
+ContractInfoResponse::new(code_id, creator, admin, pinned, ibc_port)
```

Please note that, in the future, this function signature can change between
minor versions.

- Replace all uses of `SubMsgExecutionResponse` with `SubMsgResponse`.
- Replace all uses of `PartialEq<&str> for Addr` with `PartialEq<Addr> for Addr`
like this:

```diff
-if addr == "admin" {
- // ...
-}
+let admin = deps.api.addr_validate("admin")?;
+if addr == admin {
+ // ...
+}
```

If you really want to compare the string representation (e.g. in tests), you
can use `Addr::as_str`:

```diff
-assert_eq!(addr, "admin");
+assert_eq!(addr.as_str(), "admin");
```

But keep in mind that this is case sensitive (while addresses are not).

## 1.4.x -> 1.5.0

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

```
[dependencies]
cosmwasm-std = "1.5.0"
cosmwasm-storage = "1.5.0"
# ...
[dev-dependencies]
cosmwasm-schema = "1.5.0"
cosmwasm-vm = "1.5.0"
# ...
```

## 1.3.x -> 1.4.0

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

0 comments on commit e5244e1

Please sign in to comment.