90fd044766
- snowbridge-pezpallet-* → pezsnowbridge-pezpallet-* (201 refs) - pallet/ directories → pezpallet/ (4 locations) - Fixed pezpallet.rs self-include recursion bug - Fixed sc-chain-spec hardcoded crate name in derive macro - Reverted .pezpallet_by_name() to .pallet_by_name() (subxt API) - Added BizinikiwiConfig type alias for zombienet tests - Deleted obsolete session state files Verified: pezsnowbridge-pezpallet-*, pezpallet-staking, pezpallet-staking-async, pezframe-benchmarking-cli all pass cargo check
49 lines
1.1 KiB
Rust
49 lines
1.1 KiB
Rust
use frame::{
|
|
deps::{pezframe_support::weights::constants::RocksDbWeight, pezframe_system::GenesisConfig},
|
|
prelude::*,
|
|
runtime::prelude::*,
|
|
testing_prelude::*,
|
|
};
|
|
|
|
// Configure a mock runtime to test the pezpallet.
|
|
#[frame_construct_runtime]
|
|
mod test_runtime {
|
|
#[runtime::runtime]
|
|
#[runtime::derive(
|
|
RuntimeCall,
|
|
RuntimeEvent,
|
|
RuntimeError,
|
|
RuntimeOrigin,
|
|
RuntimeFreezeReason,
|
|
RuntimeHoldReason,
|
|
RuntimeSlashReason,
|
|
RuntimeLockId,
|
|
RuntimeTask,
|
|
RuntimeViewFunction
|
|
)]
|
|
pub struct Test;
|
|
|
|
#[runtime::pezpallet_index(0)]
|
|
pub type System = pezframe_system;
|
|
#[runtime::pezpallet_index(1)]
|
|
pub type Template = crate;
|
|
}
|
|
|
|
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
|
|
impl pezframe_system::Config for Test {
|
|
type Nonce = u64;
|
|
type Block = MockBlock<Test>;
|
|
type BlockHashCount = ConstU64<250>;
|
|
type DbWeight = RocksDbWeight;
|
|
}
|
|
|
|
impl crate::Config for Test {
|
|
type RuntimeEvent = RuntimeEvent;
|
|
type WeightInfo = ();
|
|
}
|
|
|
|
// Build genesis storage according to the mock runtime.
|
|
pub fn new_test_ext() -> TestState {
|
|
GenesisConfig::<Test>::default().build_storage().unwrap().into()
|
|
}
|