ef deposit tests: parse bls_setting and skip appropriately

This commit is contained in:
Michael Sproul 2019-05-29 17:20:09 +10:00
parent 83456c6894
commit 2d943e6792
No known key found for this signature in database
GPG Key ID: 77B1309D2E54E914
2 changed files with 4 additions and 5 deletions

View File

@ -6,6 +6,7 @@ use types::{BeaconState, Deposit, EthSpec};
#[derive(Debug, Clone, Deserialize)]
pub struct OperationsDeposit<E: EthSpec> {
pub bls_setting: Option<u8>,
pub description: String,
#[serde(bound = "E: EthSpec")]
pub pre: BeaconState<E>,
@ -26,6 +27,9 @@ impl<E: EthSpec> Case for OperationsDeposit<E> {
}
fn result(&self, _case_index: usize) -> Result<(), Error> {
if self.bls_setting == Some(cfg!(feature = "fake_crypto") as u8) {
return Ok(());
}
let mut state = self.pre.clone();
let deposit = self.deposit.clone();
let mut expected = self.post.clone();

View File

@ -70,7 +70,6 @@ fn shuffling() {
}
#[test]
#[cfg(not(feature = "fake_crypto"))]
fn operations_deposit() {
yaml_files_in_test_dir(&Path::new("operations").join("deposit"))
.into_par_iter()
@ -80,7 +79,6 @@ fn operations_deposit() {
}
#[test]
#[cfg(not(feature = "fake_crypto"))]
fn operations_transfer() {
yaml_files_in_test_dir(&Path::new("operations").join("transfer"))
.into_par_iter()
@ -91,7 +89,6 @@ fn operations_transfer() {
}
#[test]
#[cfg(not(feature = "fake_crypto"))]
fn operations_exit() {
yaml_files_in_test_dir(&Path::new("operations").join("voluntary_exit"))
.into_par_iter()
@ -101,7 +98,6 @@ fn operations_exit() {
}
#[test]
#[cfg(not(feature = "fake_crypto"))]
fn operations_proposer_slashing() {
yaml_files_in_test_dir(&Path::new("operations").join("proposer_slashing"))
.into_par_iter()
@ -111,7 +107,6 @@ fn operations_proposer_slashing() {
}
#[test]
#[cfg(not(feature = "fake_crypto"))]
fn operations_attester_slashing() {
yaml_files_in_test_dir(&Path::new("operations").join("attester_slashing"))
.into_par_iter()