mirror of
https://github.com/logos-storage/logos-storage-proofs.git
synced 2026-01-04 06:23:11 +00:00
refactor
This commit is contained in:
parent
2164045a7a
commit
5f07bff2df
@ -90,11 +90,12 @@ impl StorageProofs {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn proof_build_inputs(
|
pub fn prove_run(
|
||||||
&mut self,
|
&mut self,
|
||||||
inputs: &[u8]
|
inputs: &[u8],
|
||||||
) -> Result<CircomCircuit<Params256Ty>, String> {
|
proof_bytes: &mut Vec<u8>,
|
||||||
|
public_inputs_bytes: &mut Vec<u8>,
|
||||||
|
) -> Result<(), String> {
|
||||||
let mut builder: CircomBuilder<Params256Ty> = self.builder.clone();
|
let mut builder: CircomBuilder<Params256Ty> = self.builder.clone();
|
||||||
|
|
||||||
parse_mpack_args(&mut builder, inputs)?;
|
parse_mpack_args(&mut builder, inputs)?;
|
||||||
@ -102,15 +103,6 @@ impl StorageProofs {
|
|||||||
let circuit: CircomCircuit<Params256Ty> = builder.build()
|
let circuit: CircomCircuit<Params256Ty> = builder.build()
|
||||||
.map_err(|e| e.to_string())?;
|
.map_err(|e| e.to_string())?;
|
||||||
|
|
||||||
Ok(circuit)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn prove_run(
|
|
||||||
&mut self,
|
|
||||||
circuit: CircomCircuit<Params256Ty>,
|
|
||||||
proof_bytes: &mut Vec<u8>,
|
|
||||||
public_inputs_bytes: &mut Vec<u8>,
|
|
||||||
) -> Result<(), String> {
|
|
||||||
let inputs = circuit
|
let inputs = circuit
|
||||||
.get_public_inputs()
|
.get_public_inputs()
|
||||||
.ok_or("Unable to get public inputs!")?;
|
.ok_or("Unable to get public inputs!")?;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user