Skip to content

Commit

Permalink
add fork ord consistent test
Browse files Browse the repository at this point in the history
  • Loading branch information
realbigsean committed Apr 9, 2024
1 parent ad9fe72 commit c34b26e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions consensus/types/src/fork_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,13 @@ mod test {
}
assert_eq!(ForkName::latest(), fork);
}

#[test]
fn fork_ord_consistent() {
for (prev_fork, fork) in ForkName::list_all().into_iter().tuple_windows() {
assert_eq!(prev_fork.next_fork(), Some(fork));
assert_eq!(fork.previous_fork(), Some(prev_fork));
assert!(prev_fork < fork);
}
}
}

0 comments on commit c34b26e

Please sign in to comment.