Skip to content

Commit

Permalink
deps: bump cosmwasm to 1.5 (#19)
Browse files Browse the repository at this point in the history
* deps: updated cw

* style: ran 'cargo fmt'

* imp(owner): updated Cargo.lock
  • Loading branch information
srdtrk authored Nov 8, 2023
1 parent e1d7508 commit d5233cb
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 68 deletions.
94 changes: 59 additions & 35 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ optimize = """docker run --rm -v "$(pwd)":/code \
"""

[dependencies]
cosmwasm-schema = "1.4.0"
cosmwasm-std = { version = "1.4.0", features = [
cosmwasm-schema = "1.5.0"
cosmwasm-std = { version = "1.5.0", features = [
"cosmwasm_1_2",
# Enable this if you only deploy to chains that have CosmWasm 1.4 or higher
# "cosmwasm_1_4",
"stargate",
"ibc3",
] }
cw-storage-plus = "1.1.0"
cw2 = "1.1.0"
cw2 = "1.1.1"
schemars = "0.8.10"
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde-json-wasm = "0.5.1"
thiserror = { version = "1.0.31" }
serde-json-wasm = "1.0.0"
thiserror = { version = "1.0.50" }
cosmos-sdk-proto = { version = "0.20.0", default-features = false }
semver = "1.0"

Expand Down
8 changes: 4 additions & 4 deletions src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! This module handles the execution logic of the contract.
use cosmwasm_std::entry_point;
use cosmwasm_std::{to_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult};
use cosmwasm_std::{to_json_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult};

use crate::ibc::types::stargate::channel::new_ica_channel_open_init_cosmos_msg;
use crate::types::keys::{CONTRACT_NAME, CONTRACT_VERSION};
Expand Down Expand Up @@ -84,9 +84,9 @@ pub fn execute(
#[entry_point]
pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
match msg {
QueryMsg::GetContractState {} => to_binary(&query::state(deps)?),
QueryMsg::GetChannel {} => to_binary(&query::channel(deps)?),
QueryMsg::GetCallbackCounter {} => to_binary(&query::callback_counter(deps)?),
QueryMsg::GetContractState {} => to_json_binary(&query::state(deps)?),
QueryMsg::GetChannel {} => to_json_binary(&query::channel(deps)?),
QueryMsg::GetCallbackCounter {} => to_json_binary(&query::callback_counter(deps)?),
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use cosmwasm_std::{to_binary, Addr, Binary, CosmosMsg, QuerierWrapper, StdResult, WasmMsg};
use cosmwasm_std::{to_json_binary, Addr, Binary, CosmosMsg, QuerierWrapper, StdResult, WasmMsg};

use crate::types::{msg, state};

Expand All @@ -31,7 +31,7 @@ impl CwIcaControllerContract {

/// call creates a [`WasmMsg::Execute`] message targeting this contract,
pub fn call(&self, msg: impl Into<msg::ExecuteMsg>) -> StdResult<CosmosMsg> {
let msg = to_binary(&msg.into())?;
let msg = to_json_binary(&msg.into())?;
Ok(WasmMsg::Execute {
contract_addr: self.addr().into(),
msg,
Expand Down Expand Up @@ -81,7 +81,7 @@ impl CwIcaControllerContract {
msg: impl Into<msg::MigrateMsg>,
new_code_id: u64,
) -> StdResult<CosmosMsg> {
let msg = to_binary(&msg.into())?;
let msg = to_json_binary(&msg.into())?;
Ok(WasmMsg::Migrate {
contract_addr: self.addr().into(),
new_code_id,
Expand Down Expand Up @@ -109,7 +109,7 @@ impl CwIcaControllerCode {
label: impl Into<String>,
admin: Option<impl Into<String>>,
) -> StdResult<CosmosMsg> {
let msg = to_binary(&msg.into())?;
let msg = to_json_binary(&msg.into())?;
Ok(WasmMsg::Instantiate {
code_id: self.code_id(),
msg,
Expand All @@ -128,7 +128,7 @@ impl CwIcaControllerCode {
admin: Option<impl Into<String>>,
salt: impl Into<Binary>,
) -> StdResult<CosmosMsg> {
let msg = to_binary(&msg.into())?;
let msg = to_json_binary(&msg.into())?;
Ok(WasmMsg::Instantiate2 {
code_id: self.code_id(),
msg,
Expand Down
4 changes: 2 additions & 2 deletions src/ibc/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use cosmwasm_std::entry_point;
use cosmwasm_std::{
from_binary, DepsMut, Env, IbcBasicResponse, IbcPacketAckMsg, IbcPacketReceiveMsg,
from_json, DepsMut, Env, IbcBasicResponse, IbcPacketAckMsg, IbcPacketReceiveMsg,
IbcPacketTimeoutMsg, IbcReceiveResponse, Never,
};

Expand All @@ -24,7 +24,7 @@ pub fn ibc_packet_ack(
ack: IbcPacketAckMsg,
) -> Result<IbcBasicResponse, ContractError> {
// This lets the ICA controller know whether or not the sent transactions succeeded.
match from_binary(&ack.acknowledgement.data)? {
match from_json(&ack.acknowledgement.data)? {
AcknowledgementData::Result(res) => {
ibc_packet_ack::success(deps, ack.original_packet, ack.relayer, res)
}
Expand Down
Loading

0 comments on commit d5233cb

Please sign in to comment.