From d209d0c71945429d7e93b00f3b94038e9c9ea8be Mon Sep 17 00:00:00 2001 From: Gavin Wood Date: Wed, 15 Jan 2020 20:20:32 +0100 Subject: [PATCH] Fix overflow in crowdfunding module (#771) * Fix overflow in crowdfunding module * Bump impl version --- polkadot/runtime/common/src/crowdfund.rs | 5 ++++- polkadot/runtime/kusama/src/lib.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/polkadot/runtime/common/src/crowdfund.rs b/polkadot/runtime/common/src/crowdfund.rs index 801fd7a844..127a2ed5e5 100644 --- a/polkadot/runtime/common/src/crowdfund.rs +++ b/polkadot/runtime/common/src/crowdfund.rs @@ -395,7 +395,10 @@ decl_module! { let fund = Self::funds(index).ok_or("invalid fund index")?; ensure!(fund.parachain.is_none(), "cannot dissolve fund with active parachain"); let now = >::block_number(); - ensure!(now >= fund.end + T::RetirementPeriod::get(), "retirement period not over"); + ensure!( + now >= fund.end.saturating_add(T::RetirementPeriod::get()), + "retirement period not over" + ); let account = Self::fund_account_id(index); diff --git a/polkadot/runtime/kusama/src/lib.rs b/polkadot/runtime/kusama/src/lib.rs index 2298f27151..c870d5fba1 100644 --- a/polkadot/runtime/kusama/src/lib.rs +++ b/polkadot/runtime/kusama/src/lib.rs @@ -78,7 +78,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { impl_name: create_runtime_str!("parity-kusama"), authoring_version: 2, spec_version: 1040, - impl_version: 1, + impl_version: 2, apis: RUNTIME_API_VERSIONS, };