Skip to content

Commit

Permalink
wip: bump cw-std to 2+; disable cw-orch
Browse files Browse the repository at this point in the history
  • Loading branch information
bekauz committed Dec 29, 2024
1 parent f70440a commit 6e83d0d
Show file tree
Hide file tree
Showing 14 changed files with 756 additions and 3,010 deletions.
3,478 changes: 605 additions & 2,873 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["packages/*", "contracts/accessories/*", "contracts/main/*"]
members = ["packages/polytone", "contracts/accessories/*", "contracts/main/*"]
resolver = "2"

[workspace.package]
Expand All @@ -26,11 +26,11 @@ polytone-proxy = { path = "contracts/main/proxy", version = "1.1.0" }
polytone-note = { path = "contracts/main/note", version = "1.1.0" }
polytone-voice = { path = "contracts/main/voice", version = "1.1.0" }

cosmwasm-schema = "1.5.4"
cosmwasm-std = { version = "1.5.4", features = ["ibc3", "staking"] }
cw-storage-plus = "1.0.1"
cw-utils = "1.0.1"
cw2 = "1.0.1"
cosmwasm-schema = "2.1.3"
cosmwasm-std = { version = "2.1.3", features = ["cosmwasm_1_2", "stargate"] }
cw-storage-plus = "2.0.0"
cw-utils = "2.0.0"
cw2 = "2.0.0"

serde = { version = "1.0.145", default-features = false, features = ["derive"] }
thiserror = "1.0.31"
Expand All @@ -41,7 +41,7 @@ thiserror = "1.0.31"
sha2 = "0.10.6"

# dev-dependencies
cw-multi-test = "0.16.2"
cw-multi-test = { version = "2.1.1" }
polytone-tester = { path = "tests/polytone-tester" }
anyhow = { version = "1.0.51" }
cw-orch = { version = "0.22.2" }
# cw-orch = { version = "0.27.0" }
1 change: 0 additions & 1 deletion contracts/accessories/listener/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ crate-type = ["cdylib", "rlib"]

[features]
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]
# disables #[entry_point] (i.e. instantiate/execute/query) export
library = []

Expand Down
39 changes: 19 additions & 20 deletions contracts/accessories/polytone-tester/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
[package]
name = "polytone-tester"
authors = ["ekez <[email protected]>"]
description = "A Polytone tester contract."
edition = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
name = "polytone-tester"
authors = ["ekez <[email protected]>"]
description = "A Polytone tester contract."
edition = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
version = { workspace = true }
version = { workspace = true }

[lib]
crate-type = ["cdylib", "rlib"]

[features]
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]
# disables #[entry_point] (i.e. instantiate/execute/query) export
library = []

# This is here inspite of the warnings to make sure it is not missed
# if the contract is taken out of the workspace
[profile.release]
codegen-units = 1
debug = false
codegen-units = 1
debug = false
debug-assertions = false
incremental = false
lto = true
opt-level = 3
overflow-checks = true # very important, do not turn these off.
panic = 'abort'
rpath = false
incremental = false
lto = true
opt-level = 3
overflow-checks = true # very important, do not turn these off.
panic = 'abort'
rpath = false

[dependencies]
cosmwasm-schema = { workspace = true }
cosmwasm-std = { workspace = true }
cosmwasm-std = { workspace = true }
cw-storage-plus = { workspace = true }
cw2 = { workspace = true }
thiserror = { workspace = true }
polytone = { workspace = true }
cw2 = { workspace = true }
thiserror = { workspace = true }
polytone = { workspace = true }
48 changes: 24 additions & 24 deletions contracts/main/note/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
[package]
name = "polytone-note"
authors = ["ekez <[email protected]>"]
description = "Sends messages to be executed on other chains over IBC."
edition = { workspace = true }
license = { workspace = true }
name = "polytone-note"
authors = ["ekez <[email protected]>"]
description = "Sends messages to be executed on other chains over IBC."
edition = { workspace = true }
license = { workspace = true }
rust-version = { workspace = true }
repository = { workspace = true }
version = { workspace = true }
repository = { workspace = true }
version = { workspace = true }

[lib]
crate-type = ["cdylib", "rlib"]

[features]
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]
# disables #[entry_point] (i.e. instantiate/execute/query) export
library = []
interface = ["dep:cw-orch"]
interface = []
# interface = ["dep:cw-orch"]

# This is here inspite of the warnings to make sure it is not missed
# if the contract is taken out of the workspace
[profile.release]
codegen-units = 1
debug = false
codegen-units = 1
debug = false
debug-assertions = false
incremental = false
lto = true
opt-level = 3
overflow-checks = true # very important, do not turn these off.
panic = 'abort'
rpath = false
incremental = false
lto = true
opt-level = 3
overflow-checks = true # very important, do not turn these off.
panic = 'abort'
rpath = false

[dependencies]
cosmwasm-schema = { workspace = true }
cosmwasm-std = { workspace = true }
cosmwasm-std = { workspace = true }
cw-storage-plus = { workspace = true }
cw-utils = { workspace = true }
cw2 = { workspace = true }
thiserror = { workspace = true }
polytone = { workspace = true }
cw-orch = { workspace = true, optional = true }
cw-utils = { workspace = true }
cw2 = { workspace = true }
thiserror = { workspace = true }
polytone = { workspace = true }
# cw-orch = { workspace = true, optional = true }

