@@ -71,15 +71,19 @@ impl TemplateProgram {
7171 ///
7272 /// The arguments are not consistent with the parameters of the program.
7373 /// Use [`TemplateProgram::parameters`] to see which parameters the program has.
74- pub fn instantiate ( & self , arguments : Arguments ) -> Result < CompiledProgram , String > {
74+ pub fn instantiate (
75+ & self ,
76+ arguments : Arguments ,
77+ include_debug_symbols : bool ,
78+ ) -> Result < CompiledProgram , String > {
7579 arguments
7680 . is_consistent ( self . simfony . parameters ( ) )
7781 . map_err ( |error| error. to_string ( ) ) ?;
7882 Ok ( CompiledProgram {
7983 debug_symbols : self . simfony . debug_symbols ( self . file . as_ref ( ) ) ,
8084 simplicity : self
8185 . simfony
82- . compile ( arguments)
86+ . compile ( arguments, include_debug_symbols )
8387 . with_file ( Arc :: clone ( & self . file ) ) ?,
8488 witness_types : self . simfony . witness_types ( ) . shallow_clone ( ) ,
8589 } )
@@ -112,8 +116,13 @@ impl CompiledProgram {
112116 ///
113117 /// - [`TemplateProgram::new`]
114118 /// - [`TemplateProgram::instantiate`]
115- pub fn new < Str : Into < Arc < str > > > ( s : Str , arguments : Arguments ) -> Result < Self , String > {
116- TemplateProgram :: new ( s) . and_then ( |template| template. instantiate ( arguments) )
119+ pub fn new < Str : Into < Arc < str > > > (
120+ s : Str ,
121+ arguments : Arguments ,
122+ include_debug_symbols : bool ,
123+ ) -> Result < Self , String > {
124+ TemplateProgram :: new ( s)
125+ . and_then ( |template| template. instantiate ( arguments, include_debug_symbols) )
117126 }
118127
119128 /// Access the debug symbols for the Simplicity target code.
@@ -166,8 +175,9 @@ impl SatisfiedProgram {
166175 s : Str ,
167176 arguments : Arguments ,
168177 witness_values : WitnessValues ,
178+ include_debug_symbols : bool ,
169179 ) -> Result < Self , String > {
170- let compiled = CompiledProgram :: new ( s, arguments) ?;
180+ let compiled = CompiledProgram :: new ( s, arguments, include_debug_symbols ) ?;
171181 compiled. satisfy ( witness_values)
172182 }
173183
@@ -295,7 +305,7 @@ mod tests {
295305 }
296306
297307 pub fn with_arguments ( self , arguments : Arguments ) -> TestCase < CompiledProgram > {
298- let program = match self . program . instantiate ( arguments) {
308+ let program = match self . program . instantiate ( arguments, true ) {
299309 Ok ( x) => x,
300310 Err ( error) => panic ! ( "{error}" ) ,
301311 } ;
@@ -585,7 +595,12 @@ fn main() {
585595 assert!(my_true());
586596}
587597"# ;
588- match SatisfiedProgram :: new ( prog_text, Arguments :: default ( ) , WitnessValues :: default ( ) ) {
598+ match SatisfiedProgram :: new (
599+ prog_text,
600+ Arguments :: default ( ) ,
601+ WitnessValues :: default ( ) ,
602+ false ,
603+ ) {
589604 Ok ( _) => panic ! ( "Accepted faulty program" ) ,
590605 Err ( error) => {
591606 if !error. contains ( "Expected expression of type `bool`, found type `()`" ) {
0 commit comments