Skip to content

Commit

Permalink
change when old network key is deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseAbram committed Aug 27, 2024
1 parent 80c4880 commit 705ffa3
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions crates/threshold-signature-server/src/validator/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 705ffa3

Please sign in to comment.