From 705ffa3a06ef44860b17cacf7dfd5b7c264e39d9 Mon Sep 17 00:00:00 2001 From: Jesse Abramowitz Date: Tue, 27 Aug 2024 19:43:14 -0400 Subject: [PATCH] change when old network key is deleted --- .../src/validator/api.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/threshold-signature-server/src/validator/api.rs b/crates/threshold-signature-server/src/validator/api.rs index 2def65eaf..caa91c82c 100644 --- a/crates/threshold-signature-server/src/validator/api.rs +++ b/crates/threshold-signature-server/src/validator/api.rs @@ -93,12 +93,9 @@ pub async fn new_reshare( ) .map_err(|e| ValidatorErr::VerifyingKeyError(e.to_string()))?; - let is_proper_signer = is_signer_or_delete_parent_key( - signer.account_id(), - validators_info.clone(), - &app_state.kv_store, - ) - .await?; + let is_proper_signer = validators_info + .iter() + .any(|validator_info| validator_info.tss_account == *signer.account_id()); if !is_proper_signer { return Ok(StatusCode::MISDIRECTED_REQUEST); @@ -215,9 +212,12 @@ pub async fn rotate_network_key( .await .map_err(|e| ValidatorErr::UserError(e.to_string()))?; - let is_proper_signer = validators_info - .iter() - .any(|validator_info| validator_info.tss_account == *signer.account_id()); + let is_proper_signer = is_signer_or_delete_parent_key( + signer.account_id(), + validators_info.clone(), + &app_state.kv_store, + ) + .await?; if !is_proper_signer { return Ok(StatusCode::MISDIRECTED_REQUEST);