Skip to content

Commit

Permalink
fix(test): update test strings in Bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxMustermann2 committed Jun 3, 2024
1 parent 3751546 commit 5c2aec1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/storage/BootstrapStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -400,24 +400,24 @@ contract BootstrapStorage is GatewayStorage, ITokenWhitelister {
uint256[40] private __gap;

modifier isTokenWhitelisted(address token) {
require(isWhitelistedToken[token], "BaseRestakingController: token is not whitelisted");
require(isWhitelistedToken[token], "BootstrapStorage: token is not whitelisted");
_;
}

modifier isValidAmount(uint256 amount) {
require(amount > 0, "BaseRestakingController: amount should be greater than zero");
require(amount > 0, "BootstrapStorage: amount should be greater than zero");
_;
}

modifier vaultExists(address token) {
require(address(tokenToVault[token]) != address(0), "BaseRestakingController: no vault added for this token");
require(address(tokenToVault[token]) != address(0), "BootstrapStorage: no vault added for this token");
_;
}

modifier isValidBech32Address(string calldata exocoreAddress) {
require(
isValidExocoreAddress(exocoreAddress),
"BaseRestakingController: invalid bech32 encoded Exocore address"
"BootstrapStorage: invalid bech32 encoded Exocore address"
);
_;
}
Expand Down
24 changes: 12 additions & 12 deletions test/foundry/Bootstrap.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ contract BootstrapTest is Test {

function test01_AddWhitelistToken_AlreadyExists() public {
vm.startPrank(deployer);
vm.expectRevert("Bootstrap: token should be not whitelisted before");
vm.expectRevert("BootstrapStorage: token should be not whitelisted before");
bootstrap.addWhitelistToken(address(myToken));
vm.stopPrank();
}
Expand Down Expand Up @@ -265,7 +265,7 @@ contract BootstrapTest is Test {

// now try to deposit
myToken.approve(address(bootstrap), amounts[0]);
vm.expectRevert("Bootstrap: token is not whitelisted");
vm.expectRevert("BootstrapStorage: token is not whitelisted");
bootstrap.deposit(cloneAddress, amounts[0]);
vm.stopPrank();
}
Expand Down Expand Up @@ -532,7 +532,7 @@ contract BootstrapTest is Test {

function test07_AddWhitelistedToken_AlreadyWhitelisted() public {
vm.startPrank(deployer);
vm.expectRevert("Bootstrap: token should be not whitelisted before");
vm.expectRevert("BootstrapStorage: token should be not whitelisted before");
bootstrap.addWhitelistToken(address(myToken));
vm.stopPrank();
}
Expand Down Expand Up @@ -606,7 +606,7 @@ contract BootstrapTest is Test {
test03_RegisterOperator();
test02_Deposit();
vm.startPrank(addrs[0]);
vm.expectRevert("Bootstrap: token is not whitelisted");
vm.expectRevert("BootstrapStorage: token is not whitelisted");
bootstrap.delegateTo("exo13hasr43vvq8v44xpzh0l6yuym4kca98f87j7ac", address(0xa), amounts[0]);
}

Expand All @@ -624,7 +624,7 @@ contract BootstrapTest is Test {
test03_RegisterOperator();
test02_Deposit();
vm.startPrank(addrs[0]);
vm.expectRevert("Bootstrap: amount should be greater than zero");
vm.expectRevert("BootstrapStorage: amount should be greater than zero");
bootstrap.delegateTo("exo13hasr43vvq8v44xpzh0l6yuym4kca98f87j7ac", address(myToken), 0);
}

Expand Down Expand Up @@ -696,7 +696,7 @@ contract BootstrapTest is Test {
function test10_UndelegateFrom_TokenNotWhitelisted() public {
test03_RegisterOperator();
vm.startPrank(addrs[0]);
vm.expectRevert("Bootstrap: token is not whitelisted");
vm.expectRevert("BootstrapStorage: token is not whitelisted");
bootstrap.undelegateFrom("exo13hasr43vvq8v44xpzh0l6yuym4kca98f87j7ac", address(0xa), amounts[0]);
}

Expand All @@ -714,7 +714,7 @@ contract BootstrapTest is Test {
test03_RegisterOperator();
test02_Deposit();
vm.startPrank(addrs[0]);
vm.expectRevert("Bootstrap: amount should be greater than zero");
vm.expectRevert("BootstrapStorage: amount should be greater than zero");
bootstrap.undelegateFrom("exo13hasr43vvq8v44xpzh0l6yuym4kca98f87j7ac", address(myToken), 0);
}

Expand Down Expand Up @@ -760,14 +760,14 @@ contract BootstrapTest is Test {

function test11_WithdrawPrincipleFromExocore_TokenNotWhitelisted() public {
vm.startPrank(addrs[0]);
vm.expectRevert("Bootstrap: token is not whitelisted");
vm.expectRevert("BootstrapStorage: token is not whitelisted");
bootstrap.withdrawPrincipleFromExocore(address(0xa), amounts[0]);
vm.stopPrank();
}

function test11_WithdrawPrincipleFromExocore_ZeroAmount() public {
vm.startPrank(addrs[0]);
vm.expectRevert("Bootstrap: amount should be greater than zero");
vm.expectRevert("BootstrapStorage: amount should be greater than zero");
bootstrap.withdrawPrincipleFromExocore(address(myToken), 0);
vm.stopPrank();
}
Expand Down Expand Up @@ -1164,7 +1164,7 @@ contract BootstrapTest is Test {
function test18_RemoveWhitelistToken_DoesNotExist() public {
address fakeToken = address(0xa);
vm.startPrank(deployer);
vm.expectRevert("Bootstrap: token should be already whitelisted");
vm.expectRevert("BootstrapStorage: token is not whitelisted");
bootstrap.removeWhitelistToken(fakeToken);
}

Expand All @@ -1187,13 +1187,13 @@ contract BootstrapTest is Test {

function test22_Claim_TokenNotWhitelisted() public {
vm.startPrank(addrs[0]);
vm.expectRevert("Bootstrap: token is not whitelisted");
vm.expectRevert("BootstrapStorage: token is not whitelisted");
bootstrap.claim(address(0xa), amounts[0], addrs[0]);
}

function test22_Claim_ZeroAmount() public {
vm.startPrank(addrs[0]);
vm.expectRevert("Bootstrap: amount should be greater than zero");
vm.expectRevert("BootstrapStorage: amount should be greater than zero");
bootstrap.claim(address(myToken), 0, addrs[0]);
}

Expand Down

0 comments on commit 5c2aec1

Please sign in to comment.