From a514968155fe8309ae31401536803a9c5a320ed5 Mon Sep 17 00:00:00 2001 From: pscott <30843220+pscott@users.noreply.github.com> Date: Tue, 26 Nov 2019 21:29:51 +0100 Subject: [PATCH] Add cfg! check for fake_crypto (#633) * Add cfg! check for fake_crypto * Remove function attribute and update in-code cfg! checks --- beacon_node/rest_api/tests/test.rs | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/beacon_node/rest_api/tests/test.rs b/beacon_node/rest_api/tests/test.rs index 4163da328a..888dfc735b 100644 --- a/beacon_node/rest_api/tests/test.rs +++ b/beacon_node/rest_api/tests/test.rs @@ -326,10 +326,12 @@ fn validator_block_post() { .runtime() .block_on(remote_node.http.validator().publish_block(block.clone())) .expect("should publish block"); - assert!( - !publish_status.is_valid(), - "the unsigned published block should not be valid" - ); + if cfg!(not(feature = "fake_crypto")) { + assert!( + !publish_status.is_valid(), + "the unsigned published block should not be valid" + ); + } sign_block(beacon_chain.clone(), &mut block, spec); let block_root = block.canonical_root(); @@ -338,11 +340,14 @@ fn validator_block_post() { .runtime() .block_on(remote_node.http.validator().publish_block(block.clone())) .expect("should publish block"); - assert_eq!( - publish_status, - PublishStatus::Valid, - "the signed published block should be valid" - ); + + if cfg!(not(feature = "fake_crypto")) { + assert_eq!( + publish_status, + PublishStatus::Valid, + "the signed published block should be valid" + ); + } let head = env .runtime()