Skip to content

Commit

Permalink
add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy committed Apr 24, 2024
1 parent 94ac941 commit 7408994
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ibc-apps/ics20-transfer/types/src/denom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ impl<'a> TryFrom<Vec<&'a str>> for TracePath {
}

let mut trace = vec![];
// this does not take care of the remainder if the length is not even
let id_pairs = v.chunks_exact(2).map(|paths| (paths[0], paths[1]));
for (pos, (port_id, channel_id)) in id_pairs.rev().enumerate() {
let port_id =
Expand Down Expand Up @@ -417,6 +418,19 @@ mod tests {

use super::*;

#[rstest]
#[case("")]
#[case("transfer")]
#[case("transfer/channel-1/ica")]
fn test_invalid_raw_demon_trace_parsing(#[case] trace_path: &str) {
let raw_denom_trace = RawDenomTrace {
path: trace_path.to_string(),
base_denom: "uatom".to_string(),
};

PrefixedDenom::try_from(raw_denom_trace).expect("failure");
}

#[rstest]
#[case("uatom")]
#[case("atom")]
Expand Down

0 comments on commit 7408994

Please sign in to comment.