mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +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:
@@ -1633,7 +1633,13 @@ impl ApiTester {
|
||||
|
||||
let expected = block_id.full_block(&self.chain).await.ok().map(
|
||||
|(block, _execution_optimistic, _finalized)| {
|
||||
block.message().body().attestations().clone().into()
|
||||
block
|
||||
.message()
|
||||
.body()
|
||||
.attestations()
|
||||
.map(|att| att.clone_as_attestation())
|
||||
.collect::<Vec<_>>()
|
||||
.into()
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1793,7 +1799,14 @@ impl ApiTester {
|
||||
|
||||
pub async fn test_post_beacon_pool_attester_slashings_invalid(mut self) -> Self {
|
||||
let mut slashing = self.attester_slashing.clone();
|
||||
slashing.attestation_1.data_mut().slot += 1;
|
||||
match &mut slashing {
|
||||
AttesterSlashing::Base(ref mut slashing) => {
|
||||
slashing.attestation_1.data.slot += 1;
|
||||
}
|
||||
AttesterSlashing::Electra(ref mut slashing) => {
|
||||
slashing.attestation_1.data.slot += 1;
|
||||
}
|
||||
}
|
||||
|
||||
self.client
|
||||
.post_beacon_pool_attester_slashings(&slashing)
|
||||
@@ -3183,8 +3196,10 @@ impl ApiTester {
|
||||
.head_beacon_block()
|
||||
.message()
|
||||
.body()
|
||||
.attestations()[0]
|
||||
.clone();
|
||||
.attestations()
|
||||
.next()
|
||||
.unwrap()
|
||||
.clone_as_attestation();
|
||||
|
||||
let result = self
|
||||
.client
|
||||
|
||||
Reference in New Issue
Block a user