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;
1919
2020use bitcoin:: secp256k1:: Signature ;
2121use 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 } ;
2323use bitcoin:: blockdata:: script:: Script ;
2424use bitcoin:: blockdata:: transaction:: { OutPoint , Transaction , TxOut } ;
2525use bitcoin:: consensus;
@@ -589,19 +589,19 @@ impl Readable for PublicKey {
589589
590590impl Writeable for SecretKey {
591591 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 ] ;
593593 ser. copy_from_slice ( & self [ ..] ) ;
594594 ser. write ( w)
595595 }
596596 #[ inline]
597597 fn serialized_length ( & self ) -> usize {
598- 32
598+ SECRET_KEY_SIZE
599599 }
600600}
601601
602602impl Readable for SecretKey {
603603 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) ?;
605605 match SecretKey :: from_slice ( & buf) {
606606 Ok ( key) => Ok ( key) ,
607607 Err ( _) => return Err ( DecodeError :: InvalidValue ) ,
You can’t perform that action at this time.
0 commit comments