diff --git a/eth2/types/src/attestation_data/mod.rs b/eth2/types/src/attestation_data.rs similarity index 93% rename from eth2/types/src/attestation_data/mod.rs rename to eth2/types/src/attestation_data.rs index 28504127e..d509f6b3d 100644 --- a/eth2/types/src/attestation_data/mod.rs +++ b/eth2/types/src/attestation_data.rs @@ -1,11 +1,8 @@ -use super::Hash256; +use super::{AttestationDataAndCustodyBit, Hash256}; use crate::test_utils::TestRandom; use rand::RngCore; use serde_derive::Serialize; use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash}; -use std::hash::Hash; - -mod signing; pub const SSZ_ATTESTION_DATA_LENGTH: usize = { 8 + // slot @@ -51,6 +48,14 @@ impl AttestationData { pub fn canonical_root(&self) -> Hash256 { Hash256::zero() } + + pub fn signable_message(&self, custody_bit: bool) -> Vec { + let attestation_data_and_custody_bit = AttestationDataAndCustodyBit { + data: self.clone(), + custody_bit, + }; + attestation_data_and_custody_bit.hash_tree_root() + } } impl Encodable for AttestationData { diff --git a/eth2/types/src/attestation_data/signing.rs b/eth2/types/src/attestation_data/signing.rs deleted file mode 100644 index f14cc0ef4..000000000 --- a/eth2/types/src/attestation_data/signing.rs +++ /dev/null @@ -1,12 +0,0 @@ -use crate::{AttestationData, AttestationDataAndCustodyBit}; -use ssz::TreeHash; - -impl AttestationData { - pub fn signable_message(&self, custody_bit: bool) -> Vec { - let attestation_data_and_custody_bit = AttestationDataAndCustodyBit { - data: self.clone(), - custody_bit, - }; - attestation_data_and_custody_bit.hash_tree_root() - } -}