Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Keep the double colons when constructing the module name
  • Loading branch information
KiChjang committed Sep 8, 2021
commit e9c3f6c46e2fef0ee43e43bad35ac6d3d5b70322
2 changes: 1 addition & 1 deletion frame/support/procedural/src/construct_runtime/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl PalletPath {
pub fn module_name(&self) -> String {
self.inner.segments.iter().fold(String::new(), |mut acc, segment| {
if !acc.is_empty() {
acc.push('_');
acc.push_str("::");
}
acc.push_str(&segment.ident.to_string());
acc
Expand Down
4 changes: 2 additions & 2 deletions frame/support/test/tests/construct_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -968,12 +968,12 @@ fn pallet_in_runtime_is_correct() {

assert_eq!(PalletInfo::index::<NestedModule3>().unwrap(), 34);
assert_eq!(PalletInfo::name::<NestedModule3>().unwrap(), "NestedModule3");
assert_eq!(PalletInfo::module_name::<NestedModule3>().unwrap(), "nested_module3");
assert_eq!(PalletInfo::module_name::<NestedModule3>().unwrap(), "nested::module3");
assert_eq!(PalletInfo::crate_version::<NestedModule3>().unwrap(), CrateVersion::new(3, 0, 0));

assert_eq!(PalletInfo::index::<Module3>().unwrap(), 35);
assert_eq!(PalletInfo::name::<Module3>().unwrap(), "Module3");
assert_eq!(PalletInfo::module_name::<Module3>().unwrap(), "self_module3");
assert_eq!(PalletInfo::module_name::<Module3>().unwrap(), "self::module3");
assert_eq!(PalletInfo::crate_version::<Module3>().unwrap(), CrateVersion::new(3, 0, 0));

assert_eq!(PalletInfo::index::<Module1_3>().unwrap(), 6);
Expand Down