File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ use core::cmp;
19
19
20
20
use bitcoin:: secp256k1:: Signature ;
21
21
use bitcoin:: secp256k1:: key:: { PublicKey , SecretKey } ;
22
- use bitcoin:: secp256k1:: constants:: { PUBLIC_KEY_SIZE , COMPACT_SIGNATURE_SIZE } ;
22
+ use bitcoin:: secp256k1:: constants:: { PUBLIC_KEY_SIZE , SECRET_KEY_SIZE , COMPACT_SIGNATURE_SIZE } ;
23
23
use bitcoin:: blockdata:: script:: Script ;
24
24
use bitcoin:: blockdata:: transaction:: { OutPoint , Transaction , TxOut } ;
25
25
use bitcoin:: consensus;
@@ -589,19 +589,19 @@ impl Readable for PublicKey {
589
589
590
590
impl Writeable for SecretKey {
591
591
fn write < W : Writer > ( & self , w : & mut W ) -> Result < ( ) , :: std:: io:: Error > {
592
- let mut ser = [ 0 ; 32 ] ;
592
+ let mut ser = [ 0 ; SECRET_KEY_SIZE ] ;
593
593
ser. copy_from_slice ( & self [ ..] ) ;
594
594
ser. write ( w)
595
595
}
596
596
#[ inline]
597
597
fn serialized_length ( & self ) -> usize {
598
- 32
598
+ SECRET_KEY_SIZE
599
599
}
600
600
}
601
601
602
602
impl Readable for SecretKey {
603
603
fn read < R : Read > ( r : & mut R ) -> Result < Self , DecodeError > {
604
- let buf: [ u8 ; 32 ] = Readable :: read ( r) ?;
604
+ let buf: [ u8 ; SECRET_KEY_SIZE ] = Readable :: read ( r) ?;
605
605
match SecretKey :: from_slice ( & buf) {
606
606
Ok ( key) => Ok ( key) ,
607
607
Err ( _) => return Err ( DecodeError :: InvalidValue ) ,
You can’t perform that action at this time.
0 commit comments