Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sea-snake committed Jan 28, 2025
1 parent fcbef18 commit 0da1a61
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/internet_identity/src/anchor_management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ pub fn add_openid_credential(
anchor: &mut Anchor,
openid_credential: OpenIdCredential,
) -> Result<Operation, AnchorError> {
anchor.add_openid_credential(openid_credential.clone())?;
if lookup_anchor_with_openid_credential(&openid_credential.key()).is_some() {
return Err(AnchorError::OpenIdCredentialAlreadyRegistered);
}
anchor.add_openid_credential(openid_credential.clone())?;
Ok(Operation::AddOpenIdCredential {
iss: openid_credential.iss,
})
Expand Down Expand Up @@ -279,6 +279,8 @@ fn should_register_openid_credential_only_for_a_single_anchor() {
storage_borrow_mut(|storage| storage.write(anchor_0.clone()).unwrap());
assert_eq!(
add_openid_credential(&mut anchor_1, openid_credential.clone()),
Err(AnchorError::OpenIdCredentialAlreadyRegistered)
Ok(Operation::AddOpenIdCredential {
iss: openid_credential.iss.clone()
})
);
}

0 comments on commit 0da1a61

Please sign in to comment.