Add Display implementations for various ConfidentialTransfer pod structs (#26783)
This commit is contained in:
parent
9e791ec9b7
commit
2114136e59
|
@ -43,6 +43,12 @@ impl fmt::Debug for ElGamalCiphertext {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for ElGamalCiphertext {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{}", base64::encode(self.0))
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for ElGamalCiphertext {
|
||||
fn default() -> Self {
|
||||
Self::zeroed()
|
||||
|
@ -59,6 +65,12 @@ impl fmt::Debug for ElGamalPubkey {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for ElGamalPubkey {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{}", base64::encode(self.0))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Default, Pod, Zeroable, PartialEq, Eq)]
|
||||
#[repr(transparent)]
|
||||
pub struct PedersenCommitment(pub [u8; 32]);
|
||||
|
@ -180,6 +192,12 @@ impl fmt::Debug for AeCiphertext {
|
|||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for AeCiphertext {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{}", base64::encode(self.0))
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for AeCiphertext {
|
||||
fn default() -> Self {
|
||||
Self::zeroed()
|
||||
|
|
Loading…
Reference in New Issue