Replace last usages of <() as PalletInfo> in substrate (#8080)

* replace last occurences

* Update frame/support/src/traits.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update frame/support/test/src/lib.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* fix dispatch test

* move PanicPalletInfo to tests module

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
Guillaume Thiolliere
2021-02-09 16:28:34 +01:00
committed by GitHub
parent 1ee71e54e5
commit 9fbbecc195
21 changed files with 137 additions and 28 deletions
+21 -2
View File
@@ -2409,7 +2409,7 @@ mod tests {
use crate::weights::{DispatchInfo, DispatchClass, Pays, RuntimeDbWeight};
use crate::traits::{
CallMetadata, GetCallMetadata, GetCallName, OnInitialize, OnFinalize, OnRuntimeUpgrade,
IntegrityTest, Get,
IntegrityTest, Get, PalletInfo,
};
pub trait Config: system::Config + Sized where Self::AccountId: From<u32> { }
@@ -2562,13 +2562,32 @@ mod tests {
}
}
impl PalletInfo for TraitImpl {
fn index<P: 'static>() -> Option<usize> {
let type_id = sp_std::any::TypeId::of::<P>();
if type_id == sp_std::any::TypeId::of::<Test>() {
return Some(0)
}
None
}
fn name<P: 'static>() -> Option<&'static str> {
let type_id = sp_std::any::TypeId::of::<P>();
if type_id == sp_std::any::TypeId::of::<Test>() {
return Some("Test")
}
None
}
}
impl system::Config for TraitImpl {
type Origin = OuterOrigin;
type AccountId = u32;
type Call = OuterCall;
type BaseCallFilter = ();
type BlockNumber = u32;
type PalletInfo = ();
type PalletInfo = Self;
type DbWeight = ();
}