Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ where
pub fn inclusion_list_signature_set<'a, E, F>(
state: &'a BeaconState<E>,
get_pubkey: F,
signed_inclusion_list: &'a SignedInclusionList<E>,
signed_inclusion_list: &'a SignedInclusionList,
spec: &'a ChainSpec,
) -> Result<SignatureSet<'a>>
where
Expand Down Expand Up @@ -877,7 +877,7 @@ mod inclusion_list_signature_tests {
let spec = harness.spec.clone();
let validator_index = 3usize;

let message = InclusionList::<E> {
let message = InclusionList {
slot: state.slot(),
validator_index: validator_index as u64,
dependent_root: Hash256::ZERO,
Expand Down Expand Up @@ -913,7 +913,7 @@ mod inclusion_list_signature_tests {
let claimed_index = 3usize;
let signer_index = 4usize;

let message = InclusionList::<E> {
let message = InclusionList {
slot: state.slot(),
validator_index: claimed_index as u64,
dependent_root: Hash256::ZERO,
Expand Down
21 changes: 7 additions & 14 deletions consensus/types/src/execution/inclusion_list.rs
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
use crate::{EthSpec, ForkName, Hash256, SignedRoot, Slot, Transactions};
use crate::{ForkName, Hash256, ProgressiveTransactions, SignedRoot, Slot};
use context_deserialize::context_deserialize;
use educe::Educe;
use serde::{Deserialize, Serialize};
use ssz_derive::{Decode, Encode};
use tree_hash_derive::TreeHash;

#[derive(Default, Debug, Clone, Serialize, Encode, Decode, Deserialize, TreeHash, Educe)]
#[cfg_attr(
feature = "arbitrary",
derive(arbitrary::Arbitrary),
arbitrary(bound = "E: EthSpec")
)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[educe(PartialEq, Hash)]
#[serde(bound = "E: EthSpec")]
#[context_deserialize(ForkName)]
pub struct InclusionList<E: EthSpec> {
pub struct InclusionList {
pub slot: Slot,
#[serde(with = "serde_utils::quoted_u64")]
pub validator_index: u64,
pub dependent_root: Hash256,
// TODO(heze): switch to using `ProgressiveList` once the support for EIP-7916 is added.
#[serde(with = "ssz_types::serde_utils::list_of_hex_var_list")]
pub transactions: Transactions<E>,
#[serde(with = "ssz_types::serde_utils::prog_list_of_hex_prog_var_list")]
pub transactions: ProgressiveTransactions,
}

impl<E: EthSpec> SignedRoot for InclusionList<E> {}
impl SignedRoot for InclusionList {}

#[cfg(test)]
mod tests {
use super::*;
use crate::MainnetEthSpec;

ssz_and_tree_hash_tests!(InclusionList<MainnetEthSpec>);
ssz_and_tree_hash_tests!(InclusionList);
}
16 changes: 5 additions & 11 deletions consensus/types/src/execution/signed_inclusion_list.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::ForkName;
use crate::execution::InclusionList;
use crate::{EthSpec, ForkName};
use bls::Signature;
use context_deserialize::context_deserialize;
use educe::Educe;
Expand All @@ -8,23 +8,17 @@ use ssz_derive::{Decode, Encode};
use tree_hash_derive::TreeHash;

#[derive(TreeHash, Debug, Clone, Encode, Decode, Serialize, Deserialize, Educe)]
#[cfg_attr(
feature = "arbitrary",
derive(arbitrary::Arbitrary),
arbitrary(bound = "E: EthSpec")
)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[educe(PartialEq, Hash)]
#[serde(bound = "E: EthSpec")]
#[context_deserialize(ForkName)]
pub struct SignedInclusionList<E: EthSpec> {
pub message: InclusionList<E>,
pub struct SignedInclusionList {
pub message: InclusionList,
pub signature: Signature,
}

#[cfg(test)]
mod tests {
use super::*;
use crate::MainnetEthSpec;

ssz_and_tree_hash_tests!(SignedInclusionList<MainnetEthSpec>);
ssz_and_tree_hash_tests!(SignedInclusionList);
}
Loading