Skip to content

fix: #[aztec] macro warnings#12038

Merged
benesjan merged 12 commits intomasterfrom
02-17-fix_missing_import_warnings_in_macros
Feb 18, 2025
Merged

fix: #[aztec] macro warnings#12038
benesjan merged 12 commits intomasterfrom
02-17-fix_missing_import_warnings_in_macros

Conversation

@benesjan
Copy link
Copy Markdown
Contributor

@benesjan benesjan commented Feb 17, 2025

Fixes #11863

Copy link
Copy Markdown
Contributor Author

benesjan commented Feb 17, 2025

@benesjan benesjan changed the title fix: missing import warnings in macros fix: missing import warnings in#[aztec] macro Feb 17, 2025
@benesjan benesjan changed the title fix: missing import warnings in#[aztec] macro fix: #[aztec] macro warnings Feb 17, 2025
$if_statements
else {
panic(f"Unknown note type ID: {note_type_id}")
unconstrained fn compute_note_hash_and_optionally_a_nullifier(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to do this change because if we returned a body from the if and then return the final quote from the function later we would get warnings in cases where there are no notes as the function args would be unused.

let body = if notes.len() > 0 {
if notes.len() > 0 {
quote {
// Because this unconstrained function is injected after the contract is processed by the macros, it'll not
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to do this change because if we returned a body from the if and then return the final quote from the function later we would get warnings in cases where there are no notes as the function args would be unused.

bytes
}

// TODO(#10537): Consider nuking this function.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change. Linked the issue here when I was doing old issues cleanup.

@benesjan benesjan removed the S-blocked Status: Blocked label Feb 17, 2025
@benesjan benesjan force-pushed the 02-14-refactor_notes_implementing_packable_n_ branch from 4a8b6e2 to 0c4115b Compare February 18, 2025 08:15
@benesjan benesjan force-pushed the 02-17-fix_missing_import_warnings_in_macros branch from 4f0f5e0 to 5e14e15 Compare February 18, 2025 08:15
@benesjan benesjan marked this pull request as draft February 18, 2025 08:16
@benesjan benesjan force-pushed the 02-17-fix_missing_import_warnings_in_macros branch from 5e14e15 to cb6ab93 Compare February 18, 2025 08:33
@benesjan benesjan force-pushed the 02-14-refactor_notes_implementing_packable_n_ branch 2 times, most recently from 37ce5ab to 860847c Compare February 18, 2025 08:40
@benesjan benesjan force-pushed the 02-17-fix_missing_import_warnings_in_macros branch from cb6ab93 to 63d6fc4 Compare February 18, 2025 08:40
@benesjan benesjan force-pushed the 02-14-refactor_notes_implementing_packable_n_ branch from 860847c to c8e8515 Compare February 18, 2025 08:55
@benesjan benesjan force-pushed the 02-17-fix_missing_import_warnings_in_macros branch from 63d6fc4 to 0cdc71a Compare February 18, 2025 08:55
@benesjan benesjan force-pushed the 02-14-refactor_notes_implementing_packable_n_ branch from c8e8515 to d8c127f Compare February 18, 2025 09:20
@benesjan benesjan force-pushed the 02-17-fix_missing_import_warnings_in_macros branch from 0cdc71a to 8322f0e Compare February 18, 2025 09:20
@benesjan benesjan marked this pull request as ready for review February 18, 2025 11:34
@benesjan benesjan requested a review from nventuro February 18, 2025 12:31
@benesjan benesjan force-pushed the 02-17-fix_missing_import_warnings_in_macros branch from 518ab62 to a21c5bc Compare February 18, 2025 14:07
@benesjan benesjan force-pushed the 02-14-refactor_notes_implementing_packable_n_ branch from d8c127f to a1afb7a Compare February 18, 2025 14:07
Base automatically changed from 02-14-refactor_notes_implementing_packable_n_ to master February 18, 2025 17:41
@benesjan benesjan force-pushed the 02-17-fix_missing_import_warnings_in_macros branch from 381501c to fb8222e Compare February 18, 2025 18:05
@benesjan benesjan enabled auto-merge (squash) February 18, 2025 18:07
@benesjan benesjan merged commit f897f03 into master Feb 18, 2025
@benesjan benesjan deleted the 02-17-fix_missing_import_warnings_in_macros branch February 18, 2025 18:44
TomAFrench added a commit that referenced this pull request Feb 19, 2025
* master: (245 commits)
  chore: Fix unbound CI variable on release image bootstrap (#12095)
  fix: dry run on grind (#12088)
  fix(spartan): eth-execution logging (#12094)
  fix: aws_handle_evict recovery & termination (#12086)
  chore: Use native acvm when available on orchestrator tests (#11560)
  refactor: function macros cleanup (#12066)
  refactor: remove `addNullifiedNote` from pxe (#11822)
  fix: `#[aztec]` macro warnings (#12038)
  refactor!: Notes implementing `Packable<N>` (#12004)
  chore(ops): add gcloud cli into devbox base image (#12082)
  fix: hotfix grinding
  fix: L1 deployment on reth (#12060)
  fix: Add missing bootstrap fast aliases (#12078)
  fix: hash_str caching (#12074)
  fix: Naive attempt to fix nightly deployments (#12079)
  fix: kind smoke (#12084)
  refactor!: nuking `NoteHeader` (#11942)
  fix: inject dockerhub creds (#12072)
  feat(docs): Note discovery concepts page (#11760)
  chore: cleanup libp2p logger (#12058)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove import warnings caused by macros

2 participants