mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 17:26:04 +00:00
tests..rs
This commit is contained in:
@@ -70,6 +70,7 @@ struct ApiTester {
|
|||||||
attester_slashing: AttesterSlashing<E>,
|
attester_slashing: AttesterSlashing<E>,
|
||||||
proposer_slashing: ProposerSlashing,
|
proposer_slashing: ProposerSlashing,
|
||||||
voluntary_exit: SignedVoluntaryExit,
|
voluntary_exit: SignedVoluntaryExit,
|
||||||
|
bls_to_execution_change: SignedBlsToExecutionChange,
|
||||||
network_rx: NetworkReceivers<E>,
|
network_rx: NetworkReceivers<E>,
|
||||||
local_enr: Enr,
|
local_enr: Enr,
|
||||||
external_peer_id: PeerId,
|
external_peer_id: PeerId,
|
||||||
@@ -223,6 +224,7 @@ impl ApiTester {
|
|||||||
let attester_slashing = harness.make_attester_slashing(vec![0, 1]);
|
let attester_slashing = harness.make_attester_slashing(vec![0, 1]);
|
||||||
let proposer_slashing = harness.make_proposer_slashing(2);
|
let proposer_slashing = harness.make_proposer_slashing(2);
|
||||||
let voluntary_exit = harness.make_voluntary_exit(3, harness.chain.epoch().unwrap());
|
let voluntary_exit = harness.make_voluntary_exit(3, harness.chain.epoch().unwrap());
|
||||||
|
let bls_to_execution_change = harness.make_bls_to_execution_change(4, Address::zero());
|
||||||
|
|
||||||
let chain = harness.chain.clone();
|
let chain = harness.chain.clone();
|
||||||
|
|
||||||
@@ -289,6 +291,7 @@ impl ApiTester {
|
|||||||
attester_slashing,
|
attester_slashing,
|
||||||
proposer_slashing,
|
proposer_slashing,
|
||||||
voluntary_exit,
|
voluntary_exit,
|
||||||
|
bls_to_execution_change,
|
||||||
network_rx,
|
network_rx,
|
||||||
local_enr,
|
local_enr,
|
||||||
external_peer_id,
|
external_peer_id,
|
||||||
@@ -336,6 +339,7 @@ impl ApiTester {
|
|||||||
let attester_slashing = harness.make_attester_slashing(vec![0, 1]);
|
let attester_slashing = harness.make_attester_slashing(vec![0, 1]);
|
||||||
let proposer_slashing = harness.make_proposer_slashing(2);
|
let proposer_slashing = harness.make_proposer_slashing(2);
|
||||||
let voluntary_exit = harness.make_voluntary_exit(3, harness.chain.epoch().unwrap());
|
let voluntary_exit = harness.make_voluntary_exit(3, harness.chain.epoch().unwrap());
|
||||||
|
let bls_to_execution_change = harness.make_bls_to_execution_change(4, Address::zero());
|
||||||
|
|
||||||
let chain = harness.chain.clone();
|
let chain = harness.chain.clone();
|
||||||
|
|
||||||
@@ -373,6 +377,7 @@ impl ApiTester {
|
|||||||
attester_slashing,
|
attester_slashing,
|
||||||
proposer_slashing,
|
proposer_slashing,
|
||||||
voluntary_exit,
|
voluntary_exit,
|
||||||
|
bls_to_execution_change,
|
||||||
network_rx,
|
network_rx,
|
||||||
local_enr,
|
local_enr,
|
||||||
external_peer_id,
|
external_peer_id,
|
||||||
@@ -5216,6 +5221,7 @@ impl ApiTester {
|
|||||||
EventTopic::FinalizedCheckpoint,
|
EventTopic::FinalizedCheckpoint,
|
||||||
EventTopic::AttesterSlashing,
|
EventTopic::AttesterSlashing,
|
||||||
EventTopic::ProposerSlashing,
|
EventTopic::ProposerSlashing,
|
||||||
|
EventTopic::BlsToExecutionChange,
|
||||||
];
|
];
|
||||||
let mut events_future = self
|
let mut events_future = self
|
||||||
.client
|
.client
|
||||||
@@ -5246,6 +5252,20 @@ impl ApiTester {
|
|||||||
.as_slice()
|
.as_slice()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Produce a BLS to execution change event
|
||||||
|
self.client
|
||||||
|
.post_beacon_pool_bls_to_execution_changes(&[self.bls_to_execution_change.clone()])
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
let bls_events = poll_events(&mut events_future, 1, Duration::from_millis(10000)).await;
|
||||||
|
assert_eq!(
|
||||||
|
bls_events.as_slice(),
|
||||||
|
&[EventKind::BlsToExecutionChange(Box::new(
|
||||||
|
self.bls_to_execution_change.clone()
|
||||||
|
))]
|
||||||
|
);
|
||||||
|
|
||||||
// Produce a voluntary exit event
|
// Produce a voluntary exit event
|
||||||
self.client
|
self.client
|
||||||
.post_beacon_pool_voluntary_exits(&self.voluntary_exit)
|
.post_beacon_pool_voluntary_exits(&self.voluntary_exit)
|
||||||
|
|||||||
Reference in New Issue
Block a user