Skip to content

Commit

Permalink
add 2.3 -> 2.4 migration doc
Browse files Browse the repository at this point in the history
  • Loading branch information
kwtalley committed Sep 27, 2024
1 parent abc04ec commit 604fbb4
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,50 @@ This guide provides information to assist in migrating contracts over major rele

___There are also example [contracts](./contracts) that provide concrete examples using the current release.___

## v2.3.0 -> 2.4.0

Cosmwasm is upgraded to v2.1.3 and Provenance to v1.19.1

- The encoding of messages to Provenance are now Grpc encoded rather than using the previous Stargate json encoding.
This change also removes all serde macros from the generated types and decreases the final wasm size. This upgrade
shouldn't require much to migrate contracts other than some minor Cosmwasm API changes and if you are using any of the
generated types as `inputs` to or `outputs` from the contract (i.e. the contract uses any type from
`provwasm-std::types` in the msg to or from any of the entrypoints). If this is the case, creating a new type that
holds all required inputs/outputs is the simplest remedy.

e.g.
```rust
#[derive(QueryResponses)]
pub enum QueryMsg {
#[returns(provwasm_std::types::provenance::metadata::v1::ContractSpecificationResponse)]
GetContractSpec { id: String },
}
```

becomes

```rust
#[derive(QueryResponses)]
pub enum QueryMsg {
#[returns(ContractSpecResp)]
GetContractSpec { id: String },
}

#[cw_serde]
pub struct ContractSpecData {
pub id: Vec<u8>,
pub class_name: String,
pub description: String,
pub owner_addresses: Vec<String>,
pub party_type: String,
}

#[cw_serde]
pub struct ContractSpecResp {
pub contract_spec: Option<ContractSpecData>,
}
```

## v2.1.0/v2.2.0 -> 2.3.0

Cosmwasm is upgraded to 2.0.4 and Provenance to 1.19.0. These major upgrades are mostly handled within the library:
Expand Down

0 comments on commit 604fbb4

Please sign in to comment.