use crate::db::codec::hex::encode_hex_lower;
use std::fmt;
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct ContinuationSignature([u8; 32]);
impl ContinuationSignature {
pub(crate) const fn from_bytes(bytes: [u8; 32]) -> Self {
Self(bytes)
}
pub(crate) const fn into_bytes(self) -> [u8; 32] {
self.0
}
#[must_use]
pub fn as_hex(&self) -> String {
encode_hex_lower(&self.0)
}
}
impl fmt::Display for ContinuationSignature {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.as_hex())
}
}