@@ -47,8 +47,8 @@ contract('KillSwitch', ([_, root, owner, securityPartner]) => {
4747 await killSwitch . initialize ( issuesRegistry . address )
4848 const SET_CONTRACT_ACTION_ROLE = await killSwitchBase . SET_CONTRACT_ACTION_ROLE ( )
4949 await acl . createPermission ( owner , killSwitch . address , SET_CONTRACT_ACTION_ROLE , root , { from : root } )
50- const SET_LOWEST_ALLOWED_SEVERITY_ROLE = await killSwitchBase . SET_LOWEST_ALLOWED_SEVERITY_ROLE ( )
51- await acl . createPermission ( owner , killSwitch . address , SET_LOWEST_ALLOWED_SEVERITY_ROLE , root , { from : root } )
50+ const SET_HIGHEST_ALLOWED_SEVERITY_ROLE = await killSwitchBase . SET_HIGHEST_ALLOWED_SEVERITY_ROLE ( )
51+ await acl . createPermission ( owner , killSwitch . address , SET_HIGHEST_ALLOWED_SEVERITY_ROLE , root , { from : root } )
5252 } )
5353
5454 beforeEach ( 'create kill switched app' , async ( ) => {
@@ -128,15 +128,15 @@ contract('KillSwitch', ([_, root, owner, securityPartner]) => {
128128
129129 describe ( 'isSeverityIgnored' , function ( ) {
130130 context ( 'when there is no bug registered' , ( ) => {
131- context ( 'when there is no lowest allowed severity set for the contract being called' , ( ) => {
131+ context ( 'when there is no highest allowed severity set for the contract being called' , ( ) => {
132132 it ( 'returns true' , async ( ) => {
133133 assert . isTrue ( await killSwitch . isSeverityIgnored ( appBase . address ) )
134134 } )
135135 } )
136136
137- context ( 'when there is a lowest allowed severity set for the contract being called' , ( ) => {
138- beforeEach ( 'set lowest allowed severity' , async ( ) => {
139- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . LOW , { from : owner } )
137+ context ( 'when there is a highest allowed severity set for the contract being called' , ( ) => {
138+ beforeEach ( 'set highest allowed severity' , async ( ) => {
139+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . LOW , { from : owner } )
140140 } )
141141
142142 it ( 'returns true' , async ( ) => {
@@ -150,36 +150,36 @@ contract('KillSwitch', ([_, root, owner, securityPartner]) => {
150150 await issuesRegistry . setSeverityFor ( appBase . address , SEVERITY . MID , { from : securityPartner } )
151151 } )
152152
153- context ( 'when there is no lowest allowed severity set for the contract being called' , ( ) => {
153+ context ( 'when there is no highest allowed severity set for the contract being called' , ( ) => {
154154 it ( 'returns false' , async ( ) => {
155155 assert . isFalse ( await killSwitch . isSeverityIgnored ( appBase . address ) )
156156 } )
157157 } )
158158
159- context ( 'when there is a lowest allowed severity set for the contract being called' , ( ) => {
160- context ( 'when the lowest allowed severity is under the reported bug severity' , ( ) => {
161- beforeEach ( 'set lowest allowed severity' , async ( ) => {
162- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . LOW , { from : owner } )
159+ context ( 'when there is a highest allowed severity set for the contract being called' , ( ) => {
160+ context ( 'when the highest allowed severity is under the reported bug severity' , ( ) => {
161+ beforeEach ( 'set highest allowed severity' , async ( ) => {
162+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . LOW , { from : owner } )
163163 } )
164164
165165 it ( 'returns false' , async ( ) => {
166166 assert . isFalse ( await killSwitch . isSeverityIgnored ( appBase . address ) )
167167 } )
168168 } )
169169
170- context ( 'when the lowest allowed severity is equal to the reported bug severity' , ( ) => {
171- beforeEach ( 'set lowest allowed severity' , async ( ) => {
172- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . MID , { from : owner } )
170+ context ( 'when the highest allowed severity is equal to the reported bug severity' , ( ) => {
171+ beforeEach ( 'set highest allowed severity' , async ( ) => {
172+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . MID , { from : owner } )
173173 } )
174174
175175 it ( 'returns true' , async ( ) => {
176176 assert . isTrue ( await killSwitch . isSeverityIgnored ( appBase . address ) )
177177 } )
178178 } )
179179
180- context ( 'when the lowest allowed severity is greater than the reported bug severity' , ( ) => {
181- beforeEach ( 'set lowest allowed severity' , async ( ) => {
182- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . CRITICAL , { from : owner } )
180+ context ( 'when the highest allowed severity is greater than the reported bug severity' , ( ) => {
181+ beforeEach ( 'set highest allowed severity' , async ( ) => {
182+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . CRITICAL , { from : owner } )
183183 } )
184184
185185 it ( 'returns true' , async ( ) => {
@@ -190,35 +190,35 @@ contract('KillSwitch', ([_, root, owner, securityPartner]) => {
190190 } )
191191 } )
192192
193- describe ( 'setLowestAllowedSeverity ' , function ( ) {
193+ describe ( 'setHighestAllowedSeverity ' , function ( ) {
194194 context ( 'when the contract is the owner' , function ( ) {
195195 const from = owner
196196
197197 context ( 'when there was no severity set' , function ( ) {
198- it ( 'sets the lowest allowed severity' , async function ( ) {
199- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . HIGH , { from } )
198+ it ( 'sets the highest allowed severity' , async function ( ) {
199+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . HIGH , { from } )
200200
201- assert . equal ( await killSwitch . getLowestAllowedSeverity ( appBase . address ) , SEVERITY . HIGH )
201+ assert . equal ( await killSwitch . getHighestAllowedSeverity ( appBase . address ) , SEVERITY . HIGH )
202202 } )
203203 } )
204204
205205 context ( 'when there was a previous severity set' , function ( ) {
206- beforeEach ( 'set lowest allowed severity' , async function ( ) {
207- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . LOW , { from } )
208- assert . equal ( await killSwitch . getLowestAllowedSeverity ( appBase . address ) , SEVERITY . LOW )
206+ beforeEach ( 'set highest allowed severity' , async function ( ) {
207+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . LOW , { from } )
208+ assert . equal ( await killSwitch . getHighestAllowedSeverity ( appBase . address ) , SEVERITY . LOW )
209209 } )
210210
211- it ( 'changes the lowest allowed severity' , async function ( ) {
212- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . MID , { from } )
211+ it ( 'changes the highest allowed severity' , async function ( ) {
212+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . MID , { from } )
213213
214- assert . equal ( await killSwitch . getLowestAllowedSeverity ( appBase . address ) , SEVERITY . MID )
214+ assert . equal ( await killSwitch . getHighestAllowedSeverity ( appBase . address ) , SEVERITY . MID )
215215 } )
216216 } )
217217 } )
218218
219219 context ( 'when the sender is not the owner' , function ( ) {
220220 it ( 'reverts' , async function ( ) {
221- await assertRevert ( killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . MID ) )
221+ await assertRevert ( killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . MID ) )
222222 } )
223223 } )
224224 } )
@@ -247,13 +247,13 @@ contract('KillSwitch', ([_, root, owner, securityPartner]) => {
247247 }
248248
249249 context ( 'when there is no bug registered' , ( ) => {
250- context ( 'when there is no lowest allowed severity set for the contract being called' , ( ) => {
250+ context ( 'when there is no highest allowed severity set for the contract being called' , ( ) => {
251251 itExecutesTheCallEvenIfDenied ( )
252252 } )
253253
254- context ( 'when there is a lowest allowed severity set for the contract being called' , ( ) => {
255- beforeEach ( 'set lowest allowed severity' , async ( ) => {
256- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . LOW , { from : owner } )
254+ context ( 'when there is a highest allowed severity set for the contract being called' , ( ) => {
255+ beforeEach ( 'set highest allowed severity' , async ( ) => {
256+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . LOW , { from : owner } )
257257 } )
258258
259259 itExecutesTheCallEvenIfDenied ( )
@@ -265,26 +265,26 @@ contract('KillSwitch', ([_, root, owner, securityPartner]) => {
265265 await issuesRegistry . setSeverityFor ( appBase . address , SEVERITY . MID , { from : securityPartner } )
266266 } )
267267
268- context ( 'when there is no lowest allowed severity set for the contract being called' , ( ) => {
268+ context ( 'when there is no highest allowed severity set for the contract being called' , ( ) => {
269269 itExecutesTheCallEvenIfDenied ( )
270270 } )
271271
272- context ( 'when there is a lowest allowed severity set for the contract being called' , ( ) => {
273- context ( 'when the lowest allowed severity is under the reported bug severity' , ( ) => {
272+ context ( 'when there is a highest allowed severity set for the contract being called' , ( ) => {
273+ context ( 'when the highest allowed severity is under the reported bug severity' , ( ) => {
274274 itExecutesTheCallEvenIfDenied ( )
275275 } )
276276
277- context ( 'when the lowest allowed severity is equal to the reported bug severity' , ( ) => {
278- beforeEach ( 'set lowest allowed severity' , async ( ) => {
279- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . MID , { from : owner } )
277+ context ( 'when the highest allowed severity is equal to the reported bug severity' , ( ) => {
278+ beforeEach ( 'set highest allowed severity' , async ( ) => {
279+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . MID , { from : owner } )
280280 } )
281281
282282 itExecutesTheCallEvenIfDenied ( )
283283 } )
284284
285- context ( 'when the lowest allowed severity is greater than the reported bug severity' , ( ) => {
286- beforeEach ( 'set lowest allowed severity' , async ( ) => {
287- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . CRITICAL , { from : owner } )
285+ context ( 'when the highest allowed severity is greater than the reported bug severity' , ( ) => {
286+ beforeEach ( 'set highest allowed severity' , async ( ) => {
287+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . CRITICAL , { from : owner } )
288288 } )
289289
290290 itExecutesTheCallEvenIfDenied ( )
@@ -330,13 +330,13 @@ contract('KillSwitch', ([_, root, owner, securityPartner]) => {
330330 }
331331
332332 context ( 'when there is no bug registered' , ( ) => {
333- context ( 'when there is no lowest allowed severity set for the contract being called' , ( ) => {
333+ context ( 'when there is no highest allowed severity set for the contract being called' , ( ) => {
334334 itExecutesTheCallWhenNotDenied ( )
335335 } )
336336
337- context ( 'when there is a lowest allowed severity set for the contract being called' , ( ) => {
338- beforeEach ( 'set lowest allowed severity' , async ( ) => {
339- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . LOW , { from : owner } )
337+ context ( 'when there is a highest allowed severity set for the contract being called' , ( ) => {
338+ beforeEach ( 'set highest allowed severity' , async ( ) => {
339+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . LOW , { from : owner } )
340340 } )
341341
342342 itExecutesTheCallWhenNotDenied ( )
@@ -349,7 +349,7 @@ contract('KillSwitch', ([_, root, owner, securityPartner]) => {
349349 } )
350350
351351 context ( 'when the bug was not fixed yet' , ( ) => {
352- context ( 'when there is no lowest allowed severity set for the contract being called' , ( ) => {
352+ context ( 'when there is no highest allowed severity set for the contract being called' , ( ) => {
353353 context ( 'when the contract being called is checked' , ( ) => {
354354 itDoesNotExecuteTheCall ( )
355355 } )
@@ -371,10 +371,10 @@ contract('KillSwitch', ([_, root, owner, securityPartner]) => {
371371 } )
372372 } )
373373
374- context ( 'when there is a lowest allowed severity set for the contract being called' , ( ) => {
375- context ( 'when the lowest allowed severity is under the reported bug severity' , ( ) => {
376- beforeEach ( 'set lowest allowed severity' , async ( ) => {
377- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . LOW , { from : owner } )
374+ context ( 'when there is a highest allowed severity set for the contract being called' , ( ) => {
375+ context ( 'when the highest allowed severity is under the reported bug severity' , ( ) => {
376+ beforeEach ( 'set highest allowed severity' , async ( ) => {
377+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . LOW , { from : owner } )
378378 } )
379379
380380 context ( 'when the contract being called is checked' , ( ) => {
@@ -398,17 +398,17 @@ contract('KillSwitch', ([_, root, owner, securityPartner]) => {
398398 } )
399399 } )
400400
401- context ( 'when the lowest allowed severity is equal to the reported bug severity' , ( ) => {
402- beforeEach ( 'set lowest allowed severity' , async ( ) => {
403- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . MID , { from : owner } )
401+ context ( 'when the highest allowed severity is equal to the reported bug severity' , ( ) => {
402+ beforeEach ( 'set highest allowed severity' , async ( ) => {
403+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . MID , { from : owner } )
404404 } )
405405
406406 itExecutesTheCallWhenNotDenied ( )
407407 } )
408408
409- context ( 'when the lowest allowed severity is greater than the reported bug severity' , ( ) => {
410- beforeEach ( 'set lowest allowed severity' , async ( ) => {
411- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . CRITICAL , { from : owner } )
409+ context ( 'when the highest allowed severity is greater than the reported bug severity' , ( ) => {
410+ beforeEach ( 'set highest allowed severity' , async ( ) => {
411+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . CRITICAL , { from : owner } )
412412 } )
413413
414414 itExecutesTheCallWhenNotDenied ( )
@@ -421,30 +421,30 @@ contract('KillSwitch', ([_, root, owner, securityPartner]) => {
421421 await issuesRegistry . setSeverityFor ( appBase . address , SEVERITY . NONE , { from : securityPartner } )
422422 } )
423423
424- context ( 'when there is no lowest allowed severity set for the contract being called' , ( ) => {
424+ context ( 'when there is no highest allowed severity set for the contract being called' , ( ) => {
425425 itExecutesTheCallWhenNotDenied ( )
426426 } )
427427
428- context ( 'when there is a lowest allowed severity set for the contract being called' , ( ) => {
429- context ( 'when the lowest allowed severity is under the reported bug severity' , ( ) => {
430- beforeEach ( 'set lowest allowed severity' , async ( ) => {
431- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . LOW , { from : owner } )
428+ context ( 'when there is a highest allowed severity set for the contract being called' , ( ) => {
429+ context ( 'when the highest allowed severity is under the reported bug severity' , ( ) => {
430+ beforeEach ( 'set highest allowed severity' , async ( ) => {
431+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . LOW , { from : owner } )
432432 } )
433433
434434 itExecutesTheCallWhenNotDenied ( )
435435 } )
436436
437- context ( 'when the lowest allowed severity is equal to the reported bug severity' , ( ) => {
438- beforeEach ( 'set lowest allowed severity' , async ( ) => {
439- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . MID , { from : owner } )
437+ context ( 'when the highest allowed severity is equal to the reported bug severity' , ( ) => {
438+ beforeEach ( 'set highest allowed severity' , async ( ) => {
439+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . MID , { from : owner } )
440440 } )
441441
442442 itExecutesTheCallWhenNotDenied ( )
443443 } )
444444
445- context ( 'when the lowest allowed severity is greater than the reported bug severity' , ( ) => {
446- beforeEach ( 'set lowest allowed severity' , async ( ) => {
447- await killSwitch . setLowestAllowedSeverity ( appBase . address , SEVERITY . CRITICAL , { from : owner } )
445+ context ( 'when the highest allowed severity is greater than the reported bug severity' , ( ) => {
446+ beforeEach ( 'set highest allowed severity' , async ( ) => {
447+ await killSwitch . setHighestAllowedSeverity ( appBase . address , SEVERITY . CRITICAL , { from : owner } )
448448 } )
449449
450450 itExecutesTheCallWhenNotDenied ( )
0 commit comments