Skip to content

Commit

Permalink
expect the hat wearer to lose hat
Browse files Browse the repository at this point in the history
  • Loading branch information
Da-Colon committed Oct 29, 2024
1 parent 2551fbf commit b066efa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions contracts/mocks/MockHatsAdmin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,12 @@ contract MockHatsAutoAdmin is IHats {

function checkHatWearerStatus(
uint256 _hatId,
address _wearer
) external override returns (bool updated) {}
address
) external override returns (bool updated) {
// 'burns' the hat if the wearer is no longer eligible
wearer[_hatId] = address(0);
return true;
}

function renounceHat(uint256 _hatId) external override {}

Expand Down
2 changes: 2 additions & 0 deletions test/DecentAutonomousAdmin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ describe('DecentAutonomousAdminHat', function () {

// Verify the hat is now worn by the nominated wearer
expect((await hatsProtocol.isWearerOfHat(nominatedWearer.address, userHatId)) === true);

expect((await hatsProtocol.isWearerOfHat(currentWearer.address, userHatId)) === false);
});
it('should correctly invalidate random address as current wearer', async function () {
const args = {
Expand Down

0 comments on commit b066efa

Please sign in to comment.