Skip to content

Commit

Permalink
fix foundry test
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavBreadless committed Sep 6, 2024
1 parent 068c5c0 commit acd428b
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,12 @@ contract ExperimentalBridgeTest is Test {
}

function test_addToken_cannotBeCalledByRandomAddress(address randomAddress, address randomCaller) public {
if (randomCaller != bridgeOwner) {
vm.prank(randomCaller);
vm.expectRevert(bytes("Ownable: caller is not the owner"));
bridgeHub.addToken(randomAddress);
}
vm.assume(randomAddress != bridgeOwner);
vm.assume(randomAddress != bridgeHub.admin());

vm.prank(randomCaller);
vm.expectRevert(bytes("Bridgehub: not owner or admin"));
bridgeHub.addToken(randomAddress);

assertTrue(!bridgeHub.tokenIsRegistered(randomAddress), "This random address is not registered as a token");

Expand Down

0 comments on commit acd428b

Please sign in to comment.