Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: export types mistakenly left private #27

Merged
merged 19 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,41 @@ name: Noir tests
on:
push:
branches:
- main
- master
kashbrti marked this conversation as resolved.
Show resolved Hide resolved
pull_request:

env:
CARGO_TERM_COLOR: always
MINIMUM_NOIR_VERSION: v0.36.0

jobs:
noir-version-list:
name: Query supported Noir versions
runs-on: ubuntu-latest
outputs:
noir_versions: ${{ steps.get_versions.outputs.versions }}

steps:
- name: Checkout sources
id: get_versions
run: |
# gh returns the Noir releases in reverse chronological order so we keep all releases published after the minimum supported version.
VERSIONS=$(gh release list -R noir-lang/noir --exclude-pre-releases --json tagName -q 'map(.tagName) | index(env.MINIMUM_NOIR_VERSION) as $index | if $index then .[0:$index+1] else [env.MINIMUM_NOIR_VERSION] end')
echo "versions=$VERSIONS"
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ github.token }}

test:
needs: [noir-version-list]
name: Test on Nargo ${{matrix.toolchain}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain: [nightly, 0.37.0]
toolchain: ${{ fromJson( needs.noir-version-list.outputs.noir_versions )}}
include:
- toolchain: nightly
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -30,6 +51,7 @@ jobs:
run: nargo test

format:
needs: [noir-version-list]
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand All @@ -38,8 +60,7 @@ jobs:
- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: 0.37.0

toolchain: ${{needs.noir-version-list.outputs.noir_versions[0] }}
TomAFrench marked this conversation as resolved.
Show resolved Hide resolved
- name: Run formatter
run: nargo fmt --check

Expand All @@ -64,4 +85,4 @@ jobs:
fi
env:
# We treat any cancelled, skipped or failing jobs as a failure for the workflow as a whole.
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
4 changes: 2 additions & 2 deletions Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "json_parser"
type = "lib"
authors = [""]
compiler_version = ">=0.37.0"
kashbrti marked this conversation as resolved.
Show resolved Hide resolved
compiler_version = ">= 0.36.0"

[dependencies]
noir_sort = {tag = "v0.2.0", git = "https://github.com/noir-lang/noir_sort"}
noir_sort = {tag = "v0.2.1", git = "https://github.com/noir-lang/noir_sort"}
2 changes: 1 addition & 1 deletion src/getters.nr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::transcript_entry::TranscriptEntry;
/**
* @brief records data used to reason about whether a key exists in a json blob
**/
struct KeySearchResult {
pub struct KeySearchResult {
found: bool, // does the key exist?
target_lt_smallest_entry: bool, // is the target keyhash smaller than the smallest keyhash in self.key_hashes?
target_gt_largest_entry: bool, // is the target keyhash larger than the largest keyhash in self.key_hashes?
Expand Down
2 changes: 1 addition & 1 deletion src/json.nr
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl<let MaxLength: u32> JSONValue<MaxLength> {
* @description The "root" of the JSON refers to the parent object or array (or a value if the json is just a single value e.g. text = "\"foo\": \"bar\"")
* @note text that describes just a single JSON value is not yet fully supported. Only use this library for processing objects or arrays for now
**/
struct JSON<let NumBytes: u32, let NumPackedFields: u32, let MaxNumTokens: u32, let MaxNumValues: u32, let MaxKeyFields: u32> {
pub struct JSON<let NumBytes: u32, let NumPackedFields: u32, let MaxNumTokens: u32, let MaxNumValues: u32, let MaxKeyFields: u32> {
json: [u8; NumBytes], // the raw json bytes
json_packed: [Field; NumPackedFields], // raw bytes, but packed into 31-byte Field elements
raw_transcript: [Field; MaxNumTokens], // transcript of json tokens after basic processing
Expand Down
Loading