-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: disable unused variable checks on low-level and oracle functions (
#4179) # Description ## Problem\* Resolves <!-- Link to GitHub Issue --> ## Summary\* Any low-level functions don't have a function implementation in Noir so all inputs will appear unused. We currently prefix these arguments with underscores to silence this but this leaks through into the docs where preferably we'd have non-underscored variables. This also affects any oracle functions which may exist in user code, requiring them to use underscores in the same way which isn't ideal. This PR then disables unused variable checks on any function with the `#[foreign]`, `#[builtin]` or `#[oracle]` attributes. ## Additional Context ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[Exceptional Case]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
- Loading branch information
1 parent
2d93169
commit 8f70e57
Showing
13 changed files
with
62 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
#[foreign(ecdsa_secp256k1)] | ||
// docs:start:ecdsa_secp256k1 | ||
pub fn verify_signature<N>( | ||
_public_key_x: [u8; 32], | ||
_public_key_y: [u8; 32], | ||
_signature: [u8; 64], | ||
_message_hash: [u8; N] | ||
public_key_x: [u8; 32], | ||
public_key_y: [u8; 32], | ||
signature: [u8; 64], | ||
message_hash: [u8; N] | ||
) -> bool | ||
// docs:end:ecdsa_secp256k1 | ||
{} | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
#[foreign(ecdsa_secp256r1)] | ||
// docs:start:ecdsa_secp256r1 | ||
pub fn verify_signature<N>( | ||
_public_key_x: [u8; 32], | ||
_public_key_y: [u8; 32], | ||
_signature: [u8; 64], | ||
_message_hash: [u8; N] | ||
public_key_x: [u8; 32], | ||
public_key_y: [u8; 32], | ||
signature: [u8; 64], | ||
message_hash: [u8; N] | ||
) -> bool | ||
// docs:end:ecdsa_secp256r1 | ||
{} | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
#[foreign(schnorr_verify)] | ||
// docs:start:schnorr_verify | ||
pub fn verify_signature<N>( | ||
_public_key_x: Field, | ||
_public_key_y: Field, | ||
_signature: [u8; 64], | ||
_message: [u8; N] | ||
public_key_x: Field, | ||
public_key_y: Field, | ||
signature: [u8; 64], | ||
message: [u8; N] | ||
) -> bool | ||
// docs:end:schnorr_verify | ||
{} | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters