Replace assert! with assert_ne! (#1140)

This commit is contained in:
Akihito Nakano 2020-05-13 16:05:12 +09:00 committed by GitHub
parent 62ff6d9191
commit 637ba8120b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 6 deletions

View File

@ -365,7 +365,7 @@ mod tests {
let different_root = Hash256::from_low_u64_be(1337);
unset_bit(&mut a_different, 0);
sign(&mut a_different, 2, genesis_validators_root);
assert!(a_different.data.beacon_block_root != different_root);
assert_ne!(a_different.data.beacon_block_root, different_root);
a_different.data.beacon_block_root = different_root;
assert_eq!(

View File

@ -687,7 +687,7 @@ where
AttestationStrategy::SomeValidators(faulty_validators.to_vec()),
);
assert!(honest_head != faulty_head, "forks should be distinct");
assert_ne!(honest_head, faulty_head, "forks should be distinct");
(honest_head, faulty_head)
}

View File

@ -368,7 +368,7 @@ fn delete_blocks_and_states() {
fork_blocks as usize,
);
assert!(honest_head != faulty_head, "forks should be distinct");
assert_ne!(honest_head, faulty_head, "forks should be distinct");
let head_info = harness.chain.head_info().expect("should get head");
assert_eq!(head_info.slot, unforked_blocks + fork_blocks);

View File

@ -159,7 +159,7 @@ fn chooses_fork() {
faulty_fork_blocks,
);
assert!(honest_head != faulty_head, "forks should be distinct");
assert_ne!(honest_head, faulty_head, "forks should be distinct");
let state = &harness.chain.head().expect("should get head").beacon_state;

View File

@ -382,8 +382,8 @@ fn check_duties<T: BeaconChainTypes>(
let slot_proposer = state
.get_beacon_proposer_index(slot, spec)
.expect("should know proposer");
assert!(
slot_proposer != validator_index,
assert_ne!(
slot_proposer, validator_index,
"validator should not have proposal slot in this epoch"
)
})