From b60b9345950b5adc08cb6cd97415df84d6a4e18e Mon Sep 17 00:00:00 2001 From: cgeek <cem.moreau@gmail.com> Date: Thu, 16 Nov 2023 12:41:45 +0100 Subject: [PATCH] fix(#129): reveal the bug --- runtime/gdev/tests/common/mod.rs | 10 ++++++++++ runtime/gdev/tests/integration_tests.rs | 11 +++++++++++ 2 files changed, 21 insertions(+) diff --git a/runtime/gdev/tests/common/mod.rs b/runtime/gdev/tests/common/mod.rs index 66b0a2da0..2ad0ff205 100644 --- a/runtime/gdev/tests/common/mod.rs +++ b/runtime/gdev/tests/common/mod.rs @@ -141,6 +141,16 @@ impl ExtBuilder { self }*/ + pub fn change_parameters< + F: Fn(&mut pallet_duniter_test_parameters::Parameters<u32, u32, Balance>) -> (), + >( + mut self, + f: F, + ) -> Self { + f(&mut self.parameters); + self + } + pub fn build(self) -> sp_io::TestExternalities { let Self { initial_accounts, diff --git a/runtime/gdev/tests/integration_tests.rs b/runtime/gdev/tests/integration_tests.rs index 1690e0a49..c7438ebbd 100644 --- a/runtime/gdev/tests/integration_tests.rs +++ b/runtime/gdev/tests/integration_tests.rs @@ -1256,3 +1256,14 @@ fn test_new_account_linked() { ); }) } +#[test] +fn smith_data_problem() { + ExtBuilder::new(1, 3, 4) + .change_parameters(|parameters| { + parameters.smith_cert_validity_period = 3; + }) + .build() + .execute_with(|| { + run_to_block(4); + }); +} -- GitLab