max_value -> MAX

This commit is contained in:
realbigsean
2024-06-13 17:42:48 -04:00
parent 5789db042d
commit 5f986f50f9
27 changed files with 82 additions and 87 deletions

View File

@@ -285,17 +285,17 @@ impl ForkChoiceTestDefinition {
}
}
/// Gives a root that is not the zero hash (unless i is `usize::max_value)`.
/// Gives a root that is not the zero hash (unless i is `usize::MAX)`.
fn get_root(i: u64) -> Hash256 {
Hash256::from_low_u64_be(i + 1)
}
/// Gives a hash that is not the zero hash (unless i is `usize::max_value)`.
/// Gives a hash that is not the zero hash (unless i is `usize::MAX)`.
fn get_hash(i: u64) -> ExecutionBlockHash {
ExecutionBlockHash::from_root(get_root(i))
}
/// Gives a checkpoint with a root that is not the zero hash (unless i is `usize::max_value)`.
/// Gives a checkpoint with a root that is not the zero hash (unless i is `usize::MAX)`.
/// `Epoch` will always equal `i`.
fn get_checkpoint(i: u64) -> Checkpoint {
Checkpoint {

View File

@@ -738,7 +738,7 @@ pub fn get_votes_test_definition() -> ForkChoiceTestDefinition {
// Ensure that pruning below the prune threshold does not prune.
ops.push(Operation::Prune {
finalized_root: get_root(5),
prune_threshold: usize::max_value(),
prune_threshold: usize::MAX,
expected_len: 11,
});

View File

@@ -995,7 +995,7 @@ mod test_compute_deltas {
use super::*;
use types::MainnetEthSpec;
/// Gives a hash that is not the zero hash (unless i is `usize::max_value)`.
/// Gives a hash that is not the zero hash (unless i is `usize::MAX)`.
fn hash_from_index(i: usize) -> Hash256 {
Hash256::from_low_u64_be(i as u64 + 1)
}