Skip to content

Commit 71cde60

Browse files
committed
tests..rs
1 parent b5adaa5 commit 71cde60

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

beacon_node/http_api/tests/tests.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ struct ApiTester {
7070
attester_slashing: AttesterSlashing<E>,
7171
proposer_slashing: ProposerSlashing,
7272
voluntary_exit: SignedVoluntaryExit,
73+
bls_to_execution_change: SignedBlsToExecutionChange,
7374
network_rx: NetworkReceivers<E>,
7475
local_enr: Enr,
7576
external_peer_id: PeerId,
@@ -223,6 +224,7 @@ impl ApiTester {
223224
let attester_slashing = harness.make_attester_slashing(vec![0, 1]);
224225
let proposer_slashing = harness.make_proposer_slashing(2);
225226
let voluntary_exit = harness.make_voluntary_exit(3, harness.chain.epoch().unwrap());
227+
let bls_to_execution_change = harness.make_bls_to_execution_change(4, Address::zero());
226228

227229
let chain = harness.chain.clone();
228230

@@ -289,6 +291,7 @@ impl ApiTester {
289291
attester_slashing,
290292
proposer_slashing,
291293
voluntary_exit,
294+
bls_to_execution_change,
292295
network_rx,
293296
local_enr,
294297
external_peer_id,
@@ -336,6 +339,7 @@ impl ApiTester {
336339
let attester_slashing = harness.make_attester_slashing(vec![0, 1]);
337340
let proposer_slashing = harness.make_proposer_slashing(2);
338341
let voluntary_exit = harness.make_voluntary_exit(3, harness.chain.epoch().unwrap());
342+
let bls_to_execution_change = harness.make_bls_to_execution_change(4, Address::zero());
339343

340344
let chain = harness.chain.clone();
341345

@@ -373,6 +377,7 @@ impl ApiTester {
373377
attester_slashing,
374378
proposer_slashing,
375379
voluntary_exit,
380+
bls_to_execution_change,
376381
network_rx,
377382
local_enr,
378383
external_peer_id,
@@ -5216,6 +5221,7 @@ impl ApiTester {
52165221
EventTopic::FinalizedCheckpoint,
52175222
EventTopic::AttesterSlashing,
52185223
EventTopic::ProposerSlashing,
5224+
EventTopic::BlsToExecutionChange,
52195225
];
52205226
let mut events_future = self
52215227
.client
@@ -5246,6 +5252,20 @@ impl ApiTester {
52465252
.as_slice()
52475253
);
52485254

5255+
// Produce a BLS to execution change event
5256+
self.client
5257+
.post_beacon_pool_bls_to_execution_changes(&[self.bls_to_execution_change.clone()])
5258+
.await
5259+
.unwrap();
5260+
5261+
let bls_events = poll_events(&mut events_future, 1, Duration::from_millis(10000)).await;
5262+
assert_eq!(
5263+
bls_events.as_slice(),
5264+
&[EventKind::BlsToExecutionChange(Box::new(
5265+
self.bls_to_execution_change.clone()
5266+
))]
5267+
);
5268+
52495269
// Produce a voluntary exit event
52505270
self.client
52515271
.post_beacon_pool_voluntary_exits(&self.voluntary_exit)

0 commit comments

Comments
 (0)