Skip to content

Commit

Permalink
Fix formatting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
theref committed May 15, 2024
1 parent 073c711 commit daeb79e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
17 changes: 13 additions & 4 deletions contracts/contracts/coordination/InfractionCollector.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,25 @@ contract InfractionCollector is OwnableUpgradeable {
// Mapping to keep track of reported infractions
mapping(bytes32 => mapping(address => bool)) private infractions;

function initialize(Coordinator _coordinator, TACoChildApplication _tacoChildApplication) public initializer {
function initialize(
Coordinator _coordinator,
TACoChildApplication _tacoChildApplication
) public initializer {
__Ownable_init();

coordinator = _coordinator;
tacoChildApplication = _tacoChildApplication;
}

function reportMissingTranscript(bytes32 ritualId, address[] calldata stakingProviders) external {
function reportMissingTranscript(
bytes32 ritualId,
address[] calldata stakingProviders
) external {
// Ritual must have failed
require(coordinator.getRitualState(ritualId) == Coordinator.RitualState.DKG_TIMEOUT, "Ritual must have failed");
require(
coordinator.getRitualState(ritualId) == Coordinator.RitualState.DKG_TIMEOUT,
"Ritual must have failed"
);

for (uint256 i = 0; i < stakingProviders.length; i++) {
// Check if the infraction has already been reported
Expand All @@ -37,4 +46,4 @@ contract InfractionCollector is OwnableUpgradeable {
}
}
}
}
}
10 changes: 8 additions & 2 deletions contracts/contracts/coordination/TACoChildApplication.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ contract TACoChildApplication is ITACoRootToChild, ITACoChildApplication, Initia
* @notice Initialize function for using with OpenZeppelin proxy
*/
function initialize(address _coordinator, address _infractionCollector) external initializer {
require(coordinator == address(0) || infractionCollector == address(0), "Contracts already set");
require(
coordinator == address(0) || infractionCollector == address(0),
"Contracts already set"
);
require(
_coordinator != address(0) && _infractionCollector != address(0),
"Contracts must be specified"
Expand Down Expand Up @@ -200,7 +203,10 @@ contract TACoChildApplication is ITACoRootToChild, ITACoChildApplication, Initia
* @param _stakingProvider Staking provider address
*/
function penalize(address _stakingProvider) external override {
require(msg.sender == address(_infractionCollector), "Only infractionCollector allowed to penalize");
require(
msg.sender == address(_infractionCollector),
"Only infractionCollector allowed to penalize"
);
rootApplication.penalize(_stakingProvider);
emit Penalized(_stakingProvider);
}
Expand Down

0 comments on commit daeb79e

Please sign in to comment.