| 261 | } |
| 262 | |
| 263 | pub fn run(script: treepp::Script) { |
| 264 | // let stack = script.clone().analyze_stack(); |
| 265 | // if !stack.is_valid_final_state_without_inputs() { |
| 266 | // println!("Stack analysis does not end in valid state: {:?}", stack); |
| 267 | // assert!(false); |
| 268 | // } |
| 269 | let exec_result = execute_script(script); |
| 270 | if !exec_result.success { |
| 271 | println!( |
| 272 | "ERROR: {:?} <--- \n STACK: {:4} ", |
| 273 | exec_result.last_opcode, exec_result.final_stack |
| 274 | ); |
| 275 | } |
| 276 | //println!("Max_stack_items = {}", exec_result.stats.max_nb_stack_items); |
| 277 | assert!(exec_result.success); |
| 278 | } |
| 279 | |
| 280 | pub fn execute_raw_script_with_inputs(script: Vec<u8>, witness: Vec<Vec<u8>>) -> ExecuteInfo { |
| 281 | // Get the default options for the script exec. |