Skip to content

Commit

Permalink
Solution: use the last digit (fix #878)
Browse files Browse the repository at this point in the history
use expect
  • Loading branch information
leejw51 authored and leejw51crypto committed May 3, 2021
1 parent 7230c1d commit b547e0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/src/ics24_host/identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl ChainId {
}

let split: Vec<_> = chain_id.split('-').collect();
split[1].parse().unwrap_or(0)
split.last().expect("get revision number from chain_id").parse().unwrap_or(0)
}

/// is_epoch_format() checks if a chain_id is in the format required for parsing epochs
Expand Down

0 comments on commit b547e0d

Please sign in to comment.