Mandate weight annotation (#5357)

* Disallow default weight

* Fix build and test

* Fix tests

* Fix another beloved ui test.

* fix beloved trybuild tests

* fix treasury?

* Final test fix

* Fix build

* Fix another one

* Fix

* More doctest fix
This commit is contained in:
Kian Paimani
2020-03-26 11:17:05 +01:00
committed by GitHub
parent 7cbadd73be
commit a0772117ac
27 changed files with 111 additions and 48 deletions
+2
View File
@@ -157,6 +157,7 @@
//! decl_module! {
//! pub struct Module<T: Trait> for enum Call where origin: T::Origin {
//! /// Reward a validator.
//! #[weight = frame_support::weights::SimpleDispatchInfo::default()]
//! pub fn reward_myself(origin) -> dispatch::DispatchResult {
//! let reported = ensure_signed(origin)?;
//! <staking::Module<T>>::reward_by_ids(vec![(reported, 10)]);
@@ -1476,6 +1477,7 @@ decl_module! {
/// This can be called from any origin.
///
/// - `stash`: The stash account to reap. Its balance must be zero.
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
fn reap_stash(_origin, stash: T::AccountId) {
ensure!(T::Currency::total_balance(&stash).is_zero(), Error::<T>::FundedTarget);
Self::kill_stash(&stash)?;