Skip to content

Commit 4317667

Browse files
author
vlad
committed
fixed whitelist declaration
1 parent a7e1da3 commit 4317667

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

cosmwasm/enclaves/shared/block-verifier/src/validator_whitelist.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
use std::collections::HashSet;
22
use tendermint_light_client_verifier::types::UntrustedBlockState;
33

4+
#[cfg(not(feature = "production"))]
5+
const WHITELIST_FROM_FILE: &str = include_str!("../fixtures/validator_whitelist.txt");
6+
#[cfg(feature = "production")]
7+
const WHITELIST_FROM_FILE: &str = include_str!("../fixtures/validator_whitelist_prod.txt");
8+
9+
#[cfg(not(feature = "production"))]
10+
const WHITELIST_EMERGENCY_FROM_FILE: &str = include_str!("../fixtures/validator_whitelist.txt");
11+
#[cfg(feature = "production")]
12+
const WHITELIST_EMERGENCY_FROM_FILE: &str =
13+
include_str!("../fixtures/validator_whitelist_emergency_prod.txt");
14+
415
#[cfg(not(feature = "production"))]
516
pub const VALIDATOR_THRESHOLD: usize = 1;
617
#[cfg(not(feature = "production"))]
@@ -11,16 +22,10 @@ pub const VALIDATOR_THRESHOLD: usize = 5;
1122
#[cfg(feature = "production")]
1223
pub const VALIDATOR_THRESHOLD_EMERGENCY: usize = 11;
1324

14-
#[cfg(not(feature = "production"))]
1525
lazy_static::lazy_static! {
16-
pub static ref VALIDATOR_WHITELIST: ValidatorList = ValidatorList::from_str("../fixtures/validator_whitelist.txt");
17-
pub static ref VALIDATOR_WHITELIST_EMERGENCY: ValidatorList = ValidatorList::from_str("../fixtures/validator_whitelist.txt");
18-
}
1926

20-
#[cfg(feature = "production")]
21-
lazy_static::lazy_static! {
22-
pub static ref VALIDATOR_WHITELIST: ValidatorList = ValidatorList::from_str("../fixtures/validator_whitelist_prod.txt");
23-
pub static ref VALIDATOR_WHITELIST_EMERGENCY: ValidatorList = ValidatorList::from_str("../fixtures/validator_whitelist_emergency_prod.txt");
27+
pub static ref VALIDATOR_WHITELIST: ValidatorList = ValidatorList::from_str(WHITELIST_FROM_FILE);
28+
pub static ref VALIDATOR_WHITELIST_EMERGENCY: ValidatorList = ValidatorList::from_str(WHITELIST_EMERGENCY_FROM_FILE);
2429
}
2530

2631
#[derive(Debug, Clone)]

0 commit comments

Comments
 (0)