mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-08 14:47:21 +00:00
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:
committed by
GitHub
parent
1ee71e54e5
commit
9fbbecc195
@@ -571,7 +571,7 @@ macro_rules! assert_ok {
|
||||
pub use serde::{Serialize, Deserialize};
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
pub mod tests {
|
||||
use super::*;
|
||||
use codec::{Codec, EncodeLike};
|
||||
use frame_metadata::{
|
||||
@@ -581,6 +581,18 @@ mod tests {
|
||||
use sp_std::{marker::PhantomData, result};
|
||||
use sp_io::TestExternalities;
|
||||
|
||||
/// A PalletInfo implementation which just panics.
|
||||
pub struct PanicPalletInfo;
|
||||
|
||||
impl crate::traits::PalletInfo for PanicPalletInfo {
|
||||
fn index<P: 'static>() -> Option<usize> {
|
||||
unimplemented!("PanicPalletInfo mustn't be triggered by tests");
|
||||
}
|
||||
fn name<P: 'static>() -> Option<&'static str> {
|
||||
unimplemented!("PanicPalletInfo mustn't be triggered by tests");
|
||||
}
|
||||
}
|
||||
|
||||
pub trait Config: 'static {
|
||||
type BlockNumber: Codec + EncodeLike + Default;
|
||||
type Origin;
|
||||
@@ -625,7 +637,7 @@ mod tests {
|
||||
impl Config for Test {
|
||||
type BlockNumber = u32;
|
||||
type Origin = u32;
|
||||
type PalletInfo = ();
|
||||
type PalletInfo = PanicPalletInfo;
|
||||
type DbWeight = ();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user