Skip to content

Commit

Permalink
Merge pull request #202 from InjectiveLabs/f/cw-upgrade
Browse files Browse the repository at this point in the history
cw-contracts force cosmwasm packages to 1.2.7 version compatible
  • Loading branch information
nicolasbaum authored Nov 13, 2023
2 parents be85f85 + 284ea32 commit 65d1a41
Show file tree
Hide file tree
Showing 13 changed files with 164 additions and 137 deletions.
126 changes: 77 additions & 49 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions contracts/atomic-order-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ cw-utils = { version = "0.16.0" }
schemars = { version = "0.8.8", features = [ "enumset" ] }
serde = { version = "1.0.137", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.31" }
injective-cosmwasm = { version = "0.2.16", path= "../../packages/injective-cosmwasm" }
injective-math = { version = "0.2.2", path = "../../packages/injective-math" }
injective-cosmwasm = { version = "0.2.17" }
injective-math = { version = "0.2.3" }
protobuf = { version = "2.28.0", features = ["with-bytes"] }
injective-protobuf = { path = "../../packages/injective-protobuf", version = "0.2.1" }
injective-protobuf = { version = "0.2.1" }

[dev-dependencies]
cosmwasm-schema = { version = "1.2.7" }
Expand Down
4 changes: 2 additions & 2 deletions contracts/atomic-order-example/src/helpers.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cosmwasm_std::{to_json_binary, Addr, CosmosMsg, StdResult, SubMsg, WasmMsg};
use cosmwasm_std::{to_binary, Addr, CosmosMsg, StdResult, SubMsg, WasmMsg};
use injective_cosmwasm::InjectiveMsgWrapper;
use injective_math::FPDecimal;
use schemars::JsonSchema;
Expand All @@ -17,7 +17,7 @@ impl CwTemplateContract {
}

pub fn call<T: Into<ExecuteMsg>>(&self, msg: T) -> StdResult<CosmosMsg> {
let msg = to_json_binary(&msg.into())?;
let msg = to_binary(&msg.into())?;
Ok(WasmMsg::Execute {
contract_addr: self.addr().into(),
msg,
Expand Down
6 changes: 3 additions & 3 deletions contracts/atomic-order-example/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::str::FromStr;

use cosmwasm_std::testing::{mock_info, MockApi, MockStorage};
use cosmwasm_std::{
coins, to_json_binary, BankMsg, Binary, ContractResult, CosmosMsg, OwnedDeps, QuerierResult,
Reply, SubMsgResponse, SubMsgResult, SystemResult, Uint128,
coins, to_binary, BankMsg, Binary, ContractResult, CosmosMsg, OwnedDeps, QuerierResult, Reply,
SubMsgResponse, SubMsgResult, SystemResult, Uint128,
};

use injective_cosmwasm::InjectiveMsg::CreateSpotMarketOrder;
Expand Down Expand Up @@ -138,7 +138,7 @@ fn create_spot_market_handler() -> impl HandlesMarketIdQuery {
min_quantity_tick_size: FPDecimal::from_str("1000000000000000").unwrap(),
}),
};
SystemResult::Ok(ContractResult::from(to_json_binary(&response)))
SystemResult::Ok(ContractResult::from(to_binary(&response)))
}
}
Temp()
Expand Down
2 changes: 1 addition & 1 deletion contracts/dummy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ cw2 = { version = "0.16.0" }
serde = { version = "1.0.136", default-features = false, features = ["derive"] }
schemars = "0.8.8"
thiserror = { version = "1.0.30" }
injective-cosmwasm = { version = "0.2.16", path = "../../packages/injective-cosmwasm" }
injective-cosmwasm = { version = "0.2.17" }
10 changes: 5 additions & 5 deletions contracts/dummy/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cosmwasm_std::{
to_json_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdError, StdResult,
to_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdError, StdResult,
};
use cw2::set_contract_version;
use cw_storage_plus::Item;
Expand Down Expand Up @@ -44,7 +44,7 @@ pub fn execute(
match msg {
ExecuteMsg::Ping { .. } => {
let mut response = Response::new();
response.data = Some(to_json_binary("pong")?);
response.data = Some(to_binary("pong")?);
Ok(response)
}
ExecuteMsg::Error { .. } => Err(ContractError::Std(StdError::generic_err("oh no!"))),
Expand All @@ -71,15 +71,15 @@ pub fn sudo(deps: DepsMut, _env: Env, msg: SudoMsg) -> Result<Response, Contract
#[cfg_attr(not(feature = "library"), entry_point)]
pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
match msg {
QueryMsg::Ping { .. } => to_json_binary("pong"),
QueryMsg::Ping { .. } => to_binary("pong"),
QueryMsg::Error { .. } => Err(StdError::generic_err("oh no!")),
QueryMsg::Runs {} => {
let runs_count = COUNTER.load(deps.storage)?;
to_json_binary(&format!("{runs_count}"))
to_binary(&format!("{runs_count}"))
}
QueryMsg::Active {} => {
let is_active = ACTIVE.load(deps.storage)?;
to_json_binary(&format!("{is_active}"))
to_binary(&format!("{is_active}"))
}
}
}
10 changes: 5 additions & 5 deletions packages/injective-cosmwasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ license = "Apache-2.0"
name = "injective-cosmwasm"
readme = "README.md"
repository = "https://github.com/InjectiveLabs/cw-injective/tree/master/packages/bindings"
version = "0.2.16"
version = "0.2.17"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
cosmwasm-std = { version = "1.2.7", features = [ "abort", "iterator", "stargate" ] }
cw-storage-plus = { version = "0.16.0" }
cosmwasm-std = { version = "=1.2.7", features = [ "abort", "iterator", "stargate" ] }
cw-storage-plus = { version = "=0.16.0" }
ethereum-types = { version = "0.5.2" }
hex = { version = "0.4.3", features = [ "serde" ] }
injective-math = { path = "../injective-math", version = "0.2.2" }
injective-math = { version = "0.2.3" }
schemars = "0.8.8"
serde = { version = "1.0.136", default-features = false, features = [ "derive" ] }
serde_repr = "0.1"
subtle-encoding = { version = "0.5.1", features = [ "bech32-preview" ] }
tiny-keccak = "1.2.1"

[dev-dependencies]
cosmwasm-schema = { version = "1.2.7" }
cosmwasm-schema = { version = "=1.2.7" }
serde-json-wasm = { version = "0.4.1" }
serde_test = { version = "1.0.166" }
Loading

0 comments on commit 65d1a41

Please sign in to comment.