-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
ibc-testkit
integration tests into tests-integration
directo…
…ry (#1233) * Move ibc-testkit tests into tests-integration directory * Fix include_str paths * Remove unnecessary dependencies from ibc-testkit * Remove unnecessary dev-dependencies from ibc-testkit * Add ibc-testkit/serde to serde dependency * Format ibc-testkit cargo.toml * Remove unnecessary serde feature from tests-integration crate * Fix typos * Move json test data into ibc-testkit * Move some tests around * Cargo fmt check * Gate tests behind serde feature * Switch doc_comment to doc attribute * Remove doc-comment dependency * Move client state unit tests back to ibc-clients * Add comment about internal crates * Move test_serialization_roundtrip function to utils * Assert that serialized string matches json input * Change serde_json -> dep:serde_json * Remove features section from cargo.toml * Remove unused imports * taplo fmt * Add features section back to cargo.toml * update readme and crate description * format toml * disable features Signed-off-by: Rano | Ranadeep <ranadip.bswas@gmail.com> --------- Signed-off-by: Rano | Ranadeep <ranadip.bswas@gmail.com> Co-authored-by: Ranadeep Biswas <mail@rnbguy.at> Co-authored-by: Rano | Ranadeep <ranadeep@informal.systems>
- Loading branch information
1 parent
2679767
commit 2378cd4
Showing
51 changed files
with
169 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
[package] | ||
name = "tests-integration" | ||
version = "0.1.0" | ||
authors = { workspace = true } | ||
license = { workspace = true } | ||
edition = { workspace = true } | ||
repository = { workspace = true } | ||
readme = "README.md" | ||
keywords = [ "blockchain", "consensus", "cosmos", "ibc", "tendermint" ] | ||
publish = false | ||
description = "Integration tests using `ibc-testkit` and the other IBC crates." | ||
|
||
[dependencies] | ||
# external dependencies | ||
serde = { workspace = true, optional = true } | ||
serde_json = { workspace = true, optional = true } | ||
subtle-encoding = { workspace = true } | ||
tracing = { version = "0.1.40", default-features = false } | ||
|
||
# ibc dependencies | ||
ibc = { workspace = true } | ||
ibc-core-client-types = { workspace = true } | ||
ibc-core-commitment-types = { workspace = true } | ||
ibc-client-cw = { workspace = true } | ||
ibc-client-tendermint-cw = { workspace = true } | ||
ibc-client-tendermint-types = { workspace = true } | ||
ibc-core-host-types = { workspace = true } | ||
ibc-primitives = { workspace = true } | ||
ibc-query = { workspace = true } | ||
ibc-testkit = { workspace = true } | ||
|
||
# basecoin dependencies | ||
basecoin-store = { version = "0.1.0" } | ||
|
||
# cosmos dependencies | ||
tendermint = { workspace = true } | ||
tendermint-testgen = { workspace = true } | ||
|
||
[dev_dependencies] | ||
cosmwasm-std = { workspace = true } | ||
hex = { version = "0.4.2" } | ||
rstest = { workspace = true } | ||
test-log = { version = "0.2.13", features = [ "trace" ] } | ||
tendermint-rpc = { workspace = true } | ||
|
||
[features] | ||
default = [ "std" ] | ||
std = [ | ||
"serde/std", | ||
"serde_json/std", | ||
"ibc/std", | ||
"ibc/serde", | ||
"ibc-testkit/serde", | ||
"tendermint/std", | ||
"dep:serde", | ||
"dep:serde_json", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Integration tests that make use of the types exposed by `ibc-testkit`. These | ||
tests also depend upon the other IBC crates. They live in a separate crate, that | ||
is not meant to be published, to avoid circular dependencies. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#![doc = include_str!("../README.md")] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
tests-integration/tests/clients/ics07_tendermint/client_state.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#[cfg(all(test, feature = "serde"))] | ||
mod tests { | ||
use ibc_testkit::utils::test_serialization_roundtrip; | ||
use tendermint_rpc::endpoint::abci_query::AbciQuery; | ||
|
||
#[test] | ||
fn serialization_roundtrip_no_proof() { | ||
let json_data = include_str!(concat!( | ||
env!("CARGO_MANIFEST_DIR"), | ||
"/tests/data/json/client_state.json" | ||
)); | ||
test_serialization_roundtrip::<AbciQuery>(json_data); | ||
} | ||
|
||
#[test] | ||
fn serialization_roundtrip_with_proof() { | ||
let json_data = include_str!(concat!( | ||
env!("CARGO_MANIFEST_DIR"), | ||
"/tests/data/json/client_state_proof.json" | ||
)); | ||
test_serialization_roundtrip::<AbciQuery>(json_data); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
tests-integration/tests/clients/ics07_tendermint/consensus_state.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#[cfg(feature = "serde")] | ||
mod tests { | ||
use ibc_testkit::utils::test_serialization_roundtrip; | ||
use tendermint_rpc::endpoint::abci_query::AbciQuery; | ||
|
||
#[test] | ||
fn serialization_roundtrip_no_proof() { | ||
let json_data = include_str!(concat!( | ||
env!("CARGO_MANIFEST_DIR"), | ||
"/tests/data/json/consensus_state.json" | ||
)); | ||
test_serialization_roundtrip::<AbciQuery>(json_data); | ||
} | ||
|
||
#[test] | ||
fn serialization_roundtrip_with_proof() { | ||
let json_data = include_str!(concat!( | ||
env!("CARGO_MANIFEST_DIR"), | ||
"/tests/data/json/consensus_state_proof.json" | ||
)); | ||
test_serialization_roundtrip::<AbciQuery>(json_data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pub mod client_state; | ||
pub mod consensus_state; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod ics07_tendermint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ | |
rust_2018_idioms | ||
)] | ||
pub mod applications; | ||
pub mod clients; | ||
pub mod core; | ||
pub mod cosmwasm; |