Skip to content

Commit

Permalink
Merge branch 'master' into tf/borrowed-brillig-bytecode
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray authored Oct 9, 2023
2 parents 549fca6 + 1f10395 commit a92c798
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions compiler/wasm/test/node/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@ import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { compile } from '@noir-lang/noir_wasm';

async function getFileContent(path: string): Promise<string> {
return readFileSync(join(__dirname, path)).toString();
}
const absoluteNoirSourcePath = join(__dirname, noirSourcePath);
const absoluteNargoArtifactPath = join(__dirname, nargoArtifactPath);

// eslint-disable-next-line @typescript-eslint/no-explicit-any
async function getPrecompiledSource(): Promise<any> {
const compiledData = await getFileContent(nargoArtifactPath);
const compiledData = readFileSync(absoluteNargoArtifactPath).toString();
return JSON.parse(compiledData);
}

describe('noir wasm compilation', () => {
it('matches nargos compilation', async () => {
const wasmCircuit = await compile(noirSourcePath);
const wasmCircuit = await compile(absoluteNoirSourcePath);
const cliCircuit = await getPrecompiledSource();

// We don't expect the hashes to match due to how `noir_wasm` handles dependencies
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
# Custom filter with various file extensions that we rely upon to build packages
# Currently: `.nr`, `.sol`, `.sh`, `.json`, `.md`
filter = path: type:
(builtins.match ".*\.(sh|json|md)$" path != null) || (craneLib.filterCargoSources path type);
(builtins.match ".*\.(nr|sol|sh|json|md)$" path != null) || (craneLib.filterCargoSources path type);
};

# TODO(#1198): It'd be nice to include these flags when running `cargo clippy` in a devShell.
Expand Down

0 comments on commit a92c798

Please sign in to comment.