Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
sr-support: revert back the changes in runtime for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Guanqun Lu committed Sep 13, 2018
1 parent 6842108 commit c734a43
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions srml/treasury/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -157,7 +158,9 @@ impl<T: Trait> Module<T> {

// 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);
<balances::Module<T>>::reserve(&proposer, bond)
.map_err(|_| "Proposer's balance too low")?;
Expand Down

0 comments on commit c734a43

Please sign in to comment.