48
48
49
49
@ SuppressWarnings ("unchecked" )
50
50
public class OperationsReOrgManagerTest {
51
- private final Spec spec = TestSpecFactory .createDefault ();
51
+ private final Spec spec = TestSpecFactory .createMinimalCapella ();
52
52
private final DataStructureUtil dataStructureUtil = new DataStructureUtil (spec );
53
53
54
54
private final OperationPool <ProposerSlashing > proposerSlashingOperationPool =
@@ -59,6 +59,8 @@ public class OperationsReOrgManagerTest {
59
59
mock (SimpleOperationPool .class );
60
60
private final AggregatingAttestationPool attestationPool = mock (AggregatingAttestationPool .class );
61
61
private final AttestationManager attestationManager = mock (AttestationManager .class );
62
+ private final BlsToExecutionOperationPool blsToExecutionOperationPool =
63
+ mock (BlsToExecutionOperationPool .class );
62
64
63
65
private final RecentChainData recentChainData = mock (RecentChainData .class );
64
66
@@ -69,6 +71,7 @@ public class OperationsReOrgManagerTest {
69
71
exitOperationPool ,
70
72
attestationPool ,
71
73
attestationManager ,
74
+ blsToExecutionOperationPool ,
72
75
recentChainData );
73
76
74
77
@ Test
@@ -127,10 +130,14 @@ void shouldRequeueAndRemoveOperations() {
127
130
verify (proposerSlashingOperationPool ).addAll (fork1Block1 .getBody ().getProposerSlashings ());
128
131
verify (attesterSlashingOperationPool ).addAll (fork1Block1 .getBody ().getAttesterSlashings ());
129
132
verify (exitOperationPool ).addAll (fork1Block1 .getBody ().getVoluntaryExits ());
133
+ verify (blsToExecutionOperationPool )
134
+ .addAll (fork1Block1 .getBody ().getOptionalBlsToExecutionChanges ().orElseThrow ());
130
135
131
136
verify (proposerSlashingOperationPool ).addAll (fork1Block2 .getBody ().getProposerSlashings ());
132
137
verify (attesterSlashingOperationPool ).addAll (fork1Block2 .getBody ().getAttesterSlashings ());
133
138
verify (exitOperationPool ).addAll (fork1Block2 .getBody ().getVoluntaryExits ());
139
+ verify (blsToExecutionOperationPool )
140
+ .addAll (fork1Block2 .getBody ().getOptionalBlsToExecutionChanges ().orElseThrow ());
134
141
135
142
ArgumentCaptor <ValidateableAttestation > argument =
136
143
ArgumentCaptor .forClass (ValidateableAttestation .class );
@@ -155,13 +162,17 @@ void shouldRequeueAndRemoveOperations() {
155
162
verify (attestationPool )
156
163
.onAttestationsIncludedInBlock (
157
164
fork2Block1 .getSlot (), fork2Block1 .getBody ().getAttestations ());
165
+ verify (blsToExecutionOperationPool )
166
+ .removeAll (fork2Block1 .getBody ().getOptionalBlsToExecutionChanges ().orElseThrow ());
158
167
159
168
verify (proposerSlashingOperationPool ).removeAll (fork2Block2 .getBody ().getProposerSlashings ());
160
169
verify (attesterSlashingOperationPool ).removeAll (fork2Block2 .getBody ().getAttesterSlashings ());
161
170
verify (exitOperationPool ).removeAll (fork2Block2 .getBody ().getVoluntaryExits ());
162
171
verify (attestationPool )
163
172
.onAttestationsIncludedInBlock (
164
173
fork2Block2 .getSlot (), fork2Block2 .getBody ().getAttestations ());
174
+ verify (blsToExecutionOperationPool )
175
+ .removeAll (fork2Block2 .getBody ().getOptionalBlsToExecutionChanges ().orElseThrow ());
165
176
}
166
177
167
178
@ Test
@@ -206,17 +217,22 @@ void shouldOnlyRemoveOperations() {
206
217
verify (proposerSlashingOperationPool , never ()).addAll (any ());
207
218
verify (attesterSlashingOperationPool , never ()).addAll (any ());
208
219
verify (attestationManager , never ()).onAttestation (any ());
220
+ verify (blsToExecutionOperationPool , never ()).addAll (any ());
209
221
210
222
verify (proposerSlashingOperationPool ).removeAll (block2 .getBody ().getProposerSlashings ());
211
223
verify (attesterSlashingOperationPool ).removeAll (block2 .getBody ().getAttesterSlashings ());
212
224
verify (exitOperationPool ).removeAll (block2 .getBody ().getVoluntaryExits ());
213
225
verify (attestationPool )
214
226
.onAttestationsIncludedInBlock (block2 .getSlot (), block2 .getBody ().getAttestations ());
227
+ verify (blsToExecutionOperationPool )
228
+ .removeAll (block2 .getBody ().getOptionalBlsToExecutionChanges ().orElseThrow ());
215
229
216
230
verify (proposerSlashingOperationPool ).removeAll (block1 .getBody ().getProposerSlashings ());
217
231
verify (attesterSlashingOperationPool ).removeAll (block1 .getBody ().getAttesterSlashings ());
218
232
verify (exitOperationPool ).removeAll (block1 .getBody ().getVoluntaryExits ());
219
233
verify (attestationPool )
220
234
.onAttestationsIncludedInBlock (block1 .getSlot (), block1 .getBody ().getAttestations ());
235
+ verify (blsToExecutionOperationPool )
236
+ .removeAll (block1 .getBody ().getOptionalBlsToExecutionChanges ().orElseThrow ());
221
237
}
222
238
}
0 commit comments