Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ozankaymak committed Dec 10, 2023
1 parent 5c5f464 commit 8739a28
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 21 deletions.
10 changes: 5 additions & 5 deletions src/gates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,11 @@ mod tests {
taproot_annex_scriptleaf: Some((TapLeafHash::all_zeros(), None)),
},
script.clone(),
solution_preimages.clone().iter().map(|preimage| preimage.to_vec()).collect(),
solution_preimages
.clone()
.iter()
.map(|preimage| preimage.to_vec())
.collect(),
)
.expect("error creating exec")
}
Expand All @@ -256,7 +260,6 @@ mod tests {
}

fn test_gate(gate_name: &str) {

let wire_0 = Wire::new(0);
let wire_1 = Wire::new(1);
let wire_2 = Wire::new(2);
Expand Down Expand Up @@ -302,14 +305,12 @@ mod tests {
println!("script: {:?}", script);

for input in all_possible_inputs.iter() {

gate.set_input_bits(input.clone());
gate.evaluate();

let gate_res = gate.run_gate_on_inputs(input.clone());

for output in all_possible_outputs.iter() {

gate.set_output_bits(output.clone());

let solution_preimages = gate.create_response_witness(lock_preimage);
Expand All @@ -333,7 +334,6 @@ mod tests {
println!("output preimage indices: {:?}", output_wire_preimages);
let has_error = check_exec(exec, compare_vectors);
println!("has_error: {}", has_error);

}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/traits/gate.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::wire::{HashValue, Wire, PreimageValue};
use crate::wire::{HashValue, PreimageValue, Wire};
use bitcoin::ScriptBuf;
use std::{
iter::zip,
Expand Down
17 changes: 2 additions & 15 deletions src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,21 +442,8 @@ async fn handle_connection(stream: TcpStream) {

let witness = sighash_cache.witness_mut(0).unwrap();
witness.push(equivocation_sig.as_ref());
witness.push(
value
.clone()
.preimages
.unwrap()
.one
.unwrap(),
);
witness.push(
value
.preimages
.unwrap()
.zero
.unwrap(),
);
witness.push(value.clone().preimages.unwrap().one.unwrap());
witness.push(value.preimages.unwrap().zero.unwrap());
witness.push(equivocation_script);
witness.push(&equivocation_control_block.serialize());

Expand Down

0 comments on commit 8739a28

Please sign in to comment.