mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-25 13:07:18 +00:00
bls: as_hex_string for aggregate signatures/pubkeys
This commit is contained in:
parent
0eea6fd367
commit
6bf6ba337d
@ -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!(
|
||||
|
Loading…
Reference in New Issue
Block a user