mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-23 23:04:53 +00:00
superstruct the AttesterSlashing (#5636)
* `superstruct` Attester Fork Variants * Push a little further * Deal with Encode / Decode of AttesterSlashing * not so sure about this.. * Stop Encode/Decode Bounds from Propagating Out * Tons of Changes.. * More Conversions to AttestationRef * Add AsReference trait (#15) * Add AsReference trait * Fix some snafus * Got it Compiling! :D * Got Tests Building * Get beacon chain tests compiling --------- Co-authored-by: Michael Sproul <micsproul@gmail.com>
This commit is contained in:
@@ -1191,9 +1191,17 @@ async fn attesting_to_optimistic_head() {
|
||||
.produce_unaggregated_attestation(Slot::new(0), 0)
|
||||
.unwrap();
|
||||
|
||||
attestation.aggregation_bits.set(0, true).unwrap();
|
||||
attestation.data.slot = slot;
|
||||
attestation.data.beacon_block_root = root;
|
||||
match &mut attestation {
|
||||
Attestation::Base(ref mut att) => {
|
||||
att.aggregation_bits.set(0, true).unwrap();
|
||||
}
|
||||
Attestation::Electra(ref mut att) => {
|
||||
att.aggregation_bits.set(0, true).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
attestation.data_mut().slot = slot;
|
||||
attestation.data_mut().beacon_block_root = root;
|
||||
|
||||
rig.harness
|
||||
.chain
|
||||
@@ -1214,15 +1222,15 @@ async fn attesting_to_optimistic_head() {
|
||||
let get_aggregated = || {
|
||||
rig.harness
|
||||
.chain
|
||||
.get_aggregated_attestation(&attestation.data)
|
||||
.get_aggregated_attestation(attestation.data())
|
||||
};
|
||||
|
||||
let get_aggregated_by_slot_and_root = || {
|
||||
rig.harness
|
||||
.chain
|
||||
.get_aggregated_attestation_by_slot_and_root(
|
||||
attestation.data.slot,
|
||||
&attestation.data.tree_hash_root(),
|
||||
attestation.data().slot,
|
||||
&attestation.data().tree_hash_root(),
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user