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

feat(docs): Autogenerated Aztec-nr reference docs #3481

Merged
merged 37 commits into from
Feb 22, 2024
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e3b31b6
initial script
catmcgee Nov 30, 2023
0c42ed3
multiple line comment descriptions
catmcgee Dec 5, 2023
9b9b625
Merge branch 'master' into aztecnr-reference
catmcgee Dec 18, 2023
44df329
reference
catmcgee Jan 15, 2024
07c6b13
Merge branch 'master' into aztecnr-reference
catmcgee Feb 6, 2024
5a745d5
update script
catmcgee Feb 6, 2024
9cb59e9
kinda working
catmcgee Feb 6, 2024
6462e80
sidebar merge conflicts
catmcgee Feb 9, 2024
54bd296
Merge remote-tracking branch 'origin/master' into aztecnr-reference
catmcgee Feb 9, 2024
e4935e7
transcript.hpp
catmcgee Feb 9, 2024
5f88400
script
catmcgee Feb 9, 2024
8efe5ad
fix yarn start:dev:local
catmcgee Feb 12, 2024
6160d9b
add code block in functions
catmcgee Feb 12, 2024
92e6418
added some comments
catmcgee Feb 12, 2024
1edcd75
Merge branch 'master' into aztecnr-reference
catmcgee Feb 12, 2024
dd7a1a9
Merge branch 'master' into aztecnr-reference
catmcgee Feb 12, 2024
8e5b51d
Merge branch 'master' into aztecnr-reference
catmcgee Feb 12, 2024
a490da8
Merge remote-tracking branch 'origin/master' into aztecnr-reference
catmcgee Feb 13, 2024
0c8a8fe
Merge branch 'master' into aztecnr-reference
catmcgee Feb 13, 2024
cc7c599
Merge branch 'master' into aztecnr-reference
catmcgee Feb 14, 2024
5780de5
Merge branch 'master' into aztecnr-reference
catmcgee Feb 14, 2024
7799747
Merge branch 'master' into aztecnr-reference
catmcgee Feb 15, 2024
9990da1
Merge branch 'master' into aztecnr-reference
catmcgee Feb 15, 2024
579a042
woops
catmcgee Feb 15, 2024
2cd491c
update paths for ci
catmcgee Feb 15, 2024
36de06a
const -> let
catmcgee Feb 15, 2024
b4e5bd9
Merge branch 'master' into aztecnr-reference
catmcgee Feb 16, 2024
5eccc41
update paths
catmcgee Feb 16, 2024
a881a8b
Merge branch 'master' into aztecnr-reference
catmcgee Feb 16, 2024
ad8a686
Merge branch 'master' into aztecnr-reference
catmcgee Feb 16, 2024
8eaa5c2
Merge branch 'master' into aztecnr-reference
catmcgee Feb 16, 2024
5b48bcc
Merge remote-tracking branch 'origin/master' into aztecnr-reference
catmcgee Feb 22, 2024
5d15b9e
Merge branch 'master' into aztecnr-reference
signorecello Feb 22, 2024
a7dcd86
chore(docs): fix
signorecello Feb 22, 2024
f87af4a
fix?
signorecello Feb 22, 2024
b708225
fix?
signorecello Feb 22, 2024
6a371cc
Merge branch 'master' into aztecnr-reference
signorecello Feb 22, 2024
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
Prev Previous commit
Next Next commit
added some comments
  • Loading branch information
catmcgee committed Feb 12, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 92e6418a8103503c69ce44f39dce965e8b16be65
13 changes: 9 additions & 4 deletions docs/src/preprocess/generate_aztecnr_reference.js
Original file line number Diff line number Diff line change
@@ -173,14 +173,18 @@ function generateMarkdown(structs, functions) {
methods.forEach(func => {
markdown += `### ${escapeHtml(func.name)}\n\n`;

// Insert usage code block
const usageParams = func.params.map(param => param.name).join(', ');
markdown += "```rust\n" + `${func.structName}::${func.name}(${usageParams});` + "\n```\n\n";


// Description taken from a comment above the function decalaration
// If the comment is docs:, looks at the comment above
if (func.description) {
markdown += `${escapeHtml(func.description)}\n\n`;
}

// Codeblock for example usage
const usageParams = func.params.map(param => param.name).join(', ');
markdown += "```rust\n" + `${func.structName}::${func.name}(${usageParams});` + "\n```\n\n";

// Parameters
if (func.params.length > 0) {
markdown += `#### Parameters\n`;
markdown += `| Name | Type |\n| --- | --- |\n`;
@@ -192,6 +196,7 @@ function generateMarkdown(structs, functions) {
markdown += 'Takes no parameters.\n\n';
}

// Returns
if (func.returnType) {
markdown += `#### Returns\n`;
markdown += `| Type |\n| --- |\n`;
3 changes: 2 additions & 1 deletion yarn-project/aztec-nr/aztec/src/avm/context.nr
Original file line number Diff line number Diff line change
@@ -5,9 +5,10 @@ use dep::protocol_types::address::{

// Getters that will be converted by the transpiler into their
// own opcodes
// No new function as this struct is entirely static getters

struct AvmContext {}

// No new function as this struct is entirely static getters
impl AvmContext {
#[oracle(address)]
pub fn address() -> AztecAddress {}
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ struct PrivateGlobalVariables {
}
// docs:end:private-global-variables

// Note: public global vars are equal to the private ones
impl Serialize<PRIVATE_GLOBAL_VARIABLES_LENGTH> for PrivateGlobalVariables {
fn serialize(self) -> [Field; PRIVATE_GLOBAL_VARIABLES_LENGTH] {
[self.chain_id, self.version]
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ struct EasyPrivateUint {
storage_slot: Field,
}

impl EasyPrivateUint {
// Holds a note that can act similarly to an int.
pub fn new(
context: Context,
storage_slot: Field,
1 change: 1 addition & 0 deletions yarn-project/aztec-nr/safe-math/src/safe_u120.nr
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@ impl Deserialize<SAFE_U120_SERIALIZED_LEN> for SafeU120 {
}
}

// Holds an integer in public storage
impl SafeU120 {
pub fn min() -> Self {
Self {
Loading