Skip to content

Commit 4cd7ff4

Browse files
committed
style: Forge format applied.
1 parent d6e82da commit 4cd7ff4

File tree

12 files changed

+203
-234
lines changed

12 files changed

+203
-234
lines changed

src/TransactionManager.sol

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@ contract TransactionManager is ITransactionManager, ReentrancyGuard {
115115
* @return blockNumber Block number when submitted
116116
* @return status Current proposal status
117117
*/
118-
function getProposal(
119-
bytes32 proposalId
120-
)
118+
function getProposal(bytes32 proposalId)
121119
external
122120
view
123121
returns (string memory transaction, address proposer, uint256 blockNumber, IConsensus.ProposalStatus status)

src/consensus/DisputeManager.sol

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ contract DisputeManager is ReentrancyGuard {
1818
Disputed, // Challenge initiated, voting in progress
1919
Upheld, // Dispute resolved - original decision upheld
2020
Overturned // Dispute resolved - original decision overturned
21+
2122
}
2223

2324
// ==================== EVENTS ====================
@@ -158,12 +159,11 @@ contract DisputeManager is ReentrancyGuard {
158159
* @param support Whether the vote supports upholding (true) or overturning (false) the proposal
159160
* @param signature ECDSA signature proving the vote came from the validator
160161
*/
161-
function submitVote(
162-
bytes32 proposalId,
163-
address voter,
164-
bool support,
165-
bytes calldata signature
166-
) external onlyConsensusContract onlyValidDispute(proposalId) {
162+
function submitVote(bytes32 proposalId, address voter, bool support, bytes calldata signature)
163+
external
164+
onlyConsensusContract
165+
onlyValidDispute(proposalId)
166+
{
167167
DisputeData storage dispute = disputeData[proposalId];
168168
if (dispute.state != DisputeState.Disputed) revert InvalidState();
169169
if (block.number > dispute.deadline) revert VotingPeriodExpired();
@@ -188,9 +188,12 @@ contract DisputeManager is ReentrancyGuard {
188188
* @param proposalId The unique identifier of the disputed proposal
189189
* @return upheld Whether the original decision was upheld
190190
*/
191-
function resolveDispute(
192-
bytes32 proposalId
193-
) external onlyConsensusContract onlyValidDispute(proposalId) returns (bool upheld) {
191+
function resolveDispute(bytes32 proposalId)
192+
external
193+
onlyConsensusContract
194+
onlyValidDispute(proposalId)
195+
returns (bool upheld)
196+
{
194197
return _resolveDispute(proposalId);
195198
}
196199

@@ -213,9 +216,11 @@ contract DisputeManager is ReentrancyGuard {
213216
* @return yesVotes Number of votes to uphold
214217
* @return noVotes Number of votes to overturn
215218
*/
216-
function getFullDisputeState(
217-
bytes32 proposalId
218-
) external view returns (DisputeState state, uint256 deadline, uint256 yesVotes, uint256 noVotes) {
219+
function getFullDisputeState(bytes32 proposalId)
220+
external
221+
view
222+
returns (DisputeState state, uint256 deadline, uint256 yesVotes, uint256 noVotes)
223+
{
219224
DisputeData memory dispute = disputeData[proposalId];
220225
VoteData memory votes = voteData[proposalId];
221226

@@ -231,9 +236,7 @@ contract DisputeManager is ReentrancyGuard {
231236
DisputeData memory dispute = disputeData[proposalId];
232237
// Safer enum comparison - check if dispute is in disputing state and deadline not passed
233238
return
234-
dispute.initialized &&
235-
_isDisputeInState(dispute, DisputeState.Disputed) &&
236-
block.number <= dispute.deadline;
239+
dispute.initialized && _isDisputeInState(dispute, DisputeState.Disputed) && block.number <= dispute.deadline;
237240
}
238241

239242
/**
@@ -245,9 +248,7 @@ contract DisputeManager is ReentrancyGuard {
245248
DisputeData memory dispute = disputeData[proposalId];
246249
// Safer enum comparison - check if dispute is in disputing state and deadline not passed
247250
return
248-
dispute.initialized &&
249-
_isDisputeInState(dispute, DisputeState.Disputed) &&
250-
block.number <= dispute.deadline;
251+
dispute.initialized && _isDisputeInState(dispute, DisputeState.Disputed) && block.number <= dispute.deadline;
251252
}
252253

253254
/**
@@ -297,10 +298,11 @@ contract DisputeManager is ReentrancyGuard {
297298
* @return hasVoted Whether the validator has voted
298299
* @return support The validator's vote (true = uphold, false = overturn)
299300
*/
300-
function getValidatorVote(
301-
bytes32 proposalId,
302-
address validator
303-
) external view returns (bool hasVoted, bool support) {
301+
function getValidatorVote(bytes32 proposalId, address validator)
302+
external
303+
view
304+
returns (bool hasVoted, bool support)
305+
{
304306
try this.getValidatorIndexExternal(proposalId, validator) returns (uint8 index) {
305307
uint8 votersBitmap = voteData[proposalId].votersBitmap;
306308
uint8 votesBitmap = voteData[proposalId].votesBitmap;
@@ -451,10 +453,9 @@ contract DisputeManager is ReentrancyGuard {
451453
* @return The hash that should be signed by the validator
452454
*/
453455
function _getVoteHash(bytes32 proposalId, bool support) internal pure returns (bytes32) {
454-
return
455-
keccak256(
456-
abi.encodePacked("\x19Ethereum Signed Message:\n32", keccak256(abi.encodePacked(proposalId, support)))
457-
);
456+
return keccak256(
457+
abi.encodePacked("\x19Ethereum Signed Message:\n32", keccak256(abi.encodePacked(proposalId, support)))
458+
);
458459
}
459460

460461
/**

0 commit comments

Comments
 (0)