Skip to content

Commit

Permalink
add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy committed Jul 19, 2024
1 parent cb83f43 commit 6547980
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ibc-clients/cw-context/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ cosmwasm-schema = { workspace = true }
cosmwasm-std = { workspace = true }
cw-storage-plus = { workspace = true }

[dev-dependencies]
serde-json = { workspace = true }

[features]
default = [ "std" ]
std = [
Expand Down
20 changes: 20 additions & 0 deletions ibc-clients/cw-context/src/types/msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,23 @@ impl TryFrom<CheckForMisbehaviourMsgRaw> for CheckForMisbehaviourMsg {
Ok(Self { client_message })
}
}

mod test {
use super::SudoMsg;

Check failure on line 273 in ibc-clients/cw-context/src/types/msgs.rs

View workflow job for this annotation

GitHub Actions / Upload precompiled Tendermint CosmWasm client

unused import: `super::SudoMsg`

Check failure on line 273 in ibc-clients/cw-context/src/types/msgs.rs

View workflow job for this annotation

GitHub Actions / Code Coverage

unused import: `super::SudoMsg`

Check failure on line 273 in ibc-clients/cw-context/src/types/msgs.rs

View workflow job for this annotation

GitHub Actions / test-stable

unused import: `super::SudoMsg`

Check failure on line 273 in ibc-clients/cw-context/src/types/msgs.rs

View workflow job for this annotation

GitHub Actions / clippy

unused import: `super::SudoMsg`

error: unused import: `super::SudoMsg` --> ibc-clients/cw-context/src/types/msgs.rs:273:9 | 273 | use super::SudoMsg; | ^^^^^^^^^^^^^^ | note: the lint level is defined here --> ibc-clients/cw-context/src/lib.rs:12:5 | 12 | warnings, | ^^^^^^^^ = note: `#[deny(unused_imports)]` implied by `#[deny(warnings)]`

#[test]
fn deserialize_from_json() {
let sudo_msg = r#"{
"verify_membership":{
"height":
{"revision_height":57},
"delay_time_period":0,
"delay_block_period":0,
"proof":"CuECCt4CChhjb25uZWN0aW9ucy9jb25uZWN0aW9uLTASWgoPMDctdGVuZGVybWludC0wEiMKATESDU9SREVSX09SREVSRUQSD09SREVSX1VOT1JERVJFRBgCIiAKCTA4LXdhc20tMBIMY29ubmVjdGlvbi0wGgUKA2liYxoLCAEYASABKgMAAkgiKQgBEiUCBHAg3HTYmBAMxlr6u0mv6wCpm3ur2WQc7A3Af6aV7Ye0Fe0gIisIARIEBAZwIBohIHXEkQ9RIH08ZZYBIP6THxOOJiRmjXWGn1G4RCWT3V6rIisIARIEBgxwIBohIEUjGWV7YLPEzdFVLAb0lv4VvP7A+l1TqFkjpx1kDKAPIikIARIlCBhwILWsAKEot+2MknVyn5zcS0qsqVhRj4AHpgDx7fNPbfhtICIpCAESJQxAcCCzyYMGE+CdCltudr1ddHvCJrqv3kl/i7YnMLx3XWJt/yAK/AEK+QEKA2liYxIg2nvqL76rejXXGlX6ng/UKrbw+72C8uKKgM2vP0JKj1QaCQgBGAEgASoBACIlCAESIQEGuZwNgRn/HtvL4WXQ8ZM327wIDmd8iOV6oq52fr8PDyInCAESAQEaIKplBAbqDXbjndQ9LqapHj/aockI/CGnymjl5izIEVY5IiUIARIhAdt4G8DCLINAaaJnhUMIzv74AV3zZiugAyyZ/lWYRv+cIiUIARIhAf+sohoEV+uWeKThAPEbqCUivWT4H8KNT7Giw9//LsyvIicIARIBARogNHO4HC5KxPCwBdQGgBCscVtEKw+YSn2pnf654Y3Oxik=",
"path":{"key_path":["aWJj","Y29ubmVjdGlvbnMvY29ubmVjdGlvbi0w"]},
"value":"Cg8wNy10ZW5kZXJtaW50LTASIwoBMRINT1JERVJfT1JERVJFRBIPT1JERVJfVU5PUkRFUkVEGAIiIAoJMDgtd2FzbS0wEgxjb25uZWN0aW9uLTAaBQoDaWJj"
}
}"#;
serde_json::from_str::<SudoMsg>(sudo_msg).unwrap();
}
}

0 comments on commit 6547980

Please sign in to comment.