Move all attestation_data fns into same file
This commit is contained in:
parent
05b890860a
commit
cbb84c0d69
@ -1,11 +1,8 @@
|
|||||||
use super::Hash256;
|
use super::{AttestationDataAndCustodyBit, Hash256};
|
||||||
use crate::test_utils::TestRandom;
|
use crate::test_utils::TestRandom;
|
||||||
use rand::RngCore;
|
use rand::RngCore;
|
||||||
use serde_derive::Serialize;
|
use serde_derive::Serialize;
|
||||||
use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash};
|
use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash};
|
||||||
use std::hash::Hash;
|
|
||||||
|
|
||||||
mod signing;
|
|
||||||
|
|
||||||
pub const SSZ_ATTESTION_DATA_LENGTH: usize = {
|
pub const SSZ_ATTESTION_DATA_LENGTH: usize = {
|
||||||
8 + // slot
|
8 + // slot
|
||||||
@ -51,6 +48,14 @@ impl AttestationData {
|
|||||||
pub fn canonical_root(&self) -> Hash256 {
|
pub fn canonical_root(&self) -> Hash256 {
|
||||||
Hash256::zero()
|
Hash256::zero()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn signable_message(&self, custody_bit: bool) -> Vec<u8> {
|
||||||
|
let attestation_data_and_custody_bit = AttestationDataAndCustodyBit {
|
||||||
|
data: self.clone(),
|
||||||
|
custody_bit,
|
||||||
|
};
|
||||||
|
attestation_data_and_custody_bit.hash_tree_root()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Encodable for AttestationData {
|
impl Encodable for AttestationData {
|
@ -1,12 +0,0 @@
|
|||||||
use crate::{AttestationData, AttestationDataAndCustodyBit};
|
|
||||||
use ssz::TreeHash;
|
|
||||||
|
|
||||||
impl AttestationData {
|
|
||||||
pub fn signable_message(&self, custody_bit: bool) -> Vec<u8> {
|
|
||||||
let attestation_data_and_custody_bit = AttestationDataAndCustodyBit {
|
|
||||||
data: self.clone(),
|
|
||||||
custody_bit,
|
|
||||||
};
|
|
||||||
attestation_data_and_custody_bit.hash_tree_root()
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user