Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions docs/docs-developers/docs/aztec-nr/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ LOG_LEVEL="info;debug:simulator:client_execution_context;debug:simulator:client_
| `Public state writes only supported in public functions` | Move state writes to public functions |
| `Unknown contract 0x0` | Call `wallet.registerContract(...)` to register contract |
| `No public key registered for address` | Call `wallet.registerSender(...)` |
| `Direct invocation of ... functions is not supported` | Use `self.call()`, `self.view()`, or `self.enqueue()` to [call contract functions](framework-description/calling_contracts.md) |
| `Failed to solve brillig function` | Check function parameters and note validity |

### Circuit Errors
Expand Down
5 changes: 5 additions & 0 deletions docs/netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -791,3 +791,8 @@
from = "/errors/5"
to = "/aztec-nr-api/nightly/noir_aztec/macros/events/fn.event.html"

[[redirects]]
# Aztec-nr: direct invocation of contract functions is not supported
from = "/errors/6"
to = "/developers/docs/aztec-nr/framework-description/calling_contracts"

Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ comptime fn make_functions_uncallable<let N: u32>(functions: [FunctionDefinition
let name = function.name();
// The body of the function will contain a static_assert(false, ...) to prevent the function from being called
// directly and a std::mem::zeroed() to make the compilation fail on the static_assert and not on a missing
// return value. TODO(benesjan): Add a link to the documentation for instructions on the proper invocation of
// functions.
let error_message = f"{error_message_template}{name}. See documentation for instructions on the proper invocation of functions.";
// return value.
let error_message = f"{error_message_template}{name}. See https://docs.aztec.network/errors/6";
let body = f"{{ std::static_assert(false, \"{error_message}\"); std::mem::zeroed() }}".quoted_contents();
let body_expr = body.as_expr().expect(f"Body is not an expression: {body}");

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Direct invocation of private functions is not supported. You attempted to call arbitrary_external_function. See documentation for instructions on the proper invocation of functions.
Direct invocation of private functions is not supported. You attempted to call arbitrary_external_function. See https://docs.aztec.network/errors/6
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Direct invocation of private internal functions is not supported. You attempted to call arbitrary_private_function. See documentation for instructions on the proper invocation of functions.
Direct invocation of private internal functions is not supported. You attempted to call arbitrary_private_function. See https://docs.aztec.network/errors/6
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Direct invocation of public functions is not supported. You attempted to call arbitrary_external_function. See documentation for instructions on the proper invocation of functions.
Direct invocation of public functions is not supported. You attempted to call arbitrary_external_function. See https://docs.aztec.network/errors/6
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Direct invocation of public internal functions is not supported. You attempted to call arbitrary_public_function. See documentation for instructions on the proper invocation of functions.
Direct invocation of public internal functions is not supported. You attempted to call arbitrary_public_function. See https://docs.aztec.network/errors/6
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Calling utility functions directly from within the contract is not supported. You attempted to call arbitrary_external_function. See documentation for instructions on the proper invocation of functions.
Calling utility functions directly from within the contract is not supported. You attempted to call arbitrary_external_function. See https://docs.aztec.network/errors/6
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we take the opportunity to make this error consistent with the other ones?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What other ones?

Copy link
Contributor

Choose a reason for hiding this comment

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

You had:

  • "Direct invocation of private functions is not supported..."
  • "Direct invocation of public functions is not supported..."
  • "Direct invocation of public internal functions is not supported..."
  • "Calling utility functions directly from within the contract is not supported."

I thought we could have made it consistent

Loading