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 65bd4ef
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions MIGRATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<SomeType1, SomeType2, SomeType3> 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
Expand Down

0 comments on commit 65bd4ef

Please sign in to comment.