Add tipping into treasury (#4480)

* First draft

* Initial work on tests

* Add tests.

* Ensure old members can't tip.

* Fix complexity

* Update node runtime

* Build fix.

* build fix

* Fix tests

* Fix tests

* Refactor Contains impl for tests

* Introduce new way to avoid impl Contains conflicts

* Fixes

* Docs.

* Docs.

* Typo

* Whitespace

* Docs

* Typo

* Formatting

* Update frame/treasury/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/treasury/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Update frame/treasury/src/lib.rs

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Apply suggestions from code review

Co-Authored-By: Shawn Tabrizi <shawntabrizi@gmail.com>

* Add provisional weights.

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Gavin Wood
2020-01-09 14:39:12 +01:00
committed by Shawn Tabrizi
parent 586685fca0
commit 67202b7ec3
12 changed files with 666 additions and 100 deletions
+5 -4
View File
@@ -19,7 +19,7 @@
use super::*;
use std::cell::RefCell;
use frame_support::{impl_outer_origin, parameter_types, weights::Weight};
use frame_support::{impl_outer_origin, parameter_types, weights::Weight, ord_parameter_types};
use sp_core::H256;
// The testing primitives are very useful for avoiding having to work with signatures
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
@@ -41,9 +41,6 @@ parameter_types! {
pub const CandidateDeposit: u64 = 25;
pub const Period: u64 = 4;
pub const KickOrigin: u64 = 2;
pub const ScoreOrigin: u64 = 3;
pub const BlockHashCount: u64 = 250;
pub const MaximumBlockWeight: Weight = 1024;
pub const MaximumBlockLength: u32 = 2 * 1024;
@@ -53,6 +50,10 @@ parameter_types! {
pub const TransferFee: u64 = 0;
pub const CreationFee: u64 = 0;
}
ord_parameter_types! {
pub const KickOrigin: u64 = 2;
pub const ScoreOrigin: u64 = 3;
}
impl frame_system::Trait for Test {
type Origin = Origin;