mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 18:21:45 +00:00
Proposer and attester slashing sse events (#5327)
* default vc to block v3 endpoint and deprecate block-v3 flag * Merge branch 'unstable' of https://github.com/sigp/lighthouse into unstable * add proposer and attester event variants * add TOOOs * add tests, event triggers * Merge branch 'unstable' of https://github.com/sigp/lighthouse into proposer-and-attester-slashing-sse-events * revert * revert * remove double event tracking * Merge branch 'unstable' into proposer-and-attester-slashing-sse-events * remove todo, fix test * resolve merge conflicts * Merge branch 'proposer-and-attester-slashing-sse-events' of https://github.com/eserilev/lighthouse into proposer-and-attester-slashing-sse-events * leftover debugging * Merge branch 'unstable' of https://github.com/sigp/lighthouse into proposer-and-attester-slashing-sse-events * Merge branch 'unstable' of https://github.com/sigp/lighthouse into proposer-and-attester-slashing-sse-events
This commit is contained in:
@@ -5214,6 +5214,8 @@ impl ApiTester {
|
||||
EventTopic::Block,
|
||||
EventTopic::Head,
|
||||
EventTopic::FinalizedCheckpoint,
|
||||
EventTopic::AttesterSlashing,
|
||||
EventTopic::ProposerSlashing,
|
||||
];
|
||||
let mut events_future = self
|
||||
.client
|
||||
@@ -5353,6 +5355,42 @@ impl ApiTester {
|
||||
.await;
|
||||
assert_eq!(reorg_event.as_slice(), &[expected_reorg]);
|
||||
|
||||
// Test attester slashing event
|
||||
let mut attester_slashing_event_future = self
|
||||
.client
|
||||
.get_events::<E>(&[EventTopic::AttesterSlashing])
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
self.harness.add_attester_slashing(vec![1, 2, 3]).unwrap();
|
||||
|
||||
let attester_slashing_event = poll_events(
|
||||
&mut attester_slashing_event_future,
|
||||
1,
|
||||
Duration::from_millis(10000),
|
||||
)
|
||||
.await;
|
||||
|
||||
assert!(attester_slashing_event.len() == 1);
|
||||
|
||||
// Test proposer slashing event
|
||||
let mut proposer_slashing_event_future = self
|
||||
.client
|
||||
.get_events::<E>(&[EventTopic::ProposerSlashing])
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
self.harness.add_proposer_slashing(1).unwrap();
|
||||
|
||||
let proposer_slashing_event = poll_events(
|
||||
&mut proposer_slashing_event_future,
|
||||
1,
|
||||
Duration::from_millis(10000),
|
||||
)
|
||||
.await;
|
||||
|
||||
assert!(proposer_slashing_event.len() == 1);
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user