Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidu28 committed Nov 6, 2024
1 parent f7a1beb commit 622d28e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
20 changes: 12 additions & 8 deletions contracts/script/utils/Utils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ contract Utils is Script {
}
}

function convertBoolToString(bool input) public pure returns (string memory) {
function convertBoolToString(
bool input
) public pure returns (string memory) {
if (input) {
return "true";
} else {
return "false";
}
}

function convertOperatorStatusToString(IRegistryCoordinator.OperatorStatus operatorStatus)
public
pure
returns (string memory)
{
function convertOperatorStatusToString(
IRegistryCoordinator.OperatorStatus operatorStatus
) public pure returns (string memory){
if (operatorStatus == IRegistryCoordinator.OperatorStatus.NEVER_REGISTERED) {
return "NEVER_REGISTERED";
} else if (operatorStatus == IRegistryCoordinator.OperatorStatus.REGISTERED) {
Expand All @@ -47,14 +47,18 @@ contract Utils is Script {
}

// Forge scripts best practice: https://book.getfoundry.sh/tutorials/best-practices#scripts
function readInput(string memory inputFileName) internal view returns (string memory) {
function readInput(
string memory inputFileName
) internal view returns (string memory) {
string memory inputDir = string.concat(vm.projectRoot(), "/script/input/");
string memory chainDir = string.concat(vm.toString(block.chainid), "/");
string memory file = string.concat(inputFileName, ".json");
return vm.readFile(string.concat(inputDir, chainDir, file));
}

function readOutput(string memory outputFileName) internal view returns (string memory) {
function readOutput(
string memory outputFileName
) internal view returns (string memory) {
string memory inputDir = string.concat(vm.projectRoot(), "/script/output/");
string memory chainDir = string.concat(vm.toString(block.chainid), "/");
string memory file = string.concat(outputFileName, ".json");
Expand Down
4 changes: 3 additions & 1 deletion contracts/src/IncredibleSquaringServiceManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ contract IncredibleSquaringServiceManager is ServiceManagerBase {
/// @notice Called in the event of challenge resolution, in order to forward a call to the Slasher, which 'freezes' the `operator`.
/// @dev The Slasher contract is under active development and its interface is expected to change.
/// We recommend writing slashing logic without integrating with the Slasher at this point in time.
function freezeOperator(address operatorAddr) external onlyIncredibleSquaringTaskManager {
function freezeOperator(
address operatorAddr
) external onlyIncredibleSquaringTaskManager {
// slasher.freezeOperator(operatorAddr);
}
}
16 changes: 12 additions & 4 deletions contracts/src/IncredibleSquaringTaskManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,15 @@ contract IncredibleSquaringTaskManager is
_setGenerator(_generator);
}

function setGenerator(address newGenerator) external onlyOwner {
function setGenerator(
address newGenerator
) external onlyOwner {
_setGenerator(newGenerator);
}

function setAggregator(address newAggregator) external onlyOwner {
function setAggregator(
address newAggregator
) external onlyOwner {
_setAggregator(newAggregator);
}

Expand Down Expand Up @@ -305,13 +309,17 @@ contract IncredibleSquaringTaskManager is
return TASK_RESPONSE_WINDOW_BLOCK;
}

function _setGenerator(address newGenerator) internal {
function _setGenerator(
address newGenerator
) internal {
address oldGenerator = generator;
generator = newGenerator;
emit GeneratorUpdated(oldGenerator, newGenerator);
}

function _setAggregator(address newAggregator) internal {
function _setAggregator(
address newAggregator
) internal {
address oldAggregator = aggregator;
aggregator = newAggregator;
emit AggregatorUpdated(oldAggregator, newAggregator);
Expand Down

0 comments on commit 622d28e

Please sign in to comment.