Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workspace dependencies #197

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
605 changes: 251 additions & 354 deletions Cargo.lock

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,61 @@ panic = 'abort'
incremental = false
overflow-checks = true


[workspace.dependencies]
anyhow = { version = "1.0.66" }
base64 = { version = "0.13.1" }
bincode = { version = "1.3.3" }
chrono = { version = "0.4.24" }
cosmrs = { version = "0.9.0", features = [ "cosmwasm" ] }
cosmwasm-schema = { version = "1.2.7" }
cosmwasm-std = { version = "1.2.7", features = [ "abort", "iterator", "stargate" ] }
cosmwasm-storage = { version = "1.2.7", features = [ "iterator" ] }
cosmwasm-vm = { version = "1.2.7", features = [ "iterator" ] }
cw-multi-test = { version = "0.16.5" }
cw-storage-plus = { version = "0.16.0" }
cw-utils = { version = "0.16.0" }
cw2 = { version = "0.16.0" }
cw20 = { version = "0.16.0" }
cw20-base = { version = "0.16.0", features = [ "library" ] }
enumset = { version = "1.0.12", features = [ "serde" ] }
ethereum-types = { version = "0.14.1" }
injective-test-tube = { git = "https://github.com/InjectiveLabs/test-tube", branch = "latest" }
json = { version = "0.12.4" }
hex = { version = "0.4.3", features = [ "serde" ] }
osmosis-std-derive = { version = "0.15.2" }
primitive-types = { version = "0.12.2" }
prost = { version = "0.11.9" }
prost-types = {version = "0.11.1", default-features = false}
protobuf = { version = "2.28.0", features = ["with-bytes"] }
rand = { version = "0.4.6" }
schemars = { version = "0.8.8", features = [ "enumset" ] }
secp256k1 = { version = "0.6.2" }
serde = { version = "1.0.137", default-features = false, features = ["derive"] }
serde-cw-value = { version = "0.7.0" }
serde_json = { version = "1.0.96"}
serde-json-wasm = { version = "0.4.1" }
serde_repr = { version = "0.1" }
serde_test = { version = "1.0.166" }
subtle-encoding = { version = "0.5.1", features = ["bech32-preview"] }
thiserror = { version = "1.0.31" }
tiny-keccak = { version = "1.2.1" }

# packages
injective-cosmwasm = { version = "0.2.16", path = "./packages/injective-cosmwasm" }
injective-math = { version = "0.2.1", path = "./packages/injective-math" }
injective-protobuf = { version = "0.2", path = "./packages/injective-protobuf" }
injective-std = { version = "0.1.3" , path = "./packages/injective-std" }
injective-testing = { version = "0.1.3" , path = "./packages/injective-testing" }


[patch.crates-io]
#cw-multi-test = { path = "../cw-multi-test" }
#cw-multi-test = { git = "https://github.com/InjectiveLabs/cw-multi-test.git", branch ="feature/custom_address_generator" }



# [dev-dependencies]
# cosmwasm-schema = { version = "1.2.0" }
# serde-json-wasm = { version = "0.4.1" }
# cw-multi-test = { version = "0.16.2" }
28 changes: 14 additions & 14 deletions contracts/atomic-order-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ optimize = """docker run --rm -v "$(pwd)":/code \
"""

