Skip to content

Commit

Permalink
passing hardcoded contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
vezenovm committed Mar 12, 2024
1 parent a755f8a commit 3b2a7e4
Show file tree
Hide file tree
Showing 11 changed files with 8,645 additions and 4 deletions.
7 changes: 7 additions & 0 deletions barretenberg/acir_tests/flows/write_contract.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
set -eu

export TEST_NAME=$(basename $(pwd))

$BIN write_vk -o vk
$BIN contract -k vk -c $CRS_PATH -b ./target/acir.gz -o $TEST_NAME.sol
1 change: 0 additions & 1 deletion noir/noir-repo/compiler/integration-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
contracts
crs

node_modules
Expand Down
2,869 changes: 2,869 additions & 0 deletions noir/noir-repo/compiler/integration-tests/contracts/1_mul.sol

Large diffs are not rendered by default.

2,869 changes: 2,869 additions & 0 deletions noir/noir-repo/compiler/integration-tests/contracts/assert_statement.sol

Large diffs are not rendered by default.

2,869 changes: 2,869 additions & 0 deletions noir/noir-repo/compiler/integration-tests/contracts/recursion.sol

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion noir/noir-repo/compiler/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"build": "echo Integration Test build step",
"test": "yarn test:browser && yarn test:node",
"test:node": "bash ./scripts/codegen-verifiers.sh && hardhat test test/node/**/*",
"test:node": "hardhat test test/node/**/*",
"test:browser": "web-test-runner",
"test:integration:browser": "web-test-runner test/browser/**/*.test.ts",
"test:integration:browser:watch": "web-test-runner test/browser/**/*.test.ts --watch",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "recursion"
type = "bin"
authors = [""]
compiler_version = ">=0.24.0"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
key_hash = "0"
public_inputs = ["0"]
verification_key = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
proof = ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use dep::std;

// This test is used to generate artifacts for the compiler `integration-tests`
fn main(
verification_key: [Field; 114],
proof: [Field; 93],
public_inputs: [Field; 1],
key_hash: Field
) {
std::verify_proof(
verification_key.as_slice(),
proof.as_slice(),
public_inputs.as_slice(),
key_hash
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
cli::{ContractCommand, WriteVkCommand},
Backend, BackendError,
};
use acvm::acir::circuit::Program;
use acvm::acir::circuit::{Circuit, Program};
use tempfile::tempdir;

impl Backend {
Expand All @@ -17,6 +17,7 @@ impl Backend {
// Create a temporary file for the circuit
let bytecode_path = temp_directory_path.join("program").with_extension("bytecode");
let serialized_program = Program::serialize_program(program);
// let serialized_program = Circuit::serialize_circuit(&program.functions[0]);
write_to_file(&serialized_program, &bytecode_path);

// Create the verification key and write it to the specified path
Expand Down
2 changes: 1 addition & 1 deletion noir/noir-repo/tooling/nargo_cli/src/cli/fs/witness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub(crate) fn save_witness_to_dir<P: AsRef<Path>>(
) -> Result<PathBuf, FilesystemError> {
create_named_dir(witness_dir.as_ref(), "witness");
let witness_path = witness_dir.as_ref().join(witness_name).with_extension(WITNESS_EXT);
dbg!(witnesses.clone());

// TODO(https://github.com/noir-lang/noir/issues/4428)
let witness_stack: WitnessStack = witnesses.into();
let buf: Vec<u8> = witness_stack.try_into()?;
Expand Down

0 comments on commit 3b2a7e4

Please sign in to comment.