-
Notifications
You must be signed in to change notification settings - Fork 193
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
Conversation
There was a problem hiding this 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.
17eed1c
to
dfe390a
Compare
1f0804a
to
ad01832
Compare
Codecov ReportAttention:
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. |
There was a problem hiding this 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.
This PR allow dev accounts to be allocated from the JSON file
Closes #1496