diff --git a/MIGRATING.md b/MIGRATING.md index 6099eda4..adc4993f 100644 --- a/MIGRATING.md +++ b/MIGRATING.md @@ -2,6 +2,63 @@ 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: +```rust +// In sylvia 1.0.2 +#[contract] +#[sv::messages(generic as Generic: custom(msg, query))] +impl Contract {} + +// Current Sylvia version: +#[contract] +#[sv::messages(generic as Generic: custom(msg, query))] +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: +```rust +// In sylvia 1.0.2 +let code_id: CodeId< + SvCustomMsg, + SvCustomMsg, + _, +> = CodeId::store_code(&app); + +// Current Sylvia version: +let code_id: CodeId< + GenericContract< + SvCustomMsg, + SvCustomMsg, + >, + _, +> = CodeId::store_code(&app); +``` + +3. Lifetime ellision in a contract's implementation block is not supported anymore. +```rust +// In sylvia 1.0.2 +#[contract] +impl Cw1SubkeysContract<'_> { + // [...] +} + +// Current Sylvia version: +#[contract] +impl<'a> Cw1SubkeysContract<'a> { + // [...] +} +``` + + ## 0.9.3 -> 0.10.0 ## Multitest proxy