Skip to content

Commit 595a5b0

Browse files
authored
feat: GeneralDelayedPenaltyReported emits additional fine (#640)
## Description added fine amount to the event ## Checklist - [x] Appropriate PR labels applied - [x] Test coverage maintained (`just coverage`) - [ ] No need to add/update tests - [x] Tests are added/updated - [ ] Documentation maintained - [ ] No need to update - [ ] Updated
1 parent 89b3f3a commit 595a5b0

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/lib/GeneralPenaltyLib.sol

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface IGeneralPenalty {
1212
uint256 indexed nodeOperatorId,
1313
bytes32 indexed penaltyType,
1414
uint256 amount,
15+
uint256 additionalFine,
1516
string details
1617
);
1718
event GeneralDelayedPenaltyCancelled(
@@ -54,12 +55,13 @@ library GeneralPenalty {
5455

5556
accounting.lockBondETH(nodeOperatorId, totalAmount);
5657

57-
emit IGeneralPenalty.GeneralDelayedPenaltyReported(
58-
nodeOperatorId,
59-
penaltyType,
60-
amount,
61-
details
62-
);
58+
emit IGeneralPenalty.GeneralDelayedPenaltyReported({
59+
nodeOperatorId: nodeOperatorId,
60+
penaltyType: penaltyType,
61+
amount: amount,
62+
additionalFine: additionalFine,
63+
details: details
64+
});
6365

6466
module.updateDepositableValidatorsCount(nodeOperatorId);
6567
}

test/unit/ModuleAbstract.t.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5177,12 +5177,16 @@ abstract contract ModuleReportGeneralDelayedPenalty is ModuleFixtures {
51775177
{
51785178
uint256 noId = createNodeOperator();
51795179
uint256 nonce = module.getNonce();
5180+
uint256 fine = module
5181+
.PARAMETERS_REGISTRY()
5182+
.getGeneralDelayedPenaltyAdditionalFine(0);
51805183

51815184
vm.expectEmit(address(module));
51825185
emit IGeneralPenalty.GeneralDelayedPenaltyReported(
51835186
noId,
51845187
bytes32(abi.encode(1)),
51855188
BOND_SIZE / 2,
5189+
fine,
51865190
"Test penalty"
51875191
);
51885192
module.reportGeneralDelayedPenalty(

0 commit comments

Comments
 (0)