4848
4949@ SuppressWarnings ("unchecked" )
5050public class OperationsReOrgManagerTest {
51- private final Spec spec = TestSpecFactory .createDefault ();
51+ private final Spec spec = TestSpecFactory .createMinimalCapella ();
5252 private final DataStructureUtil dataStructureUtil = new DataStructureUtil (spec );
5353
5454 private final OperationPool <ProposerSlashing > proposerSlashingOperationPool =
@@ -59,6 +59,8 @@ public class OperationsReOrgManagerTest {
5959 mock (SimpleOperationPool .class );
6060 private final AggregatingAttestationPool attestationPool = mock (AggregatingAttestationPool .class );
6161 private final AttestationManager attestationManager = mock (AttestationManager .class );
62+ private final BlsToExecutionOperationPool blsToExecutionOperationPool =
63+ mock (BlsToExecutionOperationPool .class );
6264
6365 private final RecentChainData recentChainData = mock (RecentChainData .class );
6466
@@ -69,6 +71,7 @@ public class OperationsReOrgManagerTest {
6971 exitOperationPool ,
7072 attestationPool ,
7173 attestationManager ,
74+ blsToExecutionOperationPool ,
7275 recentChainData );
7376
7477 @ Test
@@ -127,10 +130,14 @@ void shouldRequeueAndRemoveOperations() {
127130 verify (proposerSlashingOperationPool ).addAll (fork1Block1 .getBody ().getProposerSlashings ());
128131 verify (attesterSlashingOperationPool ).addAll (fork1Block1 .getBody ().getAttesterSlashings ());
129132 verify (exitOperationPool ).addAll (fork1Block1 .getBody ().getVoluntaryExits ());
133+ verify (blsToExecutionOperationPool )
134+ .addAll (fork1Block1 .getBody ().getOptionalBlsToExecutionChanges ().orElseThrow ());
130135
131136 verify (proposerSlashingOperationPool ).addAll (fork1Block2 .getBody ().getProposerSlashings ());
132137 verify (attesterSlashingOperationPool ).addAll (fork1Block2 .getBody ().getAttesterSlashings ());
133138 verify (exitOperationPool ).addAll (fork1Block2 .getBody ().getVoluntaryExits ());
139+ verify (blsToExecutionOperationPool )
140+ .addAll (fork1Block2 .getBody ().getOptionalBlsToExecutionChanges ().orElseThrow ());
134141
135142 ArgumentCaptor <ValidateableAttestation > argument =
136143 ArgumentCaptor .forClass (ValidateableAttestation .class );
@@ -155,13 +162,17 @@ void shouldRequeueAndRemoveOperations() {
155162 verify (attestationPool )
156163 .onAttestationsIncludedInBlock (
157164 fork2Block1 .getSlot (), fork2Block1 .getBody ().getAttestations ());
165+ verify (blsToExecutionOperationPool )
166+ .removeAll (fork2Block1 .getBody ().getOptionalBlsToExecutionChanges ().orElseThrow ());
158167
159168 verify (proposerSlashingOperationPool ).removeAll (fork2Block2 .getBody ().getProposerSlashings ());
160169 verify (attesterSlashingOperationPool ).removeAll (fork2Block2 .getBody ().getAttesterSlashings ());
161170 verify (exitOperationPool ).removeAll (fork2Block2 .getBody ().getVoluntaryExits ());
162171 verify (attestationPool )
163172 .onAttestationsIncludedInBlock (
164173 fork2Block2 .getSlot (), fork2Block2 .getBody ().getAttestations ());
174+ verify (blsToExecutionOperationPool )
175+ .removeAll (fork2Block2 .getBody ().getOptionalBlsToExecutionChanges ().orElseThrow ());
165176 }
166177
167178 @ Test
@@ -206,17 +217,22 @@ void shouldOnlyRemoveOperations() {
206217 verify (proposerSlashingOperationPool , never ()).addAll (any ());
207218 verify (attesterSlashingOperationPool , never ()).addAll (any ());
208219 verify (attestationManager , never ()).onAttestation (any ());
220+ verify (blsToExecutionOperationPool , never ()).addAll (any ());
209221
210222 verify (proposerSlashingOperationPool ).removeAll (block2 .getBody ().getProposerSlashings ());
211223 verify (attesterSlashingOperationPool ).removeAll (block2 .getBody ().getAttesterSlashings ());
212224 verify (exitOperationPool ).removeAll (block2 .getBody ().getVoluntaryExits ());
213225 verify (attestationPool )
214226 .onAttestationsIncludedInBlock (block2 .getSlot (), block2 .getBody ().getAttestations ());
227+ verify (blsToExecutionOperationPool )
228+ .removeAll (block2 .getBody ().getOptionalBlsToExecutionChanges ().orElseThrow ());
215229
216230 verify (proposerSlashingOperationPool ).removeAll (block1 .getBody ().getProposerSlashings ());
217231 verify (attesterSlashingOperationPool ).removeAll (block1 .getBody ().getAttesterSlashings ());
218232 verify (exitOperationPool ).removeAll (block1 .getBody ().getVoluntaryExits ());
219233 verify (attestationPool )
220234 .onAttestationsIncludedInBlock (block1 .getSlot (), block1 .getBody ().getAttestations ());
235+ verify (blsToExecutionOperationPool )
236+ .removeAll (block1 .getBody ().getOptionalBlsToExecutionChanges ().orElseThrow ());
221237 }
222238}
0 commit comments