Skip to content

Commit 61a9f5f

Browse files
committed
Add allowed value to AllowedZoneAlreadySet error
1 parent a3ad805 commit 61a9f5f

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

contracts/trading/seaport16/ImmutableSeaport.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ contract ImmutableSeaport is Consideration, Ownable, ImmutableSeaportEvents {
2626
mapping(address => bool) public allowedZones;
2727

2828
error OrderNotRestricted(uint8 orderType);
29-
error AllowedZoneAlreadySet(address zone);
29+
error AllowedZoneAlreadySet(address zone, bool allowed);
3030
error InvalidZone(address zone);
3131

3232
/**
@@ -52,7 +52,7 @@ contract ImmutableSeaport is Consideration, Ownable, ImmutableSeaportEvents {
5252
require(zone != address(0), "ImmutableSeaport: zone is the zero address");
5353

5454
if (allowedZones[zone] == allowed) {
55-
revert AllowedZoneAlreadySet(zone);
55+
revert AllowedZoneAlreadySet(zone, allowed);
5656
}
5757

5858
allowedZones[zone] = allowed;

test/trading/seaport16/ImmutableSeaportConfig.t.sol

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,22 @@ contract ImmutableSeaportConfigTest is ImmutableSeaportBaseTest {
2121
immutableSeaport.setAllowedZone(address(0), true);
2222
}
2323

24-
function testRejectAllowedZoneAlreadySet() public {
24+
function testRejectAllowedZoneAlreadySetToTrue() public {
2525
address zone = makeAddr("zone");
2626

2727
vm.prank(owner);
2828
immutableSeaport.setAllowedZone(zone, true);
2929

3030
vm.prank(owner);
31-
vm.expectRevert(abi.encodeWithSelector(ImmutableSeaport.AllowedZoneAlreadySet.selector, zone));
31+
vm.expectRevert(abi.encodeWithSelector(ImmutableSeaport.AllowedZoneAlreadySet.selector, zone, true));
3232
immutableSeaport.setAllowedZone(zone, true);
3333
}
34+
35+
function testRejectAllowedZoneAlreadySetToFalse() public {
36+
address zone = makeAddr("zone");
37+
38+
vm.prank(owner);
39+
vm.expectRevert(abi.encodeWithSelector(ImmutableSeaport.AllowedZoneAlreadySet.selector, zone, false));
40+
immutableSeaport.setAllowedZone(zone, false);
41+
}
3442
}

0 commit comments

Comments
 (0)