mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-19 21:04:41 +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:
@@ -93,7 +93,7 @@ impl<E: EthSpec> Operation<E> for Attestation<E> {
|
||||
match state {
|
||||
BeaconState::Base(_) => base::process_attestations(
|
||||
state,
|
||||
&[self.clone()],
|
||||
[self.clone().to_ref()].into_iter(),
|
||||
VerifySignatures::True,
|
||||
&mut ctxt,
|
||||
spec,
|
||||
@@ -106,7 +106,7 @@ impl<E: EthSpec> Operation<E> for Attestation<E> {
|
||||
initialize_progressive_balances_cache(state, spec)?;
|
||||
altair_deneb::process_attestation(
|
||||
state,
|
||||
self,
|
||||
self.to_ref(),
|
||||
0,
|
||||
&mut ctxt,
|
||||
VerifySignatures::True,
|
||||
@@ -123,7 +123,7 @@ impl<E: EthSpec> Operation<E> for AttesterSlashing<E> {
|
||||
}
|
||||
|
||||
fn decode(path: &Path, _fork_name: ForkName, _spec: &ChainSpec) -> Result<Self, Error> {
|
||||
ssz_decode_file(path)
|
||||
Ok(Self::Base(ssz_decode_file(path)?))
|
||||
}
|
||||
|
||||
fn apply_to(
|
||||
@@ -136,7 +136,7 @@ impl<E: EthSpec> Operation<E> for AttesterSlashing<E> {
|
||||
initialize_progressive_balances_cache(state, spec)?;
|
||||
process_attester_slashings(
|
||||
state,
|
||||
&[self.clone()],
|
||||
[self.clone().to_ref()].into_iter(),
|
||||
VerifySignatures::True,
|
||||
&mut ctxt,
|
||||
spec,
|
||||
|
||||
Reference in New Issue
Block a user