// SPDX-License-Identifier: MIT
//✨only fixed logic that checks if the market was successfully unpaused since it was flawed changed bool from paused to ispaused
pragma solidity 0.8.25;
// Zaros dependencies
import { Errors } from "@zaros/utils/Errors.sol";
import { MarketMakingEngineConfigurationBranch } from
"@zaros/market-making/branches/MarketMakingEngineConfigurationBranch.sol";
// Zaros dependencies test
import { Base_Test } from "test/Base.t.sol";
// Open Zeppelin dependencies
import { Ownable } from "@openzeppelin/access/Ownable.sol";
contract MarketMakingEngineConfigurationBranch_UnpauseMarket_Integration_Test is Base_Test {
function setUp() public virtual override {
Base_Test.setUp();
changePrank({ msgSender: users.owner.account });
configureSystemParameters();
createPerpMarkets();
}
function testFuzz_RevertGiven_TheSenderIsNotTheOwner(uint256 marketId) external {
MarketConfig memory fuzzMarketConfig = getFuzzMarketConfig(marketId);
changePrank({ msgSender: users.sakura.account });
vm.expectRevert({
revertData: abi.encodeWithSelector(Ownable.OwnableUnauthorizedAccount.selector, users.sakura.account)
});
marketMakingEngine.unpauseMarket(fuzzMarketConfig.marketId);
}
function testFuzz_GivenTheSenderIsTheOwner(uint256 marketId) external {
MarketConfig memory fuzzMarketConfig = getFuzzMarketConfig(marketId);
marketMakingEngine.unpauseMarket(fuzzMarketConfig.marketId);
uint128[] memory activeMarketIds = marketMakingEngine.getLiveMarketIds();
bool isUnpaused = false;
for (uint256 i = 0; i < activeMarketIds.length; i++) {
if (activeMarketIds[i] == fuzzMarketConfig.marketId) {
isUnpaused = true;
break;
}
}
assertTrue(isUnpaused, "Market ID was not found in the active markets list after unpausing.");
}
}