Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: clippy fix #2626

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/acvm_backend_barretenberg/src/cli/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ fn contract_command() -> Result<(), BackendError> {
is_recursive: false,
crs_path: crs_path.clone(),
};
write_vk_command.run(&backend.binary_path())?;
write_vk_command.run(backend.binary_path())?;

let contract_command = ContractCommand { vk_path, crs_path };
contract_command.run(&backend.binary_path())?;
contract_command.run(backend.binary_path())?;

drop(temp_directory);

Expand Down
2 changes: 1 addition & 1 deletion crates/acvm_backend_barretenberg/src/cli/gates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn gate_command() -> Result<(), BackendError> {

let gate_command = GatesCommand { crs_path, bytecode_path };

let output = gate_command.run(&backend.binary_path())?;
let output = gate_command.run(backend.binary_path())?;
// Mock backend always returns zero gates.
assert_eq!(output, 0);

Expand Down
2 changes: 1 addition & 1 deletion crates/acvm_backend_barretenberg/src/cli/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fn info_command() -> Result<(), BackendError> {
let backend = crate::get_mock_backend()?;
let crs_path = backend.backend_directory();

let (language, is_opcode_supported) = InfoCommand { crs_path }.run(&backend.binary_path())?;
let (language, is_opcode_supported) = InfoCommand { crs_path }.run(backend.binary_path())?;

assert!(matches!(language, Language::PLONKCSat { width: 3 }));
assert!(is_opcode_supported(&Opcode::Arithmetic(Expression::default())));
Expand Down
2 changes: 1 addition & 1 deletion crates/acvm_backend_barretenberg/src/cli/prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fn prove_command() -> Result<(), BackendError> {
let crs_path = backend.backend_directory();
let prove_command = ProveCommand { crs_path, bytecode_path, witness_path, is_recursive: false };

let proof = prove_command.run(&backend.binary_path())?;
let proof = prove_command.run(backend.binary_path())?;
assert_eq!(proof, "proof".as_bytes());
drop(temp_directory);

Expand Down
6 changes: 3 additions & 3 deletions crates/acvm_backend_barretenberg/src/cli/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,22 @@ fn verify_command() -> Result<(), BackendError> {
vk_path_output: vk_path_output.clone(),
};

write_vk_command.run(&backend.binary_path())?;
write_vk_command.run(backend.binary_path())?;

let prove_command = ProveCommand {
crs_path: crs_path.clone(),
is_recursive: false,
bytecode_path,
witness_path,
};
let proof = prove_command.run(&backend.binary_path())?;
let proof = prove_command.run(backend.binary_path())?;

write_to_file(&proof, &proof_path);

let verify_command =
VerifyCommand { crs_path, is_recursive: false, proof_path, vk_path: vk_path_output };

let verified = verify_command.run(&backend.binary_path())?;
let verified = verify_command.run(backend.binary_path())?;
assert!(verified);

drop(temp_directory);
Expand Down
2 changes: 1 addition & 1 deletion crates/acvm_backend_barretenberg/src/cli/write_vk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn write_vk_command() -> Result<(), BackendError> {
let write_vk_command =
WriteVkCommand { bytecode_path, crs_path, is_recursive: false, vk_path_output };

write_vk_command.run(&backend.binary_path())?;
write_vk_command.run(backend.binary_path())?;
drop(temp_directory);

Ok(())
Expand Down
10 changes: 5 additions & 5 deletions crates/acvm_backend_barretenberg/src/proof_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ impl Backend {
write_to_file(&serialized_circuit, &circuit_path);

GatesCommand { crs_path: self.crs_directory(), bytecode_path: circuit_path }
.run(&binary_path)
.run(binary_path)
}

pub fn get_backend_info(
&self,
) -> Result<(Language, Box<impl Fn(&Opcode) -> bool>), BackendError> {
let binary_path = self.assert_binary_exists()?;
InfoCommand { crs_path: self.crs_directory() }.run(&binary_path)
InfoCommand { crs_path: self.crs_directory() }.run(binary_path)
}

pub fn prove(
Expand Down Expand Up @@ -64,7 +64,7 @@ impl Backend {
bytecode_path,
witness_path,
}
.run(&binary_path)?;
.run(binary_path)?;

// Barretenberg return the proof prepended with the public inputs.
//
Expand Down Expand Up @@ -120,11 +120,11 @@ impl Backend {
bytecode_path,
vk_path_output: vk_path.clone(),
}
.run(&binary_path)?;
.run(binary_path)?;

// Verify the proof
VerifyCommand { crs_path: self.crs_directory(), is_recursive, proof_path, vk_path }
.run(&binary_path)
.run(binary_path)
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/acvm_backend_barretenberg/src/smart_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ impl Backend {
bytecode_path,
vk_path_output: vk_path.clone(),
}
.run(&binary_path)?;
.run(binary_path)?;

let verification_key_library =
ContractCommand { crs_path: self.crs_directory(), vk_path }.run(&binary_path)?;
ContractCommand { crs_path: self.crs_directory(), vk_path }.run(binary_path)?;

drop(temp_directory);
Ok(format!("{verification_key_library}{ULTRA_VERIFIER_CONTRACT}"))
Expand Down