Cyfrin / foundry-defi-stablecoin-cu

241 stars 107 forks source link

Update DSCEngineTest.t.sol #97

Open meitedaf opened 1 month ago

meitedaf commented 1 month ago

Consolidated vm.prank(owner) Calls: Replaced multiple instances of vm.prank(owner) with a single vm.startPrank(owner) to improve code readability and efficiency. This change ensures that all subsequent operations within the owner context are consistently executed under the correct sender, reducing redundancy.

Improved Test Logic: Updated the logic to use mockWeth as the collateral token instead of mockDsc in the testRevertsIfTransferFromFails() function and testRevertsIfTransferFails() function, aligning with the intended purpose of each token. This adjustment helps in simulating a more realistic scenario where mockWeth acts as the collateral, and mockDsc is the stablecoin managed by the DSCEngine.

EngrPips commented 1 month ago

Thanks for pointing this out, @meitedaf. This will be addressed as soon as possible.