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

Allow dev accounts to be allocated from the JSON file #1515

Merged
merged 3 commits into from
Feb 7, 2024

Conversation

fishseabowl
Copy link
Contributor

This PR allow dev accounts to be allocated from the JSON file
Closes #1496

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 @fishseabowl thanks for the contribution.

I think we can make this more simpler. We can avoid creating a new struct specifically to differentiate between the account types in the JSON level. Adding a private_key as optional field in GenesisAccountJson struct should be suffice and we can just check if its Some or None and convert it to the appropriate GenesisAccoutAlloc variant in Genesis::TryFrom<GenesisJson>.

The GenesisJson struct is just meant to be a translation layer to build Genesis from the JSON format, so I personally don't think we need types to explicitly define all account variants as long as we're able to define the structure correctly.

@fishseabowl fishseabowl reopened this Feb 7, 2024
Copy link

codecov bot commented Feb 7, 2024

Codecov Report

Attention: 588 lines in your changes are missing coverage. Please review.

Comparison is base (374f2bf) 70.06% compared to head (bb2f599) 70.59%.
Report is 24 commits behind head on main.

❗ Current head bb2f599 differs from pull request most recent head 1085dc8. Consider uploading reports for the commit 1085dc8 to get more accurate results

Files Patch % Lines
bin/katana/src/main.rs 0.00% 94 Missing ⚠️
crates/katana/runner/src/logs.rs 10.00% 72 Missing ⚠️
bin/saya/src/main.rs 0.00% 56 Missing ⚠️
crates/saya/core/src/lib.rs 0.00% 50 Missing ⚠️
crates/katana/primitives/src/genesis/mod.rs 92.40% 35 Missing ⚠️
bin/saya/src/args/mod.rs 0.00% 33 Missing ⚠️
...es/saya/core/src/data_availability/celestia/mod.rs 0.00% 33 Missing ⚠️
crates/katana/runner/src/prefunded.rs 0.00% 31 Missing ⚠️
bin/saya/src/args/data_availability.rs 0.00% 24 Missing ⚠️
bin/sozo/src/ops/migration/mod.rs 30.30% 23 Missing ⚠️
... and 24 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1515      +/-   ##
==========================================
+ Coverage   70.06%   70.59%   +0.53%     
==========================================
  Files         236      257      +21     
  Lines       22531    24921    +2390     
==========================================
+ Hits        15786    17594    +1808     
- Misses       6745     7327     +582     

☔ 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.

Looks good, nice work. Thanks.

@kariy kariy merged commit e8edf9f into dojoengine:main Feb 7, 2024
10 checks passed
@fishseabowl fishseabowl deleted the 1496_dev_account branch February 10, 2024 06:49
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.

[Katana] Allow dev accounts to be allocated from the JSON file
2 participants