Skip to content

Commit

Permalink
- code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nshyrei committed Oct 9, 2024
1 parent e18eb9f commit 204eaa8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions vsock-proxy/enclave/src/app_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::collections::BTreeMap;
use std::fs;
use std::path::{Component, Path, PathBuf};
use std::sync::Arc;
use std::convert::TryFrom;
use std::convert::TryInto;

use em_app::utils::models::{
ApplicationConfigContents, ApplicationConfigExtra, ApplicationConfigSdkmsCredentials, RuntimeAppConfig,
Expand Down Expand Up @@ -57,7 +57,10 @@ where
{
info!("Requesting application configuration.");

let app_config_id_raw = <[u8; APPLICATION_CONFIGURATION_ID_LENGTH]>::try_from(app_config_id.as_bytes()).map_err(|err| format!("Cannot convert application config id into an array. Error: {:?}. Perhaps your id isn't {} characters long?", err, APPLICATION_CONFIGURATION_ID_LENGTH))?;
let app_config_id_raw: [u8; APPLICATION_CONFIGURATION_ID_LENGTH] = app_config_id
.as_bytes()
.try_into()
.map_err(|err| format!("Cannot convert application config id into an array. Error: {:?}. Perhaps your id isn't {} characters long?", err, APPLICATION_CONFIGURATION_ID_LENGTH))?;

let app_config = api
.runtime_config_api()
Expand Down Expand Up @@ -673,7 +676,7 @@ mod tests {
let credentials = EmAppCredentials::mock();
let api: Box<dyn RuntimeConfiguration> = Box::new(MockDataSet { json_data, hash: [0; APPLICATION_CONFIGURATION_ID_LENGTH] });

let result = api.get_checked_runtime_configuration(&backend_url, &credentials, &[0; APPLICATION_CONFIGURATION_ID_LENGTH]);
let result = api.get_runtime_configuration(&backend_url, &credentials, &[0; APPLICATION_CONFIGURATION_ID_LENGTH]);
assert!(result.is_ok(), "{:?}", result);

result.unwrap()
Expand Down

0 comments on commit 204eaa8

Please sign in to comment.