From acd428b3bea552797a8300d02cb5204d23829299 Mon Sep 17 00:00:00 2001 From: Stanislav Breadless Date: Fri, 6 Sep 2024 12:15:04 +0200 Subject: [PATCH] fix foundry test --- .../unit/concrete/Bridgehub/experimental_bridge.t.sol | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/l1-contracts/test/foundry/unit/concrete/Bridgehub/experimental_bridge.t.sol b/l1-contracts/test/foundry/unit/concrete/Bridgehub/experimental_bridge.t.sol index 9ef3ae0fb..c92820209 100644 --- a/l1-contracts/test/foundry/unit/concrete/Bridgehub/experimental_bridge.t.sol +++ b/l1-contracts/test/foundry/unit/concrete/Bridgehub/experimental_bridge.t.sol @@ -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");