(checkpoint: &Checkpoint)
| 126 | } |
| 127 | |
| 128 | let mut payload = vec![0u8; len as usize]; |
| 129 | buf.try_copy_to_slice(&mut payload) |
| 130 | .map_err(|_| Error::EndOfBuffer)?; |
| 131 | Self::from_ssz_bytes(&payload) |
| 132 | .map_err(|_| Error::Invalid("Checkpoint", "Unable to decode SSZ bytes for checkpoint")) |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | impl TryFrom<&Checkpoint> for ConsensusState { |
| 137 | type Error = Error; |
| 138 | |
| 139 | fn try_from(checkpoint: &Checkpoint) -> Result<Self, Self::Error> { |
| 140 | // Verify the digest matches the data |
| 141 | let computed_digest = Sha256::hash(&[&checkpoint.data]); |
| 142 |
nothing calls this directly
no outgoing calls
no test coverage detected