Skip to content

Commit

Permalink
chore: Optimize the revocation of attestations (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
alainncls authored Sep 4, 2023
1 parent 88aad2d commit 892eabf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 0 additions & 4 deletions src/AttestationRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ contract AttestationRegistry is OwnableUpgradeable {
event AttestationRegistered(bytes32 indexed attestationId);
/// @notice Event emitted when an attestation is revoked
event AttestationRevoked(bytes32 attestationId, bytes32 replacedBy);
/// @notice Event emitted when a list of attestations is revoked
event BulkAttestationsRevoked(bytes32[] attestationId, bytes32[] replacedBy);
/// @notice Event emitted when the version number is incremented
event VersionUpdated(uint16 version);

Expand Down Expand Up @@ -157,8 +155,6 @@ contract AttestationRegistry is OwnableUpgradeable {
for (uint256 i = 0; i < attestationIds.length; i++) {
revoke(attestationIds[i], replacedBy[i]);
}

emit BulkAttestationsRevoked(attestationIds, replacedBy);
}

/**
Expand Down
5 changes: 4 additions & 1 deletion test/AttestationRegistry.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,10 @@ contract AttestationRegistryTest is Test {
replacingAttestations[1] = attestationId3;

vm.expectEmit(true, true, true, true);
emit BulkAttestationsRevoked(attestationsToRevoke, replacingAttestations);
emit AttestationRevoked(attestationsToRevoke[0], replacingAttestations[0]);
vm.expectEmit(true, true, true, true);
emit AttestationRevoked(attestationsToRevoke[1], replacingAttestations[1]);

attestationRegistry.bulkRevoke(attestationsToRevoke, replacingAttestations);
vm.stopPrank();

Expand Down

0 comments on commit 892eabf

Please sign in to comment.