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: Migrate from substrate to polkadot-sdk repo + Implement genesis builder #313

Merged
merged 17 commits into from
Dec 22, 2023

Conversation

tgntr
Copy link
Collaborator

@tgntr tgntr commented Dec 13, 2023

Detailed description:

Which issue(s) this PR fixes:
Fixes #241

Special notes for your reviewer:

Checklist

  • Documentation added
  • Tests updated

@tgntr tgntr self-assigned this Dec 13, 2023
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

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

Comparison is base (48fe3a3) 78.51% compared to head (f8f3323) 78.69%.

Files Patch % Lines
frame/balances/genesis_builder.go 83.09% 8 Missing and 4 partials ⚠️
api/genesis_builder/module.go 82.50% 4 Missing and 3 partials ⚠️
frame/aura/genesis_builder.go 87.23% 4 Missing and 2 partials ⚠️
frame/grandpa/genesis_builder.go 90.47% 4 Missing and 2 partials ⚠️
frame/transaction_payment/genesis_builder.go 76.00% 4 Missing and 2 partials ⚠️
primitives/types/public_key_sr25519.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #313      +/-   ##
===========================================
+ Coverage    78.51%   78.69%   +0.18%     
===========================================
  Files          159      165       +6     
  Lines        10500    10774     +274     
===========================================
+ Hits          8244     8479     +235     
- Misses        1895     1921      +26     
- Partials       361      374      +13     

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

continue
}

if err := genesisBuilder.BuildConfig(gcDecodedBytes); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see that we unmarshal the decoded bytes every time in each module. Thoughts on unmarshalling only once here, and pass the struct to the modules?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was thinking about it, but I'm not sure if that's achievable without predefining all available genesis configs. I think we should keep it dynamic, especially for when we start supporting custom pallets. Let me know if you have any ideas

api/genesis_builder/module_test.go Outdated Show resolved Hide resolved
frame/aura/genesis_builder.go Outdated Show resolved Hide resolved
frame/balances/genesis_builder.go Outdated Show resolved Hide resolved
frame/balances/genesis_builder.go Outdated Show resolved Hide resolved
frame/aura/genesis_builder.go Outdated Show resolved Hide resolved
@tgntr tgntr requested a review from failfmi December 14, 2023 06:57
api/genesis_builder/module.go Outdated Show resolved Hide resolved
frame/aura/genesis_builder_test.go Outdated Show resolved Hide resolved
frame/balances/genesis_builder.go Outdated Show resolved Hide resolved
@failfmi
Copy link
Collaborator

failfmi commented Dec 18, 2023

Can we update the node_template_runtime in build with the latest from the polkadot-sdk commit hash?

continue
}

if err := genesisBuilder.BuildConfig(gcDecodedBytes); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Every module configuration must be included in the bytes. Currently, you can execute the function without having balances

@failfmi failfmi linked an issue Dec 19, 2023 that may be closed by this pull request
@tgntr tgntr requested review from failfmi and radkomih December 20, 2023 09:31
@failfmi failfmi merged commit 2465c13 into develop Dec 22, 2023
5 checks passed
@failfmi failfmi deleted the polkadot-sdk branch December 22, 2023 07:45
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.

Switch Substrate module with Polkadot SDK repository
3 participants