@@ -150,14 +150,14 @@ describe("Should change LBC owner to the multisig.ts", function () {
150150
151151 console . info ( `Impersonated account: ${ impersonatedSigner . address } ` ) ;
152152
153- // Call changeMultisigOwner
153+ // Call changeMultisigOwner and ensure the Promise is fulfilled
154154 await expect (
155155 changeMultisigOwner (
156156 multisigAddress ,
157157 deploymentNetwork ,
158158 impersonatedSigner
159159 )
160- ) . to . not . be . reverted ;
160+ ) . to . eventually . be . fulfilled ;
161161
162162 const newOwner = await contract . owner ( ) ;
163163 console . info ( `New owner: ${ newOwner } ` ) ;
@@ -167,13 +167,24 @@ describe("Should change LBC owner to the multisig.ts", function () {
167167
168168 // Verify old owner can no longer perform owner functions
169169 const adminAddress = await upgrades . erc1967 . getAdminAddress ( proxyAddress ) ;
170- const adminContract = await ethers . getContractAt (
170+
171+ // Get the ProxyAdmin contract instance
172+ const proxyAdminContract = await ethers . getContractAt (
171173 "LiquidityBridgeContractAdmin" ,
172174 adminAddress
173175 ) ;
176+
177+ // Attempt an upgrade with the former owner to ensure permissions were revoked
178+ const adminContract = proxyAdminContract . connect ( impersonatedSigner ) ;
174179 await expect (
175180 adminContract . upgrade ( proxyAddress , multisigAddress )
176- ) . to . revertedWith ( "Ownable: caller is not the owner" ) ;
181+ ) . to . be . revertedWith ( "Ownable: caller is not the owner" ) ;
182+
183+ // Verify the ProxyAdmin owner was also updated
184+ const proxyAdminOwner = await proxyAdminContract . owner ( ) ;
185+ expect ( proxyAdminOwner . toLowerCase ( ) ) . to . equal (
186+ multisigAddress . toLowerCase ( )
187+ ) ;
177188
178189 console . info (
179190 `Ownership of LiquidityBridgeContract proxy changed to multisig in ${ deploymentNetwork } `
0 commit comments