mirror of
https://github.com/logos-messaging/logos-messaging-rlnv2-contract.git
synced 2026-01-05 07:23:06 +00:00
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:
parent
c9f6ae5d8e
commit
c3ec4be6b4
@ -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");
|
||||
_;
|
||||
}
|
||||
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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)));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user