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
+5
View File
@@ -548,6 +548,7 @@ decl_module! {
/// Updates the schedule for metering contracts.
///
/// The schedule must have a greater version than the stored schedule.
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
pub fn update_schedule(origin, schedule: Schedule) -> DispatchResult {
ensure_root(origin)?;
if <Module<T>>::current_schedule().version >= schedule.version {
@@ -562,6 +563,7 @@ decl_module! {
/// Stores the given binary Wasm code into the chain's storage and returns its `codehash`.
/// You can instantiate contracts only with stored code.
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
pub fn put_code(
origin,
#[compact] gas_limit: Gas,
@@ -589,6 +591,7 @@ decl_module! {
/// * If the account is a regular account, any value will be transferred.
/// * If no account exists and the call value is not less than `existential_deposit`,
/// a regular account will be created and any value will be transferred.
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
pub fn call(
origin,
dest: <T::Lookup as StaticLookup>::Source,
@@ -614,6 +617,7 @@ decl_module! {
/// after the execution is saved as the `code` of the account. That code will be invoked
/// upon any call received by this account.
/// - The contract is initialized.
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
pub fn instantiate(
origin,
#[compact] endowment: BalanceOf<T>,
@@ -636,6 +640,7 @@ decl_module! {
///
/// If contract is not evicted as a result of this call, no actions are taken and
/// the sender is not eligible for the reward.
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
fn claim_surcharge(origin, dest: T::AccountId, aux_sender: Option<T::AccountId>) {
let origin = origin.into();
let (signed, rewarded) = match (origin, aux_sender) {