@@ -358,7 +358,7 @@ impl ToPublicKey for bitcoin::secp256k1::XOnlyPublicKey {
358
358
}
359
359
360
360
/// Dummy key which de/serializes to the empty string; useful sometimes for testing
361
- #[ derive( Copy , Clone , PartialOrd , Ord , PartialEq , Eq , Debug ) ]
361
+ #[ derive( Copy , Clone , PartialOrd , Ord , PartialEq , Eq , Debug , Default ) ]
362
362
pub struct DummyKey ;
363
363
364
364
impl str:: FromStr for DummyKey {
@@ -375,7 +375,7 @@ impl str::FromStr for DummyKey {
375
375
impl MiniscriptKey for DummyKey {
376
376
type RawPkHash = DummyKeyHash ;
377
377
type Sha256 = DummySha256Hash ;
378
- type Hash256 = DummyHash256 ;
378
+ type Hash256 = DummyHash256Hash ;
379
379
type Ripemd160 = DummyRipemd160Hash ;
380
380
type Hash160 = DummyHash160Hash ;
381
381
@@ -413,7 +413,7 @@ impl ToPublicKey for DummyKey {
413
413
. unwrap ( )
414
414
}
415
415
416
- fn to_hash256 ( _hash : & DummyHash256 ) -> hash256:: Hash {
416
+ fn to_hash256 ( _hash : & DummyHash256Hash ) -> hash256:: Hash {
417
417
hash256:: Hash :: from_str ( "50863ad64a87ae8a2fe83c1af1a8403cb53f53e486d8511dad8a04887e5b2352" )
418
418
. unwrap ( )
419
419
}
@@ -428,7 +428,7 @@ impl ToPublicKey for DummyKey {
428
428
}
429
429
430
430
/// Dummy keyhash which de/serializes to the empty string; useful sometimes for testing
431
- #[ derive( Copy , Clone , PartialOrd , Ord , PartialEq , Eq , Debug ) ]
431
+ #[ derive( Copy , Clone , PartialOrd , Ord , PartialEq , Eq , Debug , Default ) ]
432
432
pub struct DummyKeyHash ;
433
433
434
434
impl str:: FromStr for DummyKeyHash {
@@ -455,7 +455,7 @@ impl hash::Hash for DummyKeyHash {
455
455
}
456
456
457
457
/// Dummy keyhash which de/serializes to the empty string; useful for testing
458
- #[ derive( Copy , Clone , PartialOrd , Ord , PartialEq , Eq , Debug ) ]
458
+ #[ derive( Copy , Clone , PartialOrd , Ord , PartialEq , Eq , Debug , Default ) ]
459
459
pub struct DummySha256Hash ;
460
460
461
461
impl str:: FromStr for DummySha256Hash {
@@ -482,22 +482,22 @@ impl hash::Hash for DummySha256Hash {
482
482
}
483
483
484
484
/// Dummy keyhash which de/serializes to the empty string; useful for testing
485
- #[ derive( Copy , Clone , PartialOrd , Ord , PartialEq , Eq , Debug ) ]
486
- pub struct DummyHash256 ;
485
+ #[ derive( Copy , Clone , PartialOrd , Ord , PartialEq , Eq , Debug , Default ) ]
486
+ pub struct DummyHash256Hash ;
487
487
488
- impl str:: FromStr for DummyHash256 {
488
+ impl str:: FromStr for DummyHash256Hash {
489
489
type Err = & ' static str ;
490
- fn from_str ( x : & str ) -> Result < DummyHash256 , & ' static str > {
490
+ fn from_str ( x : & str ) -> Result < DummyHash256Hash , & ' static str > {
491
491
if x. is_empty ( ) {
492
- Ok ( DummyHash256 )
492
+ Ok ( DummyHash256Hash )
493
493
} else {
494
494
Err ( "non empty dummy hash" )
495
495
}
496
496
}
497
497
}
498
498
499
499
/// Dummy keyhash which de/serializes to the empty string; useful for testing
500
- #[ derive( Copy , Clone , PartialOrd , Ord , PartialEq , Eq , Debug ) ]
500
+ #[ derive( Copy , Clone , PartialOrd , Ord , PartialEq , Eq , Debug , Default ) ]
501
501
pub struct DummyRipemd160Hash ;
502
502
503
503
impl str:: FromStr for DummyRipemd160Hash {
@@ -511,7 +511,7 @@ impl str::FromStr for DummyRipemd160Hash {
511
511
}
512
512
}
513
513
514
- impl fmt:: Display for DummyHash256 {
514
+ impl fmt:: Display for DummyHash256Hash {
515
515
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
516
516
f. write_str ( "" )
517
517
}
@@ -522,7 +522,7 @@ impl fmt::Display for DummyRipemd160Hash {
522
522
}
523
523
}
524
524
525
- impl hash:: Hash for DummyHash256 {
525
+ impl hash:: Hash for DummyHash256Hash {
526
526
fn hash < H : hash:: Hasher > ( & self , state : & mut H ) {
527
527
"DummySha256Hash" . hash ( state) ;
528
528
}
@@ -535,7 +535,7 @@ impl hash::Hash for DummyRipemd160Hash {
535
535
}
536
536
537
537
/// Dummy keyhash which de/serializes to the empty string; useful for testing
538
- #[ derive( Copy , Clone , PartialOrd , Ord , PartialEq , Eq , Debug ) ]
538
+ #[ derive( Copy , Clone , PartialOrd , Ord , PartialEq , Eq , Debug , Default ) ]
539
539
pub struct DummyHash160Hash ;
540
540
541
541
impl str:: FromStr for DummyHash160Hash {
0 commit comments