Proto: minor refactoring for double (pre)attesting application
What
Minor refactoring in apply.ml
Why
Just like !16167 (merged), this change was originally part of !15244 (merged) as the addition of a new consensus operation (Attestations_aggregate) added nondesirable case in some pattern matchings. To facilitate the review process, this part has been split into this separate MR.
In the previous implementation, the function punish_double_attestation_or_preattestation took a 'kind Kind.consensus operation as a parameter that is not relevant for attestations_aggregate. The function was was also kind of hard to read and follow.
How
punish_double_attestation_or_preattestation is now splitted into punish_double_attestation and punish_double_preattestation.
Manually testing the MR
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Adam