diff --git a/RELEASES.md b/RELEASES.md index 881f7c9b5..06d94af6b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -25,6 +25,21 @@ Our release process is as follows: the root `Cargo.toml` as well, and push these changes to the release PR. - If you released a new version of `ibc-derive` in step 3, make sure to update that dependency. + - Verify that there is no dev-dependency among the workspace crates, + except `ibc-testkit`. This is important, as `cargo-release` ignores + dev-dependency edges. You may use `cargo-depgraph`: + ```sh + cargo depgraph --all-features --workspace-only --dev-deps | dot -Tpng > graph.png + ``` + The command will generate a graph similar to this: + ![alt test](docs/dev-deps-graph.png) + The blue lines indicate dev dependencies; there should only be one blue line + referring to the `ibc-testkit` dependency. So the above example would result + in an unsuccessful release. + - In order to resolve such a situation, the dev dependencies other than `ibc-testkit` + can be manually released to crates.io first so that the subsequent crates that + depend on them can then be released via the release process. For instructions + on how to release a crate on crates.io, refer [here](https://doc.rust-lang.org/cargo/reference/publishing.html). 5. Run `cargo doc -p ibc --all-features --open` locally to double-check that all the documentation compiles and seems up-to-date and coherent. Fix any potential issues here and push them to the release PR. @@ -41,7 +56,9 @@ Our release process is as follows: 1. In case of intermittent problems with the registry, try `cargo release` locally to publish any missing crates from this release. This step requires the appropriate privileges to push crates to [crates.io]. - 2. In case the problems arise from the source files, fix them, bump a new + 2. If there is any new crate published locally, add + [ibcbot](https://crates.io/users/ibcbot) to its owners list. + 3. In case problems arise from the source files, fix them, bump a new patch version (e.g. `v0.48.1`) and repeat the process with its corresponding new tag. 10. Once the tag is pushed, wait for the CI bot to create a GitHub release, diff --git a/docs/dev-deps-graph.png b/docs/dev-deps-graph.png new file mode 100644 index 000000000..7386f9cf2 Binary files /dev/null and b/docs/dev-deps-graph.png differ diff --git a/ibc-clients/ics07-tendermint/cw-contract/Cargo.toml b/ibc-clients/ics07-tendermint/cw-contract/Cargo.toml index 34eb32812..49b4f06c8 100644 --- a/ibc-clients/ics07-tendermint/cw-contract/Cargo.toml +++ b/ibc-clients/ics07-tendermint/cw-contract/Cargo.toml @@ -24,14 +24,6 @@ ibc-client-tendermint = { workspace = true } # cosmwasm dependencies cosmwasm-std = { workspace = true } -[dev-dependencies] -cosmwasm-vm = { workspace = true } -hex = { version = "0.4.2" } -ibc-testkit = { workspace = true } -ibc-client-tendermint = { workspace = true } -tendermint = { workspace = true } -tendermint-testgen = { workspace = true } - [features] default = ["std"] std = [ diff --git a/ibc-clients/ics07-tendermint/cw-contract/src/lib.rs b/ibc-clients/ics07-tendermint/cw-contract/src/lib.rs index cbed3ebe5..4a4a642f0 100644 --- a/ibc-clients/ics07-tendermint/cw-contract/src/lib.rs +++ b/ibc-clients/ics07-tendermint/cw-contract/src/lib.rs @@ -13,6 +13,3 @@ pub mod client_type; pub mod entrypoint; - -#[cfg(test)] -pub mod tests; diff --git a/ibc-testkit/Cargo.toml b/ibc-testkit/Cargo.toml index 55546cf8c..2d4e5bc0d 100644 --- a/ibc-testkit/Cargo.toml +++ b/ibc-testkit/Cargo.toml @@ -29,18 +29,23 @@ tracing = { version = "0.1.40", default-features = false } typed-builder = { version = "0.18.0" } # ibc dependencies -ibc = { workspace = true, features = ["std"] } -ibc-proto = { workspace = true } +ibc = { workspace = true, features = ["std"] } +ibc-proto = { workspace = true } +ibc-client-cw = { workspace = true } +ibc-client-tendermint-cw = { workspace = true } # cosmos dependencies tendermint = { workspace = true } tendermint-testgen = { workspace = true } [dev-dependencies] -env_logger = "0.11.0" -rstest = { workspace = true } +env_logger = { version = "0.11.0" } tracing-subscriber = { version = "0.3.17", features = ["fmt", "env-filter", "json"] } test-log = { version = "0.2.13", features = ["trace"] } +hex = { version = "0.4.2" } +rstest = { workspace = true } +cosmwasm-vm = { workspace = true } +cosmwasm-std = { workspace = true } [features] default = ["std"] diff --git a/ibc-testkit/src/testapp/ibc/clients/mock/client_state.rs b/ibc-testkit/src/testapp/ibc/clients/mock/client_state.rs index 05ff95440..c46c81343 100644 --- a/ibc-testkit/src/testapp/ibc/clients/mock/client_state.rs +++ b/ibc-testkit/src/testapp/ibc/clients/mock/client_state.rs @@ -492,3 +492,22 @@ impl From for MockClientState { Self::new(cs.header) } } + +#[cfg(test)] +mod test { + #[cfg(feature = "serde")] + #[test] + fn test_any_client_state_to_json() { + use ibc::primitives::proto::Any; + + use super::{MockClientState, MockHeader}; + + let client_state = MockClientState::new(MockHeader::default()); + let expected = r#"{"typeUrl":"/ibc.mock.ClientState","value":"CgQKAhABEIDIr6Al"}"#; + let json = serde_json::to_string(&Any::from(client_state)).unwrap(); + assert_eq!(json, expected); + + let proto_any = serde_json::from_str::(expected).unwrap(); + assert_eq!(proto_any, Any::from(client_state)); + } +} diff --git a/ibc-clients/ics07-tendermint/cw-contract/src/tests/fixture.rs b/ibc-testkit/tests/cosmwasm/fixture.rs similarity index 94% rename from ibc-clients/ics07-tendermint/cw-contract/src/tests/fixture.rs rename to ibc-testkit/tests/cosmwasm/fixture.rs index 8961f10f1..946f9ac66 100644 --- a/ibc-clients/ics07-tendermint/cw-contract/src/tests/fixture.rs +++ b/ibc-testkit/tests/cosmwasm/fixture.rs @@ -1,24 +1,24 @@ use std::time::Duration; use cosmwasm_std::{from_json, Deps, DepsMut, Empty, Response, StdError, StdResult}; +use ibc::clients::tendermint::client_state::ClientState as TmClientState; +use ibc::clients::tendermint::consensus_state::ConsensusState as TmConsensusState; +use ibc::clients::tendermint::types::Header; +use ibc::core::client::types::{Height, Status}; +use ibc::core::host::types::identifiers::ChainId; +use ibc::core::primitives::Timestamp; use ibc_client_cw::types::{ CheckForMisbehaviourMsgRaw, ContractError, ExportMetadataMsg, GenesisMetadata, InstantiateMsg, MigrationPrefix, QueryMsg, QueryResponse, StatusMsg, UpdateStateMsgRaw, UpdateStateOnMisbehaviourMsgRaw, VerifyClientMessageRaw, }; use ibc_client_cw::utils::AnyCodec; -use ibc_client_tendermint::client_state::ClientState as TmClientState; -use ibc_client_tendermint::consensus_state::ConsensusState as TmConsensusState; -use ibc_client_tendermint::types::Header; -use ibc_core::client::types::{Height, Status}; -use ibc_core::host::types::identifiers::ChainId; -use ibc_core::primitives::Timestamp; +use ibc_client_tendermint_cw::entrypoint::TendermintContext; use ibc_testkit::fixtures::clients::tendermint::ClientStateConfig; use tendermint::Time; use tendermint_testgen::{Generator, Validator}; use super::helper::{dummy_checksum, dummy_sov_consensus_state, mock_env_with_timestamp_now}; -use crate::entrypoint::TendermintContext; /// Test fixture #[derive(Clone, Debug)] diff --git a/ibc-clients/ics07-tendermint/cw-contract/src/tests/helper.rs b/ibc-testkit/tests/cosmwasm/helper.rs similarity index 91% rename from ibc-clients/ics07-tendermint/cw-contract/src/tests/helper.rs rename to ibc-testkit/tests/cosmwasm/helper.rs index 45b5137b0..666a7e83f 100644 --- a/ibc-clients/ics07-tendermint/cw-contract/src/tests/helper.rs +++ b/ibc-testkit/tests/cosmwasm/helper.rs @@ -2,8 +2,8 @@ use std::str::FromStr; use cosmwasm_std::testing::{mock_env, mock_info}; use cosmwasm_std::{coins, Env, MessageInfo, Timestamp as CwTimestamp}; -use ibc_client_tendermint::types::ConsensusState; -use ibc_core::primitives::Timestamp as IbcTimestamp; +use ibc::clients::tendermint::types::ConsensusState; +use ibc::core::primitives::Timestamp as IbcTimestamp; use tendermint::Hash; pub fn dummy_msg_info() -> MessageInfo { diff --git a/ibc-clients/ics07-tendermint/cw-contract/src/tests/mod.rs b/ibc-testkit/tests/cosmwasm/mod.rs similarity index 96% rename from ibc-clients/ics07-tendermint/cw-contract/src/tests/mod.rs rename to ibc-testkit/tests/cosmwasm/mod.rs index 9c302f1f2..413981236 100644 --- a/ibc-clients/ics07-tendermint/cw-contract/src/tests/mod.rs +++ b/ibc-testkit/tests/cosmwasm/mod.rs @@ -5,13 +5,12 @@ use std::time::Duration; use cosmwasm_std::from_json; use cosmwasm_std::testing::{mock_dependencies, mock_env}; +use fixture::Fixture; +use ibc::core::client::types::{Height, Status}; use ibc_client_cw::types::{ ContractResult, MigrateClientStoreMsg, MigrationPrefix, VerifyClientMessageRaw, }; -use ibc_core::client::types::{Height, Status}; - -use crate::entrypoint::sudo; -use crate::tests::fixture::Fixture; +use ibc_client_tendermint_cw::entrypoint::sudo; #[test] fn test_cw_create_client_ok() { diff --git a/ibc-testkit/tests/mod.rs b/ibc-testkit/tests/mod.rs index 1f32c1d98..8b6f6bf3e 100644 --- a/ibc-testkit/tests/mod.rs +++ b/ibc-testkit/tests/mod.rs @@ -8,3 +8,4 @@ )] pub mod applications; pub mod core; +pub mod cosmwasm;