diff --git a/docs/api/runtime-calls.md b/docs/api/runtime-calls.md index dd5b3eb1c914a2c9db69ede42db4af7da50d8d1b..1818c833c265b01e6cff6ef2bad711ad876d6b42 100644 --- a/docs/api/runtime-calls.md +++ b/docs/api/runtime-calls.md @@ -100,7 +100,7 @@ Cancel a named scheduled task. <details><summary><code>schedule_after(after, maybe_periodic, priority, call)</code></summary> -Taking 0 % of a block. +No weight available. ```rust after: T::BlockNumber @@ -117,7 +117,7 @@ Anonymously schedule a task after a delay. <details><summary><code>schedule_named_after(id, after, maybe_periodic, priority, call)</code></summary> -Taking 0 % of a block. +No weight available. ```rust id: TaskName @@ -137,7 +137,7 @@ Schedule a named task after a delay. <details><summary><code>report_equivocation(equivocation_proof, key_owner_proof)</code></summary> -Taking 0 % of a block. +No weight available. ```rust equivocation_proof: Box<EquivocationProof<T::Header>> @@ -178,7 +178,7 @@ The dispatch origin for this call must be `Signed` by the transactor. <details><summary><code>set_balance_deprecated(who, new_free, old_reserved)</code></summary> -Taking 0 % of a block. +No weight available. ```rust who: AccountIdLookupOf<T> @@ -248,7 +248,7 @@ The dispatch origin of this call must be Signed. <details><summary><code>transfer(dest, value)</code></summary> -Taking 0 % of a block. +No weight available. ```rust dest: AccountIdLookupOf<T> @@ -265,7 +265,7 @@ WARNING: DEPRECATED! Will be released in approximately 3 months. <details><summary><code>force_set_balance(who, new_free)</code></summary> -Taking 0 % of a block. +No weight available. ```rust who: AccountIdLookupOf<T> @@ -407,7 +407,7 @@ remove an identity from the blacklist <details><summary><code>report_equivocation(equivocation_proof, key_owner_proof)</code></summary> -Taking 0 % of a block. +No weight available. ```rust equivocation_proof: Box<EquivocationProof<T::Hash, T::BlockNumber>> @@ -427,7 +427,7 @@ will be reported. <details><summary><code>dispatch_as_root_unchecked_weight(call, weight)</code></summary> -Taking 0 % of a block. +No weight available. ```rust call: Box<<T as Config>::Call> @@ -542,7 +542,7 @@ Origin must be a member of the collective. <details><summary><code>propose(threshold, proposal, length_bound)</code></summary> -Taking 0 % of a block. +No weight available. ```rust threshold: MemberCount @@ -595,7 +595,7 @@ fee. <details><summary><code>close(proposal_hash, index, proposal_weight_bound, length_bound)</code></summary> -Taking 0 % of a block. +No weight available. ```rust proposal_hash: T::Hash @@ -991,7 +991,7 @@ The origin must be allow to certify. <details><summary><code>create_swap(target, hashed_proof, action, duration)</code></summary> -Taking 0 % of a block. +No weight available. ```rust target: T::AccountId @@ -1019,7 +1019,7 @@ The dispatch origin for this call must be _Signed_. <details><summary><code>claim_swap(proof, action)</code></summary> -Taking 0 % of a block. +No weight available. ```rust proof: Vec<u8> @@ -1040,7 +1040,7 @@ The dispatch origin for this call must be _Signed_. <details><summary><code>cancel_swap(target, hashed_proof)</code></summary> -Taking 0 % of a block. +No weight available. ```rust target: T::AccountId @@ -1088,7 +1088,7 @@ O(Z + C) where Z is the length of the call and C its execution weight. <details><summary><code>as_multi(threshold, other_signatories, maybe_timepoint, call, max_weight)</code></summary> -Taking 0 % of a block. +No weight available. ```rust threshold: u16 @@ -1144,7 +1144,7 @@ may be found in the deposited `MultisigExecuted` event. <details><summary><code>approve_as_multi(threshold, other_signatories, maybe_timepoint, call_hash, max_weight)</code></summary> -Taking 0 % of a block. +No weight available. ```rust threshold: u16 @@ -1617,7 +1617,7 @@ includes bypassing `frame_system::Config::BaseCallFilter`). <details><summary><code>with_weight(call, weight)</code></summary> -Taking 0 % of a block. +No weight available. ```rust call: Box<<T as Config>::RuntimeCall> @@ -1729,7 +1729,7 @@ Set the number of pages in the WebAssembly environment's heap. <details><summary><code>set_code(code)</code></summary> -Taking 0 % of a block. +No weight available. ```rust code: Vec<u8> @@ -1746,7 +1746,7 @@ Set the new runtime code. <details><summary><code>set_code_without_checks(code)</code></summary> -Taking 0 % of a block. +No weight available. ```rust code: Vec<u8> @@ -1811,7 +1811,7 @@ the prefix we are removing to accurately calculate the weight of this function. <details><summary><code>plan_config_change(config)</code></summary> -Taking 0 % of a block. +No weight available. ```rust config: NextConfigDescriptor @@ -1882,7 +1882,7 @@ remove an identity from the set of authorities <details><summary><code>note_stalled(delay, best_finalized_block_number)</code></summary> -Taking 0 % of a block. +No weight available. ```rust delay: T::BlockNumber diff --git a/xtask/res/templates/runtime-calls-category.md b/xtask/res/templates/runtime-calls-category.md index 95801c089a81ea32ef85b4c15754728f83365447..71c6a7bcec12c936d5ccf4dd912227954ab18b3b 100644 --- a/xtask/res/templates/runtime-calls-category.md +++ b/xtask/res/templates/runtime-calls-category.md @@ -11,9 +11,11 @@ There are **{{ calls_counter }}** {{ category_name }} calls from **{{ pallets | {{ param.name }}{% if loop.last != true %}, {% endif %} {%- endfor -%} )</code></summary> - -Taking {{ call.weight}} % of a block. - +{% if call.weight == -1 %} +No weight available. +{% else %} +Taking {{ call.weight }} % of a block. +{% endif %} ```rust {% for param in call.params -%} {{ param.name }}: {{ param.type_name }} diff --git a/xtask/src/gen_doc.rs b/xtask/src/gen_doc.rs index 0afee2bee07cc7668d06cbbaee77fe741eb63a1f..2a599b77c2c88cdee216b110c86a58882c9f6e93 100644 --- a/xtask/src/gen_doc.rs +++ b/xtask/src/gen_doc.rs @@ -300,7 +300,7 @@ pub(super) fn gen_doc() -> Result<()> { weights.insert("AtomicSwap".to_string(), Default::default()); // No weight // Insert weights for each call of each pallet. - // If no weight is available, the weight is set to 0. + // If no weight is available, the weight is set to -1. // We use the relative weight in percent computed as the extrinsic base + // the extrinsic execution divided by the total weight available in // one block. If the weight depends on a complexity parameter, @@ -312,7 +312,7 @@ pub(super) fn gen_doc() -> Result<()> { .get(&pallet.name) .expect(&("No weight for ".to_owned() + &pallet.name)) .get(&call.name) - .map_or(0f64, |weight| { + .map_or(-1f64, |weight| { (weight.relative_weight * 10000.).round() / 10000. }) })