[dev-dependencies]
cw-multi-test = { workspace = true }
anyhow = { workspace = true }
anyhow = { workspace = true }
25 changes: 14 additions & 11 deletions contracts/main/note/src/contract.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cosmwasm_std::{
to_json_binary, Binary, Deps, DepsMut, Env, IbcMsg, IbcTimeout, MessageInfo, Response,
StdResult,
to_json_binary, Binary, CosmosMsg, Deps, DepsMut, Env, IbcMsg, IbcTimeout, MessageInfo,
Response, StdResult,
};
use cw2::set_contract_version;
use polytone::callbacks::CallbackRequestType;
Expand Down Expand Up @@ -103,17 +103,20 @@ pub fn execute(
&info.sender,
)?;

let send_packet_msg: CosmosMsg = IbcMsg::SendPacket {
channel_id,
data: to_json_binary(&ibc::Packet {
sender: info.sender.into_string(),
msg,
})
.expect("msgs are known to be serializable"),
timeout: IbcTimeout::with_timestamp(env.block.time.plus_seconds(timeout_seconds.u64())),
}
.into();

Ok(Response::default()
.add_attribute("method", "execute")
.add_message(IbcMsg::SendPacket {
channel_id,
data: to_json_binary(&ibc::Packet {
sender: info.sender.into_string(),
msg,
})
.expect("msgs are known to be serializable"),
timeout: IbcTimeout::with_timestamp(env.block.time.plus_seconds(timeout_seconds.u64())),
}))
.add_message(send_packet_msg))
}

#[cfg_attr(not(feature = "library"), entry_point)]
Expand Down
8 changes: 4 additions & 4 deletions contracts/main/note/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ pub struct InstantiateMsg {
}

#[cw_serde]
#[cfg_attr(feature = "interface", derive(cw_orch::ExecuteFns))] // cw-orch automatic
// #[derive(cw_orch::ExecuteFns)] // cw-orch automatic
pub enum ExecuteMsg {
/// Performs the requested queries on the voice chain and returns
/// a callback of Vec<QuerierResult>, or ACK-FAIL if unmarshalling
/// any of the query requests fails.
#[cfg_attr(feature = "interface", fn_name("ibc_query"))]
// #[cfg_attr(feature = "interface", fn_name("ibc_query"))]
Query {
msgs: Vec<QueryRequest<Empty>>,
callback: CallbackRequest,
Expand All @@ -45,7 +45,7 @@ pub enum ExecuteMsg {
/// perform no additional actions, pass an empty list to
/// `msgs`. Accounts are queryable via the `RemoteAddress {
/// local_address }` query after they have been created.
#[cfg_attr(feature = "interface", fn_name("ibc_execute"))]
// #[cfg_attr(feature = "interface", fn_name("ibc_execute"))]
Execute {
msgs: Vec<CosmosMsg<Empty>>,
callback: Option<CallbackRequest>,
Expand All @@ -55,7 +55,7 @@ pub enum ExecuteMsg {

#[cw_serde]
#[derive(QueryResponses)]
#[cfg_attr(feature = "interface", derive(cw_orch::QueryFns))] // cw-orch automatic
// #[derive(QueryResponses, cw_orch::QueryFns)] // cw-orch automatic
pub enum QueryMsg {
/// This channel this note is currently connected to, or none if
/// no channel is connected.
Expand Down
46 changes: 23 additions & 23 deletions contracts/main/proxy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
[package]
name = "polytone-proxy"
authors = ["ekez <[email protected]>"]
description = "An Interchain Account contract."
edition = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
name = "polytone-proxy"
authors = ["ekez <[email protected]>"]
description = "An Interchain Account contract."
edition = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
version = { workspace = true }
version = { workspace = true }

[lib]
crate-type = ["cdylib", "rlib"]

[features]
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]
# disables #[entry_point] (i.e. instantiate/execute/query) export
library = []
interface = ["dep:cw-orch"]
interface = []
# interface = ["dep:cw-orch"]

# This is here inspite of the warnings to make sure it is not missed
# if the contract is taken out of the workspace
[profile.release]
codegen-units = 1
debug = false
codegen-units = 1
debug = false
debug-assertions = false
incremental = false
lto = true
opt-level = 3
overflow-checks = true # very important, do not turn these off.
panic = 'abort'
rpath = false
incremental = false
lto = true
opt-level = 3
overflow-checks = true # very important, do not turn these off.
panic = 'abort'
rpath = false

[dependencies]
cosmwasm-schema = { workspace = true }
cosmwasm-std = { workspace = true }
cosmwasm-std = { workspace = true }
cw-storage-plus = { workspace = true }
cw-utils = { workspace = true }
cw2 = { workspace = true }
thiserror = { workspace = true }
polytone = { workspace = true }
cw-orch = { workspace = true, optional = true }
cw-utils = { workspace = true }
cw2 = { workspace = true }
thiserror = { workspace = true }
polytone = { workspace = true }
# cw-orch = { workspace = true, optional = true }

[dev-dependencies]
cw-multi-test = { workspace = true }
4 changes: 2 additions & 2 deletions contracts/main/proxy/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ use cosmwasm_std::CosmosMsg;
pub struct InstantiateMsg {}

#[cw_serde]
#[cfg_attr(feature = "interface", derive(cw_orch::ExecuteFns))] // cw-orch automatic
// #[cfg_attr(feature = "interface", derive(cw_orch::ExecuteFns))] // cw-orch automatic
pub enum ExecuteMsg {
Proxy { msgs: Vec<CosmosMsg> },
}

#[cw_serde]
#[derive(QueryResponses)]
#[cfg_attr(feature = "interface", derive(cw_orch::QueryFns))] // cw-orch automatic
// #[cfg_attr(feature = "interface", derive(cw_orch::QueryFns))] // cw-orch automatic
pub enum QueryMsg {
#[returns(cosmwasm_std::Addr)]
Instantiator {},
Expand Down
Loading

0 comments on commit 6e83d0d

Please sign in to comment.