mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-22 11:39:35 +00:00
Use " " instead of "" for the empty key so sh doesn't interpret it as falsy
This commit is contained in:
parent
2a31d8552e
commit
5ea3b1bf97
5 changed files with 5 additions and 5 deletions
|
@ -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)
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue