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(katana): injects controller account in genesis config #2089

Merged
merged 16 commits into from
Jun 25, 2024

Conversation

kariy
Copy link
Member

@kariy kariy commented Jun 20, 2024

Description

Inject Cartridge Controller account from Slot's currently authenticated user. An experimental feature for now to easily play around and develop using a controller account in development environment.

The CLI flag to enable this feature is hidden.

Doesn't affect the randomly generated default accounts.

Flow:

  1. Upon starting Katana, it will fetch the credentials of the currently authenticated Slot user. Will return error if no authenticated user.
  2. Declare the Catridge controller class.
  3. Get the contract address, and WebAuthn credentials.
  4. Inject those values in the genesis config.

Related issue

Tests

  • Yes
  • No, because they aren't needed
  • No, because I need help

Added to documentation?

  • README.md
  • Dojo Book
  • No documentation needed (Still experimental, and the CLI arg is hidden)

Checklist

  • I've formatted my code (scripts/prettier.sh, scripts/rust_fmt.sh, scripts/cairo_fmt.sh)
  • I've linted my code (scripts/clippy.sh, scripts/docs.sh)
  • I've commented my code
  • I've requested a review after addressing the comments

@kariy kariy marked this pull request as ready for review June 20, 2024 00:58
@kariy
Copy link
Member Author

kariy commented Jun 20, 2024

@lambda-0x you can test PR #2069 against this PR's Katana

@kariy kariy requested a review from lambda-0x June 20, 2024 01:13
@kariy kariy changed the title feat(katana): add controller account injector feat(katana): injects controller account in genesis config Jun 20, 2024
Copy link

codecov bot commented Jun 20, 2024

Codecov Report

Attention: Patch coverage is 66.85083% with 60 lines in your changes missing coverage. Please review.

Project coverage is 68.50%. Comparing base (8a5902b) to head (3d22e8d).

Files Patch % Lines
crates/katana/controller/src/lib.rs 64.59% 57 Missing ⚠️
bin/katana/src/args.rs 81.81% 2 Missing ⚠️
bin/katana/src/main.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2089      +/-   ##
==========================================
- Coverage   68.51%   68.50%   -0.01%     
==========================================
  Files         329      331       +2     
  Lines       41096    41271     +175     
==========================================
+ Hits        28155    28271     +116     
- Misses      12941    13000      +59     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kariy kariy merged commit 79463be into main Jun 25, 2024
14 of 15 checks passed
@kariy kariy deleted the controller/katana branch June 25, 2024 00:28
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.

1 participant