mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 19:17:58 +00:00
Thread-local parameter_types for testing. (#7542)
* Thread-local parameter_types for testing. * Better docs. * Some minors * Merge'em * Update frame/support/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Align more to basti's trick * Update frame/support/src/lib.rs * Update frame/support/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -278,7 +278,6 @@ impl<T: Trait<I>, I: Instance> Contains<T::AccountId> for Module<T, I> {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
use std::cell::RefCell;
|
||||
use frame_support::{
|
||||
assert_ok, assert_noop, impl_outer_origin, parameter_types, weights::Weight,
|
||||
ord_parameter_types
|
||||
@@ -298,6 +297,8 @@ mod tests {
|
||||
pub const MaximumBlockWeight: Weight = 1024;
|
||||
pub const MaximumBlockLength: u32 = 2 * 1024;
|
||||
pub const AvailableBlockRatio: Perbill = Perbill::one();
|
||||
pub static Members: Vec<u64> = vec![];
|
||||
pub static Prime: Option<u64> = None;
|
||||
}
|
||||
impl frame_system::Trait for Test {
|
||||
type BaseCallFilter = ();
|
||||
@@ -334,11 +335,6 @@ mod tests {
|
||||
pub const Five: u64 = 5;
|
||||
}
|
||||
|
||||
thread_local! {
|
||||
static MEMBERS: RefCell<Vec<u64>> = RefCell::new(vec![]);
|
||||
static PRIME: RefCell<Option<u64>> = RefCell::new(None);
|
||||
}
|
||||
|
||||
pub struct TestChangeMembers;
|
||||
impl ChangeMembers<u64> for TestChangeMembers {
|
||||
fn change_members_sorted(incoming: &[u64], outgoing: &[u64], new: &[u64]) {
|
||||
|
||||
Reference in New Issue
Block a user