@@ -963,22 +963,7 @@ describe('SafeTokenLock', function () {
963
963
} )
964
964
965
965
describe ( 'Token Rescue' , function ( ) {
966
- it ( 'Should not allow non-owner to recover' , async ( ) => {
967
- const { safeTokenLock, alice } = await setupTests ( )
968
- expect ( safeTokenLock . connect ( alice ) . rescueToken ( ZeroAddress , ZeroAddress , 0 ) )
969
- . to . be . revertedWithCustomError ( safeTokenLock , 'OwnableUnauthorizedAccount' )
970
- . withArgs ( alice )
971
- } )
972
-
973
- it ( 'Should not allow Safe token recovery' , async ( ) => {
974
- const { safeToken, safeTokenLock, owner } = await setupTests ( )
975
- expect ( safeTokenLock . connect ( owner ) . rescueToken ( safeToken , ZeroAddress , 0 ) ) . to . be . revertedWithCustomError (
976
- safeTokenLock ,
977
- 'CannotRecoverSafeToken' ,
978
- )
979
- } )
980
-
981
- it ( 'Should allow ERC20 recovery other than Safe token' , async ( ) => {
966
+ it ( 'Should allow rescuing tokens other other than Safe token' , async ( ) => {
982
967
const { safeToken, safeTokenLock, owner, alice } = await setupTests ( )
983
968
const erc20 = await ( await ethers . getContractFactory ( 'TestERC20' ) ) . deploy ( 'TEST' , 'TEST' )
984
969
@@ -1012,6 +997,21 @@ describe('SafeTokenLock', function () {
1012
997
await expect ( safeTokenLock . connect ( owner ) . rescueToken ( erc20ReturnFalseOnFailure , owner , 1 ) ) . to . be . reverted
1013
998
await expect ( safeTokenLock . connect ( owner ) . rescueToken ( erc20ReturnNothingOnSuccess , owner , 1 ) ) . to . not . be . reverted
1014
999
} )
1000
+
1001
+ it ( 'Should not allow rescuing Safe token' , async ( ) => {
1002
+ const { safeToken, safeTokenLock, owner } = await setupTests ( )
1003
+ expect ( safeTokenLock . connect ( owner ) . rescueToken ( safeToken , ZeroAddress , 0 ) ) . to . be . revertedWithCustomError (
1004
+ safeTokenLock ,
1005
+ 'CannotRecoverSafeToken' ,
1006
+ )
1007
+ } )
1008
+
1009
+ it ( 'Should not allow rescuing as non-owner' , async ( ) => {
1010
+ const { safeTokenLock, alice } = await setupTests ( )
1011
+ expect ( safeTokenLock . connect ( alice ) . rescueToken ( ZeroAddress , ZeroAddress , 0 ) )
1012
+ . to . be . revertedWithCustomError ( safeTokenLock , 'OwnableUnauthorizedAccount' )
1013
+ . withArgs ( alice )
1014
+ } )
1015
1015
} )
1016
1016
1017
1017
describe ( 'Operations' , function ( ) {
0 commit comments