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
+3
View File
@@ -157,6 +157,7 @@ decl_module! {
/// Issue a new class of fungible assets. There are, and will only ever be, `total`
/// such assets and they'll all belong to the `origin` initially. It will have an
/// identifier `AssetId` instance: this will be specified in the `Issued` event.
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
fn issue(origin, #[compact] total: T::Balance) {
let origin = ensure_signed(origin)?;
@@ -170,6 +171,7 @@ decl_module! {
}
/// Move some assets from one holder to another.
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
fn transfer(origin,
#[compact] id: T::AssetId,
target: <T::Lookup as StaticLookup>::Source,
@@ -188,6 +190,7 @@ decl_module! {
}
/// Destroy any assets of `id` owned by `origin`.
#[weight = frame_support::weights::SimpleDispatchInfo::default()]
fn destroy(origin, #[compact] id: T::AssetId) {
let origin = ensure_signed(origin)?;
let balance = <Balances<T>>::take((id, &origin));