Skip to content

Commit

Permalink
Testing WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
brickpop committed Oct 22, 2024
1 parent ee0db9d commit fcedcf7
Show file tree
Hide file tree
Showing 5 changed files with 308 additions and 148 deletions.
2 changes: 1 addition & 1 deletion src/EncryptionRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ contract EncryptionRegistry is IEncryptionRegistry {
else if (
accounts[msg.sender].appointedWallet != address(0) && accounts[msg.sender].appointedWallet != msg.sender
) {
revert CannotSetPubKeyForAppointedWallets();
revert MustResetAppointment();
}

_setPublicKey(msg.sender, _publicKey);
Expand Down
7 changes: 5 additions & 2 deletions src/interfaces/IEncryptionRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ interface IEncryptionRegistry {
/// @notice Raised when a non appointed wallet tries to define the public key
error MustBeAppointed();

/// @notice Raised when an account attempts to define the public key of the appointed wallet
error CannotSetPubKeyForAppointedWallets();
/// @notice Raised when someone else is appointed and the account owner tries to override the public key of the appointed wallet. The appointed value should be set to address(0) or msg.sender first.
error MustResetAppointment();

/// @notice Raised when the caller is not an addresslist compatible contract
error InvalidAddressList();
Expand All @@ -44,6 +44,9 @@ interface IEncryptionRegistry {
/// @return appointerAddress The address of the appointer account or zero.
function appointedBy(address wallet) external returns (address appointerAddress);

/// @notice Returns the address of the account registered at the given index
function registeredAccounts(uint256) external view returns (address);

/// @notice Returns the list of addresses on the registry
/// @dev Use this function to get all addresses in a single call. You can still call registeredAccounts[idx] to resolve them one by one.
function getRegisteredAccounts() external view returns (address[] memory);
Expand Down
Loading

0 comments on commit fcedcf7

Please sign in to comment.