Skip to content

refactor: parachain template#4684

Merged
gupnik merged 12 commits intoparitytech:masterfrom
Daanvdplas:daan/refactor-parachain_template
Jun 18, 2024
Merged

refactor: parachain template#4684
gupnik merged 12 commits intoparitytech:masterfrom
Daanvdplas:daan/refactor-parachain_template

Conversation

@Daanvdplas
Copy link
Copy Markdown
Contributor

@Daanvdplas Daanvdplas commented Jun 3, 2024

Update parachain template pallet based on polkadot sdk docs

@kianenigma

Copy link
Copy Markdown
Contributor

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

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

Great!

CC @gupnik @rzadp let's agree on all changes here, then mirror it in all 3 pallet templates?

{
System: frame_system::{Pallet, Call, Config<T>, Storage, Event<T>},
TemplateModule: crate::{Pallet, Call, Storage, Event<T>},
pub enum Test {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
pub enum Test {
pub struct Test {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@gupnik we can move all of this to the new syntax as well right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@gupnik we can move all of this to the new syntax as well right?

Yes! @Daanvdplas Do you want to give that a try? #1378 should help.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will finish this weekend

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It also compiled without experimental feature, didn't run a local network with it though, added it because I saw it being used in other places.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, runtime macro is out of experimental now.

@kianenigma kianenigma added the T11-documentation This PR/Issue is related to documentation. label Jun 7, 2024
@Daanvdplas Daanvdplas force-pushed the daan/refactor-parachain_template branch from a642271 to 768af06 Compare June 15, 2024 16:11
@Daanvdplas
Copy link
Copy Markdown
Contributor Author

Daanvdplas commented Jun 15, 2024

CC @gupnik @rzadp let's agree on all changes here, then mirror it in all 3 pallet templates?

FYI, with Pop CLI we are working on a feature pop new pallet & pop add pallet. These commands create a new pallet from the pallet template and add the pallet to the runtime, respectively. This could effectively mean that the templates offered in the polkadot sdk (i.e. minimal, solo & parachain) won't need the pallet template included. In stead, a separate pallet crate can be created that can be used by all three.

@Daanvdplas Daanvdplas requested a review from kianenigma June 16, 2024 16:15
# frame deps
frame-benchmarking = { path = "../../../../substrate/frame/benchmarking", default-features = false, optional = true }
frame-support = { path = "../../../../substrate/frame/support", default-features = false }
frame-support = { path = "../../../../substrate/frame/support", default-features = false, features = ["experimental"] }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should not add experimental stuff to the template. The point of it being that it is still experimental and subject to change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So revert the changes regarding construct runtime v2? @gupnik

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So revert the changes regarding construct runtime v2? @gupnik

It's not experimental anymore. You should be able to use it without that flag @Daanvdplas.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Then we should not enable the experimental feature :P

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Apologies, I thought seeing it being used in the kitchen sink runtime but I think I had a bad dream. Thanks Kian

@Daanvdplas
Copy link
Copy Markdown
Contributor Author

Should be good to go now

Copy link
Copy Markdown
Contributor

@skunert skunert left a comment

Choose a reason for hiding this comment

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

Looks nice!

@gupnik gupnik added this pull request to the merge queue Jun 18, 2024
Merged via the queue into paritytech:master with commit 7c847f8 Jun 18, 2024
TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Aug 2, 2024
Update parachain template pallet based on polkadot sdk docs

@kianenigma

---------

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
sfffaaa pushed a commit to peaqnetwork/polkadot-sdk that referenced this pull request Dec 27, 2024
Update parachain template pallet based on polkadot sdk docs

@kianenigma

---------

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T11-documentation This PR/Issue is related to documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants