mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 10:11:44 +00:00
bls: as_hex_string for aggregate signatures/pubkeys
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use super::PublicKey;
|
||||
use milagro_bls::AggregatePublicKey as RawAggregatePublicKey;
|
||||
use serde_hex::encode as hex_encode;
|
||||
|
||||
/// A BLS aggregate public key.
|
||||
///
|
||||
@@ -21,4 +22,10 @@ impl AggregatePublicKey {
|
||||
pub fn as_raw(&self) -> &RawAggregatePublicKey {
|
||||
&self.0
|
||||
}
|
||||
|
||||
/// Return a hex string representation of this key's bytes.
|
||||
#[cfg(test)]
|
||||
pub fn as_hex_string(&self) -> String {
|
||||
hex_encode(self.as_raw().as_bytes())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,6 +129,12 @@ impl AggregateSignature {
|
||||
is_empty: true,
|
||||
}
|
||||
}
|
||||
|
||||
/// Return a hex string representation of the bytes of this signature.
|
||||
#[cfg(test)]
|
||||
pub fn as_hex_string(&self) -> String {
|
||||
hex_encode(self.as_bytes())
|
||||
}
|
||||
}
|
||||
|
||||
impl_ssz!(
|
||||
|
||||
Reference in New Issue
Block a user