Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • nodes/rust/duniter-v2s
  • llaq/lc-core-substrate
  • pini-gh/duniter-v2s
  • vincentux/duniter-v2s
  • mildred/duniter-v2s
  • d0p1/duniter-v2s
  • bgallois/duniter-v2s
  • Nicolas80/duniter-v2s
8 results
Show changes
Commits on Source (26)
Showing
with 390514 additions and 179 deletions
......@@ -125,12 +125,12 @@ tests:
- cargo cucumber
.deploy_docker_multiplatform:
stage: deploy
stage: build
rules:
- if: $CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_BRANCH =~ /^(release\/runtime-)[0-9].*/
when: manual
changes:
- node/specs/$CHAIN-raw.json
# changes:
# - node/specs/$CHAIN-raw.json
- when: never
before_script:
- sh -c "[ -n '$DUNITERTEAM_PASSWD' ] || ( echo No access to environment variable 'DUNITERTEAM_PASSWD'; exit 1 )"
......@@ -141,7 +141,7 @@ tests:
- export MANIFEST=localhost/manifest-$IMAGE_NAME:$MILESTONE
- echo $MANIFEST
- podman manifest rm "$MANIFEST" 2>/dev/null || true
- podman build --layers --platform linux/amd64 --manifest "$MANIFEST" -f docker/Dockerfile $PODMAN_BUILD_OPTIONS .
- podman build --layers --platform linux/amd64,linux/arm64 --manifest "$MANIFEST" -f docker/Dockerfile $PODMAN_BUILD_OPTIONS .
- podman manifest push --all "$MANIFEST" "docker://docker.io/$IMAGE_NAME:$MILESTONE"
- podman manifest push --all "$MANIFEST" "docker://docker.io/$IMAGE_NAME:latest"
after_script:
......@@ -197,7 +197,7 @@ readme_docker_release_tag:
# Copy sources to the expected directory of srtool
- cp -R * /build/
# Build the runtime
- /srtool/build --app --json -cM > $SRTOOL_OUTPUT
- /srtool/build --app --json -cM | tee -a $SRTOOL_OUTPUT
- mv /build/runtime/$RUNTIME/target/srtool/release/wbuild/$RUNTIME-runtime/${RUNTIME}_runtime.compact.compressed.wasm $CI_PROJECT_DIR/release/
artifacts:
name: "runtime"
......@@ -280,7 +280,7 @@ create_g1_data:
- apt-get install -y clang cmake protobuf-compiler
- cargo run ${FEATURES} -- build-spec --chain=${RUNTIME}_live > release/${RUNTIME}.json
- cargo run ${FEATURES} -- build-spec --chain=release/${RUNTIME}.json --disable-default-bootnode --raw > release/${RUNTIME}-raw.json
- cp node/specs/${RUNTIME}_client-specs.json release/
- cp node/specs/${RUNTIME}_client-specs.yaml release/
artifacts:
name: "runtime"
paths:
......@@ -324,10 +324,12 @@ create_release:
- cargo xtask release-runtime $MILESTONE $CI_COMMIT_BRANCH
# We always ship runtimes: this is both a proof and a convenience
- cargo xtask create-asset-link $MILESTONE g1-data.json https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/release/g1-data.json
- cargo xtask create-asset-link $MILESTONE gdev-indexer.json https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/release/gdev-indexer.json
- cargo xtask create-asset-link $MILESTONE gtest-indexer https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/release/gtest-indexer.json
- cargo xtask create-asset-link $MILESTONE gdev_runtime.compact.compressed.wasm https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/release/gdev_runtime.compact.compressed.wasm
- cargo xtask create-asset-link $MILESTONE gtest_runtime.compact.compressed.wasm https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/release/gtest_runtime.compact.compressed.wasm
- cargo xtask create-asset-link $MILESTONE gdev_client-specs.json https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/release/gdev_client-specs.json
- cargo xtask create-asset-link $MILESTONE gtest_client-specs.json https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/release/gtest_client-specs.json
- cargo xtask create-asset-link $MILESTONE gdev_client-specs.yaml https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/release/gdev_client-specs.yaml
- cargo xtask create-asset-link $MILESTONE gtest_client-specs.yaml https://nodes.pages.duniter.org/-/rust/duniter-v2s/-/jobs/$CI_JOB_ID/artifacts/release/gtest_client-specs.yaml
artifacts:
paths:
- $CI_PROJECT_DIR/release/
......
......@@ -210,7 +210,7 @@ version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6"
dependencies = [
"num-traits",
"num-traits 0.2.15",
]
[[package]]
......@@ -259,7 +259,7 @@ dependencies = [
"asn1-rs-impl",
"displaydoc",
"nom",
"num-traits",
"num-traits 0.2.15",
"rusticata-macros",
"thiserror",
"time 0.3.23",
......@@ -275,7 +275,7 @@ dependencies = [
"asn1-rs-impl",
"displaydoc",
"nom",
"num-traits",
"num-traits 0.2.15",
"rusticata-macros",
"thiserror",
"time 0.3.23",
......@@ -826,7 +826,7 @@ dependencies = [
"iana-time-zone",
"js-sys",
"num-integer",
"num-traits",
"num-traits 0.2.15",
"time 0.1.45",
"wasm-bindgen",
"winapi 0.3.9",
......@@ -1145,6 +1145,15 @@ dependencies = [
"memchr",
]
[[package]]
name = "countmap"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ef2a403c4af585607826502480ab6e453f320c230ef67255eee21f0cc72c0a6"
dependencies = [
"num-traits 0.1.43",
]
[[package]]
name = "cpp_demangle"
version = "0.3.5"
......@@ -1688,7 +1697,7 @@ dependencies = [
"displaydoc",
"nom",
"num-bigint",
"num-traits",
"num-traits 0.2.15",
"rusticata-macros",
]
......@@ -1702,7 +1711,7 @@ dependencies = [
"displaydoc",
"nom",
"num-bigint",
"num-traits",
"num-traits 0.2.15",
"rusticata-macros",
]
......@@ -1868,7 +1877,7 @@ dependencies = [
"flate2",
"fnv",
"log",
"num-traits",
"num-traits 0.2.15",
"parity-scale-codec",
"rayon",
"simple_logger",
......@@ -1914,7 +1923,7 @@ dependencies = [
[[package]]
name = "duniter"
version = "0.3.0"
version = "0.7.0"
dependencies = [
"async-io",
"bs58 0.5.0",
......@@ -2023,6 +2032,7 @@ name = "duniter-live-tests"
version = "3.0.0"
dependencies = [
"anyhow",
"countmap",
"hex-literal",
"parity-scale-codec",
"sp-core",
......@@ -2423,7 +2433,7 @@ dependencies = [
"futures 0.3.29",
"futures-timer",
"log",
"num-traits",
"num-traits 0.2.15",
"parity-scale-codec",
"parking_lot 0.12.1",
"scale-info",
......@@ -2464,7 +2474,7 @@ version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4"
dependencies = [
"num-traits",
"num-traits 0.2.15",
]
[[package]]
......@@ -3889,7 +3899,7 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770"
dependencies = [
"num-traits",
"num-traits 0.2.15",
]
[[package]]
......@@ -5194,7 +5204,7 @@ dependencies = [
"nalgebra-macros",
"num-complex",
"num-rational",
"num-traits",
"num-traits 0.2.15",
"simba",
"typenum",
]
......@@ -5403,7 +5413,7 @@ checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f"
dependencies = [
"autocfg",
"num-integer",
"num-traits",
"num-traits 0.2.15",
]
[[package]]
......@@ -5412,7 +5422,7 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d"
dependencies = [
"num-traits",
"num-traits 0.2.15",
]
[[package]]
......@@ -5432,7 +5442,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
dependencies = [
"autocfg",
"num-traits",
"num-traits 0.2.15",
]
[[package]]
......@@ -5444,7 +5454,16 @@ dependencies = [
"autocfg",
"num-bigint",
"num-integer",
"num-traits",
"num-traits 0.2.15",
]
[[package]]
name = "num-traits"
version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31"
dependencies = [
"num-traits 0.2.15",
]
[[package]]
......@@ -7724,7 +7743,7 @@ dependencies = [
"log",
"num-bigint",
"num-rational",
"num-traits",
"num-traits 0.2.15",
"parity-scale-codec",
"parking_lot 0.12.1",
"sc-client-api",
......@@ -8494,7 +8513,7 @@ dependencies = [
"futures-timer",
"linked-hash-map",
"log",
"num-traits",
"num-traits 0.2.15",
"parity-scale-codec",
"parking_lot 0.12.1",
"sc-client-api",
......@@ -9038,7 +9057,7 @@ checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae"
dependencies = [
"approx",
"num-complex",
"num-traits",
"num-traits 0.2.15",
"paste",
"wide",
]
......@@ -9195,7 +9214,7 @@ version = "6.0.0"
source = "git+https://github.com/duniter/substrate?branch=duniter-substrate-v0.9.42#38b19717f847d3eda654b6465802c244ea6372a6"
dependencies = [
"integer-sqrt",
"num-traits",
"num-traits 0.2.15",
"parity-scale-codec",
"scale-info",
"serde",
......@@ -11280,7 +11299,7 @@ dependencies = [
"libm",
"memory_units",
"num-rational",
"num-traits",
"num-traits 0.2.15",
"region",
]
......
......@@ -54,8 +54,10 @@ RUN set -x && \
cat /root/dynenv && \
. /root/dynenv && \
cargo build --locked $CARGO_OPTIONS --no-default-features $BENCH_OPTIONS --features $chain --target "$RUST_ARCH_TRIPLET" && \
cargo build --locked $CARGO_OPTIONS --target "$RUST_ARCH_TRIPLET" --package distance-oracle && \
mkdir -p build && \
mv target/$RUST_ARCH_TRIPLET/$TARGET_FOLDER/duniter build/
mv target/$RUST_ARCH_TRIPLET/$TARGET_FOLDER/duniter build/ && \
mv target/$RUST_ARCH_TRIPLET/$TARGET_FOLDER/distance-oracle build/
# Run tests if requested, expted when cross-building
ARG cucumber=0
......
......@@ -359,7 +359,7 @@ ask to join the set of validators two sessions after
<details><summary><code>set_session_keys(keys)</code></summary>
```rust
keys: T::KeysWrapper
keys: T::Keys
```
</details>
......@@ -750,8 +750,11 @@ Link an account to an identity
</details>
claim pending membership to become actual memberhip
the requested membership must fullfill requirements
claim membership
a pending membership should exist
it must fullfill the requirements (certs, distance)
for main wot claim_membership is called automatically when validating identity
for smith wot, it means joining the authority members
#### renew_membership - 2
......@@ -844,10 +847,9 @@ Removes the status if `status` is `None`.
#### request_membership - 0
<details><summary><code>request_membership(metadata)</code></summary>
<details><summary><code>request_membership()</code></summary>
```rust
metadata: T::MetaData
```
</details>
......@@ -864,8 +866,11 @@ submit a membership request (must have a declared identity)
</details>
claim pending membership to become actual memberhip
the requested membership must fullfill requirements
claim membership
a pending membership should exist
it must fullfill the requirements (certs, distance)
for main wot claim_membership is called automatically when validating identity
for smith wot, it means joining the authority members
#### renew_membership - 2
......@@ -2003,10 +2008,9 @@ usually means being a stash account).
#### request_membership - 0
<details><summary><code>request_membership(metadata)</code></summary>
<details><summary><code>request_membership()</code></summary>
```rust
metadata: T::MetaData
```
</details>
......
# Runtime errors
There are **190** errors from **37** pallets.
<ul>
<li>System - 0
<ul>
<li>
<details>
<summary>
<code>InvalidSpecName</code> - 0</summary>
The name of specification does not match between the current runtime
and the new runtime.
</details>
</li>
<li>
<details>
<summary>
<code>SpecVersionNeedsToIncrease</code> - 1</summary>
The specification version is not allowed to decrease between the current runtime
and the new runtime.
</details>
</li>
<li>
<details>
<summary>
<code>FailedToExtractRuntimeVersion</code> - 2</summary>
Failed to extract the runtime version from the new runtime.
Either calling `Core_version` or decoding `RuntimeVersion` failed.
</details>
</li>
<li>
<details>
<summary>
<code>NonDefaultComposite</code> - 3</summary>
Suicide called when the account has non-default composite data.
</details>
</li>
<li>
<details>
<summary>
<code>NonZeroRefCount</code> - 4</summary>
There is a non-zero reference count preventing the account from being purged.
</details>
</li>
<li>
<details>
<summary>
<code>CallFiltered</code> - 5</summary>
The origin filter prevent the call to be dispatched.
</details>
</li>
</ul>
</li>
<li>Account - 1
<ul>
</ul>
</li>
<li>Scheduler - 2
<ul>
<li>
<details>
<summary>
<code>FailedToSchedule</code> - 0</summary>
Failed to schedule a call
</details>
</li>
<li>
<details>
<summary>
<code>NotFound</code> - 1</summary>
Cannot find the scheduled call.
</details>
</li>
<li>
<details>
<summary>
<code>TargetBlockNumberInPast</code> - 2</summary>
Given target block number is in the past.
</details>
</li>
<li>
<details>
<summary>
<code>RescheduleNoChange</code> - 3</summary>
Reschedule failed because it does not change scheduled time.
</details>
</li>
<li>
<details>
<summary>
<code>Named</code> - 4</summary>
Attempt to use a non-named function on a named task.
</details>
</li>
</ul>
</li>
<li>Babe - 3
<ul>
<li>
<details>
<summary>
<code>InvalidEquivocationProof</code> - 0</summary>
An equivocation proof provided as part of an equivocation report is invalid.
</details>
</li>
<li>
<details>
<summary>
<code>InvalidKeyOwnershipProof</code> - 1</summary>
A key ownership proof provided as part of an equivocation report is invalid.
</details>
</li>
<li>
<details>
<summary>
<code>DuplicateOffenceReport</code> - 2</summary>
A given equivocation report is valid but already previously reported.
</details>
</li>
<li>
<details>
<summary>
<code>InvalidConfiguration</code> - 3</summary>
Submitted configuration is invalid.
</details>
</li>
</ul>
</li>
<li>Timestamp - 4
<ul>
</ul>
</li>
<li>Parameters - 5
<ul>
</ul>
</li>
<li>Balances - 6
<ul>
<li>
<details>
<summary>
<code>VestingBalance</code> - 0</summary>
Vesting balance too high to send value.
</details>
</li>
<li>
<details>
<summary>
<code>LiquidityRestrictions</code> - 1</summary>
Account liquidity restrictions prevent withdrawal.
</details>
</li>
<li>
<details>
<summary>
<code>InsufficientBalance</code> - 2</summary>
Balance too low to send value.
</details>
</li>
<li>
<details>
<summary>
<code>ExistentialDeposit</code> - 3</summary>
Value too low to create account due to existential deposit.
</details>
</li>
<li>
<details>
<summary>
<code>Expendability</code> - 4</summary>
Transfer/payment would kill account.
</details>
</li>
<li>
<details>
<summary>
<code>ExistingVestingSchedule</code> - 5</summary>
A vesting schedule already exists for this account.
</details>
</li>
<li>
<details>
<summary>
<code>DeadAccount</code> - 6</summary>
Beneficiary account must pre-exist.
</details>
</li>
<li>
<details>
<summary>
<code>TooManyReserves</code> - 7</summary>
Number of named reserves exceed `MaxReserves`.
</details>
</li>
<li>
<details>
<summary>
<code>TooManyHolds</code> - 8</summary>
Number of holds exceed `MaxHolds`.
</details>
</li>
<li>
<details>
<summary>
<code>TooManyFreezes</code> - 9</summary>
Number of freezes exceed `MaxFreezes`.
</details>
</li>
</ul>
</li>
<li>TransactionPayment - 32
<ul>
</ul>
</li>
<li>OneshotAccount - 7
<ul>
<li>
<details>
<summary>
<code>BlockHeightInFuture</code> - 0</summary>
Block height is in the future
</details>
</li>
<li>
<details>
<summary>
<code>BlockHeightTooOld</code> - 1</summary>
Block height is too old
</details>
</li>
<li>
<details>
<summary>
<code>DestAccountNotExist</code> - 2</summary>
Destination account does not exist
</details>
</li>
<li>
<details>
<summary>
<code>ExistentialDeposit</code> - 3</summary>
Destination account has balance less than existential deposit
</details>
</li>
<li>
<details>
<summary>
<code>InsufficientBalance</code> - 4</summary>
Source account has insufficient balance
</details>
</li>
<li>
<details>
<summary>
<code>OneshotAccountAlreadyCreated</code> - 5</summary>
Destination oneshot account already exists
</details>
</li>
<li>
<details>
<summary>
<code>OneshotAccountNotExist</code> - 6</summary>
Source oneshot account does not exist
</details>
</li>
</ul>
</li>
<li>Quota - 66
<ul>
</ul>
</li>
<li>AuthorityMembers - 10
<ul>
<li>
<details>
<summary>
<code>AlreadyIncoming</code> - 0</summary>
Already incoming
</details>
</li>
<li>
<details>
<summary>
<code>AlreadyOnline</code> - 1</summary>
Already online
</details>
</li>
<li>
<details>
<summary>
<code>AlreadyOutgoing</code> - 2</summary>
Already outgoing
</details>
</li>
<li>
<details>
<summary>
<code>MemberIdNotFound</code> - 3</summary>
Not found owner key
</details>
</li>
<li>
<details>
<summary>
<code>MemberIdBlackListed</code> - 4</summary>
Member is blacklisted
</details>
</li>
<li>
<details>
<summary>
<code>MemberNotBlackListed</code> - 5</summary>
Member is not blacklisted
</details>
</li>
<li>
<details>
<summary>
<code>MemberNotFound</code> - 6</summary>
Member not found
</details>
</li>
<li>
<details>
<summary>
<code>NotOnlineNorIncoming</code> - 7</summary>
Neither online nor scheduled
</details>
</li>
<li>
<details>
<summary>
<code>NotOwner</code> - 8</summary>
Not owner
</details>
</li>
<li>
<details>
<summary>
<code>NotMember</code> - 9</summary>
Not member
</details>
</li>
<li>
<details>
<summary>
<code>SessionKeysNotProvided</code> - 10</summary>
Session keys not provided
</details>
</li>
<li>
<details>
<summary>
<code>TooManyAuthorities</code> - 11</summary>
Too man aAuthorities
</details>
</li>
</ul>
</li>
<li>Authorship - 11
<ul>
</ul>
</li>
<li>Offences - 12
<ul>
</ul>
</li>
<li>Historical - 13
<ul>
</ul>
</li>
<li>Session - 14
<ul>
<li>
<details>
<summary>
<code>InvalidProof</code> - 0</summary>
Invalid ownership proof.
</details>
</li>
<li>
<details>
<summary>
<code>NoAssociatedValidatorId</code> - 1</summary>
No associated validator ID for account.
</details>
</li>
<li>
<details>
<summary>
<code>DuplicatedKey</code> - 2</summary>
Registered duplicate key.
</details>
</li>
<li>
<details>
<summary>
<code>NoKeys</code> - 3</summary>
No keys are associated with this account.
</details>
</li>
<li>
<details>
<summary>
<code>NoAccount</code> - 4</summary>
Key setting account is not live, so it's impossible to associate keys.
</details>
</li>
</ul>
</li>
<li>Grandpa - 15
<ul>
<li>
<details>
<summary>
<code>PauseFailed</code> - 0</summary>
Attempt to signal GRANDPA pause when the authority set isn't live
(either paused or already pending pause).
</details>
</li>
<li>
<details>
<summary>
<code>ResumeFailed</code> - 1</summary>
Attempt to signal GRANDPA resume when the authority set isn't paused
(either live or already pending resume).
</details>
</li>
<li>
<details>
<summary>
<code>ChangePending</code> - 2</summary>
Attempt to signal GRANDPA change with one already pending.
</details>
</li>
<li>
<details>
<summary>
<code>TooSoon</code> - 3</summary>
Cannot signal forced change so soon after last.
</details>
</li>
<li>
<details>
<summary>
<code>InvalidKeyOwnershipProof</code> - 4</summary>
A key ownership proof provided as part of an equivocation report is invalid.
</details>
</li>
<li>
<details>
<summary>
<code>InvalidEquivocationProof</code> - 5</summary>
An equivocation proof provided as part of an equivocation report is invalid.
</details>
</li>
<li>
<details>
<summary>
<code>DuplicateOffenceReport</code> - 6</summary>
A given equivocation report is valid but already previously reported.
</details>
</li>
</ul>
</li>
<li>ImOnline - 16
<ul>
<li>
<details>
<summary>
<code>InvalidKey</code> - 0</summary>
Non existent public key.
</details>
</li>
<li>
<details>
<summary>
<code>DuplicatedHeartbeat</code> - 1</summary>
Duplicated heartbeat.
</details>
</li>
</ul>
</li>
<li>AuthorityDiscovery - 17
<ul>
</ul>
</li>
<li>Sudo - 20
<ul>
<li>
<details>
<summary>
<code>RequireSudo</code> - 0</summary>
Sender must be the Sudo account
</details>
</li>
</ul>
</li>
<li>UpgradeOrigin - 21
<ul>
</ul>
</li>
<li>Preimage - 22
<ul>
<li>
<details>
<summary>
<code>TooBig</code> - 0</summary>
Preimage is too large to store on-chain.
</details>
</li>
<li>
<details>
<summary>
<code>AlreadyNoted</code> - 1</summary>
Preimage has already been noted on-chain.
</details>
</li>
<li>
<details>
<summary>
<code>NotAuthorized</code> - 2</summary>
The user is not authorized to perform this action.
</details>
</li>
<li>
<details>
<summary>
<code>NotNoted</code> - 3</summary>
The preimage cannot be removed since it has not yet been noted.
</details>
</li>
<li>
<details>
<summary>
<code>Requested</code> - 4</summary>
A preimage may not be removed when there are outstanding requests.
</details>
</li>
<li>
<details>
<summary>
<code>NotRequested</code> - 5</summary>
The preimage request cannot be removed since no outstanding requests exist.
</details>
</li>
</ul>
</li>
<li>TechnicalCommittee - 23
<ul>
<li>
<details>
<summary>
<code>NotMember</code> - 0</summary>
Account is not a member
</details>
</li>
<li>
<details>
<summary>
<code>DuplicateProposal</code> - 1</summary>
Duplicate proposals not allowed
</details>
</li>
<li>
<details>
<summary>
<code>ProposalMissing</code> - 2</summary>
Proposal must exist
</details>
</li>
<li>
<details>
<summary>
<code>WrongIndex</code> - 3</summary>
Mismatched index
</details>
</li>
<li>
<details>
<summary>
<code>DuplicateVote</code> - 4</summary>
Duplicate vote ignored
</details>
</li>
<li>
<details>
<summary>
<code>AlreadyInitialized</code> - 5</summary>
Members are already initialized!
</details>
</li>
<li>
<details>
<summary>
<code>TooEarly</code> - 6</summary>
The close call was made too early, before the end of the voting.
</details>
</li>
<li>
<details>
<summary>
<code>TooManyProposals</code> - 7</summary>
There can only be a maximum of `MaxProposals` active proposals.
</details>
</li>
<li>
<details>
<summary>
<code>WrongProposalWeight</code> - 8</summary>
The given weight bound for the proposal was too low.
</details>
</li>
<li>
<details>
<summary>
<code>WrongProposalLength</code> - 9</summary>
The given length bound for the proposal was too low.
</details>
</li>
</ul>
</li>
<li>UniversalDividend - 30
<ul>
<li>
<details>
<summary>
<code>AccountNotAllowedToClaimUds</code> - 0</summary>
This account is not allowed to claim UDs.
</details>
</li>
</ul>
</li>
<li>Wot - 40
<ul>
<li>
<details>
<summary>
<code>NotEnoughCertsToClaimMembership</code> - 0</summary>
Not enough certifications received to claim membership
</details>
</li>
<li>
<details>
<summary>
<code>DistanceNotOK</code> - 1</summary>
Distance has not been evaluated positively
</details>
</li>
<li>
<details>
<summary>
<code>IdtyNotAllowedToRequestMembership</code> - 2</summary>
Identity not allowed to request membership
</details>
</li>
<li>
<details>
<summary>
<code>IdtyNotAllowedToRenewMembership</code> - 3</summary>
Identity not allowed to renew membership
</details>
</li>
<li>
<details>
<summary>
<code>IdtyCreationPeriodNotRespected</code> - 4</summary>
Identity creation period not respected
</details>
</li>
<li>
<details>
<summary>
<code>NotEnoughReceivedCertsToCreateIdty</code> - 5</summary>
Not enough received certifications to create identity
</details>
</li>
<li>
<details>
<summary>
<code>MaxEmittedCertsReached</code> - 6</summary>
Max number of emitted certs reached
</details>
</li>
<li>
<details>
<summary>
<code>NotAllowedToChangeIdtyAddress</code> - 7</summary>
Not allowed to change identity address
</details>
</li>
<li>
<details>
<summary>
<code>NotAllowedToRemoveIdty</code> - 8</summary>
Not allowed to remove identity
</details>
</li>
<li>
<details>
<summary>
<code>IssuerCanNotEmitCert</code> - 9</summary>
Issuer can not emit cert because it is not validated
</details>
</li>
<li>
<details>
<summary>
<code>CertToUndefined</code> - 10</summary>
Can not issue cert to identity without membership or pending membership
</details>
</li>
<li>
<details>
<summary>
<code>IdtyNotFound</code> - 11</summary>
Issuer or receiver not found
</details>
</li>
</ul>
</li>
<li>Identity - 41
<ul>
<li>
<details>
<summary>
<code>IdtyAlreadyConfirmed</code> - 0</summary>
Identity already confirmed
</details>
</li>
<li>
<details>
<summary>
<code>IdtyAlreadyCreated</code> - 1</summary>
Identity already created
</details>
</li>
<li>
<details>
<summary>
<code>IdtyAlreadyValidated</code> - 2</summary>
Identity already validated
</details>
</li>
<li>
<details>
<summary>
<code>IdtyCreationNotAllowed</code> - 3</summary>
You are not allowed to create a new identity now
</details>
</li>
<li>
<details>
<summary>
<code>IdtyIndexNotFound</code> - 4</summary>
Identity index not found
</details>
</li>
<li>
<details>
<summary>
<code>IdtyNameAlreadyExist</code> - 5</summary>
Identity name already exists
</details>
</li>
<li>
<details>
<summary>
<code>IdtyNameInvalid</code> - 6</summary>
Invalid identity name
</details>
</li>
<li>
<details>
<summary>
<code>IdtyNotConfirmedByOwner</code> - 7</summary>
Identity not confirmed by its owner
</details>
</li>
<li>
<details>
<summary>
<code>IdtyNotFound</code> - 8</summary>
Identity not found
</details>
</li>
<li>
<details>
<summary>
<code>IdtyNotMember</code> - 9</summary>
Identity not member
</details>
</li>
<li>
<details>
<summary>
<code>IdtyNotValidated</code> - 10</summary>
Identity not validated
</details>
</li>
<li>
<details>
<summary>
<code>IdtyNotYetRenewable</code> - 11</summary>
Identity not yet renewable
</details>
</li>
<li>
<details>
<summary>
<code>InvalidSignature</code> - 12</summary>
payload signature is invalid
</details>
</li>
<li>
<details>
<summary>
<code>InvalidRevocationKey</code> - 13</summary>
Revocation key is invalid
</details>
</li>
<li>
<details>
<summary>
<code>NotRespectIdtyCreationPeriod</code> - 14</summary>
Identity creation period is not respected
</details>
</li>
<li>
<details>
<summary>
<code>NotSameIdtyName</code> - 15</summary>
Not the same identity name
</details>
</li>
<li>
<details>
<summary>
<code>OwnerKeyAlreadyRecentlyChanged</code> - 16</summary>
Owner key already recently changed
</details>
</li>
<li>
<details>
<summary>
<code>OwnerKeyAlreadyUsed</code> - 17</summary>
Owner key already used
</details>
</li>
<li>
<details>
<summary>
<code>ProhibitedToRevertToAnOldKey</code> - 18</summary>
Prohibited to revert to an old key
</details>
</li>
<li>
<details>
<summary>
<code>RightAlreadyAdded</code> - 19</summary>
Right already added
</details>
</li>
<li>
<details>
<summary>
<code>RightNotExist</code> - 20</summary>
Right does not exist
</details>
</li>
</ul>
</li>
<li>Membership - 42
<ul>
<li>
<details>
<summary>
<code>IdtyIdNotFound</code> - 0</summary>
Identity id not found
</details>
</li>
<li>
<details>
<summary>
<code>MembershipAlreadyAcquired</code> - 1</summary>
Membership already acquired
</details>
</li>
<li>
<details>
<summary>
<code>MembershipAlreadyRequested</code> - 2</summary>
Membership already requested
</details>
</li>
<li>
<details>
<summary>
<code>MembershipNotFound</code> - 3</summary>
Membership not found
</details>
</li>
<li>
<details>
<summary>
<code>OriginNotAllowedToUseIdty</code> - 4</summary>
Origin not allowed to use this identity
</details>
</li>
<li>
<details>
<summary>
<code>MembershipRequestNotFound</code> - 5</summary>
Membership request not found
</details>
</li>
</ul>
</li>
<li>Cert - 43
<ul>
<li>
<details>
<summary>
<code>CannotCertifySelf</code> - 0</summary>
An identity cannot certify itself
</details>
</li>
<li>
<details>
<summary>
<code>IssuedTooManyCert</code> - 1</summary>
This identity has already issued the maximum number of certifications
</details>
</li>
<li>
<details>
<summary>
<code>IssuerNotFound</code> - 2</summary>
Issuer not found
</details>
</li>
<li>
<details>
<summary>
<code>NotEnoughCertReceived</code> - 3</summary>
Not enough certifications received
</details>
</li>
<li>
<details>
<summary>
<code>NotRespectCertPeriod</code> - 4</summary>
This identity has already issued a certification too recently
</details>
</li>
</ul>
</li>
<li>Distance - 44
<ul>
<li>
<details>
<summary>
<code>AlreadyInEvaluation</code> - 0</summary>
</details>
</li>
<li>
<details>
<summary>
<code>CannotReserve</code> - 1</summary>
</details>
</li>
<li>
<details>
<summary>
<code>ManyEvaluationsByAuthor</code> - 2</summary>
</details>
</li>
<li>
<details>
<summary>
<code>ManyEvaluationsInBlock</code> - 3</summary>
</details>
</li>
<li>
<details>
<summary>
<code>NoAuthor</code> - 4</summary>
</details>
</li>
<li>
<details>
<summary>
<code>NoIdentity</code> - 5</summary>
</details>
</li>
<li>
<details>
<summary>
<code>NonEligibleForEvaluation</code> - 6</summary>
</details>
</li>
<li>
<details>
<summary>
<code>QueueFull</code> - 7</summary>
</details>
</li>
<li>
<details>
<summary>
<code>TooManyEvaluators</code> - 8</summary>
</details>
</li>
<li>
<details>
<summary>
<code>WrongResultLength</code> - 9</summary>
</details>
</li>
</ul>
</li>
<li>SmithSubWot - 50
<ul>
<li>
<details>
<summary>
<code>NotEnoughCertsToClaimMembership</code> - 0</summary>
Not enough certifications received to claim membership
</details>
</li>
<li>
<details>
<summary>
<code>DistanceNotOK</code> - 1</summary>
Distance has not been evaluated positively
</details>
</li>
<li>
<details>
<summary>
<code>IdtyNotAllowedToRequestMembership</code> - 2</summary>
Identity not allowed to request membership
</details>
</li>
<li>
<details>
<summary>
<code>IdtyNotAllowedToRenewMembership</code> - 3</summary>
Identity not allowed to renew membership
</details>
</li>
<li>
<details>
<summary>
<code>IdtyCreationPeriodNotRespected</code> - 4</summary>
Identity creation period not respected
</details>
</li>
<li>
<details>
<summary>
<code>NotEnoughReceivedCertsToCreateIdty</code> - 5</summary>
Not enough received certifications to create identity
</details>
</li>
<li>
<details>
<summary>
<code>MaxEmittedCertsReached</code> - 6</summary>
Max number of emitted certs reached
</details>
</li>
<li>
<details>
<summary>
<code>NotAllowedToChangeIdtyAddress</code> - 7</summary>
Not allowed to change identity address
</details>
</li>
<li>
<details>
<summary>
<code>NotAllowedToRemoveIdty</code> - 8</summary>
Not allowed to remove identity
</details>
</li>
<li>
<details>
<summary>
<code>IssuerCanNotEmitCert</code> - 9</summary>
Issuer can not emit cert because it is not validated
</details>
</li>
<li>
<details>
<summary>
<code>CertToUndefined</code> - 10</summary>
Can not issue cert to identity without membership or pending membership
</details>
</li>
<li>
<details>
<summary>
<code>IdtyNotFound</code> - 11</summary>
Issuer or receiver not found
</details>
</li>
</ul>
</li>
<li>SmithMembership - 52
<ul>
<li>
<details>
<summary>
<code>IdtyIdNotFound</code> - 0</summary>
Identity id not found
</details>
</li>
<li>
<details>
<summary>
<code>MembershipAlreadyAcquired</code> - 1</summary>
Membership already acquired
</details>
</li>
<li>
<details>
<summary>
<code>MembershipAlreadyRequested</code> - 2</summary>
Membership already requested
</details>
</li>
<li>
<details>
<summary>
<code>MembershipNotFound</code> - 3</summary>
Membership not found
</details>
</li>
<li>
<details>
<summary>
<code>OriginNotAllowedToUseIdty</code> - 4</summary>
Origin not allowed to use this identity
</details>
</li>
<li>
<details>
<summary>
<code>MembershipRequestNotFound</code> - 5</summary>
Membership request not found
</details>
</li>
</ul>
</li>
<li>SmithCert - 53
<ul>
<li>
<details>
<summary>
<code>CannotCertifySelf</code> - 0</summary>
An identity cannot certify itself
</details>
</li>
<li>
<details>
<summary>
<code>IssuedTooManyCert</code> - 1</summary>
This identity has already issued the maximum number of certifications
</details>
</li>
<li>
<details>
<summary>
<code>IssuerNotFound</code> - 2</summary>
Issuer not found
</details>
</li>
<li>
<details>
<summary>
<code>NotEnoughCertReceived</code> - 3</summary>
Not enough certifications received
</details>
</li>
<li>
<details>
<summary>
<code>NotRespectCertPeriod</code> - 4</summary>
This identity has already issued a certification too recently
</details>
</li>
</ul>
</li>
<li>AtomicSwap - 60
<ul>
<li>
<details>
<summary>
<code>AlreadyExist</code> - 0</summary>
Swap already exists.
</details>
</li>
<li>
<details>
<summary>
<code>InvalidProof</code> - 1</summary>
Swap proof is invalid.
</details>
</li>
<li>
<details>
<summary>
<code>ProofTooLarge</code> - 2</summary>
Proof is too large.
</details>
</li>
<li>
<details>
<summary>
<code>SourceMismatch</code> - 3</summary>
Source does not match.
</details>
</li>
<li>
<details>
<summary>
<code>AlreadyClaimed</code> - 4</summary>
Swap has already been claimed.
</details>
</li>
<li>
<details>
<summary>
<code>NotExist</code> - 5</summary>
Swap does not exist.
</details>
</li>
<li>
<details>
<summary>
<code>ClaimActionMismatch</code> - 6</summary>
Claim action mismatch.
</details>
</li>
<li>
<details>
<summary>
<code>DurationNotPassed</code> - 7</summary>
Duration has not yet passed for the swap to be cancelled.
</details>
</li>
</ul>
</li>
<li>Multisig - 61
<ul>
<li>
<details>
<summary>
<code>MinimumThreshold</code> - 0</summary>
Threshold must be 2 or greater.
</details>
</li>
<li>
<details>
<summary>
<code>AlreadyApproved</code> - 1</summary>
Call is already approved by this signatory.
</details>
</li>
<li>
<details>
<summary>
<code>NoApprovalsNeeded</code> - 2</summary>
Call doesn't need any (more) approvals.
</details>
</li>
<li>
<details>
<summary>
<code>TooFewSignatories</code> - 3</summary>
There are too few signatories in the list.
</details>
</li>
<li>
<details>
<summary>
<code>TooManySignatories</code> - 4</summary>
There are too many signatories in the list.
</details>
</li>
<li>
<details>
<summary>
<code>SignatoriesOutOfOrder</code> - 5</summary>
The signatories were provided out of order; they should be ordered.
</details>
</li>
<li>
<details>
<summary>
<code>SenderInSignatories</code> - 6</summary>
The sender was contained in the other signatories; it shouldn't be.
</details>
</li>
<li>
<details>
<summary>
<code>NotFound</code> - 7</summary>
Multisig operation not found when attempting to cancel.
</details>
</li>
<li>
<details>
<summary>
<code>NotOwner</code> - 8</summary>
Only the account that originally created the multisig is able to cancel it.
</details>
</li>
<li>
<details>
<summary>
<code>NoTimepoint</code> - 9</summary>
No timepoint was given, yet the multisig operation is already underway.
</details>
</li>
<li>
<details>
<summary>
<code>WrongTimepoint</code> - 10</summary>
A different timepoint was given to the multisig operation that is underway.
</details>
</li>
<li>
<details>
<summary>
<code>UnexpectedTimepoint</code> - 11</summary>
A timepoint was given, yet no multisig operation is underway.
</details>
</li>
<li>
<details>
<summary>
<code>MaxWeightTooLow</code> - 12</summary>
The maximum weight information provided was too low.
</details>
</li>
<li>
<details>
<summary>
<code>AlreadyStored</code> - 13</summary>
The data to be stored is already stored.
</details>
</li>
</ul>
</li>
<li>ProvideRandomness - 62
<ul>
<li>
<details>
<summary>
<code>FullQueue</code> - 0</summary>
The queue is full, pleasy retry later
</details>
</li>
</ul>
</li>
<li>Proxy - 63
<ul>
<li>
<details>
<summary>
<code>TooMany</code> - 0</summary>
There are too many proxies registered or too many announcements pending.
</details>
</li>
<li>
<details>
<summary>
<code>NotFound</code> - 1</summary>
Proxy registration not found.
</details>
</li>
<li>
<details>
<summary>
<code>NotProxy</code> - 2</summary>
Sender is not a proxy of the account to be proxied.
</details>
</li>
<li>
<details>
<summary>
<code>Unproxyable</code> - 3</summary>
A call which is incompatible with the proxy type's filter was attempted.
</details>
</li>
<li>
<details>
<summary>
<code>Duplicate</code> - 4</summary>
Account is already a proxy.
</details>
</li>
<li>
<details>
<summary>
<code>NoPermission</code> - 5</summary>
Call may not be made by proxy because it may escalate its privileges.
</details>
</li>
<li>
<details>
<summary>
<code>Unannounced</code> - 6</summary>
Announcement, if made at all, was made too recently.
</details>
</li>
<li>
<details>
<summary>
<code>NoSelfProxy</code> - 7</summary>
Cannot add self as proxy.
</details>
</li>
</ul>
</li>
<li>Utility - 64
<ul>
<li>
<details>
<summary>
<code>TooManyCalls</code> - 0</summary>
Too many calls batched.
</details>
</li>
</ul>
</li>
<li>Treasury - 65
<ul>
<li>
<details>
<summary>
<code>InsufficientProposersBalance</code> - 0</summary>
Proposer's balance is too low.
</details>
</li>
<li>
<details>
<summary>
<code>InvalidIndex</code> - 1</summary>
No proposal or bounty at that index.
</details>
</li>
<li>
<details>
<summary>
<code>TooManyApprovals</code> - 2</summary>
Too many approvals in the queue.
</details>
</li>
<li>
<details>
<summary>
<code>InsufficientPermission</code> - 3</summary>
The spend origin is valid but the amount it is allowed to spend is lower than the
amount to be spent.
</details>
</li>
<li>
<details>
<summary>
<code>ProposalNotApproved</code> - 4</summary>
Proposal has not been approved.
</details>
</li>
</ul>
</li>
</ul>
\ No newline at end of file
# Runtime events
There are **130** events from **37** pallets.
<ul>
<li>System - 0
<ul>
<li>
<details>
<summary>
<code>ExtrinsicSuccess(dispatch_info)</code> - 0</summary>
An extrinsic completed successfully.
```rust
dispatch_info: DispatchInfo
```
</details>
</li>
<li>
<details>
<summary>
<code>ExtrinsicFailed(dispatch_error, dispatch_info)</code> - 1</summary>
An extrinsic failed.
```rust
dispatch_error: DispatchError
dispatch_info: DispatchInfo
```
</details>
</li>
<li>
<details>
<summary>
<code>CodeUpdated()</code> - 2</summary>
`:code` was updated.
```rust
no args
```
</details>
</li>
<li>
<details>
<summary>
<code>NewAccount(account)</code> - 3</summary>
A new account was created.
```rust
account: T::AccountId
```
</details>
</li>
<li>
<details>
<summary>
<code>KilledAccount(account)</code> - 4</summary>
An account was reaped.
```rust
account: T::AccountId
```
</details>
</li>
<li>
<details>
<summary>
<code>Remarked(sender, hash)</code> - 5</summary>
On on-chain remark happened.
```rust
sender: T::AccountId
hash: T::Hash
```
</details>
</li>
</ul>
</li>
<li>Account - 1
<ul>
<li>
<details>
<summary>
<code>ForceDestroy(who, balance)</code> - 0</summary>
Force the destruction of an account because its free balance is insufficient to pay
the account creation price.
[who, balance]
```rust
who: T::AccountId
balance: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>RandomIdAssigned(who, random_id)</code> - 1</summary>
Random id assigned
[account_id, random_id]
```rust
who: T::AccountId
random_id: H256
```
</details>
</li>
<li>
<details>
<summary>
<code>AccountLinked(who, identity)</code> - 2</summary>
account linked to identity
```rust
who: T::AccountId
identity: IdtyIdOf<T>
```
</details>
</li>
<li>
<details>
<summary>
<code>AccountUnlinked()</code> - 3</summary>
account unlinked from identity
```rust
: T::AccountId
```
</details>
</li>
</ul>
</li>
<li>Scheduler - 2
<ul>
<li>
<details>
<summary>
<code>Scheduled(when, index)</code> - 0</summary>
Scheduled some task.
```rust
when: T::BlockNumber
index: u32
```
</details>
</li>
<li>
<details>
<summary>
<code>Canceled(when, index)</code> - 1</summary>
Canceled some task.
```rust
when: T::BlockNumber
index: u32
```
</details>
</li>
<li>
<details>
<summary>
<code>Dispatched(task, id, result)</code> - 2</summary>
Dispatched some task.
```rust
task: TaskAddress<T::BlockNumber>
id: Option<TaskName>
result: DispatchResult
```
</details>
</li>
<li>
<details>
<summary>
<code>CallUnavailable(task, id)</code> - 3</summary>
The call for the provided hash was not found so the task has been aborted.
```rust
task: TaskAddress<T::BlockNumber>
id: Option<TaskName>
```
</details>
</li>
<li>
<details>
<summary>
<code>PeriodicFailed(task, id)</code> - 4</summary>
The given task was unable to be renewed since the agenda is full at that block.
```rust
task: TaskAddress<T::BlockNumber>
id: Option<TaskName>
```
</details>
</li>
<li>
<details>
<summary>
<code>PermanentlyOverweight(task, id)</code> - 5</summary>
The given task can never be executed since it is overweight.
```rust
task: TaskAddress<T::BlockNumber>
id: Option<TaskName>
```
</details>
</li>
</ul>
</li>
<li>Babe - 3
<ul>
</ul>
</li>
<li>Timestamp - 4
<ul>
</ul>
</li>
<li>Parameters - 5
<ul>
</ul>
</li>
<li>Balances - 6
<ul>
<li>
<details>
<summary>
<code>Endowed(account, free_balance)</code> - 0</summary>
An account was created with some free balance.
```rust
account: T::AccountId
free_balance: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>DustLost(account, amount)</code> - 1</summary>
An account was removed whose balance was non-zero but below ExistentialDeposit,
resulting in an outright loss.
```rust
account: T::AccountId
amount: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>Transfer(from, to, amount)</code> - 2</summary>
Transfer succeeded.
```rust
from: T::AccountId
to: T::AccountId
amount: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>BalanceSet(who, free)</code> - 3</summary>
A balance was set by root.
```rust
who: T::AccountId
free: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>Reserved(who, amount)</code> - 4</summary>
Some balance was reserved (moved from free to reserved).
```rust
who: T::AccountId
amount: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>Unreserved(who, amount)</code> - 5</summary>
Some balance was unreserved (moved from reserved to free).
```rust
who: T::AccountId
amount: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>ReserveRepatriated(from, to, amount, destination_status)</code> - 6</summary>
Some balance was moved from the reserve of the first account to the second account.
Final argument indicates the destination balance type.
```rust
from: T::AccountId
to: T::AccountId
amount: T::Balance
destination_status: Status
```
</details>
</li>
<li>
<details>
<summary>
<code>Deposit(who, amount)</code> - 7</summary>
Some amount was deposited (e.g. for transaction fees).
```rust
who: T::AccountId
amount: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>Withdraw(who, amount)</code> - 8</summary>
Some amount was withdrawn from the account (e.g. for transaction fees).
```rust
who: T::AccountId
amount: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>Slashed(who, amount)</code> - 9</summary>
Some amount was removed from the account (e.g. for misbehavior).
```rust
who: T::AccountId
amount: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>Minted(who, amount)</code> - 10</summary>
Some amount was minted into an account.
```rust
who: T::AccountId
amount: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>Burned(who, amount)</code> - 11</summary>
Some amount was burned from an account.
```rust
who: T::AccountId
amount: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>Suspended(who, amount)</code> - 12</summary>
Some amount was suspended from an account (it can be restored later).
```rust
who: T::AccountId
amount: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>Restored(who, amount)</code> - 13</summary>
Some amount was restored into an account.
```rust
who: T::AccountId
amount: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>Upgraded(who)</code> - 14</summary>
An account was upgraded.
```rust
who: T::AccountId
```
</details>
</li>
<li>
<details>
<summary>
<code>Issued(amount)</code> - 15</summary>
Total issuance was increased by `amount`, creating a credit to be balanced.
```rust
amount: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>Rescinded(amount)</code> - 16</summary>
Total issuance was decreased by `amount`, creating a debt to be balanced.
```rust
amount: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>Locked(who, amount)</code> - 17</summary>
Some balance was locked.
```rust
who: T::AccountId
amount: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>Unlocked(who, amount)</code> - 18</summary>
Some balance was unlocked.
```rust
who: T::AccountId
amount: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>Frozen(who, amount)</code> - 19</summary>
Some balance was frozen.
```rust
who: T::AccountId
amount: T::Balance
```
</details>
</li>
<li>
<details>
<summary>
<code>Thawed(who, amount)</code> - 20</summary>
Some balance was thawed.
```rust
who: T::AccountId
amount: T::Balance
```
</details>
</li>
</ul>
</li>
<li>TransactionPayment - 32
<ul>
<li>
<details>
<summary>
<code>TransactionFeePaid(who, actual_fee, tip)</code> - 0</summary>
A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,
has been paid by `who`.
```rust
who: T::AccountId
actual_fee: BalanceOf<T>
tip: BalanceOf<T>
```
</details>
</li>
</ul>
</li>
<li>OneshotAccount - 7
<ul>
<li>
<details>
<summary>
<code>OneshotAccountCreated(account, balance, creator)</code> - 0</summary>
```rust
account: T::AccountId
balance: <T::Currency as Currency<T::AccountId>>::Balance
creator: T::AccountId
```
</details>
</li>
<li>
<details>
<summary>
<code>OneshotAccountConsumed(account, dest1, dest2)</code> - 1</summary>
```rust
account: T::AccountId
dest1: (T::AccountId,<T::Currency as Currency<T::AccountId>>::Balance,)
dest2: Option<
(T::AccountId,<T::Currency as Currency<T::AccountId>>::Balance,)
>
```
</details>
</li>
<li>
<details>
<summary>
<code>Withdraw(account, balance)</code> - 2</summary>
```rust
account: T::AccountId
balance: <T::Currency as Currency<T::AccountId>>::Balance
```
</details>
</li>
</ul>
</li>
<li>Quota - 66
<ul>
<li>
<details>
<summary>
<code>Refunded(who, identity, amount)</code> - 0</summary>
Refunded fees to an account
```rust
who: T::AccountId
identity: IdtyId<T>
amount: BalanceOf<T>
```
</details>
</li>
<li>
<details>
<summary>
<code>NoQuotaForIdty()</code> - 1</summary>
No quota for identity
```rust
: IdtyId<T>
```
</details>
</li>
<li>
<details>
<summary>
<code>NoMoreCurrencyForRefund()</code> - 2</summary>
No more currency available for refund
```rust
no args
```
</details>
</li>
<li>
<details>
<summary>
<code>RefundFailed()</code> - 3</summary>
Refund failed
```rust
: T::AccountId
```
</details>
</li>
<li>
<details>
<summary>
<code>RefundQueueFull()</code> - 4</summary>
Refund queue full
```rust
no args
```
</details>
</li>
</ul>
</li>
<li>AuthorityMembers - 10
<ul>
<li>
<details>
<summary>
<code>IncomingAuthorities()</code> - 0</summary>
List of members who will enter the set of authorities at the next session.
[Vec<member_id>]
```rust
: Vec<T::MemberId>
```
</details>
</li>
<li>
<details>
<summary>
<code>OutgoingAuthorities()</code> - 1</summary>
List of members who will leave the set of authorities at the next session.
[Vec<member_id>]
```rust
: Vec<T::MemberId>
```
</details>
</li>
<li>
<details>
<summary>
<code>MemberGoOffline()</code> - 2</summary>
A member will leave the set of authorities in 2 sessions.
[member_id]
```rust
: T::MemberId
```
</details>
</li>
<li>
<details>
<summary>
<code>MemberGoOnline()</code> - 3</summary>
A member will enter the set of authorities in 2 sessions.
[member_id]
```rust
: T::MemberId
```
</details>
</li>
<li>
<details>
<summary>
<code>MemberRemoved()</code> - 4</summary>
A member has lost the right to be part of the authorities,
this member will be removed from the authority set in 2 sessions.
[member_id]
```rust
: T::MemberId
```
</details>
</li>
<li>
<details>
<summary>
<code>MemberRemovedFromBlackList()</code> - 5</summary>
A member has been removed from the blacklist.
[member_id]
```rust
: T::MemberId
```
</details>
</li>
</ul>
</li>
<li>Authorship - 11
<ul>
</ul>
</li>
<li>Offences - 12
<ul>
<li>
<details>
<summary>
<code>Offence(kind, timeslot)</code> - 0</summary>
There is an offence reported of the given `kind` happened at the `session_index` and
(kind-specific) time slot. This event is not deposited for duplicate slashes.
\[kind, timeslot\].
```rust
kind: Kind
timeslot: OpaqueTimeSlot
```
</details>
</li>
</ul>
</li>
<li>Historical - 13
<ul>
</ul>
</li>
<li>Session - 14
<ul>
<li>
<details>
<summary>
<code>NewSession(session_index)</code> - 0</summary>
New session has happened. Note that the argument is the session index, not the
block number as the type might suggest.
```rust
session_index: SessionIndex
```
</details>
</li>
</ul>
</li>
<li>Grandpa - 15
<ul>
<li>
<details>
<summary>
<code>NewAuthorities(authority_set)</code> - 0</summary>
New authority set has been applied.
```rust
authority_set: AuthorityList
```
</details>
</li>
<li>
<details>
<summary>
<code>Paused()</code> - 1</summary>
Current authority set has been paused.
```rust
no args
```
</details>
</li>
<li>
<details>
<summary>
<code>Resumed()</code> - 2</summary>
Current authority set has been resumed.
```rust
no args
```
</details>
</li>
</ul>
</li>
<li>ImOnline - 16
<ul>
<li>
<details>
<summary>
<code>HeartbeatReceived(authority_id)</code> - 0</summary>
A new heartbeat was received from `AuthorityId`.
```rust
authority_id: T::AuthorityId
```
</details>
</li>
<li>
<details>
<summary>
<code>AllGood()</code> - 1</summary>
At the end of the session, no offence was committed.
```rust
no args
```
</details>
</li>
<li>
<details>
<summary>
<code>SomeOffline(offline)</code> - 2</summary>
At the end of the session, at least one validator was found to be offline.
```rust
offline: Vec<IdentificationTuple<T>>
```
</details>
</li>
</ul>
</li>
<li>AuthorityDiscovery - 17
<ul>
</ul>
</li>
<li>Sudo - 20
<ul>
<li>
<details>
<summary>
<code>Sudid(sudo_result)</code> - 0</summary>
A sudo just took place. \[result\]
```rust
sudo_result: DispatchResult
```
</details>
</li>
<li>
<details>
<summary>
<code>KeyChanged(old_sudoer)</code> - 1</summary>
The \[sudoer\] just switched identity; the old key is supplied if one existed.
```rust
old_sudoer: Option<T::AccountId>
```
</details>
</li>
<li>
<details>
<summary>
<code>SudoAsDone(sudo_result)</code> - 2</summary>
A sudo just took place. \[result\]
```rust
sudo_result: DispatchResult
```
</details>
</li>
</ul>
</li>
<li>UpgradeOrigin - 21
<ul>
<li>
<details>
<summary>
<code>DispatchedAsRoot(result)</code> - 0</summary>
A call was dispatched as root from an upgradable origin
```rust
result: DispatchResult
```
</details>
</li>
</ul>
</li>
<li>Preimage - 22
<ul>
<li>
<details>
<summary>
<code>Noted(hash)</code> - 0</summary>
A preimage has been noted.
```rust
hash: T::Hash
```
</details>
</li>
<li>
<details>
<summary>
<code>Requested(hash)</code> - 1</summary>
A preimage has been requested.
```rust
hash: T::Hash
```
</details>
</li>
<li>
<details>
<summary>
<code>Cleared(hash)</code> - 2</summary>
A preimage has ben cleared.
```rust
hash: T::Hash
```
</details>
</li>
</ul>
</li>
<li>TechnicalCommittee - 23
<ul>
<li>
<details>
<summary>
<code>Proposed(account, proposal_index, proposal_hash, threshold)</code> - 0</summary>
A motion (given hash) has been proposed (by given account) with a threshold (given
`MemberCount`).
```rust
account: T::AccountId
proposal_index: ProposalIndex
proposal_hash: T::Hash
threshold: MemberCount
```
</details>
</li>
<li>
<details>
<summary>
<code>Voted(account, proposal_hash, voted, yes, no)</code> - 1</summary>
A motion (given hash) has been voted on by given account, leaving
a tally (yes votes and no votes given respectively as `MemberCount`).
```rust
account: T::AccountId
proposal_hash: T::Hash
voted: bool
yes: MemberCount
no: MemberCount
```
</details>
</li>
<li>
<details>
<summary>
<code>Approved(proposal_hash)</code> - 2</summary>
A motion was approved by the required threshold.
```rust
proposal_hash: T::Hash
```
</details>
</li>
<li>
<details>
<summary>
<code>Disapproved(proposal_hash)</code> - 3</summary>
A motion was not approved by the required threshold.
```rust
proposal_hash: T::Hash
```
</details>
</li>
<li>
<details>
<summary>
<code>Executed(proposal_hash, result)</code> - 4</summary>
A motion was executed; result will be `Ok` if it returned without error.
```rust
proposal_hash: T::Hash
result: DispatchResult
```
</details>
</li>
<li>
<details>
<summary>
<code>MemberExecuted(proposal_hash, result)</code> - 5</summary>
A single member did some action; result will be `Ok` if it returned without error.
```rust
proposal_hash: T::Hash
result: DispatchResult
```
</details>
</li>
<li>
<details>
<summary>
<code>Closed(proposal_hash, yes, no)</code> - 6</summary>
A proposal was closed because its threshold was reached or after its duration was up.
```rust
proposal_hash: T::Hash
yes: MemberCount
no: MemberCount
```
</details>
</li>
</ul>
</li>
<li>UniversalDividend - 30
<ul>
<li>
<details>
<summary>
<code>NewUdCreated(amount, index, monetary_mass, members_count)</code> - 0</summary>
A new universal dividend is created.
```rust
amount: BalanceOf<T>
index: UdIndex
monetary_mass: BalanceOf<T>
members_count: BalanceOf<T>
```
</details>
</li>
<li>
<details>
<summary>
<code>UdReevalued(new_ud_amount, monetary_mass, members_count)</code> - 1</summary>
The universal dividend has been re-evaluated.
```rust
new_ud_amount: BalanceOf<T>
monetary_mass: BalanceOf<T>
members_count: BalanceOf<T>
```
</details>
</li>
<li>
<details>
<summary>
<code>UdsAutoPaidAtRemoval(count, total, who)</code> - 2</summary>
DUs were automatically transferred as part of a member removal.
```rust
count: UdIndex
total: BalanceOf<T>
who: T::AccountId
```
</details>
</li>
<li>
<details>
<summary>
<code>UdsClaimed(count, total, who)</code> - 3</summary>
A member claimed his UDs.
```rust
count: UdIndex
total: BalanceOf<T>
who: T::AccountId
```
</details>
</li>
</ul>
</li>
<li>Wot - 40
<ul>
</ul>
</li>
<li>Identity - 41
<ul>
<li>
<details>
<summary>
<code>IdtyCreated(idty_index, owner_key)</code> - 0</summary>
A new identity has been created
[idty_index, owner_key]
```rust
idty_index: T::IdtyIndex
owner_key: T::AccountId
```
</details>
</li>
<li>
<details>
<summary>
<code>IdtyConfirmed(idty_index, owner_key, name)</code> - 1</summary>
An identity has been confirmed by its owner
[idty_index, owner_key, name]
```rust
idty_index: T::IdtyIndex
owner_key: T::AccountId
name: IdtyName
```
</details>
</li>
<li>
<details>
<summary>
<code>IdtyValidated(idty_index)</code> - 2</summary>
An identity has been validated
[idty_index]
```rust
idty_index: T::IdtyIndex
```
</details>
</li>
<li>
<details>
<summary>
<code>IdtyChangedOwnerKey(idty_index, new_owner_key)</code> - 3</summary>
```rust
idty_index: T::IdtyIndex
new_owner_key: T::AccountId
```
</details>
</li>
<li>
<details>
<summary>
<code>IdtyRemoved(idty_index, reason)</code> - 4</summary>
An identity has been removed
[idty_index]
```rust
idty_index: T::IdtyIndex
reason: IdtyRemovalReason<T::IdtyRemovalOtherReason>
```
</details>
</li>
</ul>
</li>
<li>Membership - 42
<ul>
<li>
<details>
<summary>
<code>MembershipAcquired()</code> - 0</summary>
A membership was acquired
[idty_id]
```rust
: T::IdtyId
```
</details>
</li>
<li>
<details>
<summary>
<code>MembershipExpired()</code> - 1</summary>
A membership expired
[idty_id]
```rust
: T::IdtyId
```
</details>
</li>
<li>
<details>
<summary>
<code>MembershipRenewed()</code> - 2</summary>
A membership was renewed
[idty_id]
```rust
: T::IdtyId
```
</details>
</li>
<li>
<details>
<summary>
<code>MembershipRequested()</code> - 3</summary>
An membership was requested
[idty_id]
```rust
: T::IdtyId
```
</details>
</li>
<li>
<details>
<summary>
<code>MembershipRevoked()</code> - 4</summary>
A membership was revoked
[idty_id]
```rust
: T::IdtyId
```
</details>
</li>
<li>
<details>
<summary>
<code>PendingMembershipExpired()</code> - 5</summary>
A pending membership request has expired
[idty_id]
```rust
: T::IdtyId
```
</details>
</li>
</ul>
</li>
<li>Cert - 43
<ul>
<li>
<details>
<summary>
<code>NewCert(issuer, issuer_issued_count, receiver, receiver_received_count)</code> - 0</summary>
New certification
[issuer, issuer_issued_count, receiver, receiver_received_count]
```rust
issuer: T::IdtyIndex
issuer_issued_count: u32
receiver: T::IdtyIndex
receiver_received_count: u32
```
</details>
</li>
<li>
<details>
<summary>
<code>RemovedCert(issuer, issuer_issued_count, receiver, receiver_received_count, expiration)</code> - 1</summary>
Removed certification
[issuer, issuer_issued_count, receiver, receiver_received_count, expiration]
```rust
issuer: T::IdtyIndex
issuer_issued_count: u32
receiver: T::IdtyIndex
receiver_received_count: u32
expiration: bool
```
</details>
</li>
<li>
<details>
<summary>
<code>RenewedCert(issuer, receiver)</code> - 2</summary>
Renewed certification
[issuer, receiver]
```rust
issuer: T::IdtyIndex
receiver: T::IdtyIndex
```
</details>
</li>
</ul>
</li>
<li>Distance - 44
<ul>
</ul>
</li>
<li>SmithSubWot - 50
<ul>
</ul>
</li>
<li>SmithMembership - 52
<ul>
<li>
<details>
<summary>
<code>MembershipAcquired()</code> - 0</summary>
A membership was acquired
[idty_id]
```rust
: T::IdtyId
```
</details>
</li>
<li>
<details>
<summary>
<code>MembershipExpired()</code> - 1</summary>
A membership expired
[idty_id]
```rust
: T::IdtyId
```
</details>
</li>
<li>
<details>
<summary>
<code>MembershipRenewed()</code> - 2</summary>
A membership was renewed
[idty_id]
```rust
: T::IdtyId
```
</details>
</li>
<li>
<details>
<summary>
<code>MembershipRequested()</code> - 3</summary>
An membership was requested
[idty_id]
```rust
: T::IdtyId
```
</details>
</li>
<li>
<details>
<summary>
<code>MembershipRevoked()</code> - 4</summary>
A membership was revoked
[idty_id]
```rust
: T::IdtyId
```
</details>
</li>
<li>
<details>
<summary>
<code>PendingMembershipExpired()</code> - 5</summary>
A pending membership request has expired
[idty_id]
```rust
: T::IdtyId
```
</details>
</li>
</ul>
</li>
<li>SmithCert - 53
<ul>
<li>
<details>
<summary>
<code>NewCert(issuer, issuer_issued_count, receiver, receiver_received_count)</code> - 0</summary>
New certification
[issuer, issuer_issued_count, receiver, receiver_received_count]
```rust
issuer: T::IdtyIndex
issuer_issued_count: u32
receiver: T::IdtyIndex
receiver_received_count: u32
```
</details>
</li>
<li>
<details>
<summary>
<code>RemovedCert(issuer, issuer_issued_count, receiver, receiver_received_count, expiration)</code> - 1</summary>
Removed certification
[issuer, issuer_issued_count, receiver, receiver_received_count, expiration]
```rust
issuer: T::IdtyIndex
issuer_issued_count: u32
receiver: T::IdtyIndex
receiver_received_count: u32
expiration: bool
```
</details>
</li>
<li>
<details>
<summary>
<code>RenewedCert(issuer, receiver)</code> - 2</summary>
Renewed certification
[issuer, receiver]
```rust
issuer: T::IdtyIndex
receiver: T::IdtyIndex
```
</details>
</li>
</ul>
</li>
<li>AtomicSwap - 60
<ul>
<li>
<details>
<summary>
<code>NewSwap(account, proof, swap)</code> - 0</summary>
Swap created.
```rust
account: T::AccountId
proof: HashedProof
swap: PendingSwap<T>
```
</details>
</li>
<li>
<details>
<summary>
<code>SwapClaimed(account, proof, success)</code> - 1</summary>
Swap claimed. The last parameter indicates whether the execution succeeds.
```rust
account: T::AccountId
proof: HashedProof
success: bool
```
</details>
</li>
<li>
<details>
<summary>
<code>SwapCancelled(account, proof)</code> - 2</summary>
Swap cancelled.
```rust
account: T::AccountId
proof: HashedProof
```
</details>
</li>
</ul>
</li>
<li>Multisig - 61
<ul>
<li>
<details>
<summary>
<code>NewMultisig(approving, multisig, call_hash)</code> - 0</summary>
A new multisig operation has begun.
```rust
approving: T::AccountId
multisig: T::AccountId
call_hash: CallHash
```
</details>
</li>
<li>
<details>
<summary>
<code>MultisigApproval(approving, timepoint, multisig, call_hash)</code> - 1</summary>
A multisig operation has been approved by someone.
```rust
approving: T::AccountId
timepoint: Timepoint<T::BlockNumber>
multisig: T::AccountId
call_hash: CallHash
```
</details>
</li>
<li>
<details>
<summary>
<code>MultisigExecuted(approving, timepoint, multisig, call_hash, result)</code> - 2</summary>
A multisig operation has been executed.
```rust
approving: T::AccountId
timepoint: Timepoint<T::BlockNumber>
multisig: T::AccountId
call_hash: CallHash
result: DispatchResult
```
</details>
</li>
<li>
<details>
<summary>
<code>MultisigCancelled(cancelling, timepoint, multisig, call_hash)</code> - 3</summary>
A multisig operation has been cancelled.
```rust
cancelling: T::AccountId
timepoint: Timepoint<T::BlockNumber>
multisig: T::AccountId
call_hash: CallHash
```
</details>
</li>
</ul>
</li>
<li>ProvideRandomness - 62
<ul>
<li>
<details>
<summary>
<code>FilledRandomness(request_id, randomness)</code> - 0</summary>
Filled randomness
```rust
request_id: RequestId
randomness: H256
```
</details>
</li>
<li>
<details>
<summary>
<code>RequestedRandomness(request_id, salt, r#type)</code> - 1</summary>
Requested randomness
```rust
request_id: RequestId
salt: H256
r#type: RandomnessType
```
</details>
</li>
</ul>
</li>
<li>Proxy - 63
<ul>
<li>
<details>
<summary>
<code>ProxyExecuted(result)</code> - 0</summary>
A proxy was executed correctly, with the given.
```rust
result: DispatchResult
```
</details>
</li>
<li>
<details>
<summary>
<code>PureCreated(pure, who, proxy_type, disambiguation_index)</code> - 1</summary>
A pure account has been created by new proxy with given
disambiguation index and proxy type.
```rust
pure: T::AccountId
who: T::AccountId
proxy_type: T::ProxyType
disambiguation_index: u16
```
</details>
</li>
<li>
<details>
<summary>
<code>Announced(real, proxy, call_hash)</code> - 2</summary>
An announcement was placed to make a call in the future.
```rust
real: T::AccountId
proxy: T::AccountId
call_hash: CallHashOf<T>
```
</details>
</li>
<li>
<details>
<summary>
<code>ProxyAdded(delegator, delegatee, proxy_type, delay)</code> - 3</summary>
A proxy was added.
```rust
delegator: T::AccountId
delegatee: T::AccountId
proxy_type: T::ProxyType
delay: T::BlockNumber
```
</details>
</li>
<li>
<details>
<summary>
<code>ProxyRemoved(delegator, delegatee, proxy_type, delay)</code> - 4</summary>
A proxy was removed.
```rust
delegator: T::AccountId
delegatee: T::AccountId
proxy_type: T::ProxyType
delay: T::BlockNumber
```
</details>
</li>
</ul>
</li>
<li>Utility - 64
<ul>
<li>
<details>
<summary>
<code>BatchInterrupted(index, error)</code> - 0</summary>
Batch of dispatches did not complete fully. Index of first failing dispatch given, as
well as the error.
```rust
index: u32
error: DispatchError
```
</details>
</li>
<li>
<details>
<summary>
<code>BatchCompleted()</code> - 1</summary>
Batch of dispatches completed fully with no error.
```rust
no args
```
</details>
</li>
<li>
<details>
<summary>
<code>BatchCompletedWithErrors()</code> - 2</summary>
Batch of dispatches completed but has errors.
```rust
no args
```
</details>
</li>
<li>
<details>
<summary>
<code>ItemCompleted()</code> - 3</summary>
A single item within a Batch of dispatches has completed with no error.
```rust
no args
```
</details>
</li>
<li>
<details>
<summary>
<code>ItemFailed(error)</code> - 4</summary>
A single item within a Batch of dispatches has completed with error.
```rust
error: DispatchError
```
</details>
</li>
<li>
<details>
<summary>
<code>DispatchedAs(result)</code> - 5</summary>
A call was dispatched.
```rust
result: DispatchResult
```
</details>
</li>
</ul>
</li>
<li>Treasury - 65
<ul>
<li>
<details>
<summary>
<code>Proposed(proposal_index)</code> - 0</summary>
New proposal.
```rust
proposal_index: ProposalIndex
```
</details>
</li>
<li>
<details>
<summary>
<code>Spending(budget_remaining)</code> - 1</summary>
We have ended a spend period and will now allocate funds.
```rust
budget_remaining: BalanceOf<T, I>
```
</details>
</li>
<li>
<details>
<summary>
<code>Awarded(proposal_index, award, account)</code> - 2</summary>
Some funds have been allocated.
```rust
proposal_index: ProposalIndex
award: BalanceOf<T, I>
account: T::AccountId
```
</details>
</li>
<li>
<details>
<summary>
<code>Rejected(proposal_index, slashed)</code> - 3</summary>
A proposal was rejected; funds were slashed.
```rust
proposal_index: ProposalIndex
slashed: BalanceOf<T, I>
```
</details>
</li>
<li>
<details>
<summary>
<code>Burnt(burnt_funds)</code> - 4</summary>
Some of our funds have been burnt.
```rust
burnt_funds: BalanceOf<T, I>
```
</details>
</li>
<li>
<details>
<summary>
<code>Rollover(rollover_balance)</code> - 5</summary>
Spending has finished; this is the amount that rolls over until next spend.
```rust
rollover_balance: BalanceOf<T, I>
```
</details>
</li>
<li>
<details>
<summary>
<code>Deposit(value)</code> - 6</summary>
Some funds have been deposited.
```rust
value: BalanceOf<T, I>
```
</details>
</li>
<li>
<details>
<summary>
<code>SpendApproved(proposal_index, amount, beneficiary)</code> - 7</summary>
A new spend proposal has been approved.
```rust
proposal_index: ProposalIndex
amount: BalanceOf<T, I>
beneficiary: T::AccountId
```
</details>
</li>
<li>
<details>
<summary>
<code>UpdatedInactive(reactivated, deactivated)</code> - 8</summary>
The inactive funds of the pallet have been updated.
```rust
reactivated: BalanceOf<T, I>
deactivated: BalanceOf<T, I>
```
</details>
</li>
</ul>
</li>
</ul>
\ No newline at end of file
......@@ -81,5 +81,9 @@
],
"treasury_funder_pubkey": "FHNpKmJrUtusuvKPGomAygQqeiks98bdV6yD61Stb6vg",
"ud": 1000,
"initial_monetary_mass": 3000
"initial_monetary_mass": 3000,
"current_block": {
"number": 0,
"medianTime": 1700000000
}
}
\ No newline at end of file
......@@ -90,5 +90,9 @@
],
"treasury_funder_pubkey": "FHNpKmJrUtusuvKPGomAygQqeiks98bdV6yD61Stb6vg",
"ud": 1000,
"initial_monetary_mass": 4000
"initial_monetary_mass": 4000,
"current_block": {
"number": 0,
"medianTime": 1700000000
}
}
\ No newline at end of file
......@@ -15,4 +15,5 @@ parity-scale-codec = "3.4.0"
sp-core = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false }
subxt = { git = 'https://github.com/duniter/subxt', branch = 'duniter-substrate-v0.9.42', default-features = false, features = ["jsonrpsee-ws"] }
tokio = { version = "1.28", features = ["macros", "time", "rt-multi-thread"], default-features = false }
sp-runtime = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false , features = ["std"] } # https://github.com/paritytech/subxt/issues/437
\ No newline at end of file
sp-runtime = { git = 'https://github.com/duniter/substrate', branch = 'duniter-substrate-v0.9.42', default-features = false , features = ["std"] } # https://github.com/paritytech/subxt/issues/437
countmap = "0.2.0"
......@@ -16,7 +16,7 @@ Test suite that verifies the consistency of the onchain storage.
#### Custom RPC endpoint
You can choose to use another RPC endpoint by setting the environment variable `WS_RPC_ENDPOINT`.
This is also the only way to test against a different network that the default one.
This is also the only way to test against a different network that the default one which is `ws://localhost:9944`.
#### run against a specific block
......
......@@ -17,14 +17,16 @@
#[subxt::subxt(runtime_metadata_path = "../resources/metadata.scale")]
pub mod gdev {}
use countmap::CountMap;
use hex_literal::hex;
use sp_core::crypto::AccountId32;
use sp_core::{blake2_128, ByteArray, H256};
use std::collections::HashMap;
use std::collections::{HashMap, HashSet};
use subxt::config::SubstrateConfig as GdevConfig;
const DEFAULT_ENDPOINT: &str = "wss://gdev.librelois.fr:443/ws";
const DEFAULT_ENDPOINT: &str = "ws://localhost:9944";
const EXISTENTIAL_DEPOSIT: u64 = 100;
const TREASURY_ACCOUNT_ID: [u8; 32] =
hex!("6d6f646c70792f74727372790000000000000000000000000000000000000000");
......@@ -89,7 +91,7 @@ async fn sanity_tests_at(client: Client, _maybe_block_hash: Option<H256>) -> any
account_id_bytes.copy_from_slice(&key.0[48..]);
accounts.insert(AccountId32::new(account_id_bytes), account_info);
}
println!("accounts: {}.", accounts.len());
println!("accounts.len(): {}.", accounts.len());
// Collect identities
let mut identities: HashMap<IdtyIndex, IdtyValue> = HashMap::new();
......@@ -113,7 +115,7 @@ async fn sanity_tests_at(client: Client, _maybe_block_hash: Option<H256>) -> any
};
identities.insert(IdtyIndex::from_le_bytes(idty_index_bytes), idty_val);
}
println!("identities: {}.", identities.len());
println!("identities.len(): {}.", identities.len());
// Collect identity_index_of
let mut identity_index_of: HashMap<[u8; 16], IdtyIndex> = HashMap::new();
......@@ -126,10 +128,10 @@ async fn sanity_tests_at(client: Client, _maybe_block_hash: Option<H256>) -> any
.await?;
while let Some((key, idty_index)) = idty_index_of_iter.next().await? {
let mut blake2_128_bytes = [0u8; 16];
blake2_128_bytes.copy_from_slice(&key.0[32..]);
blake2_128_bytes.copy_from_slice(&key.0[32..48]);
identity_index_of.insert(blake2_128_bytes, idty_index);
}
println!("identity_index_of: {}.", identities.len());
println!("identity_index_of.len(): {}.", identity_index_of.len());
let storage = Storage {
accounts,
......@@ -154,12 +156,17 @@ mod verifier {
Self { errors: Vec::new() }
}
// FIXME why async functions when called with await?
/// method to run all storage tests
pub(super) async fn verify_storage(&mut self, storage: &Storage) -> anyhow::Result<()> {
self.verify_accounts(&storage.accounts).await;
self.verify_identities(&storage.accounts, &storage.identities)
.await;
self.verify_identity_index_of(&storage.identities, &storage.identity_index_of)
.await;
self.verify_identity_coherence(&storage.identities, &storage.identity_index_of)
.await;
if self.errors.is_empty() {
Ok(())
......@@ -174,12 +181,19 @@ mod verifier {
}
}
/// assert method to collect errors
fn assert(&mut self, assertion: bool, error: String) {
if !assertion {
self.errors.push(error);
}
}
/// like assert but just push error
fn error(&mut self, error: String) {
self.errors.push(error);
}
/// check accounts sufficients and consumers (specific to duniter-account pallet)
async fn verify_accounts(&mut self, accounts: &HashMap<AccountId32, AccountInfo>) {
for (account_id, account_info) in accounts {
if account_info.sufficients == 0 {
......@@ -190,7 +204,8 @@ mod verifier {
);
// Rule 2: If the account is not sufficient, it should comply to the existential deposit
self.assert(
(account_info.data.free + account_info.data.reserved) >= 200,
(account_info.data.free + account_info.data.reserved)
>= EXISTENTIAL_DEPOSIT,
format!(
"Account {} not respect existential deposit rule.",
account_id
......@@ -198,9 +213,9 @@ mod verifier {
);
}
// Rule 3: If the account have consumers, it shoul have at least one provider
// Rule 3: If the account have consumers, it should have at least one provider
if account_info.consumers > 0 {
// Rule 1: If the account is not s
// Rule 1: If the account is not sufficient [...]
self.assert(
account_info.providers > 0,
format!("Account {} has no providers nor sufficients.", account_id),
......@@ -218,12 +233,31 @@ mod verifier {
}
}
/// check list of identities (account existence, sufficient)
async fn verify_identities(
&mut self,
accounts: &HashMap<AccountId32, AccountInfo>,
identities: &HashMap<IdtyIndex, IdtyValue>,
) {
// counts occurence of owner key
let mut countmap = CountMap::<AccountId32, u8>::new();
// list owner key with multiple occurences
let mut duplicates = HashSet::new();
for (idty_index, idty_value) in identities {
countmap.insert_or_increment(idty_value.owner_key.clone());
if let Some(count) = countmap.get_count(&idty_value.owner_key) {
if count > 1 {
self.error(format!(
"address {} is the owner_key of {count} identities",
idty_value.owner_key
));
if count == 2 {
duplicates.insert(idty_value.owner_key.clone());
}
}
}
// Rule 1: each identity should have an account
let maybe_account = accounts.get(&idty_value.owner_key);
self.assert(
......@@ -244,7 +278,7 @@ mod verifier {
match idty_value.status {
IdtyStatus::Validated => {
// Rule 3: If the identity is validated, removable_on shoud be zero
// Rule 3: If the identity is validated, removable_on should be zero
self.assert(
idty_value.removable_on == 0,
format!(
......@@ -254,7 +288,7 @@ mod verifier {
);
}
_ => {
// Rule 4: If the identity is not validated, next_creatable_identity_on shoud be zero
// Rule 4: If the identity is not validated, next_creatable_identity_on should be zero
self.assert(
idty_value.next_creatable_identity_on == 0,
format!("Identity {} is corrupted: next_creatable_identity_on > 0 on non-validated idty",
......@@ -263,8 +297,18 @@ mod verifier {
}
}
}
for (idty_index, idty_value) in identities {
if duplicates.contains(&idty_value.owner_key) {
self.error(format!(
"duplicate key {} at position {idty_index}",
idty_value.owner_key
));
}
}
}
/// check the identity hashmap (length, identity existence, hash matches owner key)
async fn verify_identity_index_of(
&mut self,
identities: &HashMap<IdtyIndex, IdtyValue>,
......@@ -273,7 +317,11 @@ mod verifier {
// Rule1: identity_index_of should have the same lenght as identities
self.assert(
identities.len() == identity_index_of.len(),
"identities.len() != identity_index_of.len().".to_owned(),
format!(
"identities.len({}) != identity_index_of.len({}).",
identities.len(),
identity_index_of.len()
),
);
for (blake2_128_owner_key, idty_index) in identity_index_of {
......@@ -301,5 +349,29 @@ mod verifier {
}
}
}
/// check coherence between identity list and identity index hashmap
async fn verify_identity_coherence(
&mut self,
identities: &HashMap<IdtyIndex, IdtyValue>,
identity_index_of: &HashMap<[u8; 16], IdtyIndex>,
) {
// each identity should be correcly referenced in the hashmap
for (idty_index, idty_value) in identities {
// hash owner key to get key
let blake2_128_owner_key = &blake2_128(idty_value.owner_key.as_slice());
// get identity index from hashmap
if let Some(index_of) = identity_index_of.get(blake2_128_owner_key) {
self.assert(idty_index == index_of,
format!("identity number {idty_index} with owner key {0} is mapped to identity index {index_of}", idty_value.owner_key));
} else {
self.error(format!(
"identity with owner key {} is not present in hashmap",
idty_value.owner_key
));
}
}
}
}
}
source diff could not be displayed: it is too large. Options to address this: view the blob.
name: "ĞDev"
id: "gdev"
chainType: "Live"
bootNodes: []
bootNodes:
- "/dns/gdev.cgeek.fr/tcp/30334/p2p/12D3KooWN7QhcPbTZgNMnS7AUZh3ZfnM43VdVKqy4JbAEp5AJh4f"
- "/dns/gdev.coinduf.eu/tcp/30333/p2p/12D3KooWFseA3B66eBzj4NY5ng3Lb2U3VPnKCi3iXYGYUSAahEw7"
telemetryEndpoints:
- ["/dns/telemetry.polkadot.io/tcp/443/x-parity-wss/%2Fsubmit%2F", 0]
properties:
......
source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -81,6 +81,13 @@ pub struct GenesisData<Parameters: DeserializeOwned, SessionKeys: Decode> {
pub ud: u64,
}
#[derive(Deserialize, Serialize)]
struct BlockV1 {
number: u32,
#[serde(rename = "medianTime")]
median_time: u64,
}
#[derive(Clone)]
pub struct GenesisIdentity {
pub idty_index: u32,
......@@ -139,6 +146,7 @@ struct TransactionV2 {
#[derive(Deserialize, Serialize)]
struct GenesisMigrationData {
initial_monetary_mass: u64,
current_block: BlockV1,
identities: BTreeMap<String, IdentityV1>,
#[serde(default)]
wallets: BTreeMap<PubkeyV1, u64>,
......@@ -235,6 +243,7 @@ struct SmithWoT<SK: Decode> {
}
struct GenesisInfo<'a> {
genesis_timestamp: u64,
accounts: &'a BTreeMap<AccountId32, GenesisAccountData<u64, u32>>,
genesis_data_wallets_count: &'a usize,
inactive_identities: &'a HashMap<u32, String>,
......@@ -500,6 +509,7 @@ where
});
let genesis_info = GenesisInfo {
genesis_timestamp,
accounts: &accounts,
genesis_data_wallets_count: &genesis_data_wallets_count,
identities: &identities,
......@@ -727,6 +737,7 @@ fn dump_genesis_info(info: GenesisInfo) {
// give genesis info
log::info!(
"prepared genesis with:
- {} as genesis timestamp
- {} accounts ({} identities, {} simple wallets)
- {} total identities ({} active, {} inactive)
- {} smiths
......@@ -734,6 +745,7 @@ fn dump_genesis_info(info: GenesisInfo) {
- {} certifications
- {} smith certifications
- {} members in technical committee",
info.genesis_timestamp,
info.accounts.len(),
info.identities.len() - info.inactive_identities.len(),
info.genesis_data_wallets_count,
......@@ -1040,8 +1052,10 @@ fn check_genesis_data_and_filter_expired_certs_since_export(
genesis_data.identities.iter_mut().for_each(|(name, i)| {
if (i.membership_expire_on.0 as u64) < genesis_timestamp {
if (i.membership_expire_on.0 as u64) >= genesis_data.current_block.median_time {
log::warn!("{} membership expired since export", name);
}
i.membership_expire_on = TimestampV1(0);
log::warn!("{} membership expired since export", name);
}
});
......@@ -1606,7 +1620,9 @@ where
.map(|x| x.0.clone())
.collect::<Vec<_>>();
let genesis_timestamp: u64 = get_genesis_timestamp()?;
let genesis_info = GenesisInfo {
genesis_timestamp,
accounts: &accounts,
genesis_data_wallets_count: &genesis_data_wallets_count,
identities: &identities,
......@@ -1713,8 +1729,13 @@ fn get_genesis_input<P: Default + DeserializeOwned>(
memmap2::Mmap::map(&file)
.map_err(|e| format!("Error mmaping gen conf file `{}`: {}", config_file_path, e))?
};
serde_yaml::from_slice::<GenesisInput<P>>(&bytes)
.map_err(|e| format!("Error parsing gen conf file: {}", e))
if config_file_path.ends_with(".json") {
serde_json::from_slice::<GenesisInput<P>>(&bytes)
.map_err(|e| format!("Error parsing JSON gen conf file: {}", e))
} else {
serde_yaml::from_slice::<GenesisInput<P>>(&bytes)
.map_err(|e| format!("Error parsing YAML gen conf file: {}", e))
}
}
fn get_genesis_migration_data() -> Result<GenesisMigrationData, String> {
......
......@@ -123,7 +123,7 @@ impl SubstrateCli for Cli {
}
// hardcoded previously generated raw chainspecs
// yields a pointlessly heavy binary because of hexadecimal-text-encoded values
#[cfg(all(feature = "gdev", feature = "embed"))]
#[cfg(feature = "gdev")]
"gdev" => Box::new(chain_spec::gdev::ChainSpec::from_json_bytes(
&include_bytes!("../specs/gdev-raw.json")[..],
)?),
......
......@@ -18,47 +18,138 @@
use super::*;
use frame_benchmarking::{account, benchmarks};
use sp_runtime::traits::One;
// FIXME this is a naïve implementation of benchmarks:
// - without properly prepare data
// - without "verify" blocks
// - without thinking about worst case scenario
// - without writing complexity in the term of refund queue length
// It's there as a seed for benchmark implementation and to use WeightInfo where needed.
fn assert_has_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
frame_system::Pallet::<T>::assert_has_event(generic_event.into());
}
benchmarks! {
where_clause {
where
IdtyId<T>: From<u32>,
BalanceOf<T>: From<u64>,
T::AccountId: From<[u8; 32]>,
}
queue_refund {
let account: T::AccountId = account("Alice", 1, 1);
let dummy_refund = Refund {
account: account.clone(),
identity: 0u32.into(),
amount: 20u64.into(),
};
let refund = Refund {
account,
identity: 1u32.into(),
amount: 10u64.into(),
};
}: { Pallet::<T>::queue_refund(refund) }
// Complexity is bound to MAX_QUEUD_REFUNDS where an insertion is O(n-1)
for i in 0..MAX_QUEUED_REFUNDS-1 {
Pallet::<T>::queue_refund(dummy_refund.clone())
}
}: { Pallet::<T>::queue_refund(refund.clone()) }
verify {
assert_eq!(RefundQueue::<T>::get().last(), Some(refund).as_ref());
assert_eq!(RefundQueue::<T>::get().len() as u32, MAX_QUEUED_REFUNDS);
}
spend_quota {
let idty_id = 1u32;
let amount = 1u64;
let idty_id: IdtyId<T> = 1u32.into();
let amount = 2u64;
let quota_amount = 10u64;
IdtyQuota::<T>::insert(
idty_id,
Quota {
last_use: T::BlockNumber::zero(),
amount: quota_amount.into(),
},
);
}: { Pallet::<T>::spend_quota(idty_id.into(), amount.into()) }
verify {
let quota_growth = sp_runtime::Perbill::from_rational(
T::BlockNumber::one(),
T::ReloadRate::get(),
).mul_floor(T::MaxQuota::get());
assert_eq!(IdtyQuota::<T>::get(idty_id).unwrap().amount, quota_growth +quota_amount.into() - amount.into());
}
try_refund {
let account: T::AccountId = account("Alice", 1, 1);
let idty_id: IdtyId<T> = 1u32.into();
IdtyQuota::<T>::insert(
idty_id,
Quota {
last_use: T::BlockNumber::zero(),
amount: 10u64.into(),
},
);
let _ = CurrencyOf::<T>:: make_free_balance_be(
&T::RefundAccount::get(),u32::MAX.into(),
);
// The worst-case scenario is when the refund fails
// and can only be triggered if the account is dead,
// in this case by having no balance in the account.
let refund = Refund {
account,
account: account.clone(),
identity: 1u32.into(),
amount: 10u64.into(),
};
}: { Pallet::<T>::try_refund(refund) }
verify {
assert_has_event::<T>(Event::<T>::RefundFailed ( account ).into());
}
do_refund {
let account: T::AccountId = account("Alice", 1, 1);
let _ = CurrencyOf::<T>:: make_free_balance_be(
&T::RefundAccount::get(),u32::MAX.into(),
);
// The worst-case scenario is when the refund fails
// and can only be triggered if the account is dead,
// in this case by having no balance in the account.
let refund = Refund {
account,
account: account.clone(),
identity: 1u32.into(),
amount: 10u64.into(),
};
let amount = 5u64.into();
}: { Pallet::<T>::do_refund(refund, amount) }
}: { Pallet::<T>::try_refund(refund) }
verify {
assert_has_event::<T>(Event::<T>::RefundFailed ( account ).into());
}
// The base weight consumed on processing refund queue when empty.
on_process_refund_queue {
assert_eq!(RefundQueue::<T>::get().len() as u32, 0);
}: { Pallet::<T>::process_refund_queue(Weight::MAX) }
// The weight consumed on processing refund queue with one element.
// Can deduce the process_refund_queue overhead by subtracting try_refund weight.
#[pov_mode = Measured]
on_process_refund_queue_elements {
let i in 1..MAX_QUEUED_REFUNDS;
let account: T::AccountId = account("Alice", 1, 1);
let idty_id: IdtyId<T> = 1u32.into();
IdtyQuota::<T>::insert(
idty_id,
Quota {
last_use: T::BlockNumber::zero(),
amount: 10u64.into(),
},
);
let _ = CurrencyOf::<T>:: make_free_balance_be(
&T::RefundAccount::get(),u32::MAX.into(),
);
// The worst-case scenario is when the refund fails
// and can only be triggered if the account is dead,
// in this case by having no balance in the account.
let refund = Refund {
account: account.clone(),
identity: 1u32.into(),
amount: 10u64.into(),
};
for _ in 0..i {
Pallet::<T>::queue_refund(refund.clone());
}
assert_eq!(RefundQueue::<T>::get().len() as u32, i);
}: { Pallet::<T>::process_refund_queue(Weight::MAX) }
verify {
assert_eq!(RefundQueue::<T>::get().len() as u32, 0);
assert_has_event::<T>(Event::<T>::RefundFailed ( account ).into());
}
impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(crate::mock::QuotaConfig{identities: vec![1, 2]}), crate::mock::Test);
}
......@@ -210,19 +210,31 @@ pub mod pallet {
/// perform as many refunds as possible within the supplied weight limit
pub fn process_refund_queue(weight_limit: Weight) -> Weight {
RefundQueue::<T>::mutate(|queue| {
// The weight to process an empty queue
let mut total_weight = <T as pallet::Config>::WeightInfo::on_process_refund_queue();
// The weight to process one element without the actual try_refund weight
let overhead =
<T as pallet::Config>::WeightInfo::on_process_refund_queue_elements(2)
.saturating_sub(
<T as pallet::Config>::WeightInfo::on_process_refund_queue_elements(1),
)
.saturating_sub(<T as pallet::Config>::WeightInfo::try_refund());
// make sure that we have at least the time to handle one try_refund call
if queue.is_empty() {
return Weight::zero();
return total_weight;
}
let mut total_weight = Weight::zero();
// make sure that we have at least the time to handle one try_refund call
while total_weight.any_lt(
weight_limit.saturating_sub(<T as pallet::Config>::WeightInfo::try_refund()),
) {
while total_weight.any_lt(weight_limit.saturating_sub(
<T as pallet::Config>::WeightInfo::try_refund().saturating_add(overhead),
)) {
let Some(queued_refund) = queue.pop() else {
break;
};
let consumed_weight = Self::try_refund(queued_refund);
total_weight = total_weight.saturating_add(consumed_weight);
total_weight = total_weight
.saturating_add(consumed_weight)
.saturating_add(overhead);
}
total_weight
})
......@@ -309,8 +321,6 @@ pub mod pallet {
// process refund queue if space left on block
fn on_idle(_block: T::BlockNumber, remaining_weight: Weight) -> Weight {
Self::process_refund_queue(remaining_weight)
// opti: benchmark process_refund_queue overhead and substract this from weight limit
// .saturating_sub(T::WeightInfo::process_refund_queue())
}
}
}
......
......@@ -238,4 +238,133 @@ fn test_not_enough_treasury() {
})
}
// TODO implement a mock weight to test if refund queue processing actually stops when reached limit
/// test complete scenario with queue and process refund queue weight with available quotas
#[test]
fn test_process_refund_queue_weight_with_quotas() {
new_test_ext(QuotaConfig {
identities: vec![1, 2, 3],
})
.execute_with(|| {
run_to_block(15);
// give enough currency to accounts and treasury and double check
Balances::make_free_balance_be(&account(1), 1000);
Balances::make_free_balance_be(&account(2), 1000);
Balances::make_free_balance_be(&account(3), 1000);
Balances::make_free_balance_be(
&<Test as pallet_quota::Config>::RefundAccount::get(),
10_000,
);
assert_eq!(
Balances::free_balance(<Test as pallet_quota::Config>::RefundAccount::get()),
10_000
);
// fill in the refund queue
Quota::queue_refund(pallet_quota::Refund {
account: account(1),
identity: 10,
amount: 10,
});
Quota::queue_refund(pallet_quota::Refund {
account: account(2),
identity: 2,
amount: 500,
});
Quota::queue_refund(pallet_quota::Refund {
account: account(3),
identity: 3,
amount: 666,
});
// process it with only no weight
Quota::process_refund_queue(Weight::from(0));
// after processing, it should be of the same size
assert_eq!(pallet_quota::RefundQueue::<Test>::get().len(), 3);
// process it with only 200 allowed weight
Quota::process_refund_queue(Weight::from_parts(200u64, 0));
// after processing, it should be of size 1 because total_weight += 25*2 by iteration and
// limit is total_weight < 200-100 so 2 elements can be processed
assert_eq!(pallet_quota::RefundQueue::<Test>::get().len(), 1);
// and we should observe the effects of refund
assert_eq!(Balances::free_balance(account(3)), 1666); // 1000 initial + 666 refunded
assert_eq!(Balances::free_balance(account(2)), 1500); // 1000 initial + 1500 refunded
assert_eq!(Balances::free_balance(account(1)), 1000); // only initial because no available weight to process
assert_eq!(
Balances::free_balance(<Test as pallet_quota::Config>::RefundAccount::get()),
// initial minus refunds
10_000 - 666 - 500
);
// events
System::assert_has_event(RuntimeEvent::Quota(pallet_quota::Event::Refunded {
who: account(3),
identity: 3,
amount: 666,
}));
System::assert_has_event(RuntimeEvent::Quota(pallet_quota::Event::Refunded {
who: account(2),
identity: 2,
amount: 500,
}));
})
}
/// test complete scenario with queue and process refund queue weight with limited quotas
#[test]
fn test_process_refund_queue_weight_no_quotas() {
new_test_ext(QuotaConfig {
identities: vec![1, 2],
})
.execute_with(|| {
run_to_block(15);
// give enough currency to accounts and treasury and double check
Balances::make_free_balance_be(&account(1), 1000);
Balances::make_free_balance_be(&account(2), 1000);
Balances::make_free_balance_be(&account(3), 1000);
Balances::make_free_balance_be(
&<Test as pallet_quota::Config>::RefundAccount::get(),
10_000,
);
assert_eq!(
Balances::free_balance(<Test as pallet_quota::Config>::RefundAccount::get()),
10_000
);
// fill in the refund queue
Quota::queue_refund(pallet_quota::Refund {
account: account(1),
identity: 10,
amount: 10,
});
Quota::queue_refund(pallet_quota::Refund {
account: account(2),
identity: 2,
amount: 500,
});
Quota::queue_refund(pallet_quota::Refund {
account: account(3),
identity: 3,
amount: 666,
});
// process it with only no weight
Quota::process_refund_queue(Weight::from(0));
// after processing, it should be of the same size
assert_eq!(pallet_quota::RefundQueue::<Test>::get().len(), 3);
// process it with only 150 allowed weight
Quota::process_refund_queue(Weight::from_parts(150u64, 0));
// after processing, it should be of size 2 because try_refund weight is 25 (first in the queue with no quota) then 25*2 for the 2 other elements
// limit is total_weight < 150-100 so 2 elements can be processed
assert_eq!(pallet_quota::RefundQueue::<Test>::get().len(), 1);
// and we should observe the effects of refund
assert_eq!(Balances::free_balance(account(3)), 1000); // 1000 initial only because no quota available
assert_eq!(Balances::free_balance(account(2)), 1500); // 1000 initial + 500 refunded
assert_eq!(Balances::free_balance(account(1)), 1000); // only initial because no available weight to process
assert_eq!(
Balances::free_balance(<Test as pallet_quota::Config>::RefundAccount::get()),
// initial minus refunds
10_000 - 500
);
// events
System::assert_has_event(RuntimeEvent::Quota(pallet_quota::Event::Refunded {
who: account(2),
identity: 2,
amount: 500,
}));
})
}
......@@ -7,19 +7,27 @@ pub trait WeightInfo {
fn spend_quota() -> Weight;
fn try_refund() -> Weight;
fn do_refund() -> Weight;
fn on_process_refund_queue() -> Weight;
fn on_process_refund_queue_elements(_i: u32) -> Weight;
}
impl WeightInfo for () {
fn queue_refund() -> Weight {
Weight::from_parts(999u64, 0)
Weight::from_parts(100u64, 0)
}
fn spend_quota() -> Weight {
Weight::from_parts(999u64, 0)
Weight::from_parts(25u64, 0)
}
fn try_refund() -> Weight {
Weight::from_parts(999u64, 0)
Weight::from_parts(100u64, 0)
}
fn do_refund() -> Weight {
Weight::from_parts(999u64, 0)
Weight::from_parts(25u64, 0)
}
fn on_process_refund_queue() -> Weight {
Weight::from_parts(1u64, 0)
}
fn on_process_refund_queue_elements(_i: u32) -> Weight {
Weight::from_parts(1u64, 0)
}
}