mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 02:12:33 +00:00
Fetch and sign payload envelope
This commit is contained in:
@@ -403,9 +403,9 @@ pub fn get_validator_execution_payload_envelope<T: BeaconChainTypes>(
|
||||
.and(chain_filter)
|
||||
.then(
|
||||
|slot: Slot,
|
||||
// TODO(gloas) we're only doing local building
|
||||
// we'll need to implement builder index logic
|
||||
// eventually.
|
||||
// TODO(gloas) we're only doing local building
|
||||
// we'll need to implement builder index logic
|
||||
// eventually.
|
||||
_builder_index: u64,
|
||||
accept_header: Option<Accept>,
|
||||
not_synced_filter: Result<(), Rejection>,
|
||||
|
||||
@@ -3978,8 +3978,26 @@ impl ApiTester {
|
||||
.unwrap();
|
||||
|
||||
let envelope = envelope_response.data;
|
||||
assert_eq!(envelope.beacon_block_root, block_root);
|
||||
assert_eq!(envelope.slot, slot);
|
||||
|
||||
// Verify envelope fields match the produced block
|
||||
assert_eq!(
|
||||
envelope.beacon_block_root, block_root,
|
||||
"Envelope beacon_block_root should match the produced block's root"
|
||||
);
|
||||
assert_eq!(
|
||||
envelope.slot, slot,
|
||||
"Envelope slot should match the block's slot"
|
||||
);
|
||||
assert_eq!(
|
||||
envelope.builder_index,
|
||||
u64::MAX,
|
||||
"Builder index should be u64::MAX for local building"
|
||||
);
|
||||
assert_ne!(
|
||||
envelope.state_root,
|
||||
Hash256::ZERO,
|
||||
"State root should not be zero"
|
||||
);
|
||||
|
||||
self.chain.slot_clock.set_slot(slot.as_u64() + 1);
|
||||
}
|
||||
@@ -4054,8 +4072,25 @@ impl ApiTester {
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(envelope.beacon_block_root, block_root);
|
||||
assert_eq!(envelope.slot, slot);
|
||||
// Verify envelope fields match the produced block
|
||||
assert_eq!(
|
||||
envelope.beacon_block_root, block_root,
|
||||
"Envelope beacon_block_root should match the produced block's root"
|
||||
);
|
||||
assert_eq!(
|
||||
envelope.slot, slot,
|
||||
"Envelope slot should match the block's slot"
|
||||
);
|
||||
assert_eq!(
|
||||
envelope.builder_index,
|
||||
u64::MAX,
|
||||
"Builder index should be u64::MAX for local building"
|
||||
);
|
||||
assert_ne!(
|
||||
envelope.state_root,
|
||||
Hash256::ZERO,
|
||||
"State root should not be zero"
|
||||
);
|
||||
|
||||
self.chain.slot_clock.set_slot(slot.as_u64() + 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user