Skip to content

Commit

Permalink
docs: Update MIGRATING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kulikthebird committed May 7, 2024
1 parent dc8747a commit 1620583
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions MIGRATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,54 @@

This guide explains what is needed to upgrade contracts when migrating over major releases of `sylvia`. Note that you can also view the [complete CHANGELOG](https://github.com/CosmWasm/sylvia/blob/main/CHANGELOG.md) to understand the differences.


## 1.0.2 ->

### Remove types forwarding to interface in `sv::messages`

1. Types forwarding to the messages' associated types is not required:
```diff
-#[contract]
-#[sv::messages(generic<SomeType1, SomeType2, SomeType3> as Generic
-impl Contract {}
+#[contract]
+#[sv::messages(generic as Generic)]
+impl Contract {}
```

This change is optional, since the generics are still accepted by the parser. Though they are
ignored in the further process.


2. Multitest's `CodeId` is now generic over the contract type, not only the generics of the contract:
```diff
-let code_id: CodeId<
- SvCustomMsg,
- SvCustomMsg,
- _,
-> = CodeId::store_code(&app);
+let code_id: CodeId<
+ GenericContract<
+ SvCustomMsg,
+ SvCustomMsg,
+ >,
+ _,
+> = CodeId::store_code(&app);
```

3. Lifetime ellision in a contract's implementation block is not supported anymore.
```diff
-#[contract]
-impl Cw1SubkeysContract<'_> {
- // [...]
-}
+#[contract]
+impl<'a> Cw1SubkeysContract<'a> {
+ // [...]
+}
```


## 0.9.3 -> 0.10.0

## Multitest proxy
Expand Down

0 comments on commit 1620583

Please sign in to comment.