@@ -10,7 +10,6 @@ use hashes::sha256::Midstate;
1010use simplicity_sys:: CFrameItem ;
1111use std:: io:: Write ;
1212use std:: { fmt, str} ;
13- use crate :: jet:: bitcoin:: BitcoinEnv ;
1413
1514/// The Bitcoin jet family.
1615#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Debug , Hash ) ]
@@ -881,13 +880,6 @@ impl Bitcoin {
881880
882881impl Jet for Bitcoin {
883882
884- type Environment = BitcoinEnv ;
885- type CJetEnvironment = ( ) ;
886-
887- fn c_jet_env ( _env : & Self :: Environment ) -> & Self :: CJetEnvironment {
888- unimplemented ! ( "Unspecified CJetEnvironment for Bitcoin jets" )
889- }
890-
891883 fn cmr ( & self ) -> Cmr {
892884 unimplemented ! ( "Bitcoin jet CMRs weights have not yet been implemented." )
893885 }
@@ -1762,7 +1754,7 @@ impl Jet for Bitcoin {
17621754 TypeName ( name)
17631755 }
17641756
1765- fn encode < W : Write > ( & self , w : & mut BitWriter < W > ) -> std:: io:: Result < usize > {
1757+ fn encode ( & self , w : & mut BitWriter < & mut dyn Write > ) -> std:: io:: Result < usize > {
17661758 let ( n, len) = match self {
17671759 Bitcoin :: Verify => ( 0 , 3 ) ,
17681760 Bitcoin :: Low1 => ( 8 , 6 ) ,
@@ -2197,7 +2189,7 @@ impl Jet for Bitcoin {
21972189 w. write_bits_be ( n, len)
21982190 }
21992191
2200- fn decode < I : Iterator < Item = u8 > > ( bits : & mut BitIter < I > ) -> Result < Self , decode:: Error > {
2192+ fn decode < I : Iterator < Item = u8 > > ( bits : & mut BitIter < I > ) -> Result < Self , decode:: Error > where Self : Sized {
22012193 decode_bits ! ( bits, {
22022194 0 => {
22032195 0 => {
@@ -4706,13 +4698,13 @@ impl Jet for Bitcoin {
47064698 } )
47074699 }
47084700
4709- fn c_jet_ptr ( & self ) -> & dyn Fn ( & mut CFrameItem , CFrameItem , & Self :: CJetEnvironment ) -> bool {
4710- unimplemented ! ( "Bitcoin jets have not yet been implemented." )
4711- }
4712-
47134701 fn cost ( & self ) -> Cost {
47144702 unimplemented ! ( "Unspecified cost of Bitcoin jets" )
47154703 }
4704+
4705+ fn parse ( s : & str ) -> Result < Self , crate :: Error > where Self : Sized {
4706+ str:: FromStr :: from_str ( s)
4707+ }
47164708}
47174709
47184710impl fmt:: Display for Bitcoin {
@@ -5587,3 +5579,7 @@ impl str::FromStr for Bitcoin {
55875579 }
55885580 }
55895581}
5582+
5583+ pub ( crate ) fn c_jet_ptr ( jet : & Bitcoin ) -> fn ( & mut CFrameItem , CFrameItem , & ( ) ) -> bool {
5584+ unimplemented ! ( "Bitcoin jets have not yet been implemented." )
5585+ }
0 commit comments