Skip to content

noir-lang/noir-runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Noir Runner

Executes exported Noir programs. Note that programs should be exported via the nargo export command before running this program. Additionally, check that the nargo version is compatible with v0.36.0.

Example

Noir Circuit:

#[export]
fn addition(x: Field, y: Field) -> Field {
    x + y
}

Bash Command:

nargo export

Rust Program:

use noir_runner::{NoirRunner, ToNoir};

use std::collections::BTreeMap;

let program_dir = std::path::PathBuf::from("tests");

let runner = NoirRunner::try_new(program_dir).unwrap();

let x = 2i128;
let y = 3i128;

let input_map = BTreeMap::from([
    ("x".to_owned(), x.to_noir()),
    ("y".to_owned(), y.to_noir()),
]);

let result = runner.run("addition", input_map).unwrap().unwrap();

assert_eq!(result, (x + y).to_noir());

Re Exports

  • [FieldElement]: (acvm) Represents a field element in the BN254 curve.
  • [InputValue]: (noirc_abi) Represents a value that can be passed as an input to a Noir program.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published