Skip to content

Commit

Permalink
fix: export types mistakenly left private (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
kashbrti authored Jan 9, 2025
1 parent e5669b6 commit 682df8b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 9 deletions.
28 changes: 24 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,36 @@ on:

env:
CARGO_TERM_COLOR: always
MINIMUM_NOIR_VERSION: v0.37.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 @@ -38,8 +59,7 @@ jobs:
- name: Install Nargo
uses: noir-lang/[email protected]
with:
toolchain: 0.37.0

toolchain: ${{ env.MINIMUM_NOIR_VERSION }}
- name: Run formatter
run: nargo fmt --check

Expand All @@ -64,4 +84,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') }}
2 changes: 1 addition & 1 deletion Nargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ authors = [""]
compiler_version = ">=0.37.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/get_literal.nr
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ global LITERAL_OFFSET_SHIFT: [Field; 6] =
* @brief a JSON "literal" type has 3 states: "true", "false", "null".
* As such we can't directly convert to a bool and cover all possible cases
**/
struct JSONLiteral {
pub struct JSONLiteral {
value: Field,
}

Expand Down
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
4 changes: 2 additions & 2 deletions src/json.nr
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::transcript_entry::{
/**
* @brief records a value in a json blob
**/
struct JSONValue<let MaxLength: u32> {
pub struct JSONValue<let MaxLength: u32> {
value: BoundedVec<u8, MaxLength>, // raw bytes that constitute the json value entry
value_type: Field, // either STRING_TOKEN, NUMERIC_TOKEN or LITERAL_TOKEN
}
Expand All @@ -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

0 comments on commit 682df8b

Please sign in to comment.