Fix operation_pool release-only tests

This commit is contained in:
Paul Hauner 2019-05-10 09:45:28 +10:00
parent be9f8aa0bf
commit 3115bf7d36
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6

View File

@ -716,9 +716,12 @@ mod tests {
(spec, state) (spec, state)
} }
#[cfg(not(debug_assertions))]
mod release_tests {
use super::*;
/// Create a signed attestation for use in tests. /// Create a signed attestation for use in tests.
/// Signed by all validators in `committee[signing_range]` and `committee[extra_signer]`. /// Signed by all validators in `committee[signing_range]` and `committee[extra_signer]`.
// #[cfg(not(debug_assertions))]
fn signed_attestation< fn signed_attestation<
R: std::slice::SliceIndex<[usize], Output = [usize]>, R: std::slice::SliceIndex<[usize], Output = [usize]>,
B: BeaconStateTypes, B: BeaconStateTypes,
@ -753,10 +756,6 @@ mod tests {
builder.build() builder.build()
} }
#[cfg(not(debug_assertions))]
mod release_tests {
use super::*;
/// Test state for attestation-related tests. /// Test state for attestation-related tests.
fn attestation_test_state<B: BeaconStateTypes>( fn attestation_test_state<B: BeaconStateTypes>(
num_committees: usize, num_committees: usize,
@ -779,7 +778,7 @@ mod tests {
} }
/// Set the latest crosslink in the state to match the attestation. /// Set the latest crosslink in the state to match the attestation.
fn fake_latest_crosslink<T: BeaconStateTypes>( fn fake_latest_crosslink<B: BeaconStateTypes>(
att: &Attestation, att: &Attestation,
state: &mut BeaconState<B>, state: &mut BeaconState<B>,
spec: &ChainSpec, spec: &ChainSpec,
@ -960,10 +959,12 @@ mod tests {
/// are also signed by the 0th member of the committee. /// are also signed by the 0th member of the committee.
#[test] #[test]
fn attestation_get_max() { fn attestation_get_max() {
let spec = &ChainSpec::foundation();
let small_step_size = 2; let small_step_size = 2;
let big_step_size = 4; let big_step_size = 4;
let (ref mut state, ref keypairs) = attestation_test_state(spec, big_step_size);
let (ref mut state, ref keypairs, ref spec) =
attestation_test_state::<FoundationStateTypes>(big_step_size);
let op_pool = OperationPool::new(); let op_pool = OperationPool::new();
let slot = state.slot - 1; let slot = state.slot - 1;