Skip to content

Commit

Permalink
Merge pull request #849 from matter-labs/bf-N01
Browse files Browse the repository at this point in the history
fix: Misleading Errors
  • Loading branch information
brunoffranca authored Oct 14, 2024
2 parents 0963893 + ebb3f54 commit c6be1a7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 3 additions & 2 deletions l2-contracts/contracts/ConsensusRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pragma solidity 0.8.24;
import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable-v4/access/Ownable2StepUpgradeable.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable-v4/proxy/utils/Initializable.sol";
import {IConsensusRegistry} from "./interfaces/IConsensusRegistry.sol";
import {ZeroAddress} from "./errors/L2ContractErrors.sol";

/// @author Matter Labs
/// @custom:security-contact security@matterlabs.dev
Expand Down Expand Up @@ -49,7 +50,7 @@ contract ConsensusRegistry is IConsensusRegistry, Initializable, Ownable2StepUpg

function initialize(address _initialOwner) external initializer {
if (_initialOwner == address(0)) {
revert InvalidInputNodeOwnerAddress();
revert ZeroAddress();
}
_transferOwnership(_initialOwner);
}
Expand Down Expand Up @@ -461,7 +462,7 @@ contract ConsensusRegistry is IConsensusRegistry, Initializable, Ownable2StepUpg

function _verifyInputAddress(address _nodeOwner) private pure {
if (_nodeOwner == address(0)) {
revert InvalidInputNodeOwnerAddress();
revert ZeroAddress();
}
}

Expand Down
2 changes: 0 additions & 2 deletions l2-contracts/contracts/interfaces/IConsensusRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,8 @@ interface IConsensusRegistry {
error UnauthorizedOnlyOwnerOrNodeOwner();
error NodeOwnerExists();
error NodeOwnerDoesNotExist();
error NodeOwnerNotFound();
error ValidatorPubKeyExists();
error AttesterPubKeyExists();
error InvalidInputNodeOwnerAddress();
error InvalidInputBLS12_381PublicKey();
error InvalidInputBLS12_381Signature();
error InvalidInputSecp256k1PublicKey();
Expand Down

0 comments on commit c6be1a7

Please sign in to comment.