Encode versioned attestation bytes.
(&self)
| 419 | |
| 420 | /// Encode versioned attestation bytes. |
| 421 | pub fn to_bytes(&self) -> Result<Vec<u8>> { |
| 422 | match self { |
| 423 | Self::V0 { attestation } => Ok(LegacyVersionedAttestation::V0 { |
| 424 | attestation: attestation.clone(), |
| 425 | } |
| 426 | .encode()), |
| 427 | Self::V1 { attestation } => attestation.to_msgpack(), |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | #[doc(hidden)] |
| 432 | pub fn from_scale(bytes: &[u8]) -> Result<Self> { |
no test coverage detected