This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
migrations: VersionedRuntimeUpgrade #14311
migrations: VersionedRuntimeUpgrade #14311
Changes from 6 commits
0885a4f
9c0072f
2f30d00
451de26
d8bc4d7
53f6170
617c864
1b9c68d
acc9b0c
c3638c5
f5cab56
bd42fbe
0aae7e8
71f7c6c
7919778
44d65b0
87ecff5
284a403
53bf2f1
d34405a
46f8bfb
3c31046
5bdb5b8
65fd376
9941c7c
6fd6c10
446b19e
2b23890
53473ee
e78ff5a
27f35d1
7f8add6
52b920e
a16eba7
c8e0538
2417754
a72c9b7
63542cf
547feec
8c2050c
ae484c7
ab880cb
605f63d
8a9e31c
e5d4207
888f5eb
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
possibly not to difficult to make this not be
ignore
and actually compile.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.
are you thinking I'd use the dummy pallet and upgrades from my test file? I'd rather not use a migration from a real pallet since it creates a dependency that could break. I'm also curious what the benefit/s are of making the comment compile
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.
For readability purposes, I would consider moving
Pallet
andDbWeight
to be associated types rather than generics and hardcoded. This might require you to add another trait. When a pallet is implementing this new trait, it will fix itsPallet
andDbWeight
(both of which can be obtained fromsystem
).Then, in the runtime, when you are wrapping things in
VersionedRuntimeUpgrade
, you only see(VersionedRuntimeUpgrade<1, 2, Foo>, VersionedRuntimeUpgrade<5, 6, Bar>)
.Possibly not worth it, especially as I am still critical of the fundamental approach.
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.
I'm unsure how to obtain
Pallet
fromsystem
do you have an example you could point me towards?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.
I'm able to remove the
DbWeight
from the runtime file like this, without needing to create a new trait:before (inside migrations file):
after (inside migrations file):
Then in the runtime file, you no longer need to pass the DbWeight:
Let me know if this approach is also OK, it seems to keep things clean in the runtime file without needing to create an extra trait, but I'm a noob with associated types so definitely may be missing something, please let me know if I am.