Skip to content

Commit

Permalink
Merge pull request #818 from CosmWasm/update-to-0.14.0-alpha2
Browse files Browse the repository at this point in the history
Update to 0.14.0 alpha2
  • Loading branch information
webmaster128 authored Mar 3, 2021
2 parents 265f485 + 35cf871 commit 5bd2f2f
Show file tree
Hide file tree
Showing 16 changed files with 79 additions and 76 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 16 additions & 13 deletions MIGRATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ major releases of `cosmwasm`. Note that you can also view the
- Rename the `handle` entry point to `execute`.
Also, rename `HandleMsg` to `ExecuteMsg`.

- Rename `InitResponse`, `HandleResponse` and `MigrateResponse` to `Response`.
The old names are still supported (with a deprecation warning), and will be
removed in the next version.

- Remove `from_address` from `BankMsg::Send`, which is now automatically filled
with the contract address:

Expand Down Expand Up @@ -70,7 +74,7 @@ major releases of `cosmwasm`. Note that you can also view the
_env: Env,
_info: MessageInfo,
_msg: InitMsg,
) -> StdResult<InitResponse> {
) -> StdResult<Response> {
//
}

Expand All @@ -80,7 +84,7 @@ major releases of `cosmwasm`. Note that you can also view the
_env: Env,
_info: MessageInfo,
_msg: ExecuteMsg,
) -> StdResult<HandleResponse> {
) -> StdResult<Response> {
//
}

Expand All @@ -91,7 +95,7 @@ major releases of `cosmwasm`. Note that you can also view the
env: Env,
_info: MessageInfo,
msg: MigrateMsg,
) -> StdResult<MigrateResponse> {
) -> StdResult<Response> {
//
}

Expand All @@ -101,8 +105,8 @@ major releases of `cosmwasm`. Note that you can also view the
}
```

- Since `InitResponse` now contains a `data` field like `HandleResponse` and
`MigrateResponse`, converting `Context` into `InitResponse` always succeeds.
- Since `Response` contains a `data` field, converting `Context` into `Response`
always succeeds.

```rust
// before
Expand All @@ -114,7 +118,7 @@ major releases of `cosmwasm`. Note that you can also view the
}

// after
pub fn init(deps: DepsMut, env: Env, info: MessageInfo, msg: InitMsg) -> Result<InitResponse, HackError> {
pub fn init(deps: DepsMut, env: Env, info: MessageInfo, msg: InitMsg) -> Result<Response, HackError> {
//
let mut ctx = Context::new();
ctx.add_attribute("Let the", "hacking begin");
Expand All @@ -136,7 +140,7 @@ major releases of `cosmwasm`. Note that you can also view the
}

// After
pub fn migrate(deps: DepsMut, env: Env, msg: MigrateMsg) -> StdResult<MigrateResponse> {
pub fn migrate(deps: DepsMut, env: Env, msg: MigrateMsg) -> StdResult<Response> {
// ...
}
```
Expand All @@ -150,13 +154,12 @@ major releases of `cosmwasm`. Note that you can also view the
[msgmigratecontract]:
https://github.com/CosmWasm/wasmd/blob/v0.15.0/x/wasm/internal/types/tx.proto#L86-L96

- Add mutating helper methods to `InitResponse`, `HandleResponse` and
`MigrateResponse` that can be used instead of a creating a `Context` that is
later converted to a response:
- Add mutating helper methods to `Response` that can be used instead of
creating a `Context` that is later converted to a response:

```rust
// before
pub fn handle_impl(deps: DepsMut, env: Env, info: MessageInfo) -> Result<HandleResponse, ContractError> {
pub fn handle_impl(deps: DepsMut, env: Env, info: MessageInfo) -> Result<Response, ContractError> {
// ...

// release counter_offer to creator
Expand All @@ -180,11 +183,11 @@ major releases of `cosmwasm`. Note that you can also view the


// after
pub fn execute_impl(deps: DepsMut, env: Env, info: MessageInfo) -> Result<HandleResponse, ContractError> {
pub fn execute_impl(deps: DepsMut, env: Env, info: MessageInfo) -> Result<Response, ContractError> {
// ...

// release counter_offer to creator
let mut resp = HandleResponse::new();
let mut resp = Response::new();
resp.add_message(BankMsg::Send {
to_address: state.creator,
amount: state.counter_offer,
Expand Down
10 changes: 5 additions & 5 deletions contracts/burner/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions contracts/crypto-verify/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions contracts/hackatom/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions contracts/ibc-reflect-send/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5bd2f2f

Please sign in to comment.