[dependencies]
cosmwasm-std = "1.4.1"
cosmwasm-storage = "1.4.1"
cw-storage-plus = "0.14.0"
cw2 = "0.14.0"
cw-utils = "0.14.0"
schemars = "0.8.8"
serde = { version = "1.0.137", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.31" }
injective-cosmwasm = { version = "0.1.104" }
injective-math = { version = "0.1.4" }
protobuf = { version = "2", features = ["with-bytes"] }
injective-protobuf = { path = "../../packages/injective-protobuf", version = "0.2" }
cosmwasm-std = { workspace = true }
cosmwasm-storage = { workspace = true }
cw-storage-plus = { workspace = true }
cw2 = { workspace = true }
cw-utils = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
thiserror = { workspace = true }
protobuf = { workspace = true }
injective-cosmwasm = { workspace = true }
injective-math = { workspace = true }
injective-protobuf = { workspace = true }

[dev-dependencies]
cosmwasm-schema = "1.4.1"
cw-multi-test = "0.16.2"
cosmwasm-schema = { workspace = true }
cw-multi-test = { workspace = true }
1 change: 1 addition & 0 deletions contracts/atomic-order-example/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ pub fn try_swap(
&config.market_id,
subaccount_id,
Some(contract.to_owned()),
None,
);

let coins = &info.funds[0];
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_binary, Addr, CosmosMsg, StdResult, SubMsg, WasmMsg};
use cosmwasm_std::{to_json_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_binary(&msg.into())?;
let msg = to_json_binary(&msg.into())?;
Ok(WasmMsg::Execute {
contract_addr: self.addr().into(),
msg,
Expand Down
15 changes: 8 additions & 7 deletions contracts/atomic-order-example/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ use std::str::FromStr;

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

use injective_cosmwasm::InjectiveMsg::CreateSpotMarketOrder;
use injective_cosmwasm::{
inj_mock_deps, inj_mock_env, HandlesMarketIdQuery, InjectiveQueryWrapper, InjectiveRoute,
MarketId, OrderInfo, OrderType, OwnedDepsExt, SpotMarket, SpotMarketResponse, SpotOrder,
SubaccountId, WasmMockQuerier,
exchange::market::MarketStatus, inj_mock_deps, inj_mock_env, HandlesMarketIdQuery,
InjectiveQueryWrapper, InjectiveRoute, MarketId, OrderInfo, OrderType, OwnedDepsExt,
SpotMarket, SpotMarketResponse, SpotOrder, SubaccountId, WasmMockQuerier,
};
use injective_math::FPDecimal;

Expand Down Expand Up @@ -77,6 +77,7 @@ fn test_swap() {
fee_recipient: Some(env.contract.address),
price: i32_to_dec(1000),
quantity: i32_to_dec(8),
cid: None,
},
order_type: OrderType::BuyAtomic,
trigger_price: None,
Expand Down Expand Up @@ -132,12 +133,12 @@ fn create_spot_market_handler() -> impl HandlesMarketIdQuery {
taker_fee_rate: FPDecimal::from_str("0.1").unwrap(),
relayer_fee_share_rate: FPDecimal::from_str("0.4").unwrap(),
market_id,
status: 0,
status: MarketStatus::Unspecified,
min_price_tick_size: FPDecimal::from_str("0.000000000000001").unwrap(),
min_quantity_tick_size: FPDecimal::from_str("1000000000000000").unwrap(),
}),
};
SystemResult::Ok(ContractResult::from(to_binary(&response)))
SystemResult::Ok(ContractResult::from(to_json_binary(&response)))
}
}
Temp()
Expand Down
14 changes: 7 additions & 7 deletions contracts/dummy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ optimize = """docker run --rm -v "$(pwd)":/code \
"""

[dependencies]
cosmwasm-std = { version = "1.4.1" }
cw-storage-plus = "0.16.0"
cw2 = "0.14.0"
serde = { version = "1.0.136", default-features = false, features = ["derive"] }
schemars = "0.8.8"
thiserror = { version = "1.0.30" }
injective-cosmwasm = { version = "0.1.104" }
cosmwasm-std = { workspace = true }
cw-storage-plus = { workspace = true }
cw2 = { workspace = true }
serde = { workspace = true }
schemars = { workspace = true }
thiserror = { workspace = true }
injective-cosmwasm = { workspace = true }
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_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdError, StdResult,
to_json_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_binary("pong")?);
response.data = Some(to_json_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_binary("pong"),
QueryMsg::Ping { .. } => to_json_binary("pong"),
QueryMsg::Error { .. } => Err(StdError::generic_err("oh no!")),
QueryMsg::Runs {} => {
let runs_count = COUNTER.load(deps.storage)?;
to_binary(&format!("{runs_count}"))
to_json_binary(&format!("{runs_count}"))
}
QueryMsg::Active {} => {
let is_active = ACTIVE.load(deps.storage)?;
to_binary(&format!("{is_active}"))
to_json_binary(&format!("{is_active}"))
}
}
}
26 changes: 13 additions & 13 deletions packages/injective-cosmwasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ version = "0.2.16"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
cosmwasm-std = { version = "1.4.1" }
cw-storage-plus = { version = "0.15.0" }
ethereum-types = "0.5.2"
hex = { version = "0.4.3", features = [ "serde" ] }
injective-math = { path = "../injective-math", version = "0.2.0" }
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"
cosmwasm-std = { workspace = true }
cw-storage-plus = { workspace = true }
ethereum-types = { workspace = true }
hex = { workspace = true }
injective-math = { workspace = true }
schemars = { workspace = true }
serde = { workspace = true }
serde_repr = { workspace = true }
subtle-encoding = { workspace = true }
tiny-keccak = { workspace = true }

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