Skip to content

Commit

Permalink
Use " " instead of "" for the empty key so sh doesn't interpret it as…
Browse files Browse the repository at this point in the history
… falsy
  • Loading branch information
kayabaNerve committed Mar 23, 2024
1 parent 2a31d85 commit 5ea3b1b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion substrate/client/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ macro_rules! serai_test {
.replace_env(
HashMap::from([
("RUST_LOG".to_string(), "runtime=debug".to_string()),
("KEY".to_string(), String::new()),
("KEY".to_string(), " ".to_string()),
])
)
.set_publish_all_ports(true)
Expand Down
2 changes: 1 addition & 1 deletion substrate/client/tests/dht.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async fn dht() {
Image::with_repository("serai-dev-serai").pull_policy(PullPolicy::Never),
)
.replace_env(
[("SERAI_NAME".to_string(), name.to_string()), ("KEY".to_string(), String::new())].into(),
[("SERAI_NAME".to_string(), name.to_string()), ("KEY".to_string(), " ".to_string())].into(),
)
.set_publish_all_ports(true)
.set_handle(handle(name))
Expand Down
2 changes: 1 addition & 1 deletion substrate/client/tests/validator_sets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async fn validator_set_rotation() {
])
.replace_env(HashMap::from([
("RUST_LOG".to_string(), "runtime=debug".to_string()),
("KEY".to_string(), String::new()),
("KEY".to_string(), " ".to_string()),
]))
.set_publish_all_ports(true)
.set_handle(handle(name))
Expand Down
2 changes: 1 addition & 1 deletion substrate/node/src/keystore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub struct Keystore(sr25519::Pair);
impl Keystore {
pub fn from_env() -> Option<Self> {
let mut key_hex = serai_env::var("KEY")?;
if key_hex.is_empty() {
if key_hex.trim().is_empty() {
None?;
}
let mut key = hex::decode(&key_hex).expect("KEY from environment wasn't hex");
Expand Down
2 changes: 1 addition & 1 deletion tests/coordinator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub fn serai_composition(name: &str) -> TestBodySpecification {
Image::with_repository("serai-dev-serai").pull_policy(PullPolicy::Never),
)
.replace_env(
[("SERAI_NAME".to_string(), name.to_lowercase()), ("KEY".to_string(), String::new())].into(),
[("SERAI_NAME".to_string(), name.to_lowercase()), ("KEY".to_string(), " ".to_string())].into(),
)
.set_publish_all_ports(true)
}
Expand Down

0 comments on commit 5ea3b1b

Please sign in to comment.