Skip to content

Commit

Permalink
chore: move ibc tests using ibc-testkit
Browse files Browse the repository at this point in the history
  • Loading branch information
Farhad-Shabani committed Nov 23, 2023
1 parent 6d4e022 commit 75a2203
Show file tree
Hide file tree
Showing 83 changed files with 2,186 additions and 2,327 deletions.
42 changes: 22 additions & 20 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
[workspace]
resolver = "2"
# members sorted by publishing order to `crates.io`
members = [
"ibc",
"ibc-data-types",
"ibc-primitives",
"ibc-core",
"ibc-clients",
"ibc-apps",
"ibc-testkit",
"ibc-query",
"ibc-derive",
"ibc-core/ics02-client",
"ibc-primitives",
"ibc-core/ics24-host/types",
"ibc-core/ics26-routing/types",
"ibc-core/ics23-commitment/types",
"ibc-core/ics02-client/types",
"ibc-core/ics03-connection",
"ibc-core/ics03-connection/types",
"ibc-core/ics04-channel",
"ibc-core/ics04-channel/types",
"ibc-core/ics23-commitment/types",
"ibc-core/ics24-host",
"ibc-core/ics24-host/types",
"ibc-core/ics24-host/cosmos",
"ibc-core/ics25-handler",
"ibc-core/ics25-handler/types",
"ibc-core/ics02-client/context",
"ibc-core/ics24-host",
"ibc-core/ics26-routing",
"ibc-core/ics26-routing/types",
"ibc-clients/ics07-tendermint",
"ibc-core/ics02-client",
"ibc-core/ics03-connection",
"ibc-core/ics04-channel",
"ibc-core/ics25-handler",
"ibc-core",
"ibc-clients/ics07-tendermint/types",
"ibc-apps/ics20-transfer",
"ibc-clients/ics07-tendermint",
"ibc-clients",
"ibc-core/ics24-host/cosmos",
"ibc-apps/ics20-transfer/types",
"ibc-apps/ics20-transfer",
"ibc-apps",
"ibc-data-types",
"ibc",
"ibc-query",
"ibc-testkit",
]
exclude = [
"ci/cw-check",
Expand Down Expand Up @@ -66,7 +68,7 @@ ibc-core = { version = "0.48.0", path = "./ibc-core", default-feature
ibc-clients = { version = "0.48.0", path = "./ibc-clients", default-features = false }
ibc-apps = { version = "0.48.0", path = "./ibc-apps", default-features = false }
ibc-primitives = { version = "0.48.0", path = "./ibc-primitives", default-features = false }
ibc-testkit = { path = "./ibc-testkit" }
ibc-testkit = { version = "0.48.0", path = "./ibc-testkit" }
ibc-derive = { version = "0.4.0", path = "./ibc-derive" }

ibc-core-client = { version = "0.48.0", path = "./ibc-core/ics02-client", default-features = false }
Expand Down
5 changes: 2 additions & 3 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

## Releases

Our release process is as follows:
Expand Down Expand Up @@ -33,8 +32,8 @@ Our release process is as follows:
work. Fix any potential issues here and push them to the release PR.
7. Mark the PR as **Ready for Review** and incorporate feedback on the release.
8. Once approved, merge the PR, and pull the `main` branch.
9. Run `cargo publish -p <PACKAGE_NAME>` for each package separately to publish
the crates.
9. Publish each package to crates.io by running `cargo publish -p <PACKAGE_NAME>`
in the order specified in the workspace `Cargo.toml`.
10. Create a signed tag and push it to GitHub: `git tag -s -a vX.Y.Z`. In the
tag message, write the version and the link to the corresponding section of
the changelog.
Expand Down
2 changes: 0 additions & 2 deletions ci/cw-check/Cargo.lock

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

2 changes: 0 additions & 2 deletions ci/no-std-check/Cargo.lock

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

3 changes: 0 additions & 3 deletions ibc-apps/ics20-transfer/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ parity-scale-codec = { workspace = true , optional = true }
scale-info = { workspace = true , optional = true }

[dev-dependencies]
ibc-testkit = { workspace = true }
serde_json = { workspace = true }
rstest = { workspace = true }

Expand All @@ -50,13 +49,11 @@ std = [
"primitive-types/std",
"ibc-core/std",
"ibc-proto/std",
"ibc-testkit/std",
]
serde = [
"dep:serde",
"ibc-core/serde",
"ibc-proto/serde",
"ibc-testkit/serde"
]
schema = [
"dep:schemars",
Expand Down
5 changes: 3 additions & 2 deletions ibc-apps/ics20-transfer/types/src/packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,16 @@ impl From<PacketData> for RawPacketData {

#[cfg(test)]
mod tests {
use ibc_testkit::utils::core::signer::dummy_bech32_account;
use primitive_types::U256;

use super::*;
use crate::BaseCoin;

impl PacketData {
pub fn new_dummy() -> Self {
let address: Signer = dummy_bech32_account().into();
let address: Signer = "cosmos1wxeyh7zgn4tctjzs0vtqpc6p5cxq5t2muzl7ng"
.to_string()
.into();

Self {
token: BaseCoin {
Expand Down
15 changes: 14 additions & 1 deletion ibc-clients/ics07-tendermint/src/client_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,14 +503,27 @@ mod tests {
use core::time::Duration;

use ibc_client_tendermint_types::{
AllowUpdate, ClientState as ClientStateType, ClientStateParams, TrustThreshold,
AllowUpdate, ClientState as ClientStateType, TrustThreshold,
};
use ibc_core_client::types::Height;
use ibc_core_commitment_types::specs::ProofSpecs;
use ibc_core_host::types::identifiers::ChainId;

use super::*;

#[derive(Clone, Debug, PartialEq)]
pub struct ClientStateParams {
pub id: ChainId,
pub trust_level: TrustThreshold,
pub trusting_period: Duration,
pub unbonding_period: Duration,
pub max_clock_drift: Duration,
pub latest_height: Height,
pub proof_specs: ProofSpecs,
pub upgrade_path: Vec<String>,
pub allow_update: AllowUpdate,
}

#[test]
fn client_state_verify_height() {
// Define a "default" set of parameters to reuse throughout these tests.
Expand Down
10 changes: 0 additions & 10 deletions ibc-clients/ics07-tendermint/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ prost = { workspace = true }
serde = { workspace = true, optional = true }

# ibc dependencies
ibc-core-client-context = { workspace = true }
ibc-core-client-types = { workspace = true }
ibc-core-commitment-types = { workspace = true }
ibc-core-handler-types = { workspace = true }
ibc-core-host-types = { workspace = true }
ibc-primitives = { workspace = true }
ibc-proto = { workspace = true }
Expand All @@ -44,7 +42,6 @@ parity-scale-codec = { workspace = true, optional = true }
scale-info = { workspace = true, optional = true }

[dev-dependencies]
ibc-testkit = { workspace = true }
serde_json = { workspace = true }
tendermint-rpc = { workspace = true }

Expand All @@ -56,29 +53,24 @@ std = [
"prost/std",
"serde/std",
"serde_json/std",
"ibc-core-client-context/std",
"ibc-core-client-types/std",
"ibc-core-commitment-types/std",
"ibc-core-handler-types/std",
"ibc-core-host-types/std",
"ibc-primitives/std",
"ibc-proto/std",
"tendermint/std",
]
serde = [
"dep:serde",
"ibc-core-client-context/serde",
"ibc-core-client-types/serde",
"ibc-core-commitment-types/serde",
"ibc-core-handler-types/serde",
"ibc-core-host-types/serde",
"ibc-primitives/serde",
"ibc-proto/serde",
]
schema = [
"ibc-core-client-types/schema",
"ibc-core-commitment-types/schema",
"ibc-core-handler-types/schema",
"ibc-core-host-types/schema",
"ibc-primitives/schema",
"ibc-proto/json-schema",
Expand All @@ -89,7 +81,6 @@ borsh = [
"dep:borsh",
"ibc-core-client-types/borsh",
"ibc-core-commitment-types/borsh",
"ibc-core-handler-types/borsh",
"ibc-core-host-types/borsh",
"ibc-primitives/borsh",
"ibc-proto/borsh",
Expand All @@ -99,7 +90,6 @@ parity-scale-codec = [
"dep:scale-info",
"ibc-core-client-types/parity-scale-codec",
"ibc-core-commitment-types/parity-scale-codec",
"ibc-core-handler-types/parity-scale-codec",
"ibc-core-host-types/parity-scale-codec",
"ibc-primitives/parity-scale-codec",
"ibc-proto/parity-scale-codec",
Expand Down
Loading

0 comments on commit 75a2203

Please sign in to comment.