Skip to content

Commit 682df8b

Browse files
authored
fix: export types mistakenly left private (#27)
1 parent e5669b6 commit 682df8b

File tree

5 files changed

+29
-9
lines changed

5 files changed

+29
-9
lines changed

.github/workflows/test.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,36 @@ on:
88

99
env:
1010
CARGO_TERM_COLOR: always
11+
MINIMUM_NOIR_VERSION: v0.37.0
1112

1213
jobs:
14+
noir-version-list:
15+
name: Query supported Noir versions
16+
runs-on: ubuntu-latest
17+
outputs:
18+
noir_versions: ${{ steps.get_versions.outputs.versions }}
19+
20+
steps:
21+
- name: Checkout sources
22+
id: get_versions
23+
run: |
24+
# gh returns the Noir releases in reverse chronological order so we keep all releases published after the minimum supported version.
25+
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')
26+
echo "versions=$VERSIONS"
27+
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
28+
env:
29+
GH_TOKEN: ${{ github.token }}
30+
1331
test:
32+
needs: [noir-version-list]
1433
name: Test on Nargo ${{matrix.toolchain}}
1534
runs-on: ubuntu-latest
1635
strategy:
1736
fail-fast: false
1837
matrix:
19-
toolchain: [nightly, 0.37.0]
38+
toolchain: ${{ fromJson( needs.noir-version-list.outputs.noir_versions )}}
39+
include:
40+
- toolchain: nightly
2041
steps:
2142
- name: Checkout sources
2243
uses: actions/checkout@v4
@@ -38,8 +59,7 @@ jobs:
3859
- name: Install Nargo
3960
uses: noir-lang/[email protected]
4061
with:
41-
toolchain: 0.37.0
42-
62+
toolchain: ${{ env.MINIMUM_NOIR_VERSION }}
4363
- name: Run formatter
4464
run: nargo fmt --check
4565

@@ -64,4 +84,4 @@ jobs:
6484
fi
6585
env:
6686
# We treat any cancelled, skipped or failing jobs as a failure for the workflow as a whole.
67-
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
87+
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}

Nargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ authors = [""]
55
compiler_version = ">=0.37.0"
66

77
[dependencies]
8-
noir_sort = {tag = "v0.2.0", git = "https://github.com/noir-lang/noir_sort"}
8+
noir_sort = {tag = "v0.2.1", git = "https://github.com/noir-lang/noir_sort"}

src/get_literal.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ global LITERAL_OFFSET_SHIFT: [Field; 6] =
1313
* @brief a JSON "literal" type has 3 states: "true", "false", "null".
1414
* As such we can't directly convert to a bool and cover all possible cases
1515
**/
16-
struct JSONLiteral {
16+
pub struct JSONLiteral {
1717
value: Field,
1818
}
1919

src/getters.nr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::transcript_entry::TranscriptEntry;
1212
/**
1313
* @brief records data used to reason about whether a key exists in a json blob
1414
**/
15-
struct KeySearchResult {
15+
pub struct KeySearchResult {
1616
found: bool, // does the key exist?
1717
target_lt_smallest_entry: bool, // is the target keyhash smaller than the smallest keyhash in self.key_hashes?
1818
target_gt_largest_entry: bool, // is the target keyhash larger than the largest keyhash in self.key_hashes?

src/json.nr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use crate::transcript_entry::{
2020
/**
2121
* @brief records a value in a json blob
2222
**/
23-
struct JSONValue<let MaxLength: u32> {
23+
pub struct JSONValue<let MaxLength: u32> {
2424
value: BoundedVec<u8, MaxLength>, // raw bytes that constitute the json value entry
2525
value_type: Field, // either STRING_TOKEN, NUMERIC_TOKEN or LITERAL_TOKEN
2626
}
@@ -42,7 +42,7 @@ impl<let MaxLength: u32> JSONValue<MaxLength> {
4242
* @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\"")
4343
* @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
4444
**/
45-
struct JSON<let NumBytes: u32, let NumPackedFields: u32, let MaxNumTokens: u32, let MaxNumValues: u32, let MaxKeyFields: u32> {
45+
pub struct JSON<let NumBytes: u32, let NumPackedFields: u32, let MaxNumTokens: u32, let MaxNumValues: u32, let MaxKeyFields: u32> {
4646
json: [u8; NumBytes], // the raw json bytes
4747
json_packed: [Field; NumPackedFields], // raw bytes, but packed into 31-byte Field elements
4848
raw_transcript: [Field; MaxNumTokens], // transcript of json tokens after basic processing

0 commit comments

Comments
 (0)