File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
beacon_node/beacon_chain/tests Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -987,9 +987,23 @@ async fn block_gossip_verification() {
987
987
#[ tokio:: test]
988
988
async fn verify_block_for_gossip_slashing_detection ( ) {
989
989
let slasher_dir = tempdir ( ) . unwrap ( ) ;
990
- let slasher = Arc :: new (
991
- Slasher :: open ( SlasherConfig :: new ( slasher_dir. path ( ) . into ( ) ) , test_logger ( ) ) . unwrap ( ) ,
992
- ) ;
990
+
991
+ let slasher_result =
992
+ Slasher :: open ( SlasherConfig :: new ( slasher_dir. path ( ) . into ( ) ) , test_logger ( ) ) ;
993
+
994
+ // The slasher should only instantiate if a backend feature-flag has been
995
+ // provided.
996
+ //
997
+ // For example: `--features slasher/lmdb`
998
+ let slasher = if cfg ! ( any( feature = "mdbx" , feature = "lmdb" ) ) {
999
+ Arc :: new ( slasher_result. unwrap ( ) )
1000
+ } else {
1001
+ assert ! ( matches!(
1002
+ slasher_result,
1003
+ Err ( slasher:: Error :: SlasherDatabaseBackendDisabled )
1004
+ ) ) ;
1005
+ return ;
1006
+ } ;
993
1007
994
1008
let inner_slasher = slasher. clone ( ) ;
995
1009
let harness = BeaconChainHarness :: builder ( MainnetEthSpec )
You can’t perform that action at this time.
0 commit comments