Closed alfellati closed 2 years ago
I got it, the issue is in lib-serml/defi/serp::serp_tes_now
and other SERP impls as highlighted below (taken from the error output submitted above):
9: serp_treasury::<impl module_support::SerpTreasury<<T as frame_system::pallet::Config>::AccountId> for serp_treasury::module::Pallet<T>>::serp_tes_now
at lib-serml/defi/serp/src/lib.rs:444:39
10: serp_treasury::<impl serp_treasury::module::Pallet<T>>::stable_inflation_on_initialize
at lib-serml/defi/serp/src/lib.rs:395:13
11: <serp_treasury::module::Pallet<T> as frame_support::traits::hooks::Hooks<<T as frame_system::pallet::Config>::BlockNumber>>::on_initialize
at lib-serml/defi/serp/src/lib.rs:302:5
12: <serp_treasury::module::Pallet<T> as frame_support::traits::hooks::OnInitialize<<T as frame_system::pallet::Config>::BlockNumber>>::on_initialize
at lib-serml/defi/serp/src/lib.rs:284:12
We can introduce a SerpTesPeriod
to study it and see if the division by zero comes from the fact that the DEX pools considered in SerpTes are not provided for on genesis, this may be the reason why the saturating_div
used there is dividing by zero. If not, a way will be found Insha'Allah
We can also introduce an if
then statement to ensure
that the SetSwap DEX Liquidity Pools are noy zero (empty).
Closed in #804
Error: Thread 'tokio-runtime-worker' panicked at 'attempt to divide by zero' when I
make run
. The output is as such: