mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 09:16:00 +00:00
Move all attestaion fns into same file
This commit is contained in:
@@ -5,8 +5,6 @@ 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};
|
||||||
|
|
||||||
mod signing;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||||
pub struct Attestation {
|
pub struct Attestation {
|
||||||
pub data: AttestationData,
|
pub data: AttestationData,
|
||||||
@@ -19,6 +17,10 @@ impl Attestation {
|
|||||||
pub fn canonical_root(&self) -> Hash256 {
|
pub fn canonical_root(&self) -> Hash256 {
|
||||||
Hash256::from(&self.hash_tree_root()[..])
|
Hash256::from(&self.hash_tree_root()[..])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn signable_message(&self, custody_bit: bool) -> Vec<u8> {
|
||||||
|
self.data.signable_message(custody_bit)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Encodable for Attestation {
|
impl Encodable for Attestation {
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
use crate::Attestation;
|
|
||||||
|
|
||||||
impl Attestation {
|
|
||||||
pub fn signable_message(&self, custody_bit: bool) -> Vec<u8> {
|
|
||||||
self.data.signable_message(custody_bit)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user