diff --git a/state-chain/pallets/cf-elections/src/electoral_systems/mocks.rs b/state-chain/pallets/cf-elections/src/electoral_systems/mocks.rs index d2a532de83..1a6c26e1d3 100644 --- a/state-chain/pallets/cf-elections/src/electoral_systems/mocks.rs +++ b/state-chain/pallets/cf-elections/src/electoral_systems/mocks.rs @@ -277,18 +277,18 @@ pub struct Check { #[macro_export] macro_rules! single_check_new { - ($arg_pre:ident, $arg_post:ident, $check_body:block, $param:ident) => { + ($state_type:ty, $arg_pre:ident, $arg_post:ident, $check_body:block, $param:ident) => { $crate::electoral_systems::mocks::SingleCheck::new( $param, #[track_caller] - |$arg_pre, $arg_post, $param| $check_body, + |$arg_pre: $state_type, $arg_post: $state_type, $param| $check_body, ) }; - ($arg_pre:ident, $arg_post:ident, $check_body:block) => { + ($state_type:ty, $arg_pre:ident, $arg_post:ident, $check_body:block) => { $crate::electoral_systems::mocks::SingleCheck::new( (), #[track_caller] - |$arg_pre, $arg_post, ()| $check_body, + |$arg_pre: $state_type, $arg_post: $state_type, ()| $check_body, ) }; } @@ -347,7 +347,7 @@ macro_rules! register_checks { impl Check<$system> { $( pub fn $check_name($($param: $param_type)?) -> Box + 'static> { - Box::new($crate::single_check_new!($arg_1, $arg_2, $check_body $(, $param)? )) + Box::new($crate::single_check_new!(&$crate::electoral_systems::mocks::ElectoralSystemState<$system>, $arg_1, $arg_2, $check_body $(, $param)? )) } )* } @@ -365,7 +365,7 @@ macro_rules! register_checks { { $( pub fn $check_name($($param: $param_type)?) -> Box + 'static> { - Box::new($crate::single_check_new!($arg_1, $arg_2, $check_body $(, $param)? )) + Box::new($crate::single_check_new!(&$crate::electoral_systems::mocks::ElectoralSystemState, $arg_1, $arg_2, $check_body $(, $param)? )) } )+ }