Add string revert error event for onlyOwnerOrMinter (#36)

* Add string revert for AccountNotMinter error

* Add TST initialize argument in WakuRlnV2.t.sol
This commit is contained in:
Tanya S 2025-09-15 14:03:03 +02:00 committed by GitHub
parent c9f6ae5d8e
commit c3ec4be6b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -31,7 +31,7 @@ contract TestStableToken is
event MaxSupplySet(uint256 oldMaxSupply, uint256 newMaxSupply);
modifier onlyOwnerOrMinter() {
if (msg.sender != owner() && !isMinter[msg.sender]) revert AccountNotMinter();
if (msg.sender != owner() && !isMinter[msg.sender]) revert("AccountNotMinter");
_;
}

View File

@ -117,7 +117,7 @@ contract TestStableTokenTest is Test {
uint256 mintAmount = 1000 ether;
vm.prank(nonMinter);
vm.expectRevert(abi.encodeWithSelector(AccountNotMinter.selector));
vm.expectRevert("AccountNotMinter");
token.mint(user1, mintAmount);
}
@ -145,7 +145,7 @@ contract TestStableTokenTest is Test {
token.removeMinter(user1);
vm.prank(user1);
vm.expectRevert(abi.encodeWithSelector(AccountNotMinter.selector));
vm.expectRevert("AccountNotMinter");
token.mint(user2, mintAmount);
}

View File

@ -21,7 +21,7 @@ contract MaliciousToken is TestStableToken {
bool public failTransferEnabled;
function initialize(address _target, bool _failTransferEnabled) public initializer {
super.initialize();
super.initialize(100_000_000 ether);
target = _target;
failTransferEnabled = _failTransferEnabled;
}
@ -1168,7 +1168,7 @@ contract WakuRlnV2Test is Test {
MaliciousToken maliciousToken = MaliciousToken(address(proxy));
// Mint tokens
maliciousToken.mint(address(this), 100_000_000 ether);
maliciousToken.mint(address(this), 100_000 ether);
// Compute new calculator before prank
address newCalc = address(new DeployPriceCalculator().deploy(address(maliciousToken)));