Extend PalletInfoAccess with module_name and crate_version method (#9690)

* Record pallet indices in CallMetadata

* Resurrect PalletVersion infrastructure and rename as CrateVersion

* cargo fmt

* Add missing runtime generics to pallet struct

* Fix path to instance

* Fix test

* Fix UI test expectations

* Fix UI test expectations

* Move crate_version function to PalletInfoAccess

* Update UI test expectations

* Add crate_name method to PalletInfo

* Convert path to module name instead of exposing crate name

* cargo fmt

* Keep the double colons when constructing the module name

* Remove unused import

* Update UI test expectations

* Update frame/support/src/traits/metadata.rs

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>

* Update UI test expectations

Co-authored-by: Guillaume Thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
Keith Yeung
2021-09-28 02:35:33 -07:00
committed by GitHub
parent 951a033e8d
commit 7b65b049cb
13 changed files with 299 additions and 16 deletions
+6
View File
@@ -49,6 +49,12 @@ impl frame_support::traits::PalletInfo for PanicPalletInfo {
fn name<P: 'static>() -> Option<&'static str> {
unimplemented!("PanicPalletInfo mustn't be triggered by tests");
}
fn module_name<P: 'static>() -> Option<&'static str> {
unimplemented!("PanicPalletInfo mustn't be triggered by tests");
}
fn crate_version<P: 'static>() -> Option<frame_support::traits::CrateVersion> {
unimplemented!("PanicPalletInfo mustn't be triggered by tests");
}
}
/// Provides an implementation of [`frame_support::traits::Randomness`] that should only be used in