Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
  • Loading branch information
JesseAbram and HCastano authored Aug 13, 2024
1 parent 9ad47f0 commit e4473de
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/threshold-signature-server/src/validator/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,14 @@ pub async fn is_signer_or_delete_parent_key(
kv_manager: &KvManager,
) -> Result<bool, ValidatorErr> {
let is_proper_signer =
&validators_info.iter().any(|validator_info| validator_info.tss_account == *account_id);
if *is_proper_signer {
validators_info.iter().any(|validator_info| validator_info.tss_account == *account_id);
if is_proper_signer {
Ok(true)
} else {
// delete old keyshare if has it and not next_signer
if kv_manager.kv().exists(&hex::encode(NETWORK_PARENT_KEY)).await? {
kv_manager.kv().delete(&hex::encode(NETWORK_PARENT_KEY)).await?
let network_key = hex::encode(NETWORK_PARENT_KEY);
if kv_manager.kv().exists(&network_key).await? {
kv_manager.kv().delete(&network_key).await?
}
Ok(false)
}
Expand Down

0 comments on commit e4473de

Please sign in to comment.