MCPcopy Index your code
hub / github.com/BitVM/BitVM / run

Function run

bitvm/src/lib.rs:263–278  ·  view source on GitHub ↗
(script: treepp::Script)

Source from the content-addressed store, hash-verified

261}
262
263pub 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
280pub fn execute_raw_script_with_inputs(script: Vec<u8>, witness: Vec<Vec<u8>>) -> ExecuteInfo {
281 // Get the default options for the script exec.

Callers 15

test_u254_cmpFunction · 0.85
test_u64_cmpFunction · 0.85
test_is_zeroFunction · 0.85
test_addFunction · 0.85
test_add1Function · 0.85
test_doubleFunction · 0.85
test_subFunction · 0.85
test_negFunction · 0.85
test_mulFunction · 0.85
test_limb_shr1_carryFunction · 0.85
test_limb_div3_carryFunction · 0.85
test_div2Function · 0.85

Calls 1

execute_scriptFunction · 0.85

Tested by 15

test_u254_cmpFunction · 0.68
test_u64_cmpFunction · 0.68
test_is_zeroFunction · 0.68
test_addFunction · 0.68
test_add1Function · 0.68
test_doubleFunction · 0.68
test_subFunction · 0.68
test_negFunction · 0.68
test_mulFunction · 0.68
test_limb_shr1_carryFunction · 0.68
test_limb_div3_carryFunction · 0.68
test_div2Function · 0.68