Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Duniter v2S
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nodes
rust
Duniter v2S
Commits
67b1e8f8
Unverified
Commit
67b1e8f8
authored
1 year ago
by
bgallois
Browse files
Options
Downloads
Patches
Plain Diff
fix no weight
parent
7a0d89d1
No related branches found
No related tags found
1 merge request
!222
Automatic weights documentation
Pipeline
#35206
passed
1 year ago
Stage: labels
Stage: quality
Stage: build
Stage: tests
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/api/runtime-calls.md
+20
-20
20 additions, 20 deletions
docs/api/runtime-calls.md
xtask/res/templates/runtime-calls-category.md
+5
-3
5 additions, 3 deletions
xtask/res/templates/runtime-calls-category.md
xtask/src/gen_doc.rs
+2
-2
2 additions, 2 deletions
xtask/src/gen_doc.rs
with
27 additions
and
25 deletions
docs/api/runtime-calls.md
+
20
−
20
View file @
67b1e8f8
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
xtask/res/templates/runtime-calls-category.md
+
5
−
3
View file @
67b1e8f8
...
...
@@ -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
}}
...
...
This diff is collapsed.
Click to expand it.
xtask/src/gen_doc.rs
+
2
−
2
View file @
67b1e8f8
...
...
@@ -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
(
0
f64
,
|
weight
|
{
.map_or
(
-
1
f64
,
|
weight
|
{
(
weight
.relative_weight
*
10000.
)
.round
()
/
10000.
})
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment