Skip to content

Commit d362b3e

Browse files
authored
Merge branch 'dev' into issue-189-channel-if-functions
2 parents b41bb1e + ddadaab commit d362b3e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

primitives/src/channel_validator.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,13 @@ pub trait ChannelValidator {
4444
}
4545
}
4646

47-
pub fn all_validators_listed(validators: &SpecValidators, whitelist: &[String]) -> bool {
47+
pub fn all_validators_listed(validators: &SpecValidators, whitelist: &[ValidatorId]) -> bool {
4848
if whitelist.is_empty() {
4949
true
5050
} else {
5151
let found_validators = whitelist
5252
.iter()
53-
.filter_map(|identity| ValidatorId::try_from(identity).ok())
54-
.filter(|allowed| {
53+
.filter(|&allowed| {
5554
allowed == &validators.leader().id || allowed == &validators.follower().id
5655
})
5756
// this will ensure that if we find the 2 validators earlier

primitives/src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::event_submission::RateLimit;
2-
use crate::BigNum;
2+
use crate::{BigNum, ValidatorId};
33
use lazy_static::lazy_static;
44
use serde::{Deserialize, Serialize};
55
use std::fs;
@@ -37,7 +37,7 @@ pub struct Config {
3737
pub token_address_whitelist: Vec<String>,
3838
pub ethereum_core_address: String,
3939
pub ethereum_network: String,
40-
pub validators_whitelist: Vec<String>,
40+
pub validators_whitelist: Vec<ValidatorId>,
4141
}
4242

4343
#[derive(Serialize, Deserialize, Debug, Clone)]

0 commit comments

Comments
 (0)