mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 17:01:09 +03:00
add impl fmt::Debug for BlindingFactor, for pretty print (#1382)
This commit is contained in:
parent
25e03aadef
commit
7d677737d7
1 changed files with 8 additions and 2 deletions
|
@ -162,9 +162,15 @@ impl fmt::Display for Identifier {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[derive(Clone, Copy, PartialEq, Serialize, Deserialize)]
|
||||
pub struct BlindingFactor([u8; SECRET_KEY_SIZE]);
|
||||
|
||||
impl fmt::Debug for BlindingFactor {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "{}", self.to_hex())
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRef<[u8]> for BlindingFactor {
|
||||
fn as_ref(&self) -> &[u8] {
|
||||
&self.0
|
||||
|
@ -297,8 +303,8 @@ mod test {
|
|||
use rand::thread_rng;
|
||||
|
||||
use types::BlindingFactor;
|
||||
use util::secp::Secp256k1;
|
||||
use util::secp::key::{SecretKey, ZERO_KEY};
|
||||
use util::secp::Secp256k1;
|
||||
|
||||
#[test]
|
||||
fn split_blinding_factor() {
|
||||
|
|
Loading…
Reference in a new issue