Skip to content

Commit

Permalink
fix: portal tests address overlaps
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzzzHui committed Nov 8, 2023
1 parent 914dc7c commit 9dfc437
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion onchain/rollups/test/foundry/portals/ERC20Portal.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,9 @@ contract ERC20PortalHandler is Test {
if (
_dapp == address(0) ||
sender == address(0) ||
_dapp == address(this)
_dapp == address(this) ||
sender == address(portal) ||
_dapp == address(portal)
) return;
_amount = bound(_amount, 0, token.balanceOf(address(this)));

Expand Down
4 changes: 4 additions & 0 deletions onchain/rollups/test/foundry/portals/EtherPortal.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ contract EtherPortalHandler is Test {
_amount = bound(_amount, 0, type(uint128).max);

// fund sender
// sender address should not overlap with portal or dapp addresses
if (sender == address(portal)) {
return;
}
for (uint256 i; i < dapps.length; ++i) {
if (sender == dapps[i]) {
return;
Expand Down

0 comments on commit 9dfc437

Please sign in to comment.