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

fix: handle edge cases during registration #452

Merged
merged 3 commits into from
Nov 6, 2024

Conversation

shekohex
Copy link
Contributor

@shekohex shekohex commented Nov 6, 2024

This pull request includes several updates to dependencies, submodules, and error handling in the project. The most important changes are the addition of a new dependency, updates to submodule commits, and improvements in error handling and function implementation.

Dependency updates:

  • Added eyre version 0.6.12 to Cargo.toml to enhance error reporting capabilities.

Error handling improvements:

  • Added a new error variant NotActiveOperator to the RunnerError enum in sdk/src/runners/mod.rs to handle cases where the operator is not active.
  • Modified impl BlueprintConfig for TangleConfig in sdk/src/runners/tangle.rs to check if the operator is active and return the new NotActiveOperator error if not.

Function implementation improvements:

  • Updated sdk_main_impl function in macros/blueprint-proc-macro/src/sdk_main.rs to dynamically determine the return type of the inner_main function based on the input function signature.

With this new change, our error reporting is way cleaner, for example here is when the operator is not an active one:

INFO gadget: Starting the event watcher ...
Error:
   0: You are currently not an active operator
      Please checkout the docs here: https://docs.tangle.tools/restake/join_operator/join

Location:
   src/main.rs:69

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Closes #408
Closes #451

@shekohex shekohex merged commit 889d12c into main Nov 6, 2024
13 checks passed
@shekohex shekohex deleted the shady/fix-operator-profile branch November 6, 2024 15:58
@webb-spider webb-spider bot mentioned this pull request Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants