diff --git a/coordination-layer/README.md b/coordination-layer/README.md index f0ddbfa..3539c7e 100644 --- a/coordination-layer/README.md +++ b/coordination-layer/README.md @@ -21,5 +21,5 @@ noirup From the repository root run: ```bash -python -m unittest -v coordination-layer/test_* +python -m unittest discover -v coordination-layer ``` diff --git a/coordination-layer/noir/.gitignore b/coordination-layer/noir/.gitignore index 3251ad6..438a1ad 100644 --- a/coordination-layer/noir/.gitignore +++ b/coordination-layer/noir/.gitignore @@ -1,4 +1,4 @@ crates/*/Prover.toml crates/*/Verifier.toml proofs/*.proof -target/* \ No newline at end of file +target/* diff --git a/coordination-layer/noir/crates/bigger/Nargo.toml b/coordination-layer/noir/crates/bigger/Nargo.toml index 9480e15..4034dd3 100644 --- a/coordination-layer/noir/crates/bigger/Nargo.toml +++ b/coordination-layer/noir/crates/bigger/Nargo.toml @@ -4,4 +4,4 @@ type = "bin" authors = [""] compiler_version = ">=0.22.0" -[dependencies] \ No newline at end of file +[dependencies] diff --git a/coordination-layer/noir_constraint.py b/coordination-layer/noir_constraint.py index efd82f4..6246a32 100644 --- a/coordination-layer/noir_constraint.py +++ b/coordination-layer/noir_constraint.py @@ -4,7 +4,6 @@ This module provides the interface for loading, proving and verifying constraint The assumptions of this module: - noir constraints are defined as a noir package in `./noir/crates//` - ./noir is relative to this file -- noir constraints have already been compiled. For ergonomics, one should provide python wrappers that understands the API of the corresponding constraint. @@ -26,7 +25,7 @@ NARGO = sh.Command("nargo") @dataclass -class Proof: +class NoirProof: proof: str @@ -40,7 +39,7 @@ class NoirConstraint: def noir_package_dir(self): return CONSTRAINTS_DIR / self.name - def prove(self, params: dict): + def prove(self, params: dict) -> NoirProof: with portalocker.TemporaryFileLock(LOCK_FILE): with open(self.noir_package_dir / "Prover.toml", "w") as prover_f: toml.dump(params, prover_f) @@ -49,9 +48,9 @@ class NoirConstraint: assert prove_res.exit_code == 0 with open(NOIR_DIR / "proofs" / f"{self.name}.proof", "r") as proof: - return Proof(proof.read()) + return NoirProof(proof.read()) - def verify(self, params: dict, proof: Proof): + def verify(self, params: dict, proof: NoirProof): with portalocker.TemporaryFileLock(LOCK_FILE): with open(self.noir_package_dir / "Verifier.toml", "w") as verifier_f: toml.dump(params, verifier_f) diff --git a/coordination-layer/test_noir_constraint.py b/coordination-layer/test_noir_constraint.py index 4b0c026..101783a 100644 --- a/coordination-layer/test_noir_constraint.py +++ b/coordination-layer/test_noir_constraint.py @@ -1,6 +1,6 @@ from unittest import TestCase -from .noir_constraint import NoirConstraint +from noir_constraint import NoirConstraint class TestNoirCoinstraint(TestCase):