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:
ethDreamer
2024-05-02 18:00:21 -05:00
committed by GitHub
parent 3b7132bc0d
commit e6c7f145dd
53 changed files with 1405 additions and 437 deletions

View File

@@ -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(),
)
};