Run cargo fmt that got clobbered in merge

This commit is contained in:
Alex Stokes 2018-11-20 12:54:35 -08:00 committed by mjkeating
parent 9021227c1c
commit db4c4bf223
3 changed files with 16 additions and 11 deletions

View File

@ -14,11 +14,7 @@ pub mod special_record;
pub mod validator_record; pub mod validator_record;
pub mod validator_registration; pub mod validator_registration;
use self::ethereum_types::{ use self::ethereum_types::{H160, H256, U256};
H256,
H160,
U256
};
use std::collections::HashMap; use std::collections::HashMap;
pub use active_state::ActiveState; pub use active_state::ActiveState;

View File

@ -243,8 +243,9 @@ impl From<SignatureVerificationError> for AttestationValidationError {
AttestationValidationError::NoPublicKeyForValidator AttestationValidationError::NoPublicKeyForValidator
} }
SignatureVerificationError::DBError(s) => AttestationValidationError::DBError(s), SignatureVerificationError::DBError(s) => AttestationValidationError::DBError(s),
SignatureVerificationError::OutOfBoundsBitfieldIndex SignatureVerificationError::OutOfBoundsBitfieldIndex => {
=> AttestationValidationError::OutOfBoundsBitfieldIndex, AttestationValidationError::OutOfBoundsBitfieldIndex
}
} }
} }
} }

View File

@ -132,7 +132,9 @@ fn test_attestation_validation_invalid_bad_bitfield_length() {
* We take advantage of the fact that setting a bit outside the current bounds will grow the bitvector. * We take advantage of the fact that setting a bit outside the current bounds will grow the bitvector.
*/ */
let one_byte_higher = rig.attester_count + 8; let one_byte_higher = rig.attester_count + 8;
rig.attestation.attester_bitfield.set(one_byte_higher, false); rig.attestation
.attester_bitfield
.set(one_byte_higher, false);
let result = rig.context.validate_attestation(&rig.attestation); let result = rig.context.validate_attestation(&rig.attestation);
assert_eq!(result, Err(AttestationValidationError::BadBitfieldLength)); assert_eq!(result, Err(AttestationValidationError::BadBitfieldLength));
@ -166,11 +168,17 @@ fn test_attestation_validation_invalid_invalid_bitfield_end_bit_with_irreguar_bi
* bit in a bitfield and the byte length of that bitfield * bit in a bitfield and the byte length of that bitfield
*/ */
let one_bit_high = rig.attester_count + 1; let one_bit_high = rig.attester_count + 1;
assert!(one_bit_high % 8 != 0, "the test is ineffective in this case."); assert!(
one_bit_high % 8 != 0,
"the test is ineffective in this case."
);
rig.attestation.attester_bitfield.set(one_bit_high, true); rig.attestation.attester_bitfield.set(one_bit_high, true);
let result = rig.context.validate_attestation(&rig.attestation); let result = rig.context.validate_attestation(&rig.attestation);
assert_eq!(result, Err(AttestationValidationError::InvalidBitfieldEndBits)); assert_eq!(
result,
Err(AttestationValidationError::InvalidBitfieldEndBits)
);
} }
#[test] #[test]