mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-31 13:17:09 +00:00
Spec v1.7.0-alpha.6 and Gloas genesis (#9190)
Co-Authored-By: Josh King <josh@sigmaprime.io> Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com> Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -53,6 +53,15 @@ pub struct WithdrawalsPayload<E: EthSpec> {
|
||||
payload: Option<ExecutionPayload<E>>,
|
||||
}
|
||||
|
||||
/// Newtype for testing voluntary exit churn (Gloas+).
|
||||
///
|
||||
/// The test case applies the same `process_voluntary_exit` operation as the regular
|
||||
/// `voluntary_exit` test, but under the `voluntary_exit_churn` handler directory.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct VoluntaryExitChurn {
|
||||
exit: SignedVoluntaryExit,
|
||||
}
|
||||
|
||||
/// Newtype for testing execution payload bids.
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct ExecutionPayloadBidBlock<E: EthSpec> {
|
||||
@@ -265,6 +274,40 @@ impl<E: EthSpec> Operation<E> for SignedVoluntaryExit {
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: EthSpec> Operation<E> for VoluntaryExitChurn {
|
||||
type Error = BlockProcessingError;
|
||||
|
||||
fn handler_name() -> String {
|
||||
"voluntary_exit_churn".into()
|
||||
}
|
||||
|
||||
fn filename() -> String {
|
||||
"voluntary_exit.ssz_snappy".into()
|
||||
}
|
||||
|
||||
fn is_enabled_for_fork(fork_name: ForkName) -> bool {
|
||||
fork_name.gloas_enabled()
|
||||
}
|
||||
|
||||
fn decode(path: &Path, _fork_name: ForkName, _spec: &ChainSpec) -> Result<Self, Error> {
|
||||
ssz_decode_file(path).map(|exit| VoluntaryExitChurn { exit })
|
||||
}
|
||||
|
||||
fn apply_to(
|
||||
&self,
|
||||
state: &mut BeaconState<E>,
|
||||
spec: &ChainSpec,
|
||||
_: &Operations<E, Self>,
|
||||
) -> Result<(), BlockProcessingError> {
|
||||
process_exits(
|
||||
state,
|
||||
std::slice::from_ref(&self.exit),
|
||||
VerifySignatures::True,
|
||||
spec,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: EthSpec> Operation<E> for BeaconBlock<E> {
|
||||
type Error = BlockProcessingError;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user