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

[Katana] Allow choosing the class in the genesis file without affecting the actual class hash #1975

Merged
merged 8 commits into from
May 22, 2024

Conversation

Yogalholic
Copy link
Contributor

@Yogalholic Yogalholic commented May 16, 2024

Description

Add a name field in GenesisClassJson that allows class identification by a unique name rather than by hash in Katana

Related issue

Fixes #<#1502>

Tests

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

Added to documentation?

  • README.md
  • Dojo Book
  • No documentation needed

Checklist

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

Copy link
Member

@kariy kariy left a comment

Choose a reason for hiding this comment

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

hey sorry for not being too active on this PR!

thanks for the work! its looking good so far, just have some few feedbacks. but overall its looking great!

crates/katana/primitives/src/genesis/json.rs Outdated Show resolved Hide resolved
crates/katana/primitives/src/genesis/json.rs Outdated Show resolved Hide resolved
crates/katana/primitives/src/genesis/json.rs Outdated Show resolved Hide resolved
crates/katana/primitives/src/genesis/json.rs Outdated Show resolved Hide resolved
@kariy
Copy link
Member

kariy commented May 20, 2024

i've also took the liberty to add some changes in 8403a27 . basically adding a custom deserializer for the NameOrHash enum.

because both are parsed as string in the JSON format, we need to do distinguish between when user set an actual class hash (with 0x prefix) or a name.

Copy link

codecov bot commented May 20, 2024

Codecov Report

Attention: Patch coverage is 76.19048% with 45 lines in your changes are missing coverage. Please review.

Project coverage is 69.70%. Comparing base (bec687b) to head (cc51ab3).

Files Patch % Lines
crates/katana/primitives/src/genesis/json.rs 76.19% 45 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1975      +/-   ##
==========================================
- Coverage   69.73%   69.70%   -0.04%     
==========================================
  Files         314      314              
  Lines       35654    35766     +112     
==========================================
+ Hits        24864    24931      +67     
- Misses      10790    10835      +45     

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

Copy link
Member

@kariy kariy left a comment

Choose a reason for hiding this comment

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

nice it looks good! i've helped added some stuff and just some styling

thanks!!

@kariy kariy merged commit 9aa4301 into dojoengine:main May 22, 2024
13 checks passed
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.

2 participants