@@ -104,17 +104,19 @@ contract TestGhoReserve is TestGhoBase {
104104 }
105105
106106 function testAddEntityAlreadyInSet () public {
107+ uint256 entitiesCount = GHO_RESERVE.totalEntities ();
107108 address alice = makeAddr ('alice ' );
108109 vm.expectEmit (true , true , true , true , address (GHO_RESERVE));
109110 emit EntityAdded (alice);
110111 GHO_RESERVE.addEntity (address (alice));
111112
112113 // Set already contains two entities from constructor
113- assertEq (GHO_RESERVE.totalEntities (), 3 );
114+ assertEq (GHO_RESERVE.totalEntities (), entitiesCount + 1 );
114115
116+ vm.expectRevert ('ENTITY_ALREADY_EXISTS ' );
115117 GHO_RESERVE.addEntity (address (alice));
116118
117- assertEq (GHO_RESERVE.totalEntities (), 3 );
119+ assertEq (GHO_RESERVE.totalEntities (), entitiesCount + 1 );
118120 }
119121
120122 function testRemoveEntity () public {
@@ -133,14 +135,16 @@ contract TestGhoReserve is TestGhoBase {
133135 }
134136
135137 function testRemoveEntityNotInSet () public {
138+ uint256 entitiesCount = GHO_RESERVE.totalEntities ();
136139 address alice = makeAddr ('alice ' );
137140 assertFalse (GHO_RESERVE.isEntity (alice));
138- assertEq (GHO_RESERVE.totalEntities (), 2 );
141+ assertEq (GHO_RESERVE.totalEntities (), entitiesCount );
139142
143+ vm.expectRevert ('ENTITY_NOT_REMOVED ' );
140144 GHO_RESERVE.removeEntity (address (alice));
141145
142146 assertFalse (GHO_RESERVE.isEntity (alice));
143- assertEq (GHO_RESERVE.totalEntities (), 2 );
147+ assertEq (GHO_RESERVE.totalEntities (), entitiesCount );
144148 }
145149
146150 function testRevertRemoveEntityBalanceOutstanding () public {
@@ -152,7 +156,7 @@ contract TestGhoReserve is TestGhoBase {
152156 vm.prank (alice);
153157 GHO_RESERVE.use (5_000 ether);
154158
155- vm.expectRevert ('CANNOT_REMOVE_ENTITY_WITH_BALANCE ' );
159+ vm.expectRevert ('ENTITY_GHO_USED_NOT_ZERO ' );
156160 GHO_RESERVE.removeEntity (alice);
157161 }
158162
@@ -166,6 +170,11 @@ contract TestGhoReserve is TestGhoBase {
166170 GHO_RESERVE.setLimit (alice, capacity);
167171 }
168172
173+ function testSetLimitEntityDoesNotExist () public {
174+ vm.expectRevert ('ENTITY_DOES_NOT_EXIST ' );
175+ GHO_RESERVE.setLimit (makeAddr ('no-entity ' ), 100_000 ether);
176+ }
177+
169178 function testTransfer () public {
170179 GhoReserve reserve = _deployReserve ();
171180 address facilitator = makeAddr ('facilitator ' );
0 commit comments