diff --git a/integration_tests/src/contract_test.rs b/integration_tests/src/contract_test.rs index ecc2f225a..b23439717 100644 --- a/integration_tests/src/contract_test.rs +++ b/integration_tests/src/contract_test.rs @@ -201,7 +201,7 @@ pub async fn validate_contract_user_functionality(db_addr: Address) { // Try requests when there are no users present let res = get_all_regsitered_clients(&contact, miner_pub_key, db_addr).await; - assert!(res.is_err()); + assert_eq!(res.unwrap(), vec![]); let res = get_registered_client_using_wgkey(user_1.wg_public_key, miner_pub_key, db_addr, &contact) diff --git a/rita_client_registration/src/client_db.rs b/rita_client_registration/src/client_db.rs index 1de0a2ed0..07d1dc785 100644 --- a/rita_client_registration/src/client_db.rs +++ b/rita_client_registration/src/client_db.rs @@ -368,6 +368,11 @@ pub fn parse_identity_array_abi(bytes: Vec) -> Result, Web3Err let mut ret = vec![]; let byte_chunks: Vec<&[u8]> = bytes.chunks(WORD_SIZE).collect(); + // An empty list, the first word has a type identifier, the second is empty + if byte_chunks.len() == 2 { + return Ok(vec![]) + } + // A valid array with 1 entry has 5 lines. An empty list has 2 lines if byte_chunks.len() < 5 { return Err(Web3Error::BadInput(format!( diff --git a/rita_exit/src/database/mod.rs b/rita_exit/src/database/mod.rs index 8eec34729..16641d3ee 100644 --- a/rita_exit/src/database/mod.rs +++ b/rita_exit/src/database/mod.rs @@ -221,7 +221,7 @@ pub async fn client_status( }) } Err(e) => { - error!("Failed to retrieve a client: {}", e); + trace!("Failed to retrieve a client: {}", e); Err(Box::new(RitaExitError::NoClientError)) } } diff --git a/rita_exit/src/network_endpoints/mod.rs b/rita_exit/src/network_endpoints/mod.rs index d81b34214..bb18e7177 100644 --- a/rita_exit/src/network_endpoints/mod.rs +++ b/rita_exit/src/network_endpoints/mod.rs @@ -135,14 +135,7 @@ pub async fn secure_setup_request( let exit_settings = get_rita_exit(); let our_old_secretkey: WgKey = exit_settings.exit_network.wg_private_key; - let our_new_secretkey = exit_settings - .network - .wg_private_key - .unwrap_or(our_old_secretkey); - - if our_old_secretkey == our_new_secretkey { - error!("Two Distinct wg key are not setup on this exit, please setup!!"); - } + let our_new_secretkey = exit_settings.network.wg_private_key.unwrap(); let our_old_secretkey: SecretKey = our_old_secretkey.into(); let our_new_secretkey = our_new_secretkey.into(); @@ -224,14 +217,7 @@ pub async fn secure_setup_request( pub async fn secure_status_request(request: Json) -> HttpResponse { let exit_settings = get_rita_exit(); let our_old_secretkey: WgKey = exit_settings.exit_network.wg_private_key; - let our_new_secretkey = exit_settings - .network - .wg_private_key - .unwrap_or(our_old_secretkey); - - if our_old_secretkey == our_new_secretkey { - error!("Two Distinct wg key are not setup on this exit, please setup!!"); - } + let our_new_secretkey = exit_settings.network.wg_private_key.unwrap(); let our_old_secretkey = our_old_secretkey.into(); let our_new_secretkey = our_new_secretkey.into(); diff --git a/rita_exit/src/operator_update/mod.rs b/rita_exit/src/operator_update/mod.rs index 1b6ff7c25..97ecd0dc6 100644 --- a/rita_exit/src/operator_update/mod.rs +++ b/rita_exit/src/operator_update/mod.rs @@ -27,7 +27,7 @@ pub const OPERATOR_UPDATE_TIMEOUT: Duration = Duration::from_secs(4); pub async fn operator_update(rita_started: Instant) { let url: &str; if cfg!(feature = "dev_env") { - url = "http://7.7.7.7:8080/exitcheckin"; + url = "http://7.7.7.1:8080/exitcheckin"; } else if cfg!(feature = "operator_debug") { url = "http://192.168.10.2:8080/exitcheckin"; } else { @@ -53,7 +53,10 @@ pub async fn operator_update(rita_started: Instant) { }) .await; match response { - Ok(v) => info!("Exit operator update succeeded with {:?}", v), + Ok(v) => match v.status().is_success() { + true => info!("Exit operator update succeeded"), + false => error!("Exit operator update failed with {:?}", v), + }, Err(e) => error!("Exit operator update failed with {:?}", e), } }