From c734a434972daf2a1ee55e1a0958e78a8795a504 Mon Sep 17 00:00:00 2001 From: Guanqun Lu Date: Fri, 14 Sep 2018 00:18:37 +0800 Subject: [PATCH] sr-support: revert back the changes in runtime for now --- srml/treasury/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/srml/treasury/src/lib.rs b/srml/treasury/src/lib.rs index 0f0b2559cf729..51d00224d8fec 100644 --- a/srml/treasury/src/lib.rs +++ b/srml/treasury/src/lib.rs @@ -46,6 +46,7 @@ use runtime_support::{StorageValue, StorageMap}; use runtime_support::dispatch::Result; use runtime_primitives::{Permill, traits::{OnFinalise, Zero, EnsureOrigin}}; use balances::OnDilution; +use system::ensure_signed; /// Our module's configuration trait. All our types and consts go in here. If the /// module is dependent on specific other modules, then their configuration traits @@ -73,7 +74,7 @@ decl_module! { // Put forward a suggestion for spending. A deposit proportional to the value // is reserved and slashed if the proposal is rejected. It is returned once the // proposal is awarded. - fn propose_spend(SystemOrigin(Signed(proposer)), value: T::Balance, beneficiary: T::AccountId) -> Result; + fn propose_spend(origin, value: T::Balance, beneficiary: T::AccountId) -> Result; // Set the balance of funds available to spend. fn set_pot(new_pot: T::Balance) -> Result; @@ -157,7 +158,9 @@ impl Module { // Implement Calls and add public immutables and private mutables. - fn propose_spend(proposer: T::AccountId, value: T::Balance, beneficiary: T::AccountId) -> Result { + fn propose_spend(origin: T::Origin, value: T::Balance, beneficiary: T::AccountId) -> Result { + let proposer = ensure_signed(origin)?; + let bond = Self::calculate_bond(value); >::reserve(&proposer, bond) .map_err(|_| "Proposer's balance too low")?;