-
Notifications
You must be signed in to change notification settings - Fork 1.6k
implement GenesisConfig for pallet-xcm #4125
implement GenesisConfig for pallet-xcm #4125
Conversation
Can you elaborate the problem that you're encountering and why this implementation is necessary to solve it? |
Support to modify the genesis config in TestExternalities.
|
@ascjones I see that you have authored the code at https://github.com/paritytech/substrate/blob/732f0371c2d4da7b0ec326c681e0c1d360fc1bd8/frame/system/src/lib.rs#L740-L758, would you kindly explain why it was necessary, and whether this PR needs to solve the same problem? |
@KiChjang it was simply to ease migration from the old-style FRAME macros to @thiolliere's FRAME-V2 macros, and is not stricly necessary. See the guide here: https://docs.substrate.io/rustdocs/latest/frame_support/attr.pallet.html#upgrade-guidelines. I think it was just to avoid having to update various tests etc. |
@zjb0807 So if your intention was simply to patch the code so it works with FRAMEv1 macros, then it isn't necessary. Do you have any other problems that you're trying to solve with this PR? |
I have said it many times to modify the genesis config in TestExternalities. In order to add the following code in mock.rs
|
@zjb0807 I also asked you to elaborate the problem , but you did not.
What you just said here simply tells me what your PR does, it does not tell me why you need to do it the way that you have. In order to really find out what the issue is, I've tried to call |
There is GenesisConfig in the |
xcm/pallet-xcm/src/mock.rs
Outdated
@@ -324,6 +324,10 @@ pub(crate) fn new_test_ext_with_balances( | |||
.assimilate_storage(&mut t) | |||
.unwrap(); | |||
|
|||
pallet_xcm::GenesisConfig { safe_xcm_version: Some(2) } | |||
.assimilate_storage::<Test>(&mut t) | |||
.unwrap(); |
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 think it is good practice to build the storages for all the pallets as would do a real genesis build. so this change could be kept.
WDYT @KiChjang ?
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.
That is fine for me, although this would not work as-is -- it would need your UFCS syntax in order to work.
bot merge |
* implement GenesisConfig for pallet-xcm * Apply review suggestions
Support to modify the genesis config in TestExternalities.