mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-08 04:11:08 +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]);
|
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 {
|
impl AsRef<[u8]> for BlindingFactor {
|
||||||
fn as_ref(&self) -> &[u8] {
|
fn as_ref(&self) -> &[u8] {
|
||||||
&self.0
|
&self.0
|
||||||
|
@ -297,8 +303,8 @@ mod test {
|
||||||
use rand::thread_rng;
|
use rand::thread_rng;
|
||||||
|
|
||||||
use types::BlindingFactor;
|
use types::BlindingFactor;
|
||||||
use util::secp::Secp256k1;
|
|
||||||
use util::secp::key::{SecretKey, ZERO_KEY};
|
use util::secp::key::{SecretKey, ZERO_KEY};
|
||||||
|
use util::secp::Secp256k1;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn split_blinding_factor() {
|
fn split_blinding_factor() {
|
||||||
|
|
Loading…
Reference in a new issue