Document weight for asset, system and timestamp pallets (#5593)

Co-Authored-By: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
Alexander Popiak
2020-04-24 12:00:07 +02:00
committed by GitHub
parent 8ac2bac58d
commit 61f383a116
3 changed files with 86 additions and 0 deletions
+21
View File
@@ -158,6 +158,13 @@ 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>
/// - `O(1)`
/// - 1 storage mutation (codec `O(1)`).
/// - 2 storage writes (condec `O(1)`).
/// - 1 event.
/// # </weight>
#[weight = MINIMUM_WEIGHT]
fn issue(origin, #[compact] total: T::Balance) {
let origin = ensure_signed(origin)?;
@@ -172,6 +179,13 @@ decl_module! {
}
/// Move some assets from one holder to another.
///
/// # <weight>
/// - `O(1)`
/// - 1 static lookup
/// - 2 storage mutations (codec `O(1)`).
/// - 1 event.
/// # </weight>
#[weight = MINIMUM_WEIGHT]
fn transfer(origin,
#[compact] id: T::AssetId,
@@ -191,6 +205,13 @@ decl_module! {
}
/// Destroy any assets of `id` owned by `origin`.
///
/// # <weight>
/// - `O(1)`
/// - 1 storage mutation (codec `O(1)`).
/// - 1 storage deletion (codec `O(1)`).
/// - 1 event.
/// # </weight>
#[weight = MINIMUM_WEIGHT]
fn destroy(origin, #[compact] id: T::AssetId) {
let origin = ensure_signed(origin)?;