From 82ac8479ef63291e4409f222fb5386ae26f16734 Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Tue, 15 Nov 2022 12:43:43 +0100 Subject: [PATCH 01/24] small subxt migration --- .github/actions/run-e2e-test/action.yml | 7 - aleph-client/Cargo.lock | 1518 +- aleph-client/Cargo.toml | 18 +- aleph-client/src/account.rs | 61 - aleph-client/src/aleph_zero.rs | 19324 ++++++++++++++++++++ aleph-client/src/balances.rs | 10 - aleph-client/src/connections.rs | 173 + aleph-client/src/contract/event.rs | 235 - aleph-client/src/contract/mod.rs | 107 +- aleph-client/src/contract/util.rs | 2 +- aleph-client/src/debug/aleph.rs | 20 - aleph-client/src/debug/elections.rs | 20 - aleph-client/src/debug/mod.rs | 23 - aleph-client/src/debug/treasury.rs | 42 - aleph-client/src/elections.rs | 121 - aleph-client/src/fee.rs | 33 - aleph-client/src/finalization.rs | 25 - aleph-client/src/lib.rs | 531 +- aleph-client/src/multisig.rs | 480 - aleph-client/src/pallets/aleph.rs | 87 + aleph-client/src/pallets/balances.rs | 140 + aleph-client/src/pallets/contract.rs | 171 + aleph-client/src/pallets/elections.rs | 197 + aleph-client/src/pallets/fee.rs | 22 + aleph-client/src/pallets/mod.rs | 12 + aleph-client/src/pallets/multisig.rs | 78 + aleph-client/src/pallets/session.rs | 59 + aleph-client/src/pallets/staking.rs | 375 + aleph-client/src/pallets/system.rs | 52 + aleph-client/src/pallets/treasury.rs | 118 + aleph-client/src/pallets/utility.rs | 17 + aleph-client/src/pallets/vesting.rs | 73 + aleph-client/src/rpc.rs | 216 - aleph-client/src/rpc/mod.rs | 17 + aleph-client/src/runtime_types.rs | 42 + aleph-client/src/session.rs | 167 - aleph-client/src/staking.rs | 469 - aleph-client/src/system.rs | 38 - aleph-client/src/transfer.rs | 111 - aleph-client/src/treasury.rs | 134 - aleph-client/src/utility.rs | 57 + aleph-client/src/version_upgrade.rs | 36 - aleph-client/src/vesting.rs | 121 - aleph-client/src/waiting.rs | 162 +- benches/payout-stakers/Cargo.lock | 1513 +- benches/payout-stakers/Cargo.toml | 5 +- benches/payout-stakers/src/main.rs | 293 +- bin/cliain/Cargo.lock | 1152 +- bin/cliain/Cargo.toml | 3 +- bin/cliain/src/commands.rs | 8 +- bin/cliain/src/contracts.rs | 299 +- bin/cliain/src/finalization.rs | 21 +- bin/cliain/src/keys.rs | 61 +- bin/cliain/src/lib.rs | 34 +- bin/cliain/src/main.rs | 167 +- bin/cliain/src/runtime.rs | 10 +- bin/cliain/src/staking.rs | 60 +- bin/cliain/src/transfer.rs | 21 +- bin/cliain/src/treasury.rs | 31 +- bin/cliain/src/validators.rs | 28 +- bin/cliain/src/vesting.rs | 31 +- e2e-tests/Cargo.lock | 1116 +- e2e-tests/Cargo.toml | 3 +- e2e-tests/src/accounts.rs | 17 +- e2e-tests/src/ban.rs | 120 +- e2e-tests/src/cases.rs | 102 +- e2e-tests/src/config.rs | 14 +- e2e-tests/src/elections.rs | 18 +- e2e-tests/src/lib.rs | 2 +- e2e-tests/src/main.rs | 49 +- e2e-tests/src/rewards.rs | 302 +- e2e-tests/src/test/ban.rs | 127 +- e2e-tests/src/test/electing_validators.rs | 157 +- e2e-tests/src/test/era_payout.rs | 61 +- e2e-tests/src/test/era_validators.rs | 135 +- e2e-tests/src/test/fee.rs | 161 +- e2e-tests/src/test/finalization.rs | 11 +- e2e-tests/src/test/rewards.rs | 190 +- e2e-tests/src/test/staking.rs | 264 +- e2e-tests/src/test/transfer.rs | 25 +- e2e-tests/src/test/treasury.rs | 121 +- e2e-tests/src/test/utility.rs | 22 +- e2e-tests/src/test/validators_change.rs | 110 +- e2e-tests/src/test/validators_rotate.rs | 56 +- e2e-tests/src/test/version_upgrade.rs | 34 +- e2e-tests/src/transfer.rs | 32 +- e2e-tests/src/validators.rs | 120 +- flooder/Cargo.lock | 985 +- scripts/run_e2e.sh | 2 +- 89 files changed, 26579 insertions(+), 7235 deletions(-) delete mode 100644 aleph-client/src/account.rs create mode 100644 aleph-client/src/aleph_zero.rs delete mode 100644 aleph-client/src/balances.rs create mode 100644 aleph-client/src/connections.rs delete mode 100644 aleph-client/src/contract/event.rs delete mode 100644 aleph-client/src/debug/aleph.rs delete mode 100644 aleph-client/src/debug/elections.rs delete mode 100644 aleph-client/src/debug/mod.rs delete mode 100644 aleph-client/src/debug/treasury.rs delete mode 100644 aleph-client/src/elections.rs delete mode 100644 aleph-client/src/fee.rs delete mode 100644 aleph-client/src/finalization.rs delete mode 100644 aleph-client/src/multisig.rs create mode 100644 aleph-client/src/pallets/aleph.rs create mode 100644 aleph-client/src/pallets/balances.rs create mode 100644 aleph-client/src/pallets/contract.rs create mode 100644 aleph-client/src/pallets/elections.rs create mode 100644 aleph-client/src/pallets/fee.rs create mode 100644 aleph-client/src/pallets/mod.rs create mode 100644 aleph-client/src/pallets/multisig.rs create mode 100644 aleph-client/src/pallets/session.rs create mode 100644 aleph-client/src/pallets/staking.rs create mode 100644 aleph-client/src/pallets/system.rs create mode 100644 aleph-client/src/pallets/treasury.rs create mode 100644 aleph-client/src/pallets/utility.rs create mode 100644 aleph-client/src/pallets/vesting.rs delete mode 100644 aleph-client/src/rpc.rs create mode 100644 aleph-client/src/rpc/mod.rs create mode 100644 aleph-client/src/runtime_types.rs delete mode 100644 aleph-client/src/session.rs delete mode 100644 aleph-client/src/staking.rs delete mode 100644 aleph-client/src/system.rs delete mode 100644 aleph-client/src/transfer.rs delete mode 100644 aleph-client/src/treasury.rs create mode 100644 aleph-client/src/utility.rs delete mode 100644 aleph-client/src/version_upgrade.rs delete mode 100644 aleph-client/src/vesting.rs diff --git a/.github/actions/run-e2e-test/action.yml b/.github/actions/run-e2e-test/action.yml index ba7b8f6fdc..45aada34ca 100644 --- a/.github/actions/run-e2e-test/action.yml +++ b/.github/actions/run-e2e-test/action.yml @@ -90,10 +90,3 @@ runs: if: inputs.follow-up-finalization-check == 'true' shell: bash run: ./.github/scripts/run_e2e_test.sh -t finalization -m "${{ inputs.min-validator-count }}" - - - name: Print debug if failed - if: ${{ failure() }} - shell: bash - run: | - cd bin/cliain - cargo run -- --seed //Alice debug-storage diff --git a/aleph-client/Cargo.lock b/aleph-client/Cargo.lock index e290c25710..f5a91aa17c 100644 --- a/aleph-client/Cargo.lock +++ b/aleph-client/Cargo.lock @@ -12,55 +12,6 @@ dependencies = [ "regex", ] -[[package]] -name = "ac-compose-macros" -version = "0.1.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate-api-client.git?branch=aleph-v0.9.28#92bc66b75428213e4bcdb2484616cf458455813a" -dependencies = [ - "ac-primitives", - "log", - "parity-scale-codec", - "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "ac-node-api" -version = "0.1.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate-api-client.git?branch=aleph-v0.9.28#92bc66b75428213e4bcdb2484616cf458455813a" -dependencies = [ - "ac-primitives", - "derive_more", - "frame-metadata 15.0.0 (git+https://github.com/integritee-network/frame-metadata)", - "frame-support", - "frame-system", - "hex", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "serde_json", - "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "ac-primitives" -version = "0.1.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate-api-client.git?branch=aleph-v0.9.28#92bc66b75428213e4bcdb2484616cf458455813a" -dependencies = [ - "hex", - "parity-scale-codec", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "addr2line" version = "0.17.0" @@ -98,31 +49,25 @@ dependencies = [ [[package]] name = "aleph_client" -version = "1.11.0" +version = "2.0.0" dependencies = [ - "ac-node-api", - "ac-primitives", "anyhow", + "async-trait", "contract-metadata 1.5.0", "contract-transcode", "frame-support", + "futures", "hex", "ink_metadata", "log", - "pallet-aleph", - "pallet-balances", - "pallet-elections", - "pallet-multisig", - "pallet-staking", - "pallet-treasury", - "pallet-vesting", "parity-scale-codec", "primitives", "rayon", + "serde", "serde_json", "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "substrate-api-client", + "subxt", "thiserror", ] @@ -141,7 +86,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -150,15 +95,6 @@ version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" -[[package]] -name = "approx" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" -dependencies = [ - "num-traits", -] - [[package]] name = "arrayref" version = "0.3.6" @@ -186,6 +122,16 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +[[package]] +name = "async-lock" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" +dependencies = [ + "event-listener", + "futures-lite", +] + [[package]] name = "async-trait" version = "0.1.58" @@ -205,7 +151,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -222,7 +168,7 @@ checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -247,6 +193,15 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +dependencies = [ + "serde", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -356,16 +311,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -dependencies = [ - "byteorder", - "iovec", -] - [[package]] name = "bytes" version = "1.2.1" @@ -378,12 +323,6 @@ version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -399,7 +338,7 @@ dependencies = [ "iana-time-zone", "num-integer", "num-traits", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -477,10 +416,14 @@ dependencies = [ ] [[package]] -name = "convert_case" -version = "0.4.0" +name = "core-foundation" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] [[package]] name = "core-foundation-sys" @@ -503,7 +446,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -513,7 +456,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] @@ -525,7 +468,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", "memoffset", "scopeguard", @@ -537,7 +480,7 @@ version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -658,6 +601,41 @@ dependencies = [ "syn", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "der" version = "0.5.1" @@ -667,16 +645,25 @@ dependencies = [ "const-oid", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "convert_case", "proc-macro2", "quote", - "rustc_version", "syn", ] @@ -829,12 +816,27 @@ dependencies = [ "rustversion", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + [[package]] name = "fake-simd" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + [[package]] name = "ff" version = "0.11.1" @@ -858,19 +860,10 @@ dependencies = [ ] [[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" @@ -881,73 +874,13 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "frame-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "linregress", - "log", - "parity-scale-codec", - "paste", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-storage 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "frame-election-provider-solution-type" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "frame-election-provider-support" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-election-provider-solution-type", - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-arithmetic 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-npos-elections", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "frame-metadata" version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df6bb8542ef006ef0de09a5c4420787d79823c0ed7924225822362fd2bf2ff2d" dependencies = [ - "cfg-if 1.0.0", - "parity-scale-codec", - "scale-info", - "serde", -] - -[[package]] -name = "frame-metadata" -version = "15.0.0" -source = "git+https://github.com/integritee-network/frame-metadata#3b43da9821238681f9431276d55b92a079142083" -dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "parity-scale-codec", "scale-info", "serde", @@ -959,7 +892,7 @@ version = "4.0.0-dev" source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" dependencies = [ "bitflags", - "frame-metadata 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", "k256", @@ -1018,39 +951,6 @@ dependencies = [ "syn", ] -[[package]] -name = "frame-system" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-version", -] - -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "funty" version = "2.0.0" @@ -1106,6 +1006,21 @@ version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + [[package]] name = "futures-macro" version = "0.3.25" @@ -1178,7 +1093,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi 0.9.0+wasi-snapshot-preview1", @@ -1191,7 +1106,7 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] @@ -1237,6 +1152,12 @@ dependencies = [ "ahash", ] +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -1283,6 +1204,17 @@ dependencies = [ "hmac 0.8.1", ] +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "httparse" version = "1.8.0" @@ -1306,7 +1238,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1319,6 +1251,12 @@ dependencies = [ "cxx-build", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.3.0" @@ -1380,7 +1318,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c9588a59a0e8997c0b2153cd11b5aaa77c06a0537a6b18f3811d1f1aa098b12" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1406,7 +1344,7 @@ checksum = "a891d34301a3dbb1c7b7424c49ae184282b163491c54f9acd17fcbe14a80447b" dependencies = [ "arrayref", "blake2", - "cfg-if 1.0.0", + "cfg-if", "derive_more", "ink_allocator", "ink_engine", @@ -1445,7 +1383,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f031e6b8495594a7288b089bf4122e76c26b994959d1b2b693bdfe846b14c0e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1454,28 +1392,28 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e12cf42dce81d060401c7cec95a392ad6d3c2f18661fa3083f619ce135133c33" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ink_prelude", "parity-scale-codec", "scale-info", ] [[package]] -name = "integer-sqrt" -version = "0.1.5" +name = "instant" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "num-traits", + "cfg-if", ] [[package]] -name = "iovec" -version = "0.1.4" +name = "integer-sqrt" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" dependencies = [ - "libc", + "num-traits", ] [[package]] @@ -1509,56 +1447,103 @@ dependencies = [ ] [[package]] -name = "k256" -version = "0.10.4" +name = "jsonrpsee" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" +checksum = "8bd0d559d5e679b1ab2f869b486a11182923863b1b3ee8b421763cdd707b783a" dependencies = [ - "cfg-if 1.0.0", - "ecdsa", - "elliptic-curve", - "sec1", + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", ] [[package]] -name = "keccak" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" - -[[package]] -name = "kernel32-sys" -version = "0.2.2" +name = "jsonrpsee-client-transport" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +checksum = "8752740ecd374bcbf8b69f3e80b0327942df76f793f8d4e60d3355650c31fb74" dependencies = [ - "winapi 0.2.8", - "winapi-build", + "futures-util", + "http", + "jsonrpsee-core", + "jsonrpsee-types", + "pin-project", + "rustls-native-certs", + "soketto", + "thiserror", + "tokio", + "tokio-rustls", + "tokio-util", + "tracing", + "webpki-roots", ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "jsonrpsee-core" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.3.0" +checksum = "f3dc3e9cf2ba50b7b1d7d76a667619f82846caa39e8e8daa8a4962d74acaddca" +dependencies = [ + "anyhow", + "async-lock", + "async-trait", + "beef", + "futures-channel", + "futures-timer", + "futures-util", + "jsonrpsee-types", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +checksum = "e290bba767401b646812f608c099b922d8142603c9e73a50fb192d3ac86f4a0d" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] [[package]] -name = "libc" -version = "0.2.137" +name = "k256" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sec1", +] [[package]] -name = "libm" -version = "0.2.5" +name = "keccak" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "292a948cd991e376cf75541fe5b97a1081d713c618b4f1b9500f8844e49eb565" +checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" [[package]] name = "libsecp256k1" @@ -1617,16 +1602,6 @@ dependencies = [ "cc", ] -[[package]] -name = "linregress" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c601a85f5ecd1aba625247bca0031585fb1c446461b142878a16f8245ddeb8" -dependencies = [ - "nalgebra", - "statrs", -] - [[package]] name = "lock_api" version = "0.4.9" @@ -1643,7 +1618,7 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1655,15 +1630,6 @@ dependencies = [ "regex-automata", ] -[[package]] -name = "matrixmultiply" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add85d4dd35074e6fedc608f8c8f513a3548619a9024b751949ef0e8e45a4d84" -dependencies = [ - "rawpointer", -] - [[package]] name = "memchr" version = "2.5.0" @@ -1725,85 +1691,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.6.23" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", "libc", "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - -[[package]] -name = "nalgebra" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "462fffe4002f4f2e1f6a9dcf12cc1a6fc0e15989014efc02a941d3e0f5dc2120" -dependencies = [ - "approx", - "matrixmultiply", - "nalgebra-macros", - "num-complex", - "num-rational 0.4.1", - "num-traits", - "rand 0.8.5", - "rand_distr", - "simba", - "typenum", -] - -[[package]] -name = "nalgebra-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "net2" -version = "0.2.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.42.0", ] [[package]] @@ -1846,15 +1741,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-complex" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" -dependencies = [ - "num-traits", -] - [[package]] name = "num-format" version = "0.4.3" @@ -1887,17 +1773,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.15" @@ -1905,7 +1780,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -1946,238 +1820,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] -name = "openssl" -version = "0.10.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" -dependencies = [ - "bitflags", - "cfg-if 1.0.0", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-sys" -version = "0.9.77" +name = "openssl-probe" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" -dependencies = [ - "autocfg", - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "pallet-aleph" -version = "0.5.0" -dependencies = [ - "frame-support", - "frame-system", - "pallet-balances", - "pallet-session", - "pallets-support", - "parity-scale-codec", - "primitives", - "scale-info", - "serde", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-authorship" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "sp-authorship", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-balances" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-elections" -version = "0.5.0" -dependencies = [ - "frame-election-provider-support", - "frame-support", - "frame-system", - "pallet-authorship", - "pallet-balances", - "pallet-session", - "pallet-staking", - "pallets-support", - "parity-scale-codec", - "primitives", - "scale-info", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-staking", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-multisig" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-session" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "pallet-timestamp", - "parity-scale-codec", - "scale-info", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-session", - "sp-staking", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-trie 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-staking" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-election-provider-support", - "frame-support", - "frame-system", - "log", - "pallet-authorship", - "pallet-session", - "parity-scale-codec", - "scale-info", - "serde", - "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-staking", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-inherents", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-timestamp", -] - -[[package]] -name = "pallet-transaction-payment" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-treasury" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "pallet-balances", - "parity-scale-codec", - "scale-info", - "serde", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-vesting" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallets-support" -version = "0.1.0" -dependencies = [ - "frame-support", -] +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "parity-scale-codec" @@ -2188,7 +1834,7 @@ dependencies = [ "arrayvec 0.7.2", "bitvec", "byte-slice-cast", - "bytes 1.2.1", + "bytes", "impl-trait-for-tuples", "parity-scale-codec-derive", "serde", @@ -2212,13 +1858,13 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "hashbrown", "impl-trait-for-tuples", "parity-util-mem-derive", "parking_lot", "primitive-types", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2238,6 +1884,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + [[package]] name = "parking_lot" version = "0.12.1" @@ -2254,11 +1906,11 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2291,6 +1943,26 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" version = "0.2.9" @@ -2303,12 +1975,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" - [[package]] name = "ppv-lite86" version = "0.2.16" @@ -2354,6 +2020,30 @@ dependencies = [ "toml", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro2" version = "1.0.47" @@ -2441,16 +2131,6 @@ dependencies = [ "getrandom 0.2.8", ] -[[package]] -name = "rand_distr" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" -dependencies = [ - "num-traits", - "rand 0.8.5", -] - [[package]] name = "rand_hc" version = "0.2.0" @@ -2469,12 +2149,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - [[package]] name = "rayon" version = "1.5.3" @@ -2565,6 +2239,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + [[package]] name = "rlibc" version = "1.0.0" @@ -2590,12 +2279,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] -name = "rustc_version" -version = "0.4.0" +name = "rustls" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" dependencies = [ - "semver", + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +dependencies = [ + "base64", ] [[package]] @@ -2610,6 +2323,29 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +[[package]] +name = "scale-bits" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd7aca73785181cc41f0bbe017263e682b585ca660540ba569133901d013ecf" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "scale-decode" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d823d4be477fc33321f93d08fb6c2698273d044f01362dc27573a750deb7c233" +dependencies = [ + "parity-scale-codec", + "scale-bits", + "scale-info", + "thiserror", +] + [[package]] name = "scale-info" version = "2.2.0" @@ -2617,7 +2353,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "333af15b02563b8182cd863f925bd31ef8fa86a0e095d30c091956057d436153" dependencies = [ "bitvec", - "cfg-if 1.0.0", + "cfg-if", "derive_more", "parity-scale-codec", "scale-info-derive", @@ -2636,6 +2372,33 @@ dependencies = [ "syn", ] +[[package]] +name = "scale-value" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16a5e7810815bd295da73e4216d1dfbced3c7c7c7054d70fa5f6e4c58123fff4" +dependencies = [ + "either", + "frame-metadata", + "parity-scale-codec", + "scale-bits", + "scale-decode", + "scale-info", + "serde", + "thiserror", + "yap", +] + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys 0.36.1", +] + [[package]] name = "schnorrkel" version = "0.9.1" @@ -2666,6 +2429,16 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "sec1" version = "0.2.1" @@ -2723,6 +2496,29 @@ dependencies = [ "zeroize", ] +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "1.0.14" @@ -2765,14 +2561,15 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.8.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", ] [[package]] @@ -2794,7 +2591,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", @@ -2806,7 +2603,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.5", ] @@ -2841,32 +2638,45 @@ dependencies = [ ] [[package]] -name = "simba" -version = "0.5.1" +name = "slab" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e82063457853d00243beda9952e910b82593e4b07ae9f721b9278a99a0d3d5c" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" dependencies = [ - "approx", - "num-complex", - "num-traits", - "paste", + "autocfg", ] [[package]] -name = "slab" +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ - "autocfg", + "libc", + "winapi", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64", + "bytes", + "futures", + "httparse", + "log", + "rand 0.8.5", + "sha-1", ] -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - [[package]] name = "sp-api" version = "4.0.0-dev" @@ -2954,18 +2764,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "sp-authorship" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "async-trait", - "parity-scale-codec", - "sp-inherents", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "sp-core" version = "6.0.0" @@ -3187,7 +2985,7 @@ name = "sp-io" version = "6.0.0" source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" dependencies = [ - "bytes 1.2.1", + "bytes", "futures", "hash-db", "libsecp256k1", @@ -3241,20 +3039,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "sp-npos-elections" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-arithmetic 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "sp-panic-handler" version = "4.0.0" @@ -3276,16 +3060,6 @@ dependencies = [ "regex", ] -[[package]] -name = "sp-rpc" -version = "6.0.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "rustc-hash", - "serde", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "sp-runtime" version = "6.0.0" @@ -3354,7 +3128,7 @@ name = "sp-runtime-interface" version = "6.0.0" source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" dependencies = [ - "bytes 1.2.1", + "bytes", "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", @@ -3392,20 +3166,6 @@ dependencies = [ "syn", ] -[[package]] -name = "sp-session" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-staking", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "sp-staking" version = "4.0.0-dev" @@ -3501,22 +3261,6 @@ dependencies = [ "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", ] -[[package]] -name = "sp-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "async-trait", - "futures-timer", - "log", - "parity-scale-codec", - "sp-api", - "sp-inherents", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "thiserror", -] - [[package]] name = "sp-tracing" version = "5.0.0" @@ -3627,6 +3371,12 @@ dependencies = [ "wasmi", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "ss58-registry" version = "1.33.0" @@ -3649,47 +3399,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] -name = "statrs" -version = "0.15.0" +name = "strsim" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05bdbb8e4e78216a85785a85d3ec3183144f98d0097b9281802c019bb07a6f05" -dependencies = [ - "approx", - "lazy_static", - "nalgebra", - "num-traits", - "rand 0.8.5", -] - -[[package]] -name = "substrate-api-client" -version = "0.6.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate-api-client.git?branch=aleph-v0.9.28#92bc66b75428213e4bcdb2484616cf458455813a" -dependencies = [ - "ac-compose-macros", - "ac-node-api", - "ac-primitives", - "frame-metadata 15.0.0 (git+https://github.com/integritee-network/frame-metadata)", - "frame-support", - "frame-system", - "hex", - "log", - "pallet-balances", - "pallet-staking", - "pallet-transaction-payment", - "parity-scale-codec", - "primitive-types", - "serde", - "serde_json", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-rpc", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-version", - "thiserror", - "ws", -] +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "substrate-bip39" @@ -3710,6 +3423,75 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +[[package]] +name = "subxt" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a8757ee0e19f87e722577282ab1386c86592a4b13ff963b9c6ec4176348104c" +dependencies = [ + "bitvec", + "derivative", + "frame-metadata", + "futures", + "hex", + "jsonrpsee", + "parity-scale-codec", + "parking_lot", + "scale-decode", + "scale-info", + "scale-value", + "serde", + "serde_json", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "subxt-macro", + "subxt-metadata", + "thiserror", + "tracing", +] + +[[package]] +name = "subxt-codegen" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb77f93e11e6ff3ff95fe33e3d24c27c342e16feca8ef47759993614ebe90d2c" +dependencies = [ + "darling", + "frame-metadata", + "heck", + "parity-scale-codec", + "proc-macro-error", + "proc-macro2", + "quote", + "scale-info", + "subxt-metadata", + "syn", +] + +[[package]] +name = "subxt-macro" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051cc21d77a54ae944b872eafdf9edfe1d9134fdfcfc3477dc10f763c76564a9" +dependencies = [ + "darling", + "proc-macro-error", + "subxt-codegen", + "syn", +] + +[[package]] +name = "subxt-metadata" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ed78d80db3a97d55e8b1cfecc1f6f9e21793a589d4e2e5f4fe2d6d5850c2e54" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "syn" version = "1.0.103" @@ -3820,6 +3602,57 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +[[package]] +name = "tokio" +version = "1.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +dependencies = [ + "autocfg", + "libc", + "mio", + "pin-project-lite", + "socket2", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite", + "tokio", +] + [[package]] name = "toml" version = "0.5.9" @@ -3835,7 +3668,7 @@ version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -3862,6 +3695,16 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + [[package]] name = "tracing-log" version = "0.1.3" @@ -3939,7 +3782,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "digest 0.10.5", "rand 0.8.5", "static_assertions", @@ -3996,6 +3839,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "url" version = "2.3.1" @@ -4014,18 +3863,18 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -4044,7 +3893,7 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -4101,7 +3950,7 @@ dependencies = [ "downcast-rs", "libc", "memory_units", - "num-rational 0.2.4", + "num-rational", "num-traits", "parity-wasm", "wasmi-validation", @@ -4117,10 +3966,33 @@ dependencies = [ ] [[package]] -name = "winapi" -version = "0.2.8" +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" +dependencies = [ + "webpki", +] [[package]] name = "winapi" @@ -4132,12 +4004,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -4150,7 +4016,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -4159,6 +4025,19 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + [[package]] name = "windows-sys" version = "0.42.0" @@ -4166,12 +4045,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_x86_64_msvc 0.42.0", ] [[package]] @@ -4180,24 +4059,48 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + [[package]] name = "windows_aarch64_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + [[package]] name = "windows_i686_gnu" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + [[package]] name = "windows_i686_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + [[package]] name = "windows_x86_64_gnu" version = "0.42.0" @@ -4212,38 +4115,15 @@ checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" [[package]] name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" - -[[package]] -name = "ws" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fe90c75f236a0a00247d5900226aea4f2d7b05ccc34da9e7a8880ff59b5848" -dependencies = [ - "byteorder", - "bytes 0.4.12", - "httparse", - "log", - "mio", - "mio-extras", - "openssl", - "rand 0.7.3", - "sha-1", - "slab", - "url", -] +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] -name = "ws2_32-sys" -version = "0.2.1" +name = "windows_x86_64_msvc" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" [[package]] name = "wyz" @@ -4254,6 +4134,12 @@ dependencies = [ "tap", ] +[[package]] +name = "yap" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc77f52dc9e9b10d55d3f4462c3b7fc393c4f17975d641542833ab2d3bc26ef" + [[package]] name = "zeroize" version = "1.5.7" diff --git a/aleph-client/Cargo.toml b/aleph-client/Cargo.toml index 7f71b82ebe..edb1fae5f6 100644 --- a/aleph-client/Cargo.toml +++ b/aleph-client/Cargo.toml @@ -1,10 +1,11 @@ [package] name = "aleph_client" -version = "1.11.0" +version = "2.0.0" edition = "2021" license = "Apache 2.0" [dependencies] +async-trait = "0.1.58" anyhow = "1.0" codec = { package = 'parity-scale-codec', version = "3.0.0", features = ['derive'] } hex = { version = "0.4.3", features = ["alloc"] } @@ -15,20 +16,11 @@ thiserror = "1.0" contract-metadata = "1.5" contract-transcode = "0.1" ink_metadata = "3.3" - -ac-primitives = { git = "https://github.com/Cardinal-Cryptography/substrate-api-client.git", branch = "aleph-v0.9.28" } -substrate-api-client = { git = "https://github.com/Cardinal-Cryptography/substrate-api-client.git", branch = "aleph-v0.9.28", features = ["staking-xt"] } -ac-node-api = { git = "https://github.com/Cardinal-Cryptography/substrate-api-client.git", branch = "aleph-v0.9.28" } +subxt = "0.24.0" +futures = "0.3.25" +serde = { version = "1.0", features = ["derive"] } frame-support = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } sp-core = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28", features = ["full_crypto"] } sp-runtime = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } -pallet-multisig = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } -pallet-staking = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } -pallet-treasury = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } -pallet-balances = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } -pallet-vesting = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } - -pallet-aleph = { path = "../pallets/aleph" } -pallet-elections = { path = "../pallets/elections" } primitives = { path = "../primitives" } diff --git a/aleph-client/src/account.rs b/aleph-client/src/account.rs deleted file mode 100644 index 5f5f42bad8..0000000000 --- a/aleph-client/src/account.rs +++ /dev/null @@ -1,61 +0,0 @@ -use codec::Decode; -use pallet_balances::BalanceLock; -use sp_core::{crypto::AccountId32, storage::StorageKey}; -use substrate_api_client::{AccountId, Balance}; - -use crate::{state_query_storage_at, AnyConnection}; - -pub fn get_free_balance(connection: &C, account: &AccountId) -> Balance { - match connection - .as_connection() - .get_account_data(account) - .expect("Should be able to access account data") - { - Some(account_data) => account_data.free, - // Account may have not been initialized yet or liquidated due to the lack of funds. - None => 0, - } -} - -pub fn locks( - connection: &C, - accounts: &[AccountId], -) -> Vec>> { - let storage_keys = create_storage_keys_from_accounts(connection, accounts); - get_locked_balances_from_storage(connection, storage_keys) -} - -fn create_storage_keys_from_accounts( - connection: &C, - accounts: &[AccountId32], -) -> Vec { - accounts - .iter() - .map(|account| { - connection - .as_connection() - .metadata - .storage_map_key("Balances", "Locks", account) - .unwrap_or_else(|_| panic!("Cannot create storage key for account {}!", account)) - }) - .collect() -} - -fn get_locked_balances_from_storage( - connection: &C, - storage_keys: Vec, -) -> Vec>> { - match state_query_storage_at(connection, storage_keys) { - Ok(storage_entries) => storage_entries - .into_iter() - .map(|storage_entry| { - let entry_bytes = storage_entry.expect("Storage entry is null!").0; - Decode::decode(&mut entry_bytes.as_slice()) - .expect("Failed to decode locked balances!") - }) - .collect(), - Err(err) => { - panic!("Failed to query storage, details: {}", &err[..]); - } - } -} diff --git a/aleph-client/src/aleph_zero.rs b/aleph-client/src/aleph_zero.rs new file mode 100644 index 0000000000..9a863f452e --- /dev/null +++ b/aleph-client/src/aleph_zero.rs @@ -0,0 +1,19324 @@ +#[allow(dead_code, unused_imports, non_camel_case_types)] +pub mod api { + use super::api as root_mod; + pub static PALLETS: [&str; 21usize] = [ + "System", + "RandomnessCollectiveFlip", + "Scheduler", + "Aura", + "Timestamp", + "Balances", + "TransactionPayment", + "Authorship", + "Staking", + "History", + "Session", + "Aleph", + "Elections", + "Treasury", + "Vesting", + "Utility", + "Multisig", + "Sudo", + "Contracts", + "NominationPools", + "Identity", + ]; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Event { + #[codec(index = 0)] + System(system::Event), + #[codec(index = 2)] + Scheduler(scheduler::Event), + #[codec(index = 5)] + Balances(balances::Event), + #[codec(index = 6)] + TransactionPayment(transaction_payment::Event), + #[codec(index = 8)] + Staking(staking::Event), + #[codec(index = 10)] + Session(session::Event), + #[codec(index = 11)] + Aleph(aleph::Event), + #[codec(index = 12)] + Elections(elections::Event), + #[codec(index = 13)] + Treasury(treasury::Event), + #[codec(index = 14)] + Vesting(vesting::Event), + #[codec(index = 15)] + Utility(utility::Event), + #[codec(index = 16)] + Multisig(multisig::Event), + #[codec(index = 17)] + Sudo(sudo::Event), + #[codec(index = 18)] + Contracts(contracts::Event), + #[codec(index = 19)] + NominationPools(nomination_pools::Event), + #[codec(index = 20)] + Identity(identity::Event), + } + pub mod system { + use super::{root_mod, runtime_types}; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct FillBlock { + pub ratio: runtime_types::sp_arithmetic::per_things::Perbill, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Remark { + pub remark: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetHeapPages { + pub pages: ::core::primitive::u64, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetCode { + pub code: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetCodeWithoutChecks { + pub code: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetStorage { + pub items: ::std::vec::Vec<( + ::std::vec::Vec<::core::primitive::u8>, + ::std::vec::Vec<::core::primitive::u8>, + )>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct KillStorage { + pub keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct KillPrefix { + pub prefix: ::std::vec::Vec<::core::primitive::u8>, + pub subkeys: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RemarkWithEvent { + pub remark: ::std::vec::Vec<::core::primitive::u8>, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "A dispatch that will fill the block weight up to the given ratio."] + pub fn fill_block( + &self, + ratio: runtime_types::sp_arithmetic::per_things::Perbill, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "fill_block", + FillBlock { ratio }, + [ + 48u8, 18u8, 205u8, 90u8, 222u8, 4u8, 20u8, 251u8, 173u8, 76u8, 167u8, + 4u8, 83u8, 203u8, 160u8, 89u8, 132u8, 218u8, 191u8, 145u8, 130u8, + 245u8, 177u8, 201u8, 169u8, 129u8, 173u8, 105u8, 88u8, 45u8, 136u8, + 191u8, + ], + ) + } + #[doc = "Make some on-chain remark."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`"] + #[doc = "# "] + pub fn remark( + &self, + remark: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "remark", + Remark { remark }, + [ + 101u8, 80u8, 195u8, 226u8, 224u8, 247u8, 60u8, 128u8, 3u8, 101u8, 51u8, + 147u8, 96u8, 126u8, 76u8, 230u8, 194u8, 227u8, 191u8, 73u8, 160u8, + 146u8, 87u8, 147u8, 243u8, 28u8, 228u8, 116u8, 224u8, 181u8, 129u8, + 160u8, + ], + ) + } + #[doc = "Set the number of pages in the WebAssembly environment's heap."] + pub fn set_heap_pages( + &self, + pages: ::core::primitive::u64, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "set_heap_pages", + SetHeapPages { pages }, + [ + 43u8, 103u8, 128u8, 49u8, 156u8, 136u8, 11u8, 204u8, 80u8, 6u8, 244u8, + 86u8, 171u8, 44u8, 140u8, 225u8, 142u8, 198u8, 43u8, 87u8, 26u8, 45u8, + 125u8, 222u8, 165u8, 254u8, 172u8, 158u8, 39u8, 178u8, 86u8, 87u8, + ], + ) + } + #[doc = "Set the new runtime code."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code`"] + #[doc = "- 1 call to `can_set_code`: `O(S)` (calls `sp_io::misc::runtime_version` which is"] + #[doc = " expensive)."] + #[doc = "- 1 storage write (codec `O(C)`)."] + #[doc = "- 1 digest item."] + #[doc = "- 1 event."] + #[doc = "The weight of this function is dependent on the runtime, but generally this is very"] + #[doc = "expensive. We will treat this as a full block."] + #[doc = "# "] + pub fn set_code( + &self, + code: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "set_code", + SetCode { code }, + [ + 27u8, 104u8, 244u8, 205u8, 188u8, 254u8, 121u8, 13u8, 106u8, 120u8, + 244u8, 108u8, 97u8, 84u8, 100u8, 68u8, 26u8, 69u8, 93u8, 128u8, 107u8, + 4u8, 3u8, 142u8, 13u8, 134u8, 196u8, 62u8, 113u8, 181u8, 14u8, 40u8, + ], + ) + } + #[doc = "Set the new runtime code without doing any checks of the given `code`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(C)` where `C` length of `code`"] + #[doc = "- 1 storage write (codec `O(C)`)."] + #[doc = "- 1 digest item."] + #[doc = "- 1 event."] + #[doc = "The weight of this function is dependent on the runtime. We will treat this as a full"] + #[doc = "block. # "] + pub fn set_code_without_checks( + &self, + code: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "set_code_without_checks", + SetCodeWithoutChecks { code }, + [ + 102u8, 160u8, 125u8, 235u8, 30u8, 23u8, 45u8, 239u8, 112u8, 148u8, + 159u8, 158u8, 42u8, 93u8, 206u8, 94u8, 80u8, 250u8, 66u8, 195u8, 60u8, + 40u8, 142u8, 169u8, 183u8, 80u8, 80u8, 96u8, 3u8, 231u8, 99u8, 216u8, + ], + ) + } + #[doc = "Set some items of storage."] + pub fn set_storage( + &self, + items: ::std::vec::Vec<( + ::std::vec::Vec<::core::primitive::u8>, + ::std::vec::Vec<::core::primitive::u8>, + )>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "set_storage", + SetStorage { items }, + [ + 74u8, 43u8, 106u8, 255u8, 50u8, 151u8, 192u8, 155u8, 14u8, 90u8, 19u8, + 45u8, 165u8, 16u8, 235u8, 242u8, 21u8, 131u8, 33u8, 172u8, 119u8, 78u8, + 140u8, 10u8, 107u8, 202u8, 122u8, 235u8, 181u8, 191u8, 22u8, 116u8, + ], + ) + } + #[doc = "Kill some items from storage."] + pub fn kill_storage( + &self, + keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "kill_storage", + KillStorage { keys }, + [ + 174u8, 174u8, 13u8, 174u8, 75u8, 138u8, 128u8, 235u8, 222u8, 216u8, + 85u8, 18u8, 198u8, 1u8, 138u8, 70u8, 19u8, 108u8, 209u8, 41u8, 228u8, + 67u8, 130u8, 230u8, 160u8, 207u8, 11u8, 180u8, 139u8, 242u8, 41u8, + 15u8, + ], + ) + } + #[doc = "Kill all storage items with a key that starts with the given prefix."] + #[doc = ""] + #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] + #[doc = "the prefix we are removing to accurately calculate the weight of this function."] + pub fn kill_prefix( + &self, + prefix: ::std::vec::Vec<::core::primitive::u8>, + subkeys: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "kill_prefix", + KillPrefix { prefix, subkeys }, + [ + 203u8, 116u8, 217u8, 42u8, 154u8, 215u8, 77u8, 217u8, 13u8, 22u8, + 193u8, 2u8, 128u8, 115u8, 179u8, 115u8, 187u8, 218u8, 129u8, 34u8, + 80u8, 4u8, 173u8, 120u8, 92u8, 35u8, 237u8, 112u8, 201u8, 207u8, 200u8, + 48u8, + ], + ) + } + #[doc = "Make some on-chain remark and emit event."] + pub fn remark_with_event( + &self, + remark: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "System", + "remark_with_event", + RemarkWithEvent { remark }, + [ + 123u8, 225u8, 180u8, 179u8, 144u8, 74u8, 27u8, 85u8, 101u8, 75u8, + 134u8, 44u8, 181u8, 25u8, 183u8, 158u8, 14u8, 213u8, 56u8, 225u8, + 136u8, 88u8, 26u8, 114u8, 178u8, 43u8, 176u8, 43u8, 240u8, 84u8, 116u8, + 46u8, + ], + ) + } + } + } + #[doc = "Event for the System pallet."] + pub type Event = runtime_types::frame_system::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An extrinsic completed successfully."] + pub struct ExtrinsicSuccess { + pub dispatch_info: runtime_types::frame_support::weights::DispatchInfo, + } + impl ::subxt::events::StaticEvent for ExtrinsicSuccess { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "ExtrinsicSuccess"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An extrinsic failed."] + pub struct ExtrinsicFailed { + pub dispatch_error: runtime_types::sp_runtime::DispatchError, + pub dispatch_info: runtime_types::frame_support::weights::DispatchInfo, + } + impl ::subxt::events::StaticEvent for ExtrinsicFailed { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "ExtrinsicFailed"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "`:code` was updated."] + pub struct CodeUpdated; + impl ::subxt::events::StaticEvent for CodeUpdated { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "CodeUpdated"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A new account was created."] + pub struct NewAccount { + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for NewAccount { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "NewAccount"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An account was reaped."] + pub struct KilledAccount { + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for KilledAccount { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "KilledAccount"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "On on-chain remark happened."] + pub struct Remarked { + pub sender: ::subxt::ext::sp_core::crypto::AccountId32, + pub hash: ::subxt::ext::sp_core::H256, + } + impl ::subxt::events::StaticEvent for Remarked { + const PALLET: &'static str = "System"; + const EVENT: &'static str = "Remarked"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The full account information for a particular account ID."] + pub fn account( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_system::AccountInfo< + ::core::primitive::u32, + runtime_types::pallet_balances::AccountData<::core::primitive::u128>, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "Account", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 176u8, 187u8, 21u8, 220u8, 159u8, 204u8, 127u8, 14u8, 21u8, 69u8, 77u8, + 114u8, 230u8, 141u8, 107u8, 79u8, 23u8, 16u8, 174u8, 243u8, 252u8, + 42u8, 65u8, 120u8, 229u8, 38u8, 210u8, 255u8, 22u8, 40u8, 109u8, 223u8, + ], + ) + } + #[doc = " The full account information for a particular account ID."] + pub fn account_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_system::AccountInfo< + ::core::primitive::u32, + runtime_types::pallet_balances::AccountData<::core::primitive::u128>, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "Account", + Vec::new(), + [ + 176u8, 187u8, 21u8, 220u8, 159u8, 204u8, 127u8, 14u8, 21u8, 69u8, 77u8, + 114u8, 230u8, 141u8, 107u8, 79u8, 23u8, 16u8, 174u8, 243u8, 252u8, + 42u8, 65u8, 120u8, 229u8, 38u8, 210u8, 255u8, 22u8, 40u8, 109u8, 223u8, + ], + ) + } + #[doc = " Total extrinsics count for the current block."] + pub fn extrinsic_count( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "ExtrinsicCount", + vec![], + [ + 223u8, 60u8, 201u8, 120u8, 36u8, 44u8, 180u8, 210u8, 242u8, 53u8, + 222u8, 154u8, 123u8, 176u8, 249u8, 8u8, 225u8, 28u8, 232u8, 4u8, 136u8, + 41u8, 151u8, 82u8, 189u8, 149u8, 49u8, 166u8, 139u8, 9u8, 163u8, 231u8, + ], + ) + } + #[doc = " The current weight for the block."] + pub fn block_weight( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::weights::PerDispatchClass< + ::core::primitive::u64, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "BlockWeight", + vec![], + [ + 91u8, 211u8, 177u8, 36u8, 147u8, 249u8, 55u8, 164u8, 48u8, 49u8, 55u8, + 11u8, 121u8, 193u8, 103u8, 69u8, 38u8, 142u8, 148u8, 36u8, 137u8, 41u8, + 115u8, 195u8, 31u8, 174u8, 163u8, 125u8, 69u8, 5u8, 94u8, 79u8, + ], + ) + } + #[doc = " Total length (in bytes) for all extrinsics put together, for the current block."] + pub fn all_extrinsics_len( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "AllExtrinsicsLen", + vec![], + [ + 202u8, 145u8, 209u8, 225u8, 40u8, 220u8, 174u8, 74u8, 93u8, 164u8, + 254u8, 248u8, 254u8, 192u8, 32u8, 117u8, 96u8, 149u8, 53u8, 145u8, + 219u8, 64u8, 234u8, 18u8, 217u8, 200u8, 203u8, 141u8, 145u8, 28u8, + 134u8, 60u8, + ], + ) + } + #[doc = " Map of block numbers to block hashes."] + pub fn block_hash( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::H256>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "BlockHash", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 50u8, 112u8, 176u8, 239u8, 175u8, 18u8, 205u8, 20u8, 241u8, 195u8, + 21u8, 228u8, 186u8, 57u8, 200u8, 25u8, 38u8, 44u8, 106u8, 20u8, 168u8, + 80u8, 76u8, 235u8, 12u8, 51u8, 137u8, 149u8, 200u8, 4u8, 220u8, 237u8, + ], + ) + } + #[doc = " Map of block numbers to block hashes."] + pub fn block_hash_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::H256>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "BlockHash", + Vec::new(), + [ + 50u8, 112u8, 176u8, 239u8, 175u8, 18u8, 205u8, 20u8, 241u8, 195u8, + 21u8, 228u8, 186u8, 57u8, 200u8, 25u8, 38u8, 44u8, 106u8, 20u8, 168u8, + 80u8, 76u8, 235u8, 12u8, 51u8, 137u8, 149u8, 200u8, 4u8, 220u8, 237u8, + ], + ) + } + #[doc = " Extrinsics data for the current block (maps an extrinsic's index to its data)."] + pub fn extrinsic_data( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::std::vec::Vec<::core::primitive::u8>>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "ExtrinsicData", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 210u8, 224u8, 211u8, 186u8, 118u8, 210u8, 185u8, 194u8, 238u8, 211u8, + 254u8, 73u8, 67u8, 184u8, 31u8, 229u8, 168u8, 125u8, 98u8, 23u8, 241u8, + 59u8, 49u8, 86u8, 126u8, 9u8, 114u8, 163u8, 160u8, 62u8, 50u8, 67u8, + ], + ) + } + #[doc = " Extrinsics data for the current block (maps an extrinsic's index to its data)."] + pub fn extrinsic_data_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::std::vec::Vec<::core::primitive::u8>>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "ExtrinsicData", + Vec::new(), + [ + 210u8, 224u8, 211u8, 186u8, 118u8, 210u8, 185u8, 194u8, 238u8, 211u8, + 254u8, 73u8, 67u8, 184u8, 31u8, 229u8, 168u8, 125u8, 98u8, 23u8, 241u8, + 59u8, 49u8, 86u8, 126u8, 9u8, 114u8, 163u8, 160u8, 62u8, 50u8, 67u8, + ], + ) + } + #[doc = " The current block number being processed. Set by `execute_block`."] + pub fn number( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "Number", + vec![], + [ + 228u8, 96u8, 102u8, 190u8, 252u8, 130u8, 239u8, 172u8, 126u8, 235u8, + 246u8, 139u8, 208u8, 15u8, 88u8, 245u8, 141u8, 232u8, 43u8, 204u8, + 36u8, 87u8, 211u8, 141u8, 187u8, 68u8, 236u8, 70u8, 193u8, 235u8, + 164u8, 191u8, + ], + ) + } + #[doc = " Hash of the previous block."] + pub fn parent_hash( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::H256>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "ParentHash", + vec![], + [ + 232u8, 206u8, 177u8, 119u8, 38u8, 57u8, 233u8, 50u8, 225u8, 49u8, + 169u8, 176u8, 210u8, 51u8, 231u8, 176u8, 234u8, 186u8, 188u8, 112u8, + 15u8, 152u8, 195u8, 232u8, 201u8, 97u8, 208u8, 249u8, 9u8, 163u8, 69u8, + 36u8, + ], + ) + } + #[doc = " Digest of the current block, also part of the block header."] + pub fn digest( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::generic::digest::Digest, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "Digest", + vec![], + [ + 83u8, 141u8, 200u8, 132u8, 182u8, 55u8, 197u8, 122u8, 13u8, 159u8, + 31u8, 42u8, 60u8, 191u8, 89u8, 221u8, 242u8, 47u8, 199u8, 213u8, 48u8, + 216u8, 131u8, 168u8, 245u8, 82u8, 56u8, 190u8, 62u8, 69u8, 96u8, 37u8, + ], + ) + } + #[doc = " Events deposited for the current block."] + #[doc = ""] + #[doc = " NOTE: The item is unbound and should therefore never be read on chain."] + #[doc = " It could otherwise inflate the PoV size of a block."] + #[doc = ""] + #[doc = " Events have a large in-memory size. Box the events to not go out-of-memory"] + #[doc = " just in case someone still reads them from within the runtime."] + pub fn events( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec< + runtime_types::frame_system::EventRecord< + runtime_types::aleph_runtime::Event, + ::subxt::ext::sp_core::H256, + >, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "Events", + vec![], + [ + 136u8, 10u8, 224u8, 245u8, 154u8, 113u8, 236u8, 64u8, 20u8, 3u8, 151u8, + 221u8, 140u8, 30u8, 163u8, 129u8, 68u8, 211u8, 76u8, 197u8, 121u8, + 137u8, 164u8, 50u8, 231u8, 208u8, 123u8, 112u8, 10u8, 65u8, 2u8, 92u8, + ], + ) + } + #[doc = " The number of events in the `Events` list."] + pub fn event_count( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "EventCount", + vec![], + [ + 236u8, 93u8, 90u8, 177u8, 250u8, 211u8, 138u8, 187u8, 26u8, 208u8, + 203u8, 113u8, 221u8, 233u8, 227u8, 9u8, 249u8, 25u8, 202u8, 185u8, + 161u8, 144u8, 167u8, 104u8, 127u8, 187u8, 38u8, 18u8, 52u8, 61u8, 66u8, + 112u8, + ], + ) + } + #[doc = " Mapping between a topic (represented by T::Hash) and a vector of indexes"] + #[doc = " of events in the `>` list."] + #[doc = ""] + #[doc = " All topic vectors have deterministic storage locations depending on the topic. This"] + #[doc = " allows light-clients to leverage the changes trie storage tracking mechanism and"] + #[doc = " in case of changes fetch the list of events of interest."] + #[doc = ""] + #[doc = " The value has the type `(T::BlockNumber, EventIndex)` because if we used only just"] + #[doc = " the `EventIndex` then in case if the topic has the same contents on the next block"] + #[doc = " no notification will be triggered thus the event might be lost."] + pub fn event_topics( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "EventTopics", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 205u8, 90u8, 142u8, 190u8, 176u8, 37u8, 94u8, 82u8, 98u8, 1u8, 129u8, + 63u8, 246u8, 101u8, 130u8, 58u8, 216u8, 16u8, 139u8, 196u8, 154u8, + 111u8, 110u8, 178u8, 24u8, 44u8, 183u8, 176u8, 232u8, 82u8, 223u8, + 38u8, + ], + ) + } + #[doc = " Mapping between a topic (represented by T::Hash) and a vector of indexes"] + #[doc = " of events in the `>` list."] + #[doc = ""] + #[doc = " All topic vectors have deterministic storage locations depending on the topic. This"] + #[doc = " allows light-clients to leverage the changes trie storage tracking mechanism and"] + #[doc = " in case of changes fetch the list of events of interest."] + #[doc = ""] + #[doc = " The value has the type `(T::BlockNumber, EventIndex)` because if we used only just"] + #[doc = " the `EventIndex` then in case if the topic has the same contents on the next block"] + #[doc = " no notification will be triggered thus the event might be lost."] + pub fn event_topics_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "EventTopics", + Vec::new(), + [ + 205u8, 90u8, 142u8, 190u8, 176u8, 37u8, 94u8, 82u8, 98u8, 1u8, 129u8, + 63u8, 246u8, 101u8, 130u8, 58u8, 216u8, 16u8, 139u8, 196u8, 154u8, + 111u8, 110u8, 178u8, 24u8, 44u8, 183u8, 176u8, 232u8, 82u8, 223u8, + 38u8, + ], + ) + } + #[doc = " Stores the `spec_version` and `spec_name` of when the last runtime upgrade happened."] + pub fn last_runtime_upgrade( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_system::LastRuntimeUpgradeInfo, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "LastRuntimeUpgrade", + vec![], + [ + 52u8, 37u8, 117u8, 111u8, 57u8, 130u8, 196u8, 14u8, 99u8, 77u8, 91u8, + 126u8, 178u8, 249u8, 78u8, 34u8, 9u8, 194u8, 92u8, 105u8, 113u8, 81u8, + 185u8, 127u8, 245u8, 184u8, 60u8, 29u8, 234u8, 182u8, 96u8, 196u8, + ], + ) + } + #[doc = " True if we have upgraded so that `type RefCount` is `u32`. False (default) if not."] + pub fn upgraded_to_u32_ref_count( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "UpgradedToU32RefCount", + vec![], + [ + 171u8, 88u8, 244u8, 92u8, 122u8, 67u8, 27u8, 18u8, 59u8, 175u8, 175u8, + 178u8, 20u8, 150u8, 213u8, 59u8, 222u8, 141u8, 32u8, 107u8, 3u8, 114u8, + 83u8, 250u8, 180u8, 233u8, 152u8, 54u8, 187u8, 99u8, 131u8, 204u8, + ], + ) + } + #[doc = " True if we have upgraded so that AccountInfo contains three types of `RefCount`. False"] + #[doc = " (default) if not."] + pub fn upgraded_to_triple_ref_count( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "UpgradedToTripleRefCount", + vec![], + [ + 90u8, 33u8, 56u8, 86u8, 90u8, 101u8, 89u8, 133u8, 203u8, 56u8, 201u8, + 210u8, 244u8, 232u8, 150u8, 18u8, 51u8, 105u8, 14u8, 230u8, 103u8, + 155u8, 246u8, 99u8, 53u8, 207u8, 225u8, 128u8, 186u8, 76u8, 40u8, + 185u8, + ], + ) + } + #[doc = " The execution phase of the block."] + pub fn execution_phase( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "ExecutionPhase", + vec![], + [ + 230u8, 183u8, 221u8, 135u8, 226u8, 223u8, 55u8, 104u8, 138u8, 224u8, + 103u8, 156u8, 222u8, 99u8, 203u8, 199u8, 164u8, 168u8, 193u8, 133u8, + 201u8, 155u8, 63u8, 95u8, 17u8, 206u8, 165u8, 123u8, 161u8, 33u8, + 172u8, 93u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Block & extrinsics weights: base values and limits."] + pub fn block_weights( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_system::limits::BlockWeights, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "System", + "BlockWeights", + [ + 153u8, 164u8, 86u8, 79u8, 97u8, 114u8, 248u8, 181u8, 179u8, 186u8, + 214u8, 124u8, 215u8, 96u8, 116u8, 109u8, 215u8, 182u8, 61u8, 10u8, + 77u8, 74u8, 29u8, 125u8, 131u8, 111u8, 249u8, 208u8, 233u8, 170u8, + 11u8, 14u8, + ], + ) + } + #[doc = " The maximum length of a block (in bytes)."] + pub fn block_length( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_system::limits::BlockLength, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "System", + "BlockLength", + [ + 116u8, 184u8, 225u8, 228u8, 207u8, 203u8, 4u8, 220u8, 234u8, 198u8, + 150u8, 108u8, 205u8, 87u8, 194u8, 131u8, 229u8, 51u8, 140u8, 4u8, 47u8, + 12u8, 200u8, 144u8, 153u8, 62u8, 51u8, 39u8, 138u8, 205u8, 203u8, + 236u8, + ], + ) + } + #[doc = " Maximum number of block number to block hash mappings to keep (oldest pruned first)."] + pub fn block_hash_count( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "System", + "BlockHashCount", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " The weight of runtime database operations the runtime can invoke."] + pub fn db_weight( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::weights::RuntimeDbWeight, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "System", + "DbWeight", + [ + 124u8, 162u8, 190u8, 149u8, 49u8, 177u8, 162u8, 231u8, 62u8, 167u8, + 199u8, 181u8, 43u8, 232u8, 185u8, 116u8, 195u8, 51u8, 233u8, 223u8, + 20u8, 129u8, 246u8, 13u8, 65u8, 180u8, 64u8, 9u8, 157u8, 59u8, 245u8, + 118u8, + ], + ) + } + #[doc = " Get the chain's current version."] + pub fn version( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType, + > { + ::subxt::constants::StaticConstantAddress::new( + "System", + "Version", + [ + 93u8, 98u8, 57u8, 243u8, 229u8, 8u8, 234u8, 231u8, 72u8, 230u8, 139u8, + 47u8, 63u8, 181u8, 17u8, 2u8, 220u8, 231u8, 104u8, 237u8, 185u8, 143u8, + 165u8, 253u8, 188u8, 76u8, 147u8, 12u8, 170u8, 26u8, 74u8, 200u8, + ], + ) + } + #[doc = " The designated SS85 prefix of this chain."] + #[doc = ""] + #[doc = " This replaces the \"ss58Format\" property declared in the chain spec. Reason is"] + #[doc = " that the runtime should know about the prefix in order to make use of it as"] + #[doc = " an identifier of the chain."] + pub fn ss58_prefix( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u16>, + > { + ::subxt::constants::StaticConstantAddress::new( + "System", + "SS58Prefix", + [ + 116u8, 33u8, 2u8, 170u8, 181u8, 147u8, 171u8, 169u8, 167u8, 227u8, + 41u8, 144u8, 11u8, 236u8, 82u8, 100u8, 74u8, 60u8, 184u8, 72u8, 169u8, + 90u8, 208u8, 135u8, 15u8, 117u8, 10u8, 123u8, 128u8, 193u8, 29u8, 70u8, + ], + ) + } + } + } + } + pub mod randomness_collective_flip { + use super::{root_mod, runtime_types}; + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Series of block headers from the last 81 blocks that acts as random seed material. This"] + #[doc = " is arranged as a ring buffer with `block_number % 81` being the index into the `Vec` of"] + #[doc = " the oldest hash."] + pub fn random_material( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::subxt::ext::sp_core::H256, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "RandomnessCollectiveFlip", + "RandomMaterial", + vec![], + [ + 152u8, 126u8, 73u8, 88u8, 54u8, 147u8, 6u8, 19u8, 214u8, 40u8, 159u8, + 30u8, 236u8, 61u8, 240u8, 65u8, 178u8, 94u8, 146u8, 152u8, 135u8, + 252u8, 160u8, 86u8, 123u8, 114u8, 251u8, 140u8, 98u8, 143u8, 217u8, + 242u8, + ], + ) + } + } + } + } + pub mod scheduler { + use super::{root_mod, runtime_types}; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Schedule { + pub when: ::core::primitive::u32, + pub maybe_periodic: + ::core::option::Option<(::core::primitive::u32, ::core::primitive::u32)>, + pub priority: ::core::primitive::u8, + pub call: ::std::boxed::Box< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::aleph_runtime::Call, + ::subxt::ext::sp_core::H256, + >, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Cancel { + pub when: ::core::primitive::u32, + pub index: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ScheduleNamed { + pub id: ::std::vec::Vec<::core::primitive::u8>, + pub when: ::core::primitive::u32, + pub maybe_periodic: + ::core::option::Option<(::core::primitive::u32, ::core::primitive::u32)>, + pub priority: ::core::primitive::u8, + pub call: ::std::boxed::Box< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::aleph_runtime::Call, + ::subxt::ext::sp_core::H256, + >, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CancelNamed { + pub id: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ScheduleAfter { + pub after: ::core::primitive::u32, + pub maybe_periodic: + ::core::option::Option<(::core::primitive::u32, ::core::primitive::u32)>, + pub priority: ::core::primitive::u8, + pub call: ::std::boxed::Box< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::aleph_runtime::Call, + ::subxt::ext::sp_core::H256, + >, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ScheduleNamedAfter { + pub id: ::std::vec::Vec<::core::primitive::u8>, + pub after: ::core::primitive::u32, + pub maybe_periodic: + ::core::option::Option<(::core::primitive::u32, ::core::primitive::u32)>, + pub priority: ::core::primitive::u8, + pub call: ::std::boxed::Box< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::aleph_runtime::Call, + ::subxt::ext::sp_core::H256, + >, + >, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Anonymously schedule a task."] + pub fn schedule( + &self, + when: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::aleph_runtime::Call, + ::subxt::ext::sp_core::H256, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Scheduler", + "schedule", + Schedule { + when, + maybe_periodic, + priority, + call: ::std::boxed::Box::new(call), + }, + [ + 58u8, 0u8, 22u8, 96u8, 133u8, 148u8, 237u8, 76u8, 85u8, 28u8, 163u8, + 20u8, 179u8, 80u8, 210u8, 161u8, 81u8, 210u8, 32u8, 29u8, 27u8, 214u8, + 35u8, 16u8, 221u8, 62u8, 217u8, 76u8, 71u8, 160u8, 22u8, 118u8, + ], + ) + } + #[doc = "Cancel an anonymously scheduled task."] + pub fn cancel( + &self, + when: ::core::primitive::u32, + index: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Scheduler", + "cancel", + Cancel { when, index }, + [ + 81u8, 251u8, 234u8, 17u8, 214u8, 75u8, 19u8, 59u8, 19u8, 30u8, 89u8, + 74u8, 6u8, 216u8, 238u8, 165u8, 7u8, 19u8, 153u8, 253u8, 161u8, 103u8, + 178u8, 227u8, 152u8, 180u8, 80u8, 156u8, 82u8, 126u8, 132u8, 120u8, + ], + ) + } + #[doc = "Schedule a named task."] + pub fn schedule_named( + &self, + id: ::std::vec::Vec<::core::primitive::u8>, + when: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::aleph_runtime::Call, + ::subxt::ext::sp_core::H256, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Scheduler", + "schedule_named", + ScheduleNamed { + id, + when, + maybe_periodic, + priority, + call: ::std::boxed::Box::new(call), + }, + [ + 164u8, 210u8, 167u8, 227u8, 122u8, 215u8, 105u8, 10u8, 48u8, 2u8, + 203u8, 183u8, 121u8, 218u8, 65u8, 101u8, 55u8, 122u8, 224u8, 26u8, + 64u8, 19u8, 162u8, 73u8, 214u8, 172u8, 56u8, 250u8, 159u8, 235u8, + 202u8, 97u8, + ], + ) + } + #[doc = "Cancel a named scheduled task."] + pub fn cancel_named( + &self, + id: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Scheduler", + "cancel_named", + CancelNamed { id }, + [ + 42u8, 232u8, 92u8, 167u8, 113u8, 136u8, 7u8, 215u8, 88u8, 117u8, 74u8, + 26u8, 225u8, 230u8, 244u8, 106u8, 150u8, 112u8, 46u8, 228u8, 96u8, + 252u8, 78u8, 126u8, 39u8, 207u8, 36u8, 110u8, 83u8, 62u8, 84u8, 241u8, + ], + ) + } + #[doc = "Anonymously schedule a task after a delay."] + #[doc = ""] + #[doc = "# "] + #[doc = "Same as [`schedule`]."] + #[doc = "# "] + pub fn schedule_after( + &self, + after: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::aleph_runtime::Call, + ::subxt::ext::sp_core::H256, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Scheduler", + "schedule_after", + ScheduleAfter { + after, + maybe_periodic, + priority, + call: ::std::boxed::Box::new(call), + }, + [ + 103u8, 53u8, 250u8, 8u8, 211u8, 184u8, 96u8, 235u8, 92u8, 25u8, 43u8, + 88u8, 42u8, 94u8, 235u8, 185u8, 48u8, 177u8, 186u8, 114u8, 222u8, + 162u8, 123u8, 230u8, 112u8, 101u8, 202u8, 89u8, 246u8, 102u8, 24u8, + 65u8, + ], + ) + } + #[doc = "Schedule a named task after a delay."] + #[doc = ""] + #[doc = "# "] + #[doc = "Same as [`schedule_named`](Self::schedule_named)."] + #[doc = "# "] + pub fn schedule_named_after( + &self, + id: ::std::vec::Vec<::core::primitive::u8>, + after: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::aleph_runtime::Call, + ::subxt::ext::sp_core::H256, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Scheduler", + "schedule_named_after", + ScheduleNamedAfter { + id, + after, + maybe_periodic, + priority, + call: ::std::boxed::Box::new(call), + }, + [ + 77u8, 231u8, 213u8, 170u8, 21u8, 59u8, 133u8, 4u8, 160u8, 3u8, 114u8, + 212u8, 42u8, 125u8, 16u8, 114u8, 90u8, 179u8, 250u8, 85u8, 2u8, 102u8, + 205u8, 86u8, 177u8, 120u8, 242u8, 40u8, 2u8, 238u8, 20u8, 50u8, + ], + ) + } + } + } + #[doc = "Events type."] + pub type Event = runtime_types::pallet_scheduler::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Scheduled some task."] + pub struct Scheduled { + pub when: ::core::primitive::u32, + pub index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for Scheduled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Scheduled"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Canceled some task."] + pub struct Canceled { + pub when: ::core::primitive::u32, + pub index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for Canceled { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Canceled"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Dispatched some task."] + pub struct Dispatched { + pub task: (::core::primitive::u32, ::core::primitive::u32), + pub id: ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::events::StaticEvent for Dispatched { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "Dispatched"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The call for the provided hash was not found so the task has been aborted."] + pub struct CallLookupFailed { + pub task: (::core::primitive::u32, ::core::primitive::u32), + pub id: ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + pub error: runtime_types::frame_support::traits::schedule::LookupError, + } + impl ::subxt::events::StaticEvent for CallLookupFailed { + const PALLET: &'static str = "Scheduler"; + const EVENT: &'static str = "CallLookupFailed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Items to be executed, indexed by the block number that they should be executed on."] + pub fn agenda( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec< + ::core::option::Option< + runtime_types::pallet_scheduler::ScheduledV3< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::aleph_runtime::Call, + ::subxt::ext::sp_core::H256, + >, + ::core::primitive::u32, + runtime_types::aleph_runtime::OriginCaller, + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Scheduler", + "Agenda", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 59u8, 231u8, 128u8, 61u8, 34u8, 203u8, 172u8, 251u8, 35u8, 14u8, 62u8, + 28u8, 120u8, 20u8, 207u8, 108u8, 39u8, 0u8, 101u8, 62u8, 23u8, 3u8, + 176u8, 161u8, 86u8, 53u8, 107u8, 222u8, 148u8, 54u8, 193u8, 247u8, + ], + ) + } + #[doc = " Items to be executed, indexed by the block number that they should be executed on."] + pub fn agenda_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec< + ::core::option::Option< + runtime_types::pallet_scheduler::ScheduledV3< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::aleph_runtime::Call, + ::subxt::ext::sp_core::H256, + >, + ::core::primitive::u32, + runtime_types::aleph_runtime::OriginCaller, + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Scheduler", + "Agenda", + Vec::new(), + [ + 59u8, 231u8, 128u8, 61u8, 34u8, 203u8, 172u8, 251u8, 35u8, 14u8, 62u8, + 28u8, 120u8, 20u8, 207u8, 108u8, 39u8, 0u8, 101u8, 62u8, 23u8, 3u8, + 176u8, 161u8, 86u8, 53u8, 107u8, 222u8, 148u8, 54u8, 193u8, 247u8, + ], + ) + } + #[doc = " Lookup from identity to the block number and index of the task."] + pub fn lookup( + &self, + _0: impl ::std::borrow::Borrow<[::core::primitive::u8]>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Scheduler", + "Lookup", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 56u8, 105u8, 156u8, 110u8, 251u8, 141u8, 219u8, 56u8, 131u8, 57u8, + 180u8, 33u8, 48u8, 30u8, 193u8, 194u8, 169u8, 182u8, 168u8, 43u8, 36u8, + 202u8, 222u8, 182u8, 41u8, 216u8, 222u8, 1u8, 72u8, 165u8, 62u8, 166u8, + ], + ) + } + #[doc = " Lookup from identity to the block number and index of the task."] + pub fn lookup_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Scheduler", + "Lookup", + Vec::new(), + [ + 56u8, 105u8, 156u8, 110u8, 251u8, 141u8, 219u8, 56u8, 131u8, 57u8, + 180u8, 33u8, 48u8, 30u8, 193u8, 194u8, 169u8, 182u8, 168u8, 43u8, 36u8, + 202u8, 222u8, 182u8, 41u8, 216u8, 222u8, 1u8, 72u8, 165u8, 62u8, 166u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The maximum weight that may be scheduled per block for any dispatchables of less"] + #[doc = " priority than `schedule::HARD_DEADLINE`."] + pub fn maximum_weight( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Scheduler", + "MaximumWeight", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, + 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, + 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, + 246u8, + ], + ) + } + #[doc = " The maximum number of scheduled calls in the queue for a single block."] + #[doc = " Not strictly enforced, but used for weight estimation."] + pub fn max_scheduled_per_block( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Scheduler", + "MaxScheduledPerBlock", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + } + } + } + pub mod aura { + use super::{root_mod, runtime_types}; + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The current authority set."] + pub fn authorities( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + runtime_types::sp_consensus_aura::sr25519::app_sr25519::Public, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Aura", + "Authorities", + vec![], + [ + 199u8, 89u8, 94u8, 48u8, 249u8, 35u8, 105u8, 90u8, 15u8, 86u8, 218u8, + 85u8, 22u8, 236u8, 228u8, 36u8, 137u8, 64u8, 236u8, 171u8, 242u8, + 217u8, 91u8, 240u8, 205u8, 205u8, 226u8, 16u8, 147u8, 235u8, 181u8, + 41u8, + ], + ) + } + #[doc = " The current slot of this block."] + #[doc = ""] + #[doc = " This will be set in `on_initialize`."] + pub fn current_slot( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Aura", + "CurrentSlot", + vec![], + [ + 139u8, 237u8, 185u8, 137u8, 251u8, 179u8, 69u8, 167u8, 133u8, 168u8, + 204u8, 64u8, 178u8, 123u8, 92u8, 250u8, 119u8, 190u8, 208u8, 178u8, + 208u8, 176u8, 124u8, 187u8, 74u8, 165u8, 33u8, 78u8, 161u8, 206u8, 8u8, + 108u8, + ], + ) + } + } + } + } + pub mod timestamp { + use super::{root_mod, runtime_types}; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Set { + #[codec(compact)] + pub now: ::core::primitive::u64, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Set the current time."] + #[doc = ""] + #[doc = "This call should be invoked exactly once per block. It will panic at the finalization"] + #[doc = "phase, if this call hasn't been invoked by that time."] + #[doc = ""] + #[doc = "The timestamp should be greater than the previous one by the amount specified by"] + #[doc = "`MinimumPeriod`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Inherent`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)"] + #[doc = "- 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in"] + #[doc = " `on_finalize`)"] + #[doc = "- 1 event handler `on_timestamp_set`. Must be `O(1)`."] + #[doc = "# "] + pub fn set( + &self, + now: ::core::primitive::u64, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Timestamp", + "set", + Set { now }, + [ + 6u8, 97u8, 172u8, 236u8, 118u8, 238u8, 228u8, 114u8, 15u8, 115u8, + 102u8, 85u8, 66u8, 151u8, 16u8, 33u8, 187u8, 17u8, 166u8, 88u8, 127u8, + 214u8, 182u8, 51u8, 168u8, 88u8, 43u8, 101u8, 185u8, 8u8, 1u8, 28u8, + ], + ) + } + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Current time for the current block."] + pub fn now( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Timestamp", + "Now", + vec![], + [ + 148u8, 53u8, 50u8, 54u8, 13u8, 161u8, 57u8, 150u8, 16u8, 83u8, 144u8, + 221u8, 59u8, 75u8, 158u8, 130u8, 39u8, 123u8, 106u8, 134u8, 202u8, + 185u8, 83u8, 85u8, 60u8, 41u8, 120u8, 96u8, 210u8, 34u8, 2u8, 250u8, + ], + ) + } + #[doc = " Did the timestamp get updated in this block?"] + pub fn did_update( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Timestamp", + "DidUpdate", + vec![], + [ + 70u8, 13u8, 92u8, 186u8, 80u8, 151u8, 167u8, 90u8, 158u8, 232u8, 175u8, + 13u8, 103u8, 135u8, 2u8, 78u8, 16u8, 6u8, 39u8, 158u8, 167u8, 85u8, + 27u8, 47u8, 122u8, 73u8, 127u8, 26u8, 35u8, 168u8, 72u8, 204u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The minimum period between blocks. Beware that this is different to the *expected*"] + #[doc = " period that the block production apparatus provides. Your chosen consensus system will"] + #[doc = " generally work with this to determine a sensible block time. e.g. For Aura, it will be"] + #[doc = " double this period on default settings."] + pub fn minimum_period( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Timestamp", + "MinimumPeriod", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, + 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, + 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, + 246u8, + ], + ) + } + } + } + } + pub mod balances { + use super::{root_mod, runtime_types}; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Transfer { + pub dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub value: ::core::primitive::u128, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetBalance { + pub who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub new_free: ::core::primitive::u128, + #[codec(compact)] + pub new_reserved: ::core::primitive::u128, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ForceTransfer { + pub source: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + pub dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub value: ::core::primitive::u128, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct TransferKeepAlive { + pub dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub value: ::core::primitive::u128, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct TransferAll { + pub dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + pub keep_alive: ::core::primitive::bool, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ForceUnreserve { + pub who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + pub amount: ::core::primitive::u128, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Transfer some liquid free balance to another account."] + #[doc = ""] + #[doc = "`transfer` will set the `FreeBalance` of the sender and receiver."] + #[doc = "If the sender's account is below the existential deposit as a result"] + #[doc = "of the transfer, the account will be reaped."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Dependent on arguments but not critical, given proper implementations for input config"] + #[doc = " types. See related functions below."] + #[doc = "- It contains a limited number of reads and writes internally and no complex"] + #[doc = " computation."] + #[doc = ""] + #[doc = "Related functions:"] + #[doc = ""] + #[doc = " - `ensure_can_withdraw` is always called internally but has a bounded complexity."] + #[doc = " - Transferring balances to accounts that did not exist before will cause"] + #[doc = " `T::OnNewAccount::on_new_account` to be called."] + #[doc = " - Removing enough funds from an account will trigger `T::DustRemoval::on_unbalanced`."] + #[doc = " - `transfer_keep_alive` works the same way as `transfer`, but has an additional check"] + #[doc = " that the transfer will not kill the origin account."] + #[doc = "---------------------------------"] + #[doc = "- Origin account is already in memory, so no DB operations for them."] + #[doc = "# "] + pub fn transfer( + &self, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + value: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "transfer", + Transfer { dest, value }, + [ + 111u8, 222u8, 32u8, 56u8, 171u8, 77u8, 252u8, 29u8, 194u8, 155u8, + 200u8, 192u8, 198u8, 81u8, 23u8, 115u8, 236u8, 91u8, 218u8, 114u8, + 107u8, 141u8, 138u8, 100u8, 237u8, 21u8, 58u8, 172u8, 3u8, 20u8, 216u8, + 38u8, + ], + ) + } + #[doc = "Set the balances of a given account."] + #[doc = ""] + #[doc = "This will alter `FreeBalance` and `ReservedBalance` in storage. it will"] + #[doc = "also alter the total issuance of the system (`TotalIssuance`) appropriately."] + #[doc = "If the new free or reserved balance is below the existential deposit,"] + #[doc = "it will reset the account nonce (`frame_system::AccountNonce`)."] + #[doc = ""] + #[doc = "The dispatch origin for this call is `root`."] + pub fn set_balance( + &self, + who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + new_free: ::core::primitive::u128, + new_reserved: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "set_balance", + SetBalance { + who, + new_free, + new_reserved, + }, + [ + 234u8, 215u8, 97u8, 98u8, 243u8, 199u8, 57u8, 76u8, 59u8, 161u8, 118u8, + 207u8, 34u8, 197u8, 198u8, 61u8, 231u8, 210u8, 169u8, 235u8, 150u8, + 137u8, 173u8, 49u8, 28u8, 77u8, 84u8, 149u8, 143u8, 210u8, 139u8, + 193u8, + ], + ) + } + #[doc = "Exactly as `transfer`, except the origin must be root and the source account may be"] + #[doc = "specified."] + #[doc = "# "] + #[doc = "- Same as transfer, but additional read and write because the source account is not"] + #[doc = " assumed to be in the overlay."] + #[doc = "# "] + pub fn force_transfer( + &self, + source: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + value: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "force_transfer", + ForceTransfer { + source, + dest, + value, + }, + [ + 79u8, 174u8, 212u8, 108u8, 184u8, 33u8, 170u8, 29u8, 232u8, 254u8, + 195u8, 218u8, 221u8, 134u8, 57u8, 99u8, 6u8, 70u8, 181u8, 227u8, 56u8, + 239u8, 243u8, 158u8, 157u8, 245u8, 36u8, 162u8, 11u8, 237u8, 147u8, + 15u8, + ], + ) + } + #[doc = "Same as the [`transfer`] call, but with a check that the transfer will not kill the"] + #[doc = "origin account."] + #[doc = ""] + #[doc = "99% of the time you want [`transfer`] instead."] + #[doc = ""] + #[doc = "[`transfer`]: struct.Pallet.html#method.transfer"] + pub fn transfer_keep_alive( + &self, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + value: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "transfer_keep_alive", + TransferKeepAlive { dest, value }, + [ + 112u8, 179u8, 75u8, 168u8, 193u8, 221u8, 9u8, 82u8, 190u8, 113u8, + 253u8, 13u8, 130u8, 134u8, 170u8, 216u8, 136u8, 111u8, 242u8, 220u8, + 202u8, 112u8, 47u8, 79u8, 73u8, 244u8, 226u8, 59u8, 240u8, 188u8, + 210u8, 208u8, + ], + ) + } + #[doc = "Transfer the entire transferable balance from the caller account."] + #[doc = ""] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be Signed."] + #[doc = ""] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] + #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] + #[doc = " keep the sender account alive (true). # "] + #[doc = "- O(1). Just like transfer, but reading the user's transferable balance first."] + #[doc = " #"] + pub fn transfer_all( + &self, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + keep_alive: ::core::primitive::bool, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "transfer_all", + TransferAll { dest, keep_alive }, + [ + 46u8, 129u8, 29u8, 177u8, 221u8, 107u8, 245u8, 69u8, 238u8, 126u8, + 145u8, 26u8, 219u8, 208u8, 14u8, 80u8, 149u8, 1u8, 214u8, 63u8, 67u8, + 201u8, 144u8, 45u8, 129u8, 145u8, 174u8, 71u8, 238u8, 113u8, 208u8, + 34u8, + ], + ) + } + #[doc = "Unreserve some balance from a user by force."] + #[doc = ""] + #[doc = "Can only be called by ROOT."] + pub fn force_unreserve( + &self, + who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + amount: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "force_unreserve", + ForceUnreserve { who, amount }, + [ + 160u8, 146u8, 137u8, 76u8, 157u8, 187u8, 66u8, 148u8, 207u8, 76u8, + 32u8, 254u8, 82u8, 215u8, 35u8, 161u8, 213u8, 52u8, 32u8, 98u8, 102u8, + 106u8, 234u8, 123u8, 6u8, 175u8, 184u8, 188u8, 174u8, 106u8, 176u8, + 78u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_balances::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An account was created with some free balance."] + pub struct Endowed { + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + pub free_balance: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Endowed { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Endowed"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] + #[doc = "resulting in an outright loss."] + pub struct DustLost { + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for DustLost { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "DustLost"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Transfer succeeded."] + pub struct Transfer { + pub from: ::subxt::ext::sp_core::crypto::AccountId32, + pub to: ::subxt::ext::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Transfer { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Transfer"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A balance was set by root."] + pub struct BalanceSet { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub free: ::core::primitive::u128, + pub reserved: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for BalanceSet { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "BalanceSet"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Some balance was reserved (moved from free to reserved)."] + pub struct Reserved { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Reserved { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Reserved"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Some balance was unreserved (moved from reserved to free)."] + pub struct Unreserved { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Unreserved { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Unreserved"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Some balance was moved from the reserve of the first account to the second account."] + #[doc = "Final argument indicates the destination balance type."] + pub struct ReserveRepatriated { + pub from: ::subxt::ext::sp_core::crypto::AccountId32, + pub to: ::subxt::ext::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + pub destination_status: + runtime_types::frame_support::traits::tokens::misc::BalanceStatus, + } + impl ::subxt::events::StaticEvent for ReserveRepatriated { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "ReserveRepatriated"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Some amount was deposited (e.g. for transaction fees)."] + pub struct Deposit { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Deposit { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Deposit"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] + pub struct Withdraw { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Withdraw { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Withdraw"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Some amount was removed from the account (e.g. for misbehavior)."] + pub struct Slashed { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Slashed { + const PALLET: &'static str = "Balances"; + const EVENT: &'static str = "Slashed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The total units issued in the system."] + pub fn total_issuance( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Balances", + "TotalIssuance", + vec![], + [ + 1u8, 206u8, 252u8, 237u8, 6u8, 30u8, 20u8, 232u8, 164u8, 115u8, 51u8, + 156u8, 156u8, 206u8, 241u8, 187u8, 44u8, 84u8, 25u8, 164u8, 235u8, + 20u8, 86u8, 242u8, 124u8, 23u8, 28u8, 140u8, 26u8, 73u8, 231u8, 51u8, + ], + ) + } + #[doc = " The Balances pallet example of storing the balance of an account."] + #[doc = ""] + #[doc = " # Example"] + #[doc = ""] + #[doc = " ```nocompile"] + #[doc = " impl pallet_balances::Config for Runtime {"] + #[doc = " type AccountStore = StorageMapShim, frame_system::Provider, AccountId, Self::AccountData>"] + #[doc = " }"] + #[doc = " ```"] + #[doc = ""] + #[doc = " You can also store the balance of an account in the `System` pallet."] + #[doc = ""] + #[doc = " # Example"] + #[doc = ""] + #[doc = " ```nocompile"] + #[doc = " impl pallet_balances::Config for Runtime {"] + #[doc = " type AccountStore = System"] + #[doc = " }"] + #[doc = " ```"] + #[doc = ""] + #[doc = " But this comes with tradeoffs, storing account balances in the system pallet stores"] + #[doc = " `frame_system` data alongside the account data contrary to storing account balances in the"] + #[doc = " `Balances` pallet, which uses a `StorageMap` to store balances data only."] + #[doc = " NOTE: This is only used in the case that this pallet is used to store balances."] + pub fn account( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_balances::AccountData<::core::primitive::u128>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Balances", + "Account", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 246u8, 154u8, 253u8, 71u8, 192u8, 192u8, 192u8, 236u8, 128u8, 80u8, + 40u8, 252u8, 201u8, 43u8, 3u8, 131u8, 19u8, 49u8, 141u8, 240u8, 172u8, + 217u8, 215u8, 109u8, 87u8, 135u8, 248u8, 57u8, 98u8, 185u8, 22u8, 4u8, + ], + ) + } + #[doc = " The Balances pallet example of storing the balance of an account."] + #[doc = ""] + #[doc = " # Example"] + #[doc = ""] + #[doc = " ```nocompile"] + #[doc = " impl pallet_balances::Config for Runtime {"] + #[doc = " type AccountStore = StorageMapShim, frame_system::Provider, AccountId, Self::AccountData>"] + #[doc = " }"] + #[doc = " ```"] + #[doc = ""] + #[doc = " You can also store the balance of an account in the `System` pallet."] + #[doc = ""] + #[doc = " # Example"] + #[doc = ""] + #[doc = " ```nocompile"] + #[doc = " impl pallet_balances::Config for Runtime {"] + #[doc = " type AccountStore = System"] + #[doc = " }"] + #[doc = " ```"] + #[doc = ""] + #[doc = " But this comes with tradeoffs, storing account balances in the system pallet stores"] + #[doc = " `frame_system` data alongside the account data contrary to storing account balances in the"] + #[doc = " `Balances` pallet, which uses a `StorageMap` to store balances data only."] + #[doc = " NOTE: This is only used in the case that this pallet is used to store balances."] + pub fn account_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_balances::AccountData<::core::primitive::u128>, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Balances", + "Account", + Vec::new(), + [ + 246u8, 154u8, 253u8, 71u8, 192u8, 192u8, 192u8, 236u8, 128u8, 80u8, + 40u8, 252u8, 201u8, 43u8, 3u8, 131u8, 19u8, 49u8, 141u8, 240u8, 172u8, + 217u8, 215u8, 109u8, 87u8, 135u8, 248u8, 57u8, 98u8, 185u8, 22u8, 4u8, + ], + ) + } + #[doc = " Any liquidity locks on some account balances."] + #[doc = " NOTE: Should only be accessed when setting, changing and freeing a lock."] + pub fn locks( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::weak_bounded_vec::WeakBoundedVec< + runtime_types::pallet_balances::BalanceLock<::core::primitive::u128>, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Balances", + "Locks", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 216u8, 253u8, 87u8, 73u8, 24u8, 218u8, 35u8, 0u8, 244u8, 134u8, 195u8, + 58u8, 255u8, 64u8, 153u8, 212u8, 210u8, 232u8, 4u8, 122u8, 90u8, 212u8, + 136u8, 14u8, 127u8, 232u8, 8u8, 192u8, 40u8, 233u8, 18u8, 250u8, + ], + ) + } + #[doc = " Any liquidity locks on some account balances."] + #[doc = " NOTE: Should only be accessed when setting, changing and freeing a lock."] + pub fn locks_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::weak_bounded_vec::WeakBoundedVec< + runtime_types::pallet_balances::BalanceLock<::core::primitive::u128>, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Balances", + "Locks", + Vec::new(), + [ + 216u8, 253u8, 87u8, 73u8, 24u8, 218u8, 35u8, 0u8, 244u8, 134u8, 195u8, + 58u8, 255u8, 64u8, 153u8, 212u8, 210u8, 232u8, 4u8, 122u8, 90u8, 212u8, + 136u8, 14u8, 127u8, 232u8, 8u8, 192u8, 40u8, 233u8, 18u8, 250u8, + ], + ) + } + #[doc = " Named reserves on some account balances."] + pub fn reserves( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + runtime_types::pallet_balances::ReserveData< + [::core::primitive::u8; 8usize], + ::core::primitive::u128, + >, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Balances", + "Reserves", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 17u8, 32u8, 191u8, 46u8, 76u8, 220u8, 101u8, 100u8, 42u8, 250u8, 128u8, + 167u8, 117u8, 44u8, 85u8, 96u8, 105u8, 216u8, 16u8, 147u8, 74u8, 55u8, + 183u8, 94u8, 160u8, 177u8, 26u8, 187u8, 71u8, 197u8, 187u8, 163u8, + ], + ) + } + #[doc = " Named reserves on some account balances."] + pub fn reserves_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + runtime_types::pallet_balances::ReserveData< + [::core::primitive::u8; 8usize], + ::core::primitive::u128, + >, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Balances", + "Reserves", + Vec::new(), + [ + 17u8, 32u8, 191u8, 46u8, 76u8, 220u8, 101u8, 100u8, 42u8, 250u8, 128u8, + 167u8, 117u8, 44u8, 85u8, 96u8, 105u8, 216u8, 16u8, 147u8, 74u8, 55u8, + 183u8, 94u8, 160u8, 177u8, 26u8, 187u8, 71u8, 197u8, 187u8, 163u8, + ], + ) + } + #[doc = " Storage version of the pallet."] + #[doc = ""] + #[doc = " This is set to v2.0.0 for new networks."] + pub fn storage_version( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Balances", + "StorageVersion", + vec![], + [ + 135u8, 96u8, 28u8, 234u8, 124u8, 212u8, 56u8, 140u8, 40u8, 101u8, + 235u8, 128u8, 136u8, 221u8, 182u8, 81u8, 17u8, 9u8, 184u8, 228u8, + 174u8, 165u8, 200u8, 162u8, 214u8, 178u8, 227u8, 72u8, 34u8, 5u8, + 173u8, 96u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The minimum amount required to keep an account open."] + pub fn existential_deposit( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Balances", + "ExistentialDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + #[doc = " The maximum number of locks that should exist on an account."] + #[doc = " Not strictly enforced, but used for weight estimation."] + pub fn max_locks( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Balances", + "MaxLocks", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " The maximum number of named reserves that can exist on an account."] + pub fn max_reserves( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Balances", + "MaxReserves", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + } + } + } + pub mod transaction_payment { + use super::{root_mod, runtime_types}; + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_transaction_payment::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,"] + #[doc = "has been paid by `who`."] + pub struct TransactionFeePaid { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub actual_fee: ::core::primitive::u128, + pub tip: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for TransactionFeePaid { + const PALLET: &'static str = "TransactionPayment"; + const EVENT: &'static str = "TransactionFeePaid"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + pub fn next_fee_multiplier( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_arithmetic::fixed_point::FixedU128, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TransactionPayment", + "NextFeeMultiplier", + vec![], + [ + 210u8, 0u8, 206u8, 165u8, 183u8, 10u8, 206u8, 52u8, 14u8, 90u8, 218u8, + 197u8, 189u8, 125u8, 113u8, 216u8, 52u8, 161u8, 45u8, 24u8, 245u8, + 237u8, 121u8, 41u8, 106u8, 29u8, 45u8, 129u8, 250u8, 203u8, 206u8, + 180u8, + ], + ) + } + pub fn storage_version( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_transaction_payment::Releases, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TransactionPayment", + "StorageVersion", + vec![], + [ + 219u8, 243u8, 82u8, 176u8, 65u8, 5u8, 132u8, 114u8, 8u8, 82u8, 176u8, + 200u8, 97u8, 150u8, 177u8, 164u8, 166u8, 11u8, 34u8, 12u8, 12u8, 198u8, + 58u8, 191u8, 186u8, 221u8, 221u8, 119u8, 181u8, 253u8, 154u8, 228u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " A fee mulitplier for `Operational` extrinsics to compute \"virtual tip\" to boost their"] + #[doc = " `priority`"] + #[doc = ""] + #[doc = " This value is multipled by the `final_fee` to obtain a \"virtual tip\" that is later"] + #[doc = " added to a tip component in regular `priority` calculations."] + #[doc = " It means that a `Normal` transaction can front-run a similarly-sized `Operational`"] + #[doc = " extrinsic (with no tip), by including a tip value greater than the virtual tip."] + #[doc = ""] + #[doc = " ```rust,ignore"] + #[doc = " // For `Normal`"] + #[doc = " let priority = priority_calc(tip);"] + #[doc = ""] + #[doc = " // For `Operational`"] + #[doc = " let virtual_tip = (inclusion_fee + tip) * OperationalFeeMultiplier;"] + #[doc = " let priority = priority_calc(tip + virtual_tip);"] + #[doc = " ```"] + #[doc = ""] + #[doc = " Note that since we use `final_fee` the multiplier applies also to the regular `tip`"] + #[doc = " sent with the transaction. So, not only does the transaction get a priority bump based"] + #[doc = " on the `inclusion_fee`, but we also amplify the impact of tips applied to `Operational`"] + #[doc = " transactions."] + pub fn operational_fee_multiplier( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u8>, + > { + ::subxt::constants::StaticConstantAddress::new( + "TransactionPayment", + "OperationalFeeMultiplier", + [ + 141u8, 130u8, 11u8, 35u8, 226u8, 114u8, 92u8, 179u8, 168u8, 110u8, + 28u8, 91u8, 221u8, 64u8, 4u8, 148u8, 201u8, 193u8, 185u8, 66u8, 226u8, + 114u8, 97u8, 79u8, 62u8, 212u8, 202u8, 114u8, 237u8, 228u8, 183u8, + 165u8, + ], + ) + } + } + } + } + pub mod authorship { + use super::{root_mod, runtime_types}; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetUncles { + pub new_uncles: ::std::vec::Vec< + runtime_types::sp_runtime::generic::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Provide a set of uncles."] + pub fn set_uncles( + &self, + new_uncles: ::std::vec::Vec< + runtime_types::sp_runtime::generic::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Authorship", + "set_uncles", + SetUncles { new_uncles }, + [ + 181u8, 70u8, 222u8, 83u8, 154u8, 215u8, 200u8, 64u8, 154u8, 228u8, + 115u8, 247u8, 117u8, 89u8, 229u8, 102u8, 128u8, 189u8, 90u8, 60u8, + 223u8, 19u8, 111u8, 172u8, 5u8, 223u8, 132u8, 37u8, 235u8, 119u8, 42u8, + 64u8, + ], + ) + } + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Uncles"] + pub fn uncles( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + runtime_types::pallet_authorship::UncleEntryItem< + ::core::primitive::u32, + ::subxt::ext::sp_core::H256, + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Authorship", + "Uncles", + vec![], + [ + 193u8, 226u8, 196u8, 151u8, 233u8, 82u8, 60u8, 164u8, 27u8, 156u8, + 231u8, 51u8, 79u8, 134u8, 170u8, 166u8, 71u8, 120u8, 250u8, 255u8, + 52u8, 168u8, 74u8, 199u8, 122u8, 253u8, 248u8, 178u8, 39u8, 233u8, + 132u8, 67u8, + ], + ) + } + #[doc = " Author of current block."] + pub fn author( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::crypto::AccountId32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Authorship", + "Author", + vec![], + [ + 149u8, 42u8, 33u8, 147u8, 190u8, 207u8, 174u8, 227u8, 190u8, 110u8, + 25u8, 131u8, 5u8, 167u8, 237u8, 188u8, 188u8, 33u8, 177u8, 126u8, + 181u8, 49u8, 126u8, 118u8, 46u8, 128u8, 154u8, 95u8, 15u8, 91u8, 103u8, + 113u8, + ], + ) + } + #[doc = " Whether uncles were already set in this block."] + pub fn did_set_uncles( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Authorship", + "DidSetUncles", + vec![], + [ + 64u8, 3u8, 208u8, 187u8, 50u8, 45u8, 37u8, 88u8, 163u8, 226u8, 37u8, + 126u8, 232u8, 107u8, 156u8, 187u8, 29u8, 15u8, 53u8, 46u8, 28u8, 73u8, + 83u8, 123u8, 14u8, 244u8, 243u8, 43u8, 245u8, 143u8, 15u8, 115u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The number of blocks back we should accept uncles."] + #[doc = " This means that we will deal with uncle-parents that are"] + #[doc = " `UncleGenerations + 1` before `now`."] + pub fn uncle_generations( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Authorship", + "UncleGenerations", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + } + } + } + pub mod staking { + use super::{root_mod, runtime_types}; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Bond { + pub controller: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub value: ::core::primitive::u128, + pub payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BondExtra { + #[codec(compact)] + pub max_additional: ::core::primitive::u128, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Unbond { + #[codec(compact)] + pub value: ::core::primitive::u128, + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct WithdrawUnbonded { + pub num_slashing_spans: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Validate { + pub prefs: runtime_types::pallet_staking::ValidatorPrefs, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Nominate { + pub targets: ::std::vec::Vec< + ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Chill; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetPayee { + pub payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetController { + pub controller: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetValidatorCount { + #[codec(compact)] + pub new: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct IncreaseValidatorCount { + #[codec(compact)] + pub additional: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ScaleValidatorCount { + pub factor: runtime_types::sp_arithmetic::per_things::Percent, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ForceNoEras; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ForceNewEra; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetInvulnerables { + pub invulnerables: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ForceUnstake { + pub stash: ::subxt::ext::sp_core::crypto::AccountId32, + pub num_slashing_spans: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ForceNewEraAlways; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CancelDeferredSlash { + pub era: ::core::primitive::u32, + pub slash_indices: ::std::vec::Vec<::core::primitive::u32>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct PayoutStakers { + pub validator_stash: ::subxt::ext::sp_core::crypto::AccountId32, + pub era: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Rebond { + #[codec(compact)] + pub value: ::core::primitive::u128, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetHistoryDepth { + #[codec(compact)] + pub new_history_depth: ::core::primitive::u32, + #[codec(compact)] + pub era_items_deleted: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ReapStash { + pub stash: ::subxt::ext::sp_core::crypto::AccountId32, + pub num_slashing_spans: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Kick { + pub who: ::std::vec::Vec< + ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetStakingConfigs { + pub min_nominator_bond: runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u128, + >, + pub min_validator_bond: runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u128, + >, + pub max_nominator_count: + runtime_types::pallet_staking::pallet::pallet::ConfigOp<::core::primitive::u32>, + pub max_validator_count: + runtime_types::pallet_staking::pallet::pallet::ConfigOp<::core::primitive::u32>, + pub chill_threshold: runtime_types::pallet_staking::pallet::pallet::ConfigOp< + runtime_types::sp_arithmetic::per_things::Percent, + >, + pub min_commission: runtime_types::pallet_staking::pallet::pallet::ConfigOp< + runtime_types::sp_arithmetic::per_things::Perbill, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ChillOther { + pub controller: ::subxt::ext::sp_core::crypto::AccountId32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ForceApplyMinCommission { + pub validator_stash: ::subxt::ext::sp_core::crypto::AccountId32, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Take the origin account as a stash and lock up `value` of its balance. `controller` will"] + #[doc = "be the account that controls it."] + #[doc = ""] + #[doc = "`value` must be more than the `minimum_balance` specified by `T::Currency`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the stash account."] + #[doc = ""] + #[doc = "Emits `Bonded`."] + #[doc = "# "] + #[doc = "- Independent of the arguments. Moderate complexity."] + #[doc = "- O(1)."] + #[doc = "- Three extra DB entries."] + #[doc = ""] + #[doc = "NOTE: Two of the storage writes (`Self::bonded`, `Self::payee`) are _never_ cleaned"] + #[doc = "unless the `origin` falls below _existential deposit_ and gets removed as dust."] + #[doc = "------------------"] + #[doc = "# "] + pub fn bond( + &self, + controller: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + value: ::core::primitive::u128, + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "bond", + Bond { + controller, + value, + payee, + }, + [ + 215u8, 211u8, 69u8, 215u8, 33u8, 158u8, 62u8, 3u8, 31u8, 216u8, 213u8, + 188u8, 151u8, 43u8, 165u8, 154u8, 117u8, 163u8, 190u8, 227u8, 116u8, + 70u8, 155u8, 178u8, 64u8, 174u8, 203u8, 179u8, 214u8, 187u8, 176u8, + 10u8, + ], + ) + } + #[doc = "Add some extra amount that have appeared in the stash `free_balance` into the balance up"] + #[doc = "for staking."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the stash, not the controller."] + #[doc = ""] + #[doc = "Use this if there are additional funds in your stash account that you wish to bond."] + #[doc = "Unlike [`bond`](Self::bond) or [`unbond`](Self::unbond) this function does not impose"] + #[doc = "any limitation on the amount that can be added."] + #[doc = ""] + #[doc = "Emits `Bonded`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Independent of the arguments. Insignificant complexity."] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn bond_extra( + &self, + max_additional: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "bond_extra", + BondExtra { max_additional }, + [ + 60u8, 45u8, 82u8, 223u8, 113u8, 95u8, 0u8, 71u8, 59u8, 108u8, 228u8, + 9u8, 95u8, 210u8, 113u8, 106u8, 252u8, 15u8, 19u8, 128u8, 11u8, 187u8, + 4u8, 151u8, 103u8, 143u8, 24u8, 33u8, 149u8, 82u8, 35u8, 192u8, + ], + ) + } + #[doc = "Schedule a portion of the stash to be unlocked ready for transfer out after the bond"] + #[doc = "period ends. If this leaves an amount actively bonded less than"] + #[doc = "T::Currency::minimum_balance(), then it is increased to the full amount."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "Once the unlock period is done, you can call `withdraw_unbonded` to actually move"] + #[doc = "the funds out of management ready for transfer."] + #[doc = ""] + #[doc = "No more than a limited number of unlocking chunks (see `MaxUnlockingChunks`)"] + #[doc = "can co-exists at the same time. In that case, [`Call::withdraw_unbonded`] need"] + #[doc = "to be called first to remove some of the chunks (if possible)."] + #[doc = ""] + #[doc = "If a user encounters the `InsufficientBond` error when calling this extrinsic,"] + #[doc = "they should call `chill` first in order to free up their bonded funds."] + #[doc = ""] + #[doc = "Emits `Unbonded`."] + #[doc = ""] + #[doc = "See also [`Call::withdraw_unbonded`]."] + pub fn unbond( + &self, + value: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "unbond", + Unbond { value }, + [ + 85u8, 62u8, 34u8, 127u8, 60u8, 241u8, 134u8, 60u8, 125u8, 91u8, 31u8, + 193u8, 50u8, 230u8, 237u8, 42u8, 114u8, 230u8, 240u8, 146u8, 14u8, + 109u8, 185u8, 151u8, 148u8, 44u8, 147u8, 182u8, 192u8, 253u8, 51u8, + 87u8, + ], + ) + } + #[doc = "Remove any unlocked chunks from the `unlocking` queue from our management."] + #[doc = ""] + #[doc = "This essentially frees up that balance to be used by the stash account to do"] + #[doc = "whatever it wants."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller."] + #[doc = ""] + #[doc = "Emits `Withdrawn`."] + #[doc = ""] + #[doc = "See also [`Call::unbond`]."] + #[doc = ""] + #[doc = "# "] + #[doc = "Complexity O(S) where S is the number of slashing spans to remove"] + #[doc = "NOTE: Weight annotation is the kill scenario, we refund otherwise."] + #[doc = "# "] + pub fn withdraw_unbonded( + &self, + num_slashing_spans: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "withdraw_unbonded", + WithdrawUnbonded { num_slashing_spans }, + [ + 95u8, 223u8, 122u8, 217u8, 76u8, 208u8, 86u8, 129u8, 31u8, 104u8, 70u8, + 154u8, 23u8, 250u8, 165u8, 192u8, 149u8, 249u8, 158u8, 159u8, 194u8, + 224u8, 118u8, 134u8, 204u8, 157u8, 72u8, 136u8, 19u8, 193u8, 183u8, + 84u8, + ], + ) + } + #[doc = "Declare the desire to validate for the origin controller."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + pub fn validate( + &self, + prefs: runtime_types::pallet_staking::ValidatorPrefs, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "validate", + Validate { prefs }, + [ + 191u8, 116u8, 139u8, 35u8, 250u8, 211u8, 86u8, 240u8, 35u8, 9u8, 19u8, + 44u8, 148u8, 35u8, 91u8, 106u8, 200u8, 172u8, 108u8, 145u8, 194u8, + 146u8, 61u8, 145u8, 233u8, 168u8, 2u8, 26u8, 145u8, 101u8, 114u8, + 157u8, + ], + ) + } + #[doc = "Declare the desire to nominate `targets` for the origin controller."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "# "] + #[doc = "- The transaction's complexity is proportional to the size of `targets` (N)"] + #[doc = "which is capped at CompactAssignments::LIMIT (T::MaxNominations)."] + #[doc = "- Both the reads and writes follow a similar pattern."] + #[doc = "# "] + pub fn nominate( + &self, + targets: ::std::vec::Vec< + ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "nominate", + Nominate { targets }, + [ + 112u8, 162u8, 70u8, 26u8, 74u8, 7u8, 188u8, 193u8, 210u8, 247u8, 27u8, + 189u8, 133u8, 137u8, 33u8, 155u8, 255u8, 171u8, 122u8, 68u8, 175u8, + 247u8, 139u8, 253u8, 97u8, 187u8, 254u8, 201u8, 66u8, 166u8, 226u8, + 90u8, + ], + ) + } + #[doc = "Declare no desire to either validate or nominate."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Independent of the arguments. Insignificant complexity."] + #[doc = "- Contains one read."] + #[doc = "- Writes are limited to the `origin` account key."] + #[doc = "# "] + pub fn chill(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "chill", + Chill {}, + [ + 94u8, 20u8, 196u8, 31u8, 220u8, 125u8, 115u8, 167u8, 140u8, 3u8, 20u8, + 132u8, 81u8, 120u8, 215u8, 166u8, 230u8, 56u8, 16u8, 222u8, 31u8, + 153u8, 120u8, 62u8, 153u8, 67u8, 220u8, 239u8, 11u8, 234u8, 127u8, + 122u8, + ], + ) + } + #[doc = "(Re-)set the payment target for a controller."] + #[doc = ""] + #[doc = "Effects will be felt instantly (as soon as this function is completed successfully)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Independent of the arguments. Insignificant complexity."] + #[doc = "- Contains a limited number of reads."] + #[doc = "- Writes are limited to the `origin` account key."] + #[doc = "---------"] + #[doc = "- Weight: O(1)"] + #[doc = "- DB Weight:"] + #[doc = " - Read: Ledger"] + #[doc = " - Write: Payee"] + #[doc = "# "] + pub fn set_payee( + &self, + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "set_payee", + SetPayee { payee }, + [ + 96u8, 8u8, 254u8, 164u8, 87u8, 46u8, 120u8, 11u8, 197u8, 63u8, 20u8, + 178u8, 167u8, 236u8, 149u8, 245u8, 14u8, 171u8, 108u8, 195u8, 250u8, + 133u8, 0u8, 75u8, 192u8, 159u8, 84u8, 220u8, 242u8, 133u8, 60u8, 62u8, + ], + ) + } + #[doc = "(Re-)set the controller of a stash."] + #[doc = ""] + #[doc = "Effects will be felt instantly (as soon as this function is completed successfully)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the stash, not the controller."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Independent of the arguments. Insignificant complexity."] + #[doc = "- Contains a limited number of reads."] + #[doc = "- Writes are limited to the `origin` account key."] + #[doc = "----------"] + #[doc = "Weight: O(1)"] + #[doc = "DB Weight:"] + #[doc = "- Read: Bonded, Ledger New Controller, Ledger Old Controller"] + #[doc = "- Write: Bonded, Ledger New Controller, Ledger Old Controller"] + #[doc = "# "] + pub fn set_controller( + &self, + controller: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "set_controller", + SetController { controller }, + [ + 165u8, 250u8, 213u8, 32u8, 179u8, 163u8, 15u8, 35u8, 14u8, 152u8, 56u8, + 171u8, 43u8, 101u8, 7u8, 167u8, 178u8, 60u8, 89u8, 186u8, 59u8, 28u8, + 82u8, 159u8, 13u8, 96u8, 168u8, 123u8, 194u8, 212u8, 205u8, 184u8, + ], + ) + } + #[doc = "Sets the ideal number of validators."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight: O(1)"] + #[doc = "Write: Validator Count"] + #[doc = "# "] + pub fn set_validator_count( + &self, + new: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "set_validator_count", + SetValidatorCount { new }, + [ + 55u8, 232u8, 95u8, 66u8, 228u8, 217u8, 11u8, 27u8, 3u8, 202u8, 199u8, + 242u8, 70u8, 160u8, 250u8, 187u8, 194u8, 91u8, 15u8, 36u8, 215u8, 36u8, + 160u8, 108u8, 251u8, 60u8, 240u8, 202u8, 249u8, 235u8, 28u8, 94u8, + ], + ) + } + #[doc = "Increments the ideal number of validators."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# "] + #[doc = "Same as [`Self::set_validator_count`]."] + #[doc = "# "] + pub fn increase_validator_count( + &self, + additional: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "increase_validator_count", + IncreaseValidatorCount { additional }, + [ + 239u8, 184u8, 155u8, 213u8, 25u8, 22u8, 193u8, 13u8, 102u8, 192u8, + 82u8, 153u8, 249u8, 192u8, 60u8, 158u8, 8u8, 78u8, 175u8, 219u8, 46u8, + 51u8, 222u8, 193u8, 193u8, 201u8, 78u8, 90u8, 58u8, 86u8, 196u8, 17u8, + ], + ) + } + #[doc = "Scale up the ideal number of validators by a factor."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# "] + #[doc = "Same as [`Self::set_validator_count`]."] + #[doc = "# "] + pub fn scale_validator_count( + &self, + factor: runtime_types::sp_arithmetic::per_things::Percent, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "scale_validator_count", + ScaleValidatorCount { factor }, + [ + 198u8, 68u8, 227u8, 94u8, 110u8, 157u8, 209u8, 217u8, 112u8, 37u8, + 78u8, 142u8, 12u8, 193u8, 219u8, 167u8, 149u8, 112u8, 49u8, 139u8, + 74u8, 81u8, 172u8, 72u8, 253u8, 224u8, 56u8, 194u8, 185u8, 90u8, 87u8, + 125u8, + ], + ) + } + #[doc = "Force there to be no new eras indefinitely."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# Warning"] + #[doc = ""] + #[doc = "The election process starts multiple blocks before the end of the era."] + #[doc = "Thus the election process may be ongoing when this is called. In this case the"] + #[doc = "election will continue until the next era is triggered."] + #[doc = ""] + #[doc = "# "] + #[doc = "- No arguments."] + #[doc = "- Weight: O(1)"] + #[doc = "- Write: ForceEra"] + #[doc = "# "] + pub fn force_no_eras(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "force_no_eras", + ForceNoEras {}, + [ + 16u8, 81u8, 207u8, 168u8, 23u8, 236u8, 11u8, 75u8, 141u8, 107u8, 92u8, + 2u8, 53u8, 111u8, 252u8, 116u8, 91u8, 120u8, 75u8, 24u8, 125u8, 53u8, + 9u8, 28u8, 242u8, 87u8, 245u8, 55u8, 40u8, 103u8, 151u8, 178u8, + ], + ) + } + #[doc = "Force there to be a new era at the end of the next session. After this, it will be"] + #[doc = "reset to normal (non-forced) behaviour."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# Warning"] + #[doc = ""] + #[doc = "The election process starts multiple blocks before the end of the era."] + #[doc = "If this is called just before a new era is triggered, the election process may not"] + #[doc = "have enough blocks to get a result."] + #[doc = ""] + #[doc = "# "] + #[doc = "- No arguments."] + #[doc = "- Weight: O(1)"] + #[doc = "- Write ForceEra"] + #[doc = "# "] + pub fn force_new_era(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "force_new_era", + ForceNewEra {}, + [ + 230u8, 242u8, 169u8, 196u8, 78u8, 145u8, 24u8, 191u8, 113u8, 68u8, 5u8, + 138u8, 48u8, 51u8, 109u8, 126u8, 73u8, 136u8, 162u8, 158u8, 174u8, + 201u8, 213u8, 230u8, 215u8, 44u8, 200u8, 32u8, 75u8, 27u8, 23u8, 254u8, + ], + ) + } + #[doc = "Set the validators who cannot be slashed (if any)."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + pub fn set_invulnerables( + &self, + invulnerables: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "set_invulnerables", + SetInvulnerables { invulnerables }, + [ + 2u8, 148u8, 221u8, 111u8, 153u8, 48u8, 222u8, 36u8, 228u8, 84u8, 18u8, + 35u8, 168u8, 239u8, 53u8, 245u8, 27u8, 76u8, 18u8, 203u8, 206u8, 9u8, + 8u8, 81u8, 35u8, 224u8, 22u8, 133u8, 58u8, 99u8, 103u8, 39u8, + ], + ) + } + #[doc = "Force a current staker to become completely unstaked, immediately."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + pub fn force_unstake( + &self, + stash: ::subxt::ext::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "force_unstake", + ForceUnstake { + stash, + num_slashing_spans, + }, + [ + 94u8, 247u8, 238u8, 47u8, 250u8, 6u8, 96u8, 175u8, 173u8, 123u8, 161u8, + 187u8, 162u8, 214u8, 176u8, 233u8, 33u8, 33u8, 167u8, 239u8, 40u8, + 223u8, 19u8, 131u8, 230u8, 39u8, 175u8, 200u8, 36u8, 182u8, 76u8, + 207u8, + ], + ) + } + #[doc = "Force there to be a new era at the end of sessions indefinitely."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# Warning"] + #[doc = ""] + #[doc = "The election process starts multiple blocks before the end of the era."] + #[doc = "If this is called just before a new era is triggered, the election process may not"] + #[doc = "have enough blocks to get a result."] + pub fn force_new_era_always( + &self, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "force_new_era_always", + ForceNewEraAlways {}, + [ + 179u8, 118u8, 189u8, 54u8, 248u8, 141u8, 207u8, 142u8, 80u8, 37u8, + 241u8, 185u8, 138u8, 254u8, 117u8, 147u8, 225u8, 118u8, 34u8, 177u8, + 197u8, 158u8, 8u8, 82u8, 202u8, 108u8, 208u8, 26u8, 64u8, 33u8, 74u8, + 43u8, + ], + ) + } + #[doc = "Cancel enactment of a deferred slash."] + #[doc = ""] + #[doc = "Can be called by the `T::SlashCancelOrigin`."] + #[doc = ""] + #[doc = "Parameters: era and indices of the slashes for that era to kill."] + pub fn cancel_deferred_slash( + &self, + era: ::core::primitive::u32, + slash_indices: ::std::vec::Vec<::core::primitive::u32>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "cancel_deferred_slash", + CancelDeferredSlash { era, slash_indices }, + [ + 120u8, 57u8, 162u8, 105u8, 91u8, 250u8, 129u8, 240u8, 110u8, 234u8, + 170u8, 98u8, 164u8, 65u8, 106u8, 101u8, 19u8, 88u8, 146u8, 210u8, + 171u8, 44u8, 37u8, 50u8, 65u8, 178u8, 37u8, 223u8, 239u8, 197u8, 116u8, + 168u8, + ], + ) + } + #[doc = "Pay out all the stakers behind a single validator for a single era."] + #[doc = ""] + #[doc = "- `validator_stash` is the stash account of the validator. Their nominators, up to"] + #[doc = " `T::MaxNominatorRewardedPerValidator`, will also receive their rewards."] + #[doc = "- `era` may be any era between `[current_era - history_depth; current_era]`."] + #[doc = ""] + #[doc = "The origin of this call must be _Signed_. Any account can call this function, even if"] + #[doc = "it is not one of the stakers."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Time complexity: at most O(MaxNominatorRewardedPerValidator)."] + #[doc = "- Contains a limited number of reads and writes."] + #[doc = "-----------"] + #[doc = "N is the Number of payouts for the validator (including the validator)"] + #[doc = "Weight:"] + #[doc = "- Reward Destination Staked: O(N)"] + #[doc = "- Reward Destination Controller (Creating): O(N)"] + #[doc = ""] + #[doc = " NOTE: weights are assuming that payouts are made to alive stash account (Staked)."] + #[doc = " Paying even a dead controller is cheaper weight-wise. We don't do any refunds here."] + #[doc = "# "] + pub fn payout_stakers( + &self, + validator_stash: ::subxt::ext::sp_core::crypto::AccountId32, + era: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "payout_stakers", + PayoutStakers { + validator_stash, + era, + }, + [ + 184u8, 194u8, 33u8, 118u8, 7u8, 203u8, 89u8, 119u8, 214u8, 76u8, 178u8, + 20u8, 82u8, 111u8, 57u8, 132u8, 212u8, 43u8, 232u8, 91u8, 252u8, 49u8, + 42u8, 115u8, 1u8, 181u8, 154u8, 207u8, 144u8, 206u8, 205u8, 33u8, + ], + ) + } + #[doc = "Rebond a portion of the stash scheduled to be unlocked."] + #[doc = ""] + #[doc = "The dispatch origin must be signed by the controller."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Time complexity: O(L), where L is unlocking chunks"] + #[doc = "- Bounded by `MaxUnlockingChunks`."] + #[doc = "- Storage changes: Can't increase storage, only decrease it."] + #[doc = "# "] + pub fn rebond( + &self, + value: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "rebond", + Rebond { value }, + [ + 25u8, 22u8, 191u8, 172u8, 133u8, 101u8, 139u8, 102u8, 134u8, 16u8, + 136u8, 56u8, 137u8, 162u8, 4u8, 253u8, 196u8, 30u8, 234u8, 49u8, 102u8, + 68u8, 145u8, 96u8, 148u8, 219u8, 162u8, 17u8, 177u8, 184u8, 34u8, + 113u8, + ], + ) + } + #[doc = "Set `HistoryDepth` value. This function will delete any history information"] + #[doc = "when `HistoryDepth` is reduced."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `new_history_depth`: The new history depth you would like to set."] + #[doc = "- `era_items_deleted`: The number of items that will be deleted by this dispatch. This"] + #[doc = " should report all the storage items that will be deleted by clearing old era history."] + #[doc = " Needed to report an accurate weight for the dispatch. Trusted by `Root` to report an"] + #[doc = " accurate number."] + #[doc = ""] + #[doc = "Origin must be root."] + #[doc = ""] + #[doc = "# "] + #[doc = "- E: Number of history depths removed, i.e. 10 -> 7 = 3"] + #[doc = "- Weight: O(E)"] + #[doc = "- DB Weight:"] + #[doc = " - Reads: Current Era, History Depth"] + #[doc = " - Writes: History Depth"] + #[doc = " - Clear Prefix Each: Era Stakers, EraStakersClipped, ErasValidatorPrefs"] + #[doc = " - Writes Each: ErasValidatorReward, ErasRewardPoints, ErasTotalStake,"] + #[doc = " ErasStartSessionIndex"] + #[doc = "# "] + pub fn set_history_depth( + &self, + new_history_depth: ::core::primitive::u32, + era_items_deleted: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "set_history_depth", + SetHistoryDepth { + new_history_depth, + era_items_deleted, + }, + [ + 174u8, 55u8, 231u8, 132u8, 219u8, 215u8, 118u8, 202u8, 13u8, 151u8, + 193u8, 248u8, 141u8, 180u8, 56u8, 103u8, 90u8, 182u8, 194u8, 198u8, + 120u8, 251u8, 143u8, 218u8, 81u8, 59u8, 13u8, 161u8, 247u8, 57u8, + 178u8, 122u8, + ], + ) + } + #[doc = "Remove all data structures concerning a staker/stash once it is at a state where it can"] + #[doc = "be considered `dust` in the staking system. The requirements are:"] + #[doc = ""] + #[doc = "1. the `total_balance` of the stash is below existential deposit."] + #[doc = "2. or, the `ledger.total` of the stash is below existential deposit."] + #[doc = ""] + #[doc = "The former can happen in cases like a slash; the latter when a fully unbonded account"] + #[doc = "is still receiving staking rewards in `RewardDestination::Staked`."] + #[doc = ""] + #[doc = "It can be called by anyone, as long as `stash` meets the above requirements."] + #[doc = ""] + #[doc = "Refunds the transaction fees upon successful execution."] + pub fn reap_stash( + &self, + stash: ::subxt::ext::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "reap_stash", + ReapStash { + stash, + num_slashing_spans, + }, + [ + 34u8, 168u8, 120u8, 161u8, 95u8, 199u8, 106u8, 233u8, 61u8, 240u8, + 166u8, 31u8, 183u8, 165u8, 158u8, 179u8, 32u8, 130u8, 27u8, 164u8, + 112u8, 44u8, 14u8, 125u8, 227u8, 87u8, 70u8, 203u8, 194u8, 24u8, 212u8, + 177u8, + ], + ) + } + #[doc = "Remove the given nominations from the calling validator."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "- `who`: A list of nominator stash accounts who are nominating this validator which"] + #[doc = " should no longer be nominating this validator."] + #[doc = ""] + #[doc = "Note: Making this call only makes sense if you first set the validator preferences to"] + #[doc = "block any further nominations."] + pub fn kick( + &self, + who: ::std::vec::Vec< + ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "kick", + Kick { who }, + [ + 32u8, 26u8, 202u8, 6u8, 186u8, 180u8, 58u8, 121u8, 185u8, 208u8, 123u8, + 10u8, 53u8, 179u8, 167u8, 203u8, 96u8, 229u8, 7u8, 144u8, 231u8, 172u8, + 145u8, 141u8, 162u8, 180u8, 212u8, 42u8, 34u8, 5u8, 199u8, 82u8, + ], + ) + } + #[doc = "Update the various staking configurations ."] + #[doc = ""] + #[doc = "* `min_nominator_bond`: The minimum active bond needed to be a nominator."] + #[doc = "* `min_validator_bond`: The minimum active bond needed to be a validator."] + #[doc = "* `max_nominator_count`: The max number of users who can be a nominator at once. When"] + #[doc = " set to `None`, no limit is enforced."] + #[doc = "* `max_validator_count`: The max number of users who can be a validator at once. When"] + #[doc = " set to `None`, no limit is enforced."] + #[doc = "* `chill_threshold`: The ratio of `max_nominator_count` or `max_validator_count` which"] + #[doc = " should be filled in order for the `chill_other` transaction to work."] + #[doc = "* `min_commission`: The minimum amount of commission that each validators must maintain."] + #[doc = " This is checked only upon calling `validate`. Existing validators are not affected."] + #[doc = ""] + #[doc = "Origin must be Root to call this function."] + #[doc = ""] + #[doc = "NOTE: Existing nominators and validators will not be affected by this update."] + #[doc = "to kick people under the new limits, `chill_other` should be called."] + pub fn set_staking_configs( + &self, + min_nominator_bond: runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u128, + >, + min_validator_bond: runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u128, + >, + max_nominator_count: runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u32, + >, + max_validator_count: runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u32, + >, + chill_threshold: runtime_types::pallet_staking::pallet::pallet::ConfigOp< + runtime_types::sp_arithmetic::per_things::Percent, + >, + min_commission: runtime_types::pallet_staking::pallet::pallet::ConfigOp< + runtime_types::sp_arithmetic::per_things::Perbill, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "set_staking_configs", + SetStakingConfigs { + min_nominator_bond, + min_validator_bond, + max_nominator_count, + max_validator_count, + chill_threshold, + min_commission, + }, + [ + 176u8, 168u8, 155u8, 176u8, 27u8, 79u8, 223u8, 92u8, 88u8, 93u8, 223u8, + 69u8, 179u8, 250u8, 138u8, 138u8, 87u8, 220u8, 36u8, 3u8, 126u8, 213u8, + 16u8, 68u8, 3u8, 16u8, 218u8, 151u8, 98u8, 169u8, 217u8, 75u8, + ], + ) + } + #[doc = "Declare a `controller` to stop participating as either a validator or nominator."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_, but can be called by anyone."] + #[doc = ""] + #[doc = "If the caller is the same as the controller being targeted, then no further checks are"] + #[doc = "enforced, and this function behaves just like `chill`."] + #[doc = ""] + #[doc = "If the caller is different than the controller being targeted, the following conditions"] + #[doc = "must be met:"] + #[doc = ""] + #[doc = "* `controller` must belong to a nominator who has become non-decodable,"] + #[doc = ""] + #[doc = "Or:"] + #[doc = ""] + #[doc = "* A `ChillThreshold` must be set and checked which defines how close to the max"] + #[doc = " nominators or validators we must reach before users can start chilling one-another."] + #[doc = "* A `MaxNominatorCount` and `MaxValidatorCount` must be set which is used to determine"] + #[doc = " how close we are to the threshold."] + #[doc = "* A `MinNominatorBond` and `MinValidatorBond` must be set and checked, which determines"] + #[doc = " if this is a person that should be chilled because they have not met the threshold"] + #[doc = " bond required."] + #[doc = ""] + #[doc = "This can be helpful if bond requirements are updated, and we need to remove old users"] + #[doc = "who do not satisfy these requirements."] + pub fn chill_other( + &self, + controller: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "chill_other", + ChillOther { controller }, + [ + 140u8, 98u8, 4u8, 203u8, 91u8, 131u8, 123u8, 119u8, 169u8, 47u8, 188u8, + 23u8, 205u8, 170u8, 82u8, 220u8, 166u8, 170u8, 135u8, 176u8, 68u8, + 228u8, 14u8, 67u8, 42u8, 52u8, 140u8, 231u8, 62u8, 167u8, 80u8, 173u8, + ], + ) + } + #[doc = "Force a validator to have at least the minimum commission. This will not affect a"] + #[doc = "validator who already has a commission greater than or equal to the minimum. Any account"] + #[doc = "can call this."] + pub fn force_apply_min_commission( + &self, + validator_stash: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "force_apply_min_commission", + ForceApplyMinCommission { validator_stash }, + [ + 136u8, 163u8, 85u8, 134u8, 240u8, 247u8, 183u8, 227u8, 226u8, 202u8, + 102u8, 186u8, 138u8, 119u8, 78u8, 123u8, 229u8, 135u8, 129u8, 241u8, + 119u8, 106u8, 41u8, 182u8, 121u8, 181u8, 242u8, 175u8, 74u8, 207u8, + 64u8, 106u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_staking::pallet::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The era payout has been set; the first balance is the validator-payout; the second is"] + #[doc = "the remainder from the maximum amount of reward."] + #[doc = "\\[era_index, validator_payout, remainder\\]"] + pub struct EraPaid( + pub ::core::primitive::u32, + pub ::core::primitive::u128, + pub ::core::primitive::u128, + ); + impl ::subxt::events::StaticEvent for EraPaid { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "EraPaid"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The nominator has been rewarded by this amount. \\[stash, amount\\]"] + pub struct Rewarded( + pub ::subxt::ext::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::events::StaticEvent for Rewarded { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Rewarded"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "One validator (and its nominators) has been slashed by the given amount."] + #[doc = "\\[validator, amount\\]"] + pub struct Slashed( + pub ::subxt::ext::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::events::StaticEvent for Slashed { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Slashed"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An old slashing report from a prior era was discarded because it could"] + #[doc = "not be processed. \\[session_index\\]"] + pub struct OldSlashingReportDiscarded(pub ::core::primitive::u32); + impl ::subxt::events::StaticEvent for OldSlashingReportDiscarded { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "OldSlashingReportDiscarded"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A new set of stakers was elected."] + pub struct StakersElected; + impl ::subxt::events::StaticEvent for StakersElected { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "StakersElected"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An account has bonded this amount. \\[stash, amount\\]"] + #[doc = ""] + #[doc = "NOTE: This event is only emitted when funds are bonded via a dispatchable. Notably,"] + #[doc = "it will not be emitted for staking rewards when they are added to stake."] + pub struct Bonded( + pub ::subxt::ext::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::events::StaticEvent for Bonded { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Bonded"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An account has unbonded this amount. \\[stash, amount\\]"] + pub struct Unbonded( + pub ::subxt::ext::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::events::StaticEvent for Unbonded { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Unbonded"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An account has called `withdraw_unbonded` and removed unbonding chunks worth `Balance`"] + #[doc = "from the unlocking queue. \\[stash, amount\\]"] + pub struct Withdrawn( + pub ::subxt::ext::sp_core::crypto::AccountId32, + pub ::core::primitive::u128, + ); + impl ::subxt::events::StaticEvent for Withdrawn { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Withdrawn"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A nominator has been kicked from a validator. \\[nominator, stash\\]"] + pub struct Kicked( + pub ::subxt::ext::sp_core::crypto::AccountId32, + pub ::subxt::ext::sp_core::crypto::AccountId32, + ); + impl ::subxt::events::StaticEvent for Kicked { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Kicked"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The election failed. No new era is planned."] + pub struct StakingElectionFailed; + impl ::subxt::events::StaticEvent for StakingElectionFailed { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "StakingElectionFailed"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An account has stopped participating as either a validator or nominator."] + #[doc = "\\[stash\\]"] + pub struct Chilled(pub ::subxt::ext::sp_core::crypto::AccountId32); + impl ::subxt::events::StaticEvent for Chilled { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "Chilled"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The stakers' rewards are getting paid. \\[era_index, validator_stash\\]"] + pub struct PayoutStarted( + pub ::core::primitive::u32, + pub ::subxt::ext::sp_core::crypto::AccountId32, + ); + impl ::subxt::events::StaticEvent for PayoutStarted { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "PayoutStarted"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A validator has set their preferences."] + pub struct ValidatorPrefsSet( + pub ::subxt::ext::sp_core::crypto::AccountId32, + pub runtime_types::pallet_staking::ValidatorPrefs, + ); + impl ::subxt::events::StaticEvent for ValidatorPrefsSet { + const PALLET: &'static str = "Staking"; + const EVENT: &'static str = "ValidatorPrefsSet"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Number of eras to keep in history."] + #[doc = ""] + #[doc = " Information is kept for eras in `[current_era - history_depth; current_era]`."] + #[doc = ""] + #[doc = " Must be more than the number of eras delayed by session otherwise. I.e. active era must"] + #[doc = " always be in history. I.e. `active_era > current_era - history_depth` must be"] + #[doc = " guaranteed."] + pub fn history_depth( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "HistoryDepth", + vec![], + [ + 41u8, 54u8, 118u8, 245u8, 75u8, 136u8, 220u8, 25u8, 55u8, 255u8, 149u8, + 177u8, 49u8, 155u8, 167u8, 188u8, 170u8, 29u8, 251u8, 44u8, 240u8, + 250u8, 225u8, 205u8, 102u8, 74u8, 25u8, 47u8, 52u8, 235u8, 204u8, + 167u8, + ], + ) + } + #[doc = " The ideal number of staking participants."] + pub fn validator_count( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ValidatorCount", + vec![], + [ + 245u8, 75u8, 214u8, 110u8, 66u8, 164u8, 86u8, 206u8, 69u8, 89u8, 12u8, + 111u8, 117u8, 16u8, 228u8, 184u8, 207u8, 6u8, 0u8, 126u8, 221u8, 67u8, + 125u8, 218u8, 188u8, 245u8, 156u8, 188u8, 34u8, 85u8, 208u8, 197u8, + ], + ) + } + #[doc = " Minimum number of staking participants before emergency conditions are imposed."] + pub fn minimum_validator_count( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "MinimumValidatorCount", + vec![], + [ + 82u8, 95u8, 128u8, 55u8, 136u8, 134u8, 71u8, 117u8, 135u8, 76u8, 44u8, + 46u8, 174u8, 34u8, 170u8, 228u8, 175u8, 1u8, 234u8, 162u8, 91u8, 252u8, + 127u8, 68u8, 243u8, 241u8, 13u8, 107u8, 214u8, 70u8, 87u8, 249u8, + ], + ) + } + #[doc = " Any validators that may never be slashed or forcibly kicked. It's a Vec since they're"] + #[doc = " easy to initialize and the performance hit is minimal (we expect no more than four"] + #[doc = " invulnerables) and restricted to testnets."] + pub fn invulnerables( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Invulnerables", + vec![], + [ + 77u8, 78u8, 63u8, 199u8, 150u8, 167u8, 135u8, 130u8, 192u8, 51u8, + 202u8, 119u8, 68u8, 49u8, 241u8, 68u8, 82u8, 90u8, 226u8, 201u8, 96u8, + 170u8, 21u8, 173u8, 236u8, 116u8, 148u8, 8u8, 174u8, 92u8, 7u8, 11u8, + ], + ) + } + #[doc = " Map from all locked \"stash\" accounts to the controller account."] + pub fn bonded( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::crypto::AccountId32>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Bonded", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 35u8, 197u8, 156u8, 60u8, 22u8, 59u8, 103u8, 83u8, 77u8, 15u8, 118u8, + 193u8, 155u8, 97u8, 229u8, 36u8, 119u8, 128u8, 224u8, 162u8, 21u8, + 46u8, 199u8, 221u8, 15u8, 74u8, 59u8, 70u8, 77u8, 218u8, 73u8, 165u8, + ], + ) + } + #[doc = " Map from all locked \"stash\" accounts to the controller account."] + pub fn bonded_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::crypto::AccountId32>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Bonded", + Vec::new(), + [ + 35u8, 197u8, 156u8, 60u8, 22u8, 59u8, 103u8, 83u8, 77u8, 15u8, 118u8, + 193u8, 155u8, 97u8, 229u8, 36u8, 119u8, 128u8, 224u8, 162u8, 21u8, + 46u8, 199u8, 221u8, 15u8, 74u8, 59u8, 70u8, 77u8, 218u8, 73u8, 165u8, + ], + ) + } + #[doc = " The minimum active bond to become and maintain the role of a nominator."] + pub fn min_nominator_bond( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "MinNominatorBond", + vec![], + [ + 187u8, 66u8, 149u8, 226u8, 72u8, 219u8, 57u8, 246u8, 102u8, 47u8, 71u8, + 12u8, 219u8, 204u8, 127u8, 223u8, 58u8, 134u8, 81u8, 165u8, 200u8, + 142u8, 196u8, 158u8, 26u8, 38u8, 165u8, 19u8, 91u8, 251u8, 119u8, 84u8, + ], + ) + } + #[doc = " The minimum active bond to become and maintain the role of a validator."] + pub fn min_validator_bond( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "MinValidatorBond", + vec![], + [ + 48u8, 105u8, 85u8, 178u8, 142u8, 208u8, 208u8, 19u8, 236u8, 130u8, + 129u8, 169u8, 35u8, 245u8, 66u8, 182u8, 92u8, 20u8, 22u8, 109u8, 155u8, + 174u8, 87u8, 118u8, 242u8, 216u8, 193u8, 154u8, 4u8, 5u8, 66u8, 56u8, + ], + ) + } + #[doc = " The minimum amount of commission that validators can set."] + #[doc = ""] + #[doc = " If set to `0`, no limit exists."] + pub fn min_commission( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_arithmetic::per_things::Perbill, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "MinCommission", + vec![], + [ + 61u8, 101u8, 69u8, 27u8, 220u8, 179u8, 5u8, 71u8, 66u8, 227u8, 84u8, + 98u8, 18u8, 141u8, 183u8, 49u8, 98u8, 46u8, 123u8, 114u8, 198u8, 85u8, + 15u8, 175u8, 243u8, 239u8, 133u8, 129u8, 146u8, 174u8, 254u8, 158u8, + ], + ) + } + #[doc = " Map from all (unlocked) \"controller\" accounts to the info regarding the staking."] + pub fn ledger( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::StakingLedger, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Ledger", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 117u8, 177u8, 209u8, 237u8, 0u8, 30u8, 228u8, 128u8, 150u8, 69u8, + 138u8, 21u8, 9u8, 74u8, 178u8, 113u8, 238u8, 111u8, 57u8, 222u8, 242u8, + 241u8, 191u8, 50u8, 225u8, 51u8, 99u8, 211u8, 210u8, 163u8, 60u8, + 205u8, + ], + ) + } + #[doc = " Map from all (unlocked) \"controller\" accounts to the info regarding the staking."] + pub fn ledger_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::StakingLedger, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Ledger", + Vec::new(), + [ + 117u8, 177u8, 209u8, 237u8, 0u8, 30u8, 228u8, 128u8, 150u8, 69u8, + 138u8, 21u8, 9u8, 74u8, 178u8, 113u8, 238u8, 111u8, 57u8, 222u8, 242u8, + 241u8, 191u8, 50u8, 225u8, 51u8, 99u8, 211u8, 210u8, 163u8, 60u8, + 205u8, + ], + ) + } + #[doc = " Where the reward payment should be made. Keyed by stash."] + pub fn payee( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::RewardDestination< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Payee", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 195u8, 125u8, 82u8, 213u8, 216u8, 64u8, 76u8, 63u8, 187u8, 163u8, 20u8, + 230u8, 153u8, 13u8, 189u8, 232u8, 119u8, 118u8, 107u8, 17u8, 102u8, + 245u8, 36u8, 42u8, 232u8, 137u8, 177u8, 165u8, 169u8, 246u8, 199u8, + 57u8, + ], + ) + } + #[doc = " Where the reward payment should be made. Keyed by stash."] + pub fn payee_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::RewardDestination< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Payee", + Vec::new(), + [ + 195u8, 125u8, 82u8, 213u8, 216u8, 64u8, 76u8, 63u8, 187u8, 163u8, 20u8, + 230u8, 153u8, 13u8, 189u8, 232u8, 119u8, 118u8, 107u8, 17u8, 102u8, + 245u8, 36u8, 42u8, 232u8, 137u8, 177u8, 165u8, 169u8, 246u8, 199u8, + 57u8, + ], + ) + } + #[doc = " The map from (wannabe) validator stash key to the preferences of that validator."] + pub fn validators( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::ValidatorPrefs, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Validators", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 80u8, 77u8, 66u8, 18u8, 197u8, 250u8, 41u8, 185u8, 43u8, 24u8, 149u8, + 164u8, 208u8, 60u8, 144u8, 29u8, 251u8, 195u8, 236u8, 196u8, 108u8, + 58u8, 80u8, 115u8, 246u8, 66u8, 226u8, 241u8, 201u8, 172u8, 229u8, + 152u8, + ], + ) + } + #[doc = " The map from (wannabe) validator stash key to the preferences of that validator."] + pub fn validators_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::ValidatorPrefs, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Validators", + Vec::new(), + [ + 80u8, 77u8, 66u8, 18u8, 197u8, 250u8, 41u8, 185u8, 43u8, 24u8, 149u8, + 164u8, 208u8, 60u8, 144u8, 29u8, 251u8, 195u8, 236u8, 196u8, 108u8, + 58u8, 80u8, 115u8, 246u8, 66u8, 226u8, 241u8, 201u8, 172u8, 229u8, + 152u8, + ], + ) + } + #[doc = "Counter for the related counted storage map"] + pub fn counter_for_validators( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "CounterForValidators", + vec![], + [ + 139u8, 25u8, 223u8, 6u8, 160u8, 239u8, 212u8, 85u8, 36u8, 185u8, 69u8, + 63u8, 21u8, 156u8, 144u8, 241u8, 112u8, 85u8, 49u8, 78u8, 88u8, 11u8, + 8u8, 48u8, 118u8, 34u8, 62u8, 159u8, 239u8, 122u8, 90u8, 45u8, + ], + ) + } + #[doc = " The maximum validator count before we stop allowing new validators to join."] + #[doc = ""] + #[doc = " When this value is not set, no limits are enforced."] + pub fn max_validators_count( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "MaxValidatorsCount", + vec![], + [ + 250u8, 62u8, 16u8, 68u8, 192u8, 216u8, 236u8, 211u8, 217u8, 9u8, 213u8, + 49u8, 41u8, 37u8, 58u8, 62u8, 131u8, 112u8, 64u8, 26u8, 133u8, 7u8, + 130u8, 1u8, 71u8, 158u8, 14u8, 55u8, 169u8, 239u8, 223u8, 245u8, + ], + ) + } + #[doc = " The map from nominator stash key to their nomination preferences, namely the validators that"] + #[doc = " they wish to support."] + #[doc = ""] + #[doc = " Note that the keys of this storage map might become non-decodable in case the"] + #[doc = " [`Config::MaxNominations`] configuration is decreased. In this rare case, these nominators"] + #[doc = " are still existent in storage, their key is correct and retrievable (i.e. `contains_key`"] + #[doc = " indicates that they exist), but their value cannot be decoded. Therefore, the non-decodable"] + #[doc = " nominators will effectively not-exist, until they re-submit their preferences such that it"] + #[doc = " is within the bounds of the newly set `Config::MaxNominations`."] + #[doc = ""] + #[doc = " This implies that `::iter_keys().count()` and `::iter().count()` might return different"] + #[doc = " values for this map. Moreover, the main `::count()` is aligned with the former, namely the"] + #[doc = " number of keys that exist."] + #[doc = ""] + #[doc = " Lastly, if any of the nominators become non-decodable, they can be chilled immediately via"] + #[doc = " [`Call::chill_other`] dispatchable by anyone."] + pub fn nominators( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Nominators", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 1u8, 154u8, 55u8, 170u8, 215u8, 64u8, 56u8, 83u8, 254u8, 19u8, 152u8, + 85u8, 164u8, 171u8, 206u8, 129u8, 184u8, 45u8, 221u8, 181u8, 229u8, + 133u8, 200u8, 231u8, 16u8, 146u8, 247u8, 21u8, 77u8, 122u8, 165u8, + 134u8, + ], + ) + } + #[doc = " The map from nominator stash key to their nomination preferences, namely the validators that"] + #[doc = " they wish to support."] + #[doc = ""] + #[doc = " Note that the keys of this storage map might become non-decodable in case the"] + #[doc = " [`Config::MaxNominations`] configuration is decreased. In this rare case, these nominators"] + #[doc = " are still existent in storage, their key is correct and retrievable (i.e. `contains_key`"] + #[doc = " indicates that they exist), but their value cannot be decoded. Therefore, the non-decodable"] + #[doc = " nominators will effectively not-exist, until they re-submit their preferences such that it"] + #[doc = " is within the bounds of the newly set `Config::MaxNominations`."] + #[doc = ""] + #[doc = " This implies that `::iter_keys().count()` and `::iter().count()` might return different"] + #[doc = " values for this map. Moreover, the main `::count()` is aligned with the former, namely the"] + #[doc = " number of keys that exist."] + #[doc = ""] + #[doc = " Lastly, if any of the nominators become non-decodable, they can be chilled immediately via"] + #[doc = " [`Call::chill_other`] dispatchable by anyone."] + pub fn nominators_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Nominators", + Vec::new(), + [ + 1u8, 154u8, 55u8, 170u8, 215u8, 64u8, 56u8, 83u8, 254u8, 19u8, 152u8, + 85u8, 164u8, 171u8, 206u8, 129u8, 184u8, 45u8, 221u8, 181u8, 229u8, + 133u8, 200u8, 231u8, 16u8, 146u8, 247u8, 21u8, 77u8, 122u8, 165u8, + 134u8, + ], + ) + } + #[doc = "Counter for the related counted storage map"] + pub fn counter_for_nominators( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "CounterForNominators", + vec![], + [ + 31u8, 94u8, 130u8, 138u8, 75u8, 8u8, 38u8, 162u8, 181u8, 5u8, 125u8, + 116u8, 9u8, 51u8, 22u8, 234u8, 40u8, 117u8, 215u8, 46u8, 82u8, 117u8, + 225u8, 1u8, 9u8, 208u8, 83u8, 63u8, 39u8, 187u8, 207u8, 191u8, + ], + ) + } + #[doc = " The maximum nominator count before we stop allowing new validators to join."] + #[doc = ""] + #[doc = " When this value is not set, no limits are enforced."] + pub fn max_nominators_count( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "MaxNominatorsCount", + vec![], + [ + 180u8, 190u8, 180u8, 66u8, 235u8, 173u8, 76u8, 160u8, 197u8, 92u8, + 96u8, 165u8, 220u8, 188u8, 32u8, 119u8, 3u8, 73u8, 86u8, 49u8, 104u8, + 17u8, 186u8, 98u8, 221u8, 175u8, 109u8, 254u8, 207u8, 245u8, 125u8, + 179u8, + ], + ) + } + #[doc = " The current era index."] + #[doc = ""] + #[doc = " This is the latest planned era, depending on how the Session pallet queues the validator"] + #[doc = " set, it might be active or not."] + pub fn current_era( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "CurrentEra", + vec![], + [ + 105u8, 150u8, 49u8, 122u8, 4u8, 78u8, 8u8, 121u8, 34u8, 136u8, 157u8, + 227u8, 59u8, 139u8, 7u8, 253u8, 7u8, 10u8, 117u8, 71u8, 240u8, 74u8, + 86u8, 36u8, 198u8, 37u8, 153u8, 93u8, 196u8, 22u8, 192u8, 243u8, + ], + ) + } + #[doc = " The active era information, it holds index and start."] + #[doc = ""] + #[doc = " The active era is the era being currently rewarded. Validator set of this era must be"] + #[doc = " equal to [`SessionInterface::validators`]."] + pub fn active_era( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::ActiveEraInfo, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ActiveEra", + vec![], + [ + 15u8, 112u8, 251u8, 183u8, 108u8, 61u8, 28u8, 71u8, 44u8, 150u8, 162u8, + 4u8, 143u8, 121u8, 11u8, 37u8, 83u8, 29u8, 193u8, 21u8, 210u8, 116u8, + 190u8, 236u8, 213u8, 235u8, 49u8, 97u8, 189u8, 142u8, 251u8, 124u8, + ], + ) + } + #[doc = " The session index at which the era start for the last `HISTORY_DEPTH` eras."] + #[doc = ""] + #[doc = " Note: This tracks the starting session (i.e. session index when era start being active)"] + #[doc = " for the eras in `[CurrentEra - HISTORY_DEPTH, CurrentEra]`."] + pub fn eras_start_session_index( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasStartSessionIndex", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 92u8, 157u8, 168u8, 144u8, 132u8, 3u8, 212u8, 80u8, 230u8, 229u8, + 251u8, 218u8, 97u8, 55u8, 79u8, 100u8, 163u8, 91u8, 32u8, 246u8, 122u8, + 78u8, 149u8, 214u8, 103u8, 249u8, 119u8, 20u8, 101u8, 116u8, 110u8, + 185u8, + ], + ) + } + #[doc = " The session index at which the era start for the last `HISTORY_DEPTH` eras."] + #[doc = ""] + #[doc = " Note: This tracks the starting session (i.e. session index when era start being active)"] + #[doc = " for the eras in `[CurrentEra - HISTORY_DEPTH, CurrentEra]`."] + pub fn eras_start_session_index_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasStartSessionIndex", + Vec::new(), + [ + 92u8, 157u8, 168u8, 144u8, 132u8, 3u8, 212u8, 80u8, 230u8, 229u8, + 251u8, 218u8, 97u8, 55u8, 79u8, 100u8, 163u8, 91u8, 32u8, 246u8, 122u8, + 78u8, 149u8, 214u8, 103u8, 249u8, 119u8, 20u8, 101u8, 116u8, 110u8, + 185u8, + ], + ) + } + #[doc = " Exposure of validator at era."] + #[doc = ""] + #[doc = " This is keyed first by the era index to allow bulk deletion and then the stash account."] + #[doc = ""] + #[doc = " Is it removed after `HISTORY_DEPTH` eras."] + #[doc = " If stakers hasn't been set or has been removed then empty exposure is returned."] + pub fn eras_stakers( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::Exposure< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasStakers", + vec![ + ::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ::subxt::storage::address::StorageMapKey::new( + _1.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ], + [ + 192u8, 50u8, 152u8, 151u8, 92u8, 180u8, 206u8, 15u8, 139u8, 210u8, + 128u8, 65u8, 92u8, 253u8, 43u8, 35u8, 139u8, 171u8, 73u8, 185u8, 32u8, + 78u8, 20u8, 197u8, 154u8, 90u8, 233u8, 231u8, 23u8, 22u8, 187u8, 156u8, + ], + ) + } + #[doc = " Exposure of validator at era."] + #[doc = ""] + #[doc = " This is keyed first by the era index to allow bulk deletion and then the stash account."] + #[doc = ""] + #[doc = " Is it removed after `HISTORY_DEPTH` eras."] + #[doc = " If stakers hasn't been set or has been removed then empty exposure is returned."] + pub fn eras_stakers_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::Exposure< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasStakers", + Vec::new(), + [ + 192u8, 50u8, 152u8, 151u8, 92u8, 180u8, 206u8, 15u8, 139u8, 210u8, + 128u8, 65u8, 92u8, 253u8, 43u8, 35u8, 139u8, 171u8, 73u8, 185u8, 32u8, + 78u8, 20u8, 197u8, 154u8, 90u8, 233u8, 231u8, 23u8, 22u8, 187u8, 156u8, + ], + ) + } + #[doc = " Clipped Exposure of validator at era."] + #[doc = ""] + #[doc = " This is similar to [`ErasStakers`] but number of nominators exposed is reduced to the"] + #[doc = " `T::MaxNominatorRewardedPerValidator` biggest stakers."] + #[doc = " (Note: the field `total` and `own` of the exposure remains unchanged)."] + #[doc = " This is used to limit the i/o cost for the nominator payout."] + #[doc = ""] + #[doc = " This is keyed fist by the era index to allow bulk deletion and then the stash account."] + #[doc = ""] + #[doc = " Is it removed after `HISTORY_DEPTH` eras."] + #[doc = " If stakers hasn't been set or has been removed then empty exposure is returned."] + pub fn eras_stakers_clipped( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::Exposure< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasStakersClipped", + vec![ + ::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ::subxt::storage::address::StorageMapKey::new( + _1.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ], + [ + 43u8, 159u8, 113u8, 223u8, 122u8, 169u8, 98u8, 153u8, 26u8, 55u8, 71u8, + 119u8, 174u8, 48u8, 158u8, 45u8, 214u8, 26u8, 136u8, 215u8, 46u8, + 161u8, 185u8, 17u8, 174u8, 204u8, 206u8, 246u8, 49u8, 87u8, 134u8, + 169u8, + ], + ) + } + #[doc = " Clipped Exposure of validator at era."] + #[doc = ""] + #[doc = " This is similar to [`ErasStakers`] but number of nominators exposed is reduced to the"] + #[doc = " `T::MaxNominatorRewardedPerValidator` biggest stakers."] + #[doc = " (Note: the field `total` and `own` of the exposure remains unchanged)."] + #[doc = " This is used to limit the i/o cost for the nominator payout."] + #[doc = ""] + #[doc = " This is keyed fist by the era index to allow bulk deletion and then the stash account."] + #[doc = ""] + #[doc = " Is it removed after `HISTORY_DEPTH` eras."] + #[doc = " If stakers hasn't been set or has been removed then empty exposure is returned."] + pub fn eras_stakers_clipped_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::Exposure< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasStakersClipped", + Vec::new(), + [ + 43u8, 159u8, 113u8, 223u8, 122u8, 169u8, 98u8, 153u8, 26u8, 55u8, 71u8, + 119u8, 174u8, 48u8, 158u8, 45u8, 214u8, 26u8, 136u8, 215u8, 46u8, + 161u8, 185u8, 17u8, 174u8, 204u8, 206u8, 246u8, 49u8, 87u8, 134u8, + 169u8, + ], + ) + } + #[doc = " Similar to `ErasStakers`, this holds the preferences of validators."] + #[doc = ""] + #[doc = " This is keyed first by the era index to allow bulk deletion and then the stash account."] + #[doc = ""] + #[doc = " Is it removed after `HISTORY_DEPTH` eras."] + pub fn eras_validator_prefs( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::ValidatorPrefs, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasValidatorPrefs", + vec![ + ::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ::subxt::storage::address::StorageMapKey::new( + _1.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ], + [ + 6u8, 196u8, 209u8, 138u8, 252u8, 18u8, 203u8, 86u8, 129u8, 62u8, 4u8, + 56u8, 234u8, 114u8, 141u8, 136u8, 127u8, 224u8, 142u8, 89u8, 150u8, + 33u8, 31u8, 50u8, 140u8, 108u8, 124u8, 77u8, 188u8, 102u8, 230u8, + 174u8, + ], + ) + } + #[doc = " Similar to `ErasStakers`, this holds the preferences of validators."] + #[doc = ""] + #[doc = " This is keyed first by the era index to allow bulk deletion and then the stash account."] + #[doc = ""] + #[doc = " Is it removed after `HISTORY_DEPTH` eras."] + pub fn eras_validator_prefs_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::ValidatorPrefs, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasValidatorPrefs", + Vec::new(), + [ + 6u8, 196u8, 209u8, 138u8, 252u8, 18u8, 203u8, 86u8, 129u8, 62u8, 4u8, + 56u8, 234u8, 114u8, 141u8, 136u8, 127u8, 224u8, 142u8, 89u8, 150u8, + 33u8, 31u8, 50u8, 140u8, 108u8, 124u8, 77u8, 188u8, 102u8, 230u8, + 174u8, + ], + ) + } + #[doc = " The total validator era payout for the last `HISTORY_DEPTH` eras."] + #[doc = ""] + #[doc = " Eras that haven't finished yet or has been removed doesn't have reward."] + pub fn eras_validator_reward( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasValidatorReward", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 87u8, 80u8, 156u8, 123u8, 107u8, 77u8, 203u8, 37u8, 231u8, 84u8, 124u8, + 155u8, 227u8, 212u8, 212u8, 179u8, 84u8, 161u8, 223u8, 255u8, 254u8, + 107u8, 52u8, 89u8, 98u8, 169u8, 136u8, 241u8, 104u8, 3u8, 244u8, 161u8, + ], + ) + } + #[doc = " The total validator era payout for the last `HISTORY_DEPTH` eras."] + #[doc = ""] + #[doc = " Eras that haven't finished yet or has been removed doesn't have reward."] + pub fn eras_validator_reward_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasValidatorReward", + Vec::new(), + [ + 87u8, 80u8, 156u8, 123u8, 107u8, 77u8, 203u8, 37u8, 231u8, 84u8, 124u8, + 155u8, 227u8, 212u8, 212u8, 179u8, 84u8, 161u8, 223u8, 255u8, 254u8, + 107u8, 52u8, 89u8, 98u8, 169u8, 136u8, 241u8, 104u8, 3u8, 244u8, 161u8, + ], + ) + } + #[doc = " Rewards for the last `HISTORY_DEPTH` eras."] + #[doc = " If reward hasn't been set or has been removed then 0 reward is returned."] + pub fn eras_reward_points( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::EraRewardPoints< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasRewardPoints", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 194u8, 29u8, 20u8, 83u8, 200u8, 47u8, 158u8, 102u8, 88u8, 65u8, 24u8, + 255u8, 120u8, 178u8, 23u8, 232u8, 15u8, 64u8, 206u8, 0u8, 170u8, 40u8, + 18u8, 149u8, 45u8, 90u8, 179u8, 127u8, 52u8, 59u8, 37u8, 192u8, + ], + ) + } + #[doc = " Rewards for the last `HISTORY_DEPTH` eras."] + #[doc = " If reward hasn't been set or has been removed then 0 reward is returned."] + pub fn eras_reward_points_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::EraRewardPoints< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasRewardPoints", + Vec::new(), + [ + 194u8, 29u8, 20u8, 83u8, 200u8, 47u8, 158u8, 102u8, 88u8, 65u8, 24u8, + 255u8, 120u8, 178u8, 23u8, 232u8, 15u8, 64u8, 206u8, 0u8, 170u8, 40u8, + 18u8, 149u8, 45u8, 90u8, 179u8, 127u8, 52u8, 59u8, 37u8, 192u8, + ], + ) + } + #[doc = " The total amount staked for the last `HISTORY_DEPTH` eras."] + #[doc = " If total hasn't been set or has been removed then 0 stake is returned."] + pub fn eras_total_stake( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasTotalStake", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 224u8, 240u8, 168u8, 69u8, 148u8, 140u8, 249u8, 240u8, 4u8, 46u8, 77u8, + 11u8, 224u8, 65u8, 26u8, 239u8, 1u8, 110u8, 53u8, 11u8, 247u8, 235u8, + 142u8, 234u8, 22u8, 43u8, 24u8, 36u8, 37u8, 43u8, 170u8, 40u8, + ], + ) + } + #[doc = " The total amount staked for the last `HISTORY_DEPTH` eras."] + #[doc = " If total hasn't been set or has been removed then 0 stake is returned."] + pub fn eras_total_stake_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ErasTotalStake", + Vec::new(), + [ + 224u8, 240u8, 168u8, 69u8, 148u8, 140u8, 249u8, 240u8, 4u8, 46u8, 77u8, + 11u8, 224u8, 65u8, 26u8, 239u8, 1u8, 110u8, 53u8, 11u8, 247u8, 235u8, + 142u8, 234u8, 22u8, 43u8, 24u8, 36u8, 37u8, 43u8, 170u8, 40u8, + ], + ) + } + #[doc = " Mode of era forcing."] + pub fn force_era( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ForceEra", + vec![], + [ + 221u8, 41u8, 71u8, 21u8, 28u8, 193u8, 65u8, 97u8, 103u8, 37u8, 145u8, + 146u8, 183u8, 194u8, 57u8, 131u8, 214u8, 136u8, 68u8, 156u8, 140u8, + 194u8, 69u8, 151u8, 115u8, 177u8, 92u8, 147u8, 29u8, 40u8, 41u8, 31u8, + ], + ) + } + #[doc = " The percentage of the slash that is distributed to reporters."] + #[doc = ""] + #[doc = " The rest of the slashed value is handled by the `Slash`."] + pub fn slash_reward_fraction( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_arithmetic::per_things::Perbill, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "SlashRewardFraction", + vec![], + [ + 167u8, 79u8, 143u8, 202u8, 199u8, 100u8, 129u8, 162u8, 23u8, 165u8, + 106u8, 170u8, 244u8, 86u8, 144u8, 242u8, 65u8, 207u8, 115u8, 224u8, + 231u8, 155u8, 55u8, 139u8, 101u8, 129u8, 242u8, 196u8, 130u8, 50u8, + 3u8, 117u8, + ], + ) + } + #[doc = " The amount of currency given to reporters of a slash event which was"] + #[doc = " canceled by extraordinary circumstances (e.g. governance)."] + pub fn canceled_slash_payout( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "CanceledSlashPayout", + vec![], + [ + 126u8, 218u8, 66u8, 92u8, 82u8, 124u8, 145u8, 161u8, 40u8, 176u8, 14u8, + 211u8, 178u8, 216u8, 8u8, 156u8, 83u8, 14u8, 91u8, 15u8, 200u8, 170u8, + 3u8, 127u8, 141u8, 139u8, 151u8, 98u8, 74u8, 96u8, 238u8, 29u8, + ], + ) + } + #[doc = " All unapplied slashes that are queued for later."] + pub fn unapplied_slashes( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec< + runtime_types::pallet_staking::UnappliedSlash< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "UnappliedSlashes", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 130u8, 4u8, 163u8, 163u8, 28u8, 85u8, 34u8, 156u8, 47u8, 125u8, 57u8, + 0u8, 133u8, 176u8, 130u8, 2u8, 175u8, 180u8, 167u8, 203u8, 230u8, 82u8, + 198u8, 183u8, 55u8, 82u8, 221u8, 248u8, 100u8, 173u8, 206u8, 151u8, + ], + ) + } + #[doc = " All unapplied slashes that are queued for later."] + pub fn unapplied_slashes_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec< + runtime_types::pallet_staking::UnappliedSlash< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "UnappliedSlashes", + Vec::new(), + [ + 130u8, 4u8, 163u8, 163u8, 28u8, 85u8, 34u8, 156u8, 47u8, 125u8, 57u8, + 0u8, 133u8, 176u8, 130u8, 2u8, 175u8, 180u8, 167u8, 203u8, 230u8, 82u8, + 198u8, 183u8, 55u8, 82u8, 221u8, 248u8, 100u8, 173u8, 206u8, 151u8, + ], + ) + } + #[doc = " A mapping from still-bonded eras to the first session index of that era."] + #[doc = ""] + #[doc = " Must contains information for eras for the range:"] + #[doc = " `[active_era - bounding_duration; active_era]`"] + pub fn bonded_eras( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::u32)>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "BondedEras", + vec![], + [ + 243u8, 162u8, 236u8, 198u8, 122u8, 182u8, 37u8, 55u8, 171u8, 156u8, + 235u8, 223u8, 226u8, 129u8, 89u8, 206u8, 2u8, 155u8, 222u8, 154u8, + 116u8, 124u8, 4u8, 119u8, 155u8, 94u8, 248u8, 30u8, 171u8, 51u8, 78u8, + 106u8, + ], + ) + } + #[doc = " All slashing events on validators, mapped by era to the highest slash proportion"] + #[doc = " and slash value of the era."] + pub fn validator_slash_in_era( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + runtime_types::sp_arithmetic::per_things::Perbill, + ::core::primitive::u128, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ValidatorSlashInEra", + vec![ + ::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ::subxt::storage::address::StorageMapKey::new( + _1.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ], + [ + 237u8, 80u8, 3u8, 237u8, 9u8, 40u8, 212u8, 15u8, 251u8, 196u8, 85u8, + 29u8, 27u8, 151u8, 98u8, 122u8, 189u8, 147u8, 205u8, 40u8, 202u8, + 194u8, 158u8, 96u8, 138u8, 16u8, 116u8, 71u8, 140u8, 163u8, 121u8, + 197u8, + ], + ) + } + #[doc = " All slashing events on validators, mapped by era to the highest slash proportion"] + #[doc = " and slash value of the era."] + pub fn validator_slash_in_era_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + runtime_types::sp_arithmetic::per_things::Perbill, + ::core::primitive::u128, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ValidatorSlashInEra", + Vec::new(), + [ + 237u8, 80u8, 3u8, 237u8, 9u8, 40u8, 212u8, 15u8, 251u8, 196u8, 85u8, + 29u8, 27u8, 151u8, 98u8, 122u8, 189u8, 147u8, 205u8, 40u8, 202u8, + 194u8, 158u8, 96u8, 138u8, 16u8, 116u8, 71u8, 140u8, 163u8, 121u8, + 197u8, + ], + ) + } + #[doc = " All slashing events on nominators, mapped by era to the highest slash value of the era."] + pub fn nominator_slash_in_era( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "NominatorSlashInEra", + vec![ + ::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ::subxt::storage::address::StorageMapKey::new( + _1.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ], + [ + 249u8, 85u8, 170u8, 41u8, 179u8, 194u8, 180u8, 12u8, 53u8, 101u8, 80u8, + 96u8, 166u8, 71u8, 239u8, 23u8, 153u8, 19u8, 152u8, 38u8, 138u8, 136u8, + 221u8, 200u8, 18u8, 165u8, 26u8, 228u8, 195u8, 199u8, 62u8, 4u8, + ], + ) + } + #[doc = " All slashing events on nominators, mapped by era to the highest slash value of the era."] + pub fn nominator_slash_in_era_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "NominatorSlashInEra", + Vec::new(), + [ + 249u8, 85u8, 170u8, 41u8, 179u8, 194u8, 180u8, 12u8, 53u8, 101u8, 80u8, + 96u8, 166u8, 71u8, 239u8, 23u8, 153u8, 19u8, 152u8, 38u8, 138u8, 136u8, + 221u8, 200u8, 18u8, 165u8, 26u8, 228u8, 195u8, 199u8, 62u8, 4u8, + ], + ) + } + #[doc = " Slashing spans for stash accounts."] + pub fn slashing_spans( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::slashing::SlashingSpans, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "SlashingSpans", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 106u8, 115u8, 118u8, 52u8, 89u8, 77u8, 246u8, 5u8, 255u8, 204u8, 44u8, + 5u8, 66u8, 36u8, 227u8, 252u8, 86u8, 159u8, 186u8, 152u8, 196u8, 21u8, + 74u8, 201u8, 133u8, 93u8, 142u8, 191u8, 20u8, 27u8, 218u8, 157u8, + ], + ) + } + #[doc = " Slashing spans for stash accounts."] + pub fn slashing_spans_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::slashing::SlashingSpans, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "SlashingSpans", + Vec::new(), + [ + 106u8, 115u8, 118u8, 52u8, 89u8, 77u8, 246u8, 5u8, 255u8, 204u8, 44u8, + 5u8, 66u8, 36u8, 227u8, 252u8, 86u8, 159u8, 186u8, 152u8, 196u8, 21u8, + 74u8, 201u8, 133u8, 93u8, 142u8, 191u8, 20u8, 27u8, 218u8, 157u8, + ], + ) + } + #[doc = " Records information about the maximum slash of a stash within a slashing span,"] + #[doc = " as well as how much reward has been paid out."] + pub fn span_slash( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + _1: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::slashing::SpanRecord< + ::core::primitive::u128, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "SpanSlash", + vec![::subxt::storage::address::StorageMapKey::new( + &(_0.borrow(), _1.borrow()), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 160u8, 63u8, 115u8, 190u8, 233u8, 148u8, 75u8, 3u8, 11u8, 59u8, 184u8, + 220u8, 205u8, 64u8, 28u8, 190u8, 116u8, 210u8, 225u8, 230u8, 224u8, + 163u8, 103u8, 157u8, 100u8, 29u8, 86u8, 167u8, 84u8, 217u8, 109u8, + 200u8, + ], + ) + } + #[doc = " Records information about the maximum slash of a stash within a slashing span,"] + #[doc = " as well as how much reward has been paid out."] + pub fn span_slash_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::slashing::SpanRecord< + ::core::primitive::u128, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "SpanSlash", + Vec::new(), + [ + 160u8, 63u8, 115u8, 190u8, 233u8, 148u8, 75u8, 3u8, 11u8, 59u8, 184u8, + 220u8, 205u8, 64u8, 28u8, 190u8, 116u8, 210u8, 225u8, 230u8, 224u8, + 163u8, 103u8, 157u8, 100u8, 29u8, 86u8, 167u8, 84u8, 217u8, 109u8, + 200u8, + ], + ) + } + #[doc = " The last planned session scheduled by the session pallet."] + #[doc = ""] + #[doc = " This is basically in sync with the call to [`pallet_session::SessionManager::new_session`]."] + pub fn current_planned_session( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "CurrentPlannedSession", + vec![], + [ + 38u8, 22u8, 56u8, 250u8, 17u8, 154u8, 99u8, 37u8, 155u8, 253u8, 100u8, + 117u8, 5u8, 239u8, 31u8, 190u8, 53u8, 241u8, 11u8, 185u8, 163u8, 227u8, + 10u8, 77u8, 210u8, 64u8, 156u8, 218u8, 105u8, 16u8, 1u8, 57u8, + ], + ) + } + #[doc = " Indices of validators that have offended in the active era and whether they are currently"] + #[doc = " disabled."] + #[doc = ""] + #[doc = " This value should be a superset of disabled validators since not all offences lead to the"] + #[doc = " validator being disabled (if there was no slash). This is needed to track the percentage of"] + #[doc = " validators that have offended in the current era, ensuring a new era is forced if"] + #[doc = " `OffendingValidatorsThreshold` is reached. The vec is always kept sorted so that we can find"] + #[doc = " whether a given validator has previously offended using binary search. It gets cleared when"] + #[doc = " the era ends."] + pub fn offending_validators( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<(::core::primitive::u32, ::core::primitive::bool)>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "OffendingValidators", + vec![], + [ + 94u8, 254u8, 0u8, 50u8, 76u8, 232u8, 51u8, 153u8, 118u8, 14u8, 70u8, + 101u8, 112u8, 215u8, 173u8, 82u8, 182u8, 104u8, 167u8, 103u8, 187u8, + 168u8, 86u8, 16u8, 51u8, 235u8, 51u8, 119u8, 38u8, 154u8, 42u8, 113u8, + ], + ) + } + #[doc = " True if network has been upgraded to this version."] + #[doc = " Storage version of the pallet."] + #[doc = ""] + #[doc = " This is set to v7.0.0 for new networks."] + pub fn storage_version( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "StorageVersion", + vec![], + [ + 8u8, 115u8, 68u8, 36u8, 142u8, 21u8, 152u8, 127u8, 211u8, 17u8, 75u8, + 76u8, 65u8, 237u8, 187u8, 193u8, 176u8, 44u8, 19u8, 166u8, 116u8, + 148u8, 110u8, 234u8, 115u8, 254u8, 73u8, 128u8, 111u8, 140u8, 2u8, + 168u8, + ], + ) + } + #[doc = " The threshold for when users can start calling `chill_other` for other validators /"] + #[doc = " nominators. The threshold is compared to the actual number of validators / nominators"] + #[doc = " (`CountFor*`) in the system compared to the configured max (`Max*Count`)."] + pub fn chill_threshold( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_arithmetic::per_things::Percent, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "ChillThreshold", + vec![], + [ + 174u8, 165u8, 249u8, 105u8, 24u8, 151u8, 115u8, 166u8, 199u8, 251u8, + 28u8, 5u8, 50u8, 95u8, 144u8, 110u8, 220u8, 76u8, 14u8, 23u8, 179u8, + 41u8, 11u8, 248u8, 28u8, 154u8, 159u8, 255u8, 156u8, 109u8, 98u8, 92u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Maximum number of nominations per nominator."] + pub fn max_nominations( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Staking", + "MaxNominations", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " Number of sessions per era."] + pub fn sessions_per_era( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Staking", + "SessionsPerEra", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " Number of eras that staked funds must remain bonded for."] + pub fn bonding_duration( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Staking", + "BondingDuration", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " Number of eras that slashes are deferred by, after computation."] + #[doc = ""] + #[doc = " This should be less than the bonding duration. Set to 0 if slashes"] + #[doc = " should be applied immediately, without opportunity for intervention."] + pub fn slash_defer_duration( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Staking", + "SlashDeferDuration", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " The maximum number of nominators rewarded for each validator."] + #[doc = ""] + #[doc = " For each validator only the `$MaxNominatorRewardedPerValidator` biggest stakers can"] + #[doc = " claim their reward. This used to limit the i/o cost for the nominator payout."] + pub fn max_nominator_rewarded_per_validator( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Staking", + "MaxNominatorRewardedPerValidator", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " The maximum number of `unlocking` chunks a [`StakingLedger`] can have. Effectively"] + #[doc = " determines how many unique eras a staker may be unbonding in."] + pub fn max_unlocking_chunks( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Staking", + "MaxUnlockingChunks", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + } + } + } + pub mod history { + use super::{root_mod, runtime_types}; + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Mapping from historical session indices to session-data root hash and validator count."] + pub fn historical_sessions( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::subxt::ext::sp_core::H256, + ::core::primitive::u32, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "History", + "HistoricalSessions", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 94u8, 72u8, 245u8, 151u8, 214u8, 10u8, 12u8, 113u8, 13u8, 141u8, 176u8, + 178u8, 115u8, 238u8, 224u8, 181u8, 18u8, 5u8, 71u8, 65u8, 189u8, 148u8, + 161u8, 106u8, 24u8, 211u8, 72u8, 66u8, 221u8, 244u8, 117u8, 184u8, + ], + ) + } + #[doc = " Mapping from historical session indices to session-data root hash and validator count."] + pub fn historical_sessions_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::subxt::ext::sp_core::H256, + ::core::primitive::u32, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "History", + "HistoricalSessions", + Vec::new(), + [ + 94u8, 72u8, 245u8, 151u8, 214u8, 10u8, 12u8, 113u8, 13u8, 141u8, 176u8, + 178u8, 115u8, 238u8, 224u8, 181u8, 18u8, 5u8, 71u8, 65u8, 189u8, 148u8, + 161u8, 106u8, 24u8, 211u8, 72u8, 66u8, 221u8, 244u8, 117u8, 184u8, + ], + ) + } + #[doc = " The range of historical sessions we store. [first, last)"] + pub fn stored_range( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "History", + "StoredRange", + vec![], + [ + 89u8, 239u8, 197u8, 93u8, 135u8, 62u8, 142u8, 237u8, 64u8, 200u8, + 164u8, 4u8, 130u8, 233u8, 16u8, 238u8, 166u8, 206u8, 71u8, 42u8, 171u8, + 84u8, 8u8, 245u8, 183u8, 216u8, 212u8, 16u8, 190u8, 3u8, 167u8, 189u8, + ], + ) + } + } + } + } + pub mod session { + use super::{root_mod, runtime_types}; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetKeys { + pub keys: runtime_types::aleph_runtime::SessionKeys, + pub proof: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct PurgeKeys; + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Sets the session key(s) of the function caller to `keys`."] + #[doc = "Allows an account to set its session key prior to becoming a validator."] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "The dispatch origin of this function must be signed."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(1)`. Actual cost depends on the number of length of"] + #[doc = " `T::Keys::key_ids()` which is fixed."] + #[doc = "- DbReads: `origin account`, `T::ValidatorIdOf`, `NextKeys`"] + #[doc = "- DbWrites: `origin account`, `NextKeys`"] + #[doc = "- DbReads per key id: `KeyOwner`"] + #[doc = "- DbWrites per key id: `KeyOwner`"] + #[doc = "# "] + pub fn set_keys( + &self, + keys: runtime_types::aleph_runtime::SessionKeys, + proof: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Session", + "set_keys", + SetKeys { keys, proof }, + [ + 104u8, 12u8, 102u8, 88u8, 135u8, 226u8, 42u8, 162u8, 217u8, 56u8, + 227u8, 24u8, 190u8, 82u8, 1u8, 41u8, 49u8, 50u8, 146u8, 96u8, 21u8, + 56u8, 131u8, 32u8, 244u8, 189u8, 95u8, 22u8, 219u8, 106u8, 236u8, + 206u8, + ], + ) + } + #[doc = "Removes any session key(s) of the function caller."] + #[doc = ""] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "The dispatch origin of this function must be Signed and the account must be either be"] + #[doc = "convertible to a validator ID using the chain's typical addressing system (this usually"] + #[doc = "means being a controller account) or directly convertible into a validator ID (which"] + #[doc = "usually means being a stash account)."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(1)` in number of key types. Actual cost depends on the number of length"] + #[doc = " of `T::Keys::key_ids()` which is fixed."] + #[doc = "- DbReads: `T::ValidatorIdOf`, `NextKeys`, `origin account`"] + #[doc = "- DbWrites: `NextKeys`, `origin account`"] + #[doc = "- DbWrites per key id: `KeyOwner`"] + #[doc = "# "] + pub fn purge_keys(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Session", + "purge_keys", + PurgeKeys {}, + [ + 200u8, 255u8, 4u8, 213u8, 188u8, 92u8, 99u8, 116u8, 163u8, 152u8, 29u8, + 35u8, 133u8, 119u8, 246u8, 44u8, 91u8, 31u8, 145u8, 23u8, 213u8, 64u8, + 71u8, 242u8, 207u8, 239u8, 231u8, 37u8, 61u8, 63u8, 190u8, 35u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_session::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "New session has happened. Note that the argument is the session index, not the"] + #[doc = "block number as the type might suggest."] + pub struct NewSession { + pub session_index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for NewSession { + const PALLET: &'static str = "Session"; + const EVENT: &'static str = "NewSession"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The current set of validators."] + pub fn validators( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "Validators", + vec![], + [ + 144u8, 235u8, 200u8, 43u8, 151u8, 57u8, 147u8, 172u8, 201u8, 202u8, + 242u8, 96u8, 57u8, 76u8, 124u8, 77u8, 42u8, 113u8, 218u8, 220u8, 230u8, + 32u8, 151u8, 152u8, 172u8, 106u8, 60u8, 227u8, 122u8, 118u8, 137u8, + 68u8, + ], + ) + } + #[doc = " Current index of the session."] + pub fn current_index( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "CurrentIndex", + vec![], + [ + 148u8, 179u8, 159u8, 15u8, 197u8, 95u8, 214u8, 30u8, 209u8, 251u8, + 183u8, 231u8, 91u8, 25u8, 181u8, 191u8, 143u8, 252u8, 227u8, 80u8, + 159u8, 66u8, 194u8, 67u8, 113u8, 74u8, 111u8, 91u8, 218u8, 187u8, + 130u8, 40u8, + ], + ) + } + #[doc = " True if the underlying economic identities or weighting behind the validators"] + #[doc = " has changed in the queued validator set."] + pub fn queued_changed( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "QueuedChanged", + vec![], + [ + 105u8, 140u8, 235u8, 218u8, 96u8, 100u8, 252u8, 10u8, 58u8, 221u8, + 244u8, 251u8, 67u8, 91u8, 80u8, 202u8, 152u8, 42u8, 50u8, 113u8, 200u8, + 247u8, 59u8, 213u8, 77u8, 195u8, 1u8, 150u8, 220u8, 18u8, 245u8, 46u8, + ], + ) + } + #[doc = " The queued keys for the next session. When the next session begins, these keys"] + #[doc = " will be used to determine the validator's session keys."] + pub fn queued_keys( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::aleph_runtime::SessionKeys, + )>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "QueuedKeys", + vec![], + [ + 225u8, 184u8, 241u8, 120u8, 191u8, 179u8, 152u8, 85u8, 19u8, 139u8, + 177u8, 231u8, 102u8, 210u8, 125u8, 68u8, 196u8, 242u8, 40u8, 39u8, + 70u8, 16u8, 6u8, 167u8, 81u8, 190u8, 61u8, 91u8, 246u8, 206u8, 249u8, + 78u8, + ], + ) + } + #[doc = " Indices of disabled validators."] + #[doc = ""] + #[doc = " The vec is always kept sorted so that we can find whether a given validator is"] + #[doc = " disabled using binary search. It gets cleared when `on_session_ending` returns"] + #[doc = " a new set of identities."] + pub fn disabled_validators( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::std::vec::Vec<::core::primitive::u32>>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "DisabledValidators", + vec![], + [ + 135u8, 22u8, 22u8, 97u8, 82u8, 217u8, 144u8, 141u8, 121u8, 240u8, + 189u8, 16u8, 176u8, 88u8, 177u8, 31u8, 20u8, 242u8, 73u8, 104u8, 11u8, + 110u8, 214u8, 34u8, 52u8, 217u8, 106u8, 33u8, 174u8, 174u8, 198u8, + 84u8, + ], + ) + } + #[doc = " The next session keys for a validator."] + pub fn next_keys( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "NextKeys", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 18u8, 209u8, 31u8, 20u8, 131u8, 9u8, 97u8, 157u8, 63u8, 9u8, 233u8, + 216u8, 40u8, 240u8, 66u8, 111u8, 60u8, 87u8, 83u8, 178u8, 17u8, 105u8, + 214u8, 169u8, 171u8, 220u8, 7u8, 121u8, 35u8, 229u8, 253u8, 40u8, + ], + ) + } + #[doc = " The next session keys for a validator."] + pub fn next_keys_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "NextKeys", + Vec::new(), + [ + 18u8, 209u8, 31u8, 20u8, 131u8, 9u8, 97u8, 157u8, 63u8, 9u8, 233u8, + 216u8, 40u8, 240u8, 66u8, 111u8, 60u8, 87u8, 83u8, 178u8, 17u8, 105u8, + 214u8, 169u8, 171u8, 220u8, 7u8, 121u8, 35u8, 229u8, 253u8, 40u8, + ], + ) + } + #[doc = " The owner of a key. The key is the `KeyTypeId` + the encoded key."] + pub fn key_owner( + &self, + _0: impl ::std::borrow::Borrow, + _1: impl ::std::borrow::Borrow<[::core::primitive::u8]>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::crypto::AccountId32>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "KeyOwner", + vec![::subxt::storage::address::StorageMapKey::new( + &(_0.borrow(), _1.borrow()), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 4u8, 91u8, 25u8, 84u8, 250u8, 201u8, 174u8, 129u8, 201u8, 58u8, 197u8, + 199u8, 137u8, 240u8, 118u8, 33u8, 99u8, 2u8, 195u8, 57u8, 53u8, 172u8, + 0u8, 148u8, 203u8, 144u8, 149u8, 64u8, 135u8, 254u8, 242u8, 215u8, + ], + ) + } + #[doc = " The owner of a key. The key is the `KeyTypeId` + the encoded key."] + pub fn key_owner_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::crypto::AccountId32>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "KeyOwner", + Vec::new(), + [ + 4u8, 91u8, 25u8, 84u8, 250u8, 201u8, 174u8, 129u8, 201u8, 58u8, 197u8, + 199u8, 137u8, 240u8, 118u8, 33u8, 99u8, 2u8, 195u8, 57u8, 53u8, 172u8, + 0u8, 148u8, 203u8, 144u8, 149u8, 64u8, 135u8, 254u8, 242u8, 215u8, + ], + ) + } + } + } + } + pub mod aleph { + use super::{root_mod, runtime_types}; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetEmergencyFinalizer { + pub emergency_finalizer: runtime_types::primitives::app::Public, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ScheduleFinalityVersionChange { + pub version_incoming: ::core::primitive::u32, + pub session: ::core::primitive::u32, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Sets the emergency finalization key. If called in session `N` the key can be used to"] + #[doc = "finalize blocks from session `N+2` onwards, until it gets overridden."] + pub fn set_emergency_finalizer( + &self, + emergency_finalizer: runtime_types::primitives::app::Public, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Aleph", + "set_emergency_finalizer", + SetEmergencyFinalizer { + emergency_finalizer, + }, + [ + 13u8, 25u8, 102u8, 60u8, 64u8, 83u8, 158u8, 113u8, 177u8, 194u8, 79u8, + 66u8, 171u8, 98u8, 169u8, 52u8, 69u8, 194u8, 54u8, 131u8, 190u8, 83u8, + 21u8, 64u8, 119u8, 90u8, 53u8, 125u8, 52u8, 155u8, 222u8, 76u8, + ], + ) + } + #[doc = "Schedules a finality version change for a future session. If such a scheduled future"] + #[doc = "version is already set, it is replaced with the provided one."] + #[doc = "Any rescheduling of a future version change needs to occur at least 2 sessions in"] + #[doc = "advance of the provided session of the version change."] + #[doc = "In order to cancel a scheduled version change, a new version change should be scheduled"] + #[doc = "with the same version as the current one."] + pub fn schedule_finality_version_change( + &self, + version_incoming: ::core::primitive::u32, + session: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Aleph", + "schedule_finality_version_change", + ScheduleFinalityVersionChange { + version_incoming, + session, + }, + [ + 27u8, 162u8, 238u8, 141u8, 132u8, 87u8, 69u8, 115u8, 243u8, 197u8, + 38u8, 37u8, 243u8, 86u8, 45u8, 137u8, 73u8, 181u8, 108u8, 200u8, 168u8, + 141u8, 130u8, 244u8, 85u8, 128u8, 145u8, 34u8, 233u8, 87u8, 38u8, + 198u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_aleph::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ChangeEmergencyFinalizer(pub runtime_types::primitives::app::Public); + impl ::subxt::events::StaticEvent for ChangeEmergencyFinalizer { + const PALLET: &'static str = "Aleph"; + const EVENT: &'static str = "ChangeEmergencyFinalizer"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ScheduleFinalityVersionChange(pub runtime_types::primitives::VersionChange); + impl ::subxt::events::StaticEvent for ScheduleFinalityVersionChange { + const PALLET: &'static str = "Aleph"; + const EVENT: &'static str = "ScheduleFinalityVersionChange"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct FinalityVersionChange(pub runtime_types::primitives::VersionChange); + impl ::subxt::events::StaticEvent for FinalityVersionChange { + const PALLET: &'static str = "Aleph"; + const EVENT: &'static str = "FinalityVersionChange"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + pub fn authorities( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Aleph", + "Authorities", + vec![], + [ + 5u8, 88u8, 222u8, 150u8, 141u8, 89u8, 69u8, 47u8, 152u8, 80u8, 80u8, + 1u8, 20u8, 132u8, 5u8, 152u8, 175u8, 14u8, 99u8, 198u8, 102u8, 229u8, + 159u8, 198u8, 138u8, 149u8, 68u8, 195u8, 243u8, 50u8, 249u8, 170u8, + ], + ) + } + pub fn emergency_finalizer( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Aleph", + "EmergencyFinalizer", + vec![], + [ + 254u8, 68u8, 214u8, 192u8, 214u8, 1u8, 48u8, 167u8, 1u8, 55u8, 148u8, + 124u8, 72u8, 123u8, 148u8, 50u8, 131u8, 17u8, 48u8, 14u8, 48u8, 92u8, + 3u8, 56u8, 60u8, 224u8, 97u8, 60u8, 208u8, 53u8, 164u8, 88u8, + ], + ) + } + pub fn queued_emergency_finalizer( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Aleph", + "QueuedEmergencyFinalizer", + vec![], + [ + 156u8, 104u8, 166u8, 24u8, 170u8, 246u8, 39u8, 246u8, 130u8, 169u8, + 222u8, 196u8, 137u8, 216u8, 190u8, 64u8, 28u8, 50u8, 6u8, 194u8, 164u8, + 91u8, 85u8, 78u8, 212u8, 61u8, 126u8, 242u8, 207u8, 76u8, 227u8, 115u8, + ], + ) + } + pub fn next_emergency_finalizer( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Aleph", + "NextEmergencyFinalizer", + vec![], + [ + 84u8, 79u8, 27u8, 15u8, 74u8, 189u8, 24u8, 17u8, 157u8, 91u8, 245u8, + 30u8, 129u8, 11u8, 226u8, 87u8, 50u8, 182u8, 60u8, 73u8, 214u8, 46u8, + 132u8, 0u8, 53u8, 14u8, 228u8, 115u8, 240u8, 64u8, 158u8, 165u8, + ], + ) + } + #[doc = " Current finality version."] + pub fn finality_version( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Aleph", + "FinalityVersion", + vec![], + [ + 134u8, 19u8, 94u8, 247u8, 125u8, 18u8, 148u8, 160u8, 167u8, 235u8, + 174u8, 4u8, 107u8, 69u8, 55u8, 187u8, 249u8, 13u8, 129u8, 99u8, 116u8, + 158u8, 38u8, 29u8, 239u8, 112u8, 150u8, 92u8, 151u8, 197u8, 223u8, + 30u8, + ], + ) + } + #[doc = " Scheduled finality version change."] + pub fn finality_scheduled_version_change( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Aleph", + "FinalityScheduledVersionChange", + vec![], + [ + 195u8, 203u8, 203u8, 240u8, 214u8, 227u8, 177u8, 99u8, 82u8, 86u8, + 201u8, 237u8, 47u8, 32u8, 111u8, 219u8, 184u8, 107u8, 211u8, 83u8, + 25u8, 59u8, 170u8, 29u8, 24u8, 149u8, 85u8, 63u8, 37u8, 203u8, 129u8, + 97u8, + ], + ) + } + } + } + } + pub mod elections { + use super::{root_mod, runtime_types}; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ChangeValidators { + pub reserved_validators: ::core::option::Option< + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + >, + pub non_reserved_validators: ::core::option::Option< + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + >, + pub committee_size: + ::core::option::Option, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetBanConfig { + pub minimal_expected_performance: ::core::option::Option<::core::primitive::u8>, + pub underperformed_session_count_threshold: + ::core::option::Option<::core::primitive::u32>, + pub clean_session_counter_delay: ::core::option::Option<::core::primitive::u32>, + pub ban_period: ::core::option::Option<::core::primitive::u32>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BanFromCommittee { + pub banned: ::subxt::ext::sp_core::crypto::AccountId32, + pub ban_reason: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CancelBan { + pub banned: ::subxt::ext::sp_core::crypto::AccountId32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetElectionsOpenness { + pub openness: runtime_types::primitives::ElectionOpenness, + } + pub struct TransactionApi; + impl TransactionApi { + pub fn change_validators( + &self, + reserved_validators: ::core::option::Option< + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + >, + non_reserved_validators: ::core::option::Option< + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + >, + committee_size: ::core::option::Option< + runtime_types::primitives::CommitteeSeats, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Elections", + "change_validators", + ChangeValidators { + reserved_validators, + non_reserved_validators, + committee_size, + }, + [ + 88u8, 2u8, 255u8, 219u8, 50u8, 103u8, 169u8, 150u8, 249u8, 161u8, 57u8, + 39u8, 6u8, 241u8, 94u8, 139u8, 206u8, 236u8, 160u8, 92u8, 163u8, 170u8, + 222u8, 99u8, 50u8, 91u8, 194u8, 192u8, 99u8, 123u8, 41u8, 136u8, + ], + ) + } + #[doc = "Sets ban config, it has an immediate effect"] + pub fn set_ban_config( + &self, + minimal_expected_performance: ::core::option::Option<::core::primitive::u8>, + underperformed_session_count_threshold: ::core::option::Option< + ::core::primitive::u32, + >, + clean_session_counter_delay: ::core::option::Option<::core::primitive::u32>, + ban_period: ::core::option::Option<::core::primitive::u32>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Elections", + "set_ban_config", + SetBanConfig { + minimal_expected_performance, + underperformed_session_count_threshold, + clean_session_counter_delay, + ban_period, + }, + [ + 228u8, 199u8, 170u8, 155u8, 208u8, 190u8, 211u8, 218u8, 105u8, 213u8, + 240u8, 152u8, 92u8, 19u8, 164u8, 28u8, 215u8, 145u8, 47u8, 248u8, + 219u8, 75u8, 234u8, 78u8, 29u8, 189u8, 35u8, 106u8, 165u8, 76u8, 27u8, + 50u8, + ], + ) + } + #[doc = "Schedule a non-reserved node to be banned out from the committee at the end of the era"] + pub fn ban_from_committee( + &self, + banned: ::subxt::ext::sp_core::crypto::AccountId32, + ban_reason: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Elections", + "ban_from_committee", + BanFromCommittee { banned, ban_reason }, + [ + 60u8, 254u8, 80u8, 201u8, 64u8, 189u8, 255u8, 111u8, 14u8, 9u8, 68u8, + 177u8, 196u8, 107u8, 10u8, 177u8, 78u8, 134u8, 98u8, 21u8, 179u8, 9u8, + 111u8, 185u8, 155u8, 39u8, 148u8, 88u8, 239u8, 16u8, 24u8, 171u8, + ], + ) + } + #[doc = "Schedule a non-reserved node to be banned out from the committee at the end of the era"] + pub fn cancel_ban( + &self, + banned: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Elections", + "cancel_ban", + CancelBan { banned }, + [ + 103u8, 192u8, 40u8, 246u8, 206u8, 52u8, 222u8, 51u8, 39u8, 247u8, + 220u8, 175u8, 232u8, 31u8, 168u8, 99u8, 206u8, 45u8, 191u8, 161u8, + 107u8, 12u8, 112u8, 54u8, 163u8, 170u8, 221u8, 220u8, 122u8, 177u8, + 178u8, 246u8, + ], + ) + } + #[doc = "Set openness of the elections"] + pub fn set_elections_openness( + &self, + openness: runtime_types::primitives::ElectionOpenness, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Elections", + "set_elections_openness", + SetElectionsOpenness { openness }, + [ + 207u8, 20u8, 183u8, 25u8, 206u8, 225u8, 242u8, 167u8, 164u8, 54u8, + 111u8, 134u8, 139u8, 4u8, 7u8, 89u8, 119u8, 165u8, 53u8, 3u8, 96u8, + 107u8, 188u8, 196u8, 113u8, 35u8, 128u8, 240u8, 222u8, 23u8, 221u8, + 105u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_elections::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Committee for the next era has changed"] + pub struct ChangeValidators( + pub ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + pub ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + pub runtime_types::primitives::CommitteeSeats, + ); + impl ::subxt::events::StaticEvent for ChangeValidators { + const PALLET: &'static str = "Elections"; + const EVENT: &'static str = "ChangeValidators"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Ban thresholds for the next era has changed"] + pub struct SetBanConfig(pub runtime_types::primitives::BanConfig); + impl ::subxt::events::StaticEvent for SetBanConfig { + const PALLET: &'static str = "Elections"; + const EVENT: &'static str = "SetBanConfig"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Validators have been banned from the committee"] + pub struct BanValidators( + pub ::std::vec::Vec<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::primitives::BanInfo, + )>, + ); + impl ::subxt::events::StaticEvent for BanValidators { + const PALLET: &'static str = "Elections"; + const EVENT: &'static str = "BanValidators"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Desirable size of a committee, see [`CommitteeSeats`]."] + pub fn committee_size( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "CommitteeSize", + vec![], + [ + 138u8, 114u8, 93u8, 183u8, 35u8, 215u8, 48u8, 195u8, 127u8, 157u8, + 38u8, 169u8, 255u8, 246u8, 178u8, 219u8, 221u8, 247u8, 35u8, 45u8, + 94u8, 195u8, 84u8, 36u8, 30u8, 252u8, 145u8, 90u8, 67u8, 254u8, 39u8, + 199u8, + ], + ) + } + #[doc = " Desired size of a committee in effect from a new era."] + pub fn next_era_committee_size( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "NextEraCommitteeSize", + vec![], + [ + 1u8, 114u8, 197u8, 86u8, 178u8, 92u8, 167u8, 99u8, 96u8, 98u8, 65u8, + 149u8, 222u8, 39u8, 119u8, 24u8, 251u8, 65u8, 171u8, 126u8, 100u8, + 137u8, 50u8, 72u8, 108u8, 47u8, 95u8, 63u8, 202u8, 64u8, 120u8, 120u8, + ], + ) + } + #[doc = " Next era's list of reserved validators."] + pub fn next_era_reserved_validators( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "NextEraReservedValidators", + vec![], + [ + 6u8, 123u8, 0u8, 238u8, 248u8, 8u8, 50u8, 48u8, 77u8, 152u8, 162u8, + 53u8, 221u8, 121u8, 176u8, 84u8, 158u8, 169u8, 185u8, 96u8, 85u8, + 252u8, 56u8, 116u8, 7u8, 46u8, 147u8, 75u8, 194u8, 177u8, 0u8, 252u8, + ], + ) + } + #[doc = " Current era's list of reserved validators."] + pub fn current_era_validators( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::primitives::EraValidators< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "CurrentEraValidators", + vec![], + [ + 120u8, 47u8, 38u8, 117u8, 185u8, 231u8, 146u8, 226u8, 139u8, 21u8, + 230u8, 120u8, 147u8, 157u8, 64u8, 50u8, 153u8, 160u8, 186u8, 53u8, + 215u8, 8u8, 39u8, 146u8, 195u8, 151u8, 191u8, 0u8, 105u8, 241u8, 152u8, + 97u8, + ], + ) + } + #[doc = " Next era's list of non reserved validators."] + pub fn next_era_non_reserved_validators( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "NextEraNonReservedValidators", + vec![], + [ + 118u8, 139u8, 183u8, 59u8, 75u8, 3u8, 245u8, 47u8, 30u8, 15u8, 23u8, + 237u8, 0u8, 153u8, 31u8, 251u8, 122u8, 172u8, 215u8, 255u8, 199u8, + 145u8, 242u8, 3u8, 132u8, 27u8, 20u8, 138u8, 252u8, 235u8, 215u8, 86u8, + ], + ) + } + #[doc = " A lookup how many blocks a validator produced."] + pub fn session_validator_block_count( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "SessionValidatorBlockCount", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 186u8, 91u8, 185u8, 144u8, 216u8, 179u8, 157u8, 132u8, 17u8, 247u8, + 241u8, 172u8, 32u8, 7u8, 28u8, 60u8, 188u8, 192u8, 64u8, 29u8, 153u8, + 100u8, 130u8, 245u8, 189u8, 251u8, 68u8, 161u8, 202u8, 29u8, 153u8, + 131u8, + ], + ) + } + #[doc = " A lookup how many blocks a validator produced."] + pub fn session_validator_block_count_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "SessionValidatorBlockCount", + Vec::new(), + [ + 186u8, 91u8, 185u8, 144u8, 216u8, 179u8, 157u8, 132u8, 17u8, 247u8, + 241u8, 172u8, 32u8, 7u8, 28u8, 60u8, 188u8, 192u8, 64u8, 29u8, 153u8, + 100u8, 130u8, 245u8, 189u8, 251u8, 68u8, 161u8, 202u8, 29u8, 153u8, + 131u8, + ], + ) + } + #[doc = " Total possible reward per validator for the current era."] + pub fn validator_era_total_reward( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_elections::ValidatorTotalRewards< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "ValidatorEraTotalReward", + vec![], + [ + 111u8, 103u8, 48u8, 14u8, 23u8, 139u8, 162u8, 122u8, 212u8, 85u8, 64u8, + 188u8, 36u8, 142u8, 80u8, 224u8, 89u8, 63u8, 104u8, 86u8, 51u8, 111u8, + 166u8, 53u8, 189u8, 181u8, 240u8, 250u8, 160u8, 128u8, 179u8, 9u8, + ], + ) + } + #[doc = " Current era config for ban functionality, see [`BanConfig`]"] + pub fn ban_config( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "BanConfig", + vec![], + [ + 115u8, 228u8, 135u8, 32u8, 85u8, 156u8, 44u8, 195u8, 215u8, 11u8, 27u8, + 26u8, 231u8, 59u8, 249u8, 78u8, 172u8, 66u8, 81u8, 17u8, 99u8, 221u8, + 38u8, 253u8, 62u8, 54u8, 104u8, 161u8, 129u8, 92u8, 218u8, 193u8, + ], + ) + } + #[doc = " A lookup for a number of underperformance sessions for a given validator"] + pub fn underperformed_validator_session_count( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "UnderperformedValidatorSessionCount", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 46u8, 74u8, 46u8, 159u8, 162u8, 118u8, 159u8, 155u8, 233u8, 63u8, + 101u8, 201u8, 56u8, 204u8, 126u8, 242u8, 131u8, 5u8, 29u8, 132u8, 43u8, + 205u8, 168u8, 157u8, 29u8, 183u8, 127u8, 202u8, 25u8, 245u8, 137u8, + 67u8, + ], + ) + } + #[doc = " A lookup for a number of underperformance sessions for a given validator"] + pub fn underperformed_validator_session_count_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "UnderperformedValidatorSessionCount", + Vec::new(), + [ + 46u8, 74u8, 46u8, 159u8, 162u8, 118u8, 159u8, 155u8, 233u8, 63u8, + 101u8, 201u8, 56u8, 204u8, 126u8, 242u8, 131u8, 5u8, 29u8, 132u8, 43u8, + 205u8, 168u8, 157u8, 29u8, 183u8, 127u8, 202u8, 25u8, 245u8, 137u8, + 67u8, + ], + ) + } + #[doc = " Validators to be removed from non reserved list in the next era"] + pub fn banned( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "Banned", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 202u8, 38u8, 165u8, 35u8, 95u8, 207u8, 116u8, 43u8, 148u8, 73u8, 193u8, + 187u8, 1u8, 88u8, 209u8, 13u8, 128u8, 168u8, 121u8, 62u8, 227u8, 172u8, + 87u8, 106u8, 15u8, 43u8, 136u8, 240u8, 249u8, 210u8, 25u8, 215u8, + ], + ) + } + #[doc = " Validators to be removed from non reserved list in the next era"] + pub fn banned_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "Banned", + Vec::new(), + [ + 202u8, 38u8, 165u8, 35u8, 95u8, 207u8, 116u8, 43u8, 148u8, 73u8, 193u8, + 187u8, 1u8, 88u8, 209u8, 13u8, 128u8, 168u8, 121u8, 62u8, 227u8, 172u8, + 87u8, 106u8, 15u8, 43u8, 136u8, 240u8, 249u8, 210u8, 25u8, 215u8, + ], + ) + } + #[doc = " Openness of the elections, whether we allow all candidates that bonded enough tokens or"] + #[doc = " the validators list is managed by sudo"] + pub fn openness( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::primitives::ElectionOpenness, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "Openness", + vec![], + [ + 128u8, 231u8, 144u8, 215u8, 195u8, 90u8, 89u8, 180u8, 151u8, 233u8, + 229u8, 205u8, 40u8, 26u8, 23u8, 134u8, 171u8, 172u8, 140u8, 248u8, + 172u8, 111u8, 92u8, 51u8, 189u8, 94u8, 91u8, 151u8, 129u8, 248u8, 78u8, + 12u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Nr of blocks in the session."] + pub fn session_period( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Elections", + "SessionPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " Maximum acceptable ban reason length."] + pub fn maximum_ban_reason_length( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Elections", + "MaximumBanReasonLength", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + } + } + } + pub mod treasury { + use super::{root_mod, runtime_types}; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ProposeSpend { + #[codec(compact)] + pub value: ::core::primitive::u128, + pub beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RejectProposal { + #[codec(compact)] + pub proposal_id: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ApproveProposal { + #[codec(compact)] + pub proposal_id: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Spend { + #[codec(compact)] + pub amount: ::core::primitive::u128, + pub beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RemoveApproval { + #[codec(compact)] + pub proposal_id: ::core::primitive::u32, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Put forward a suggestion for spending. A deposit proportional to the value"] + #[doc = "is reserved and slashed if the proposal is rejected. It is returned once the"] + #[doc = "proposal is awarded."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(1)"] + #[doc = "- DbReads: `ProposalCount`, `origin account`"] + #[doc = "- DbWrites: `ProposalCount`, `Proposals`, `origin account`"] + #[doc = "# "] + pub fn propose_spend( + &self, + value: ::core::primitive::u128, + beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Treasury", + "propose_spend", + ProposeSpend { value, beneficiary }, + [ + 109u8, 46u8, 8u8, 159u8, 127u8, 79u8, 27u8, 100u8, 92u8, 244u8, 78u8, + 46u8, 105u8, 246u8, 169u8, 210u8, 149u8, 7u8, 108u8, 153u8, 203u8, + 223u8, 8u8, 117u8, 126u8, 250u8, 255u8, 52u8, 245u8, 69u8, 45u8, 136u8, + ], + ) + } + #[doc = "Reject a proposed spend. The original deposit will be slashed."] + #[doc = ""] + #[doc = "May only be called from `T::RejectOrigin`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(1)"] + #[doc = "- DbReads: `Proposals`, `rejected proposer account`"] + #[doc = "- DbWrites: `Proposals`, `rejected proposer account`"] + #[doc = "# "] + pub fn reject_proposal( + &self, + proposal_id: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Treasury", + "reject_proposal", + RejectProposal { proposal_id }, + [ + 106u8, 223u8, 97u8, 22u8, 111u8, 208u8, 128u8, 26u8, 198u8, 140u8, + 118u8, 126u8, 187u8, 51u8, 193u8, 50u8, 193u8, 68u8, 143u8, 144u8, + 34u8, 132u8, 44u8, 244u8, 105u8, 186u8, 223u8, 234u8, 17u8, 145u8, + 209u8, 145u8, + ], + ) + } + #[doc = "Approve a proposal. At a later time, the proposal will be allocated to the beneficiary"] + #[doc = "and the original deposit will be returned."] + #[doc = ""] + #[doc = "May only be called from `T::ApproveOrigin`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(1)."] + #[doc = "- DbReads: `Proposals`, `Approvals`"] + #[doc = "- DbWrite: `Approvals`"] + #[doc = "# "] + pub fn approve_proposal( + &self, + proposal_id: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Treasury", + "approve_proposal", + ApproveProposal { proposal_id }, + [ + 164u8, 229u8, 172u8, 98u8, 129u8, 62u8, 84u8, 128u8, 47u8, 108u8, 33u8, + 120u8, 89u8, 79u8, 57u8, 121u8, 4u8, 197u8, 170u8, 153u8, 156u8, 17u8, + 59u8, 164u8, 123u8, 227u8, 175u8, 195u8, 220u8, 160u8, 60u8, 186u8, + ], + ) + } + #[doc = "Propose and approve a spend of treasury funds."] + #[doc = ""] + #[doc = "- `origin`: Must be `SpendOrigin` with the `Success` value being at least `amount`."] + #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] + #[doc = "- `beneficiary`: The destination account for the transfer."] + #[doc = ""] + #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] + #[doc = "beneficiary."] + pub fn spend( + &self, + amount: ::core::primitive::u128, + beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Treasury", + "spend", + Spend { + amount, + beneficiary, + }, + [ + 177u8, 178u8, 242u8, 136u8, 135u8, 237u8, 114u8, 71u8, 233u8, 239u8, + 7u8, 84u8, 14u8, 228u8, 58u8, 31u8, 158u8, 185u8, 25u8, 91u8, 70u8, + 33u8, 19u8, 92u8, 100u8, 162u8, 5u8, 48u8, 20u8, 120u8, 9u8, 109u8, + ], + ) + } + #[doc = "Force a previously approved proposal to be removed from the approval queue."] + #[doc = "The original deposit will no longer be returned."] + #[doc = ""] + #[doc = "May only be called from `T::RejectOrigin`."] + #[doc = "- `proposal_id`: The index of a proposal"] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(A) where `A` is the number of approvals"] + #[doc = "- Db reads and writes: `Approvals`"] + #[doc = "# "] + #[doc = ""] + #[doc = "Errors:"] + #[doc = "- `ProposalNotApproved`: The `proposal_id` supplied was not found in the approval queue,"] + #[doc = "i.e., the proposal has not been approved. This could also mean the proposal does not"] + #[doc = "exist altogether, thus there is no way it would have been approved in the first place."] + pub fn remove_approval( + &self, + proposal_id: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Treasury", + "remove_approval", + RemoveApproval { proposal_id }, + [ + 133u8, 126u8, 181u8, 47u8, 196u8, 243u8, 7u8, 46u8, 25u8, 251u8, 154u8, + 125u8, 217u8, 77u8, 54u8, 245u8, 240u8, 180u8, 97u8, 34u8, 186u8, 53u8, + 225u8, 144u8, 155u8, 107u8, 172u8, 54u8, 250u8, 184u8, 178u8, 86u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_treasury::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "New proposal."] + pub struct Proposed { + pub proposal_index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for Proposed { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Proposed"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "We have ended a spend period and will now allocate funds."] + pub struct Spending { + pub budget_remaining: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Spending { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Spending"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Some funds have been allocated."] + pub struct Awarded { + pub proposal_index: ::core::primitive::u32, + pub award: ::core::primitive::u128, + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for Awarded { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Awarded"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A proposal was rejected; funds were slashed."] + pub struct Rejected { + pub proposal_index: ::core::primitive::u32, + pub slashed: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Rejected { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Rejected"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Some of our funds have been burnt."] + pub struct Burnt { + pub burnt_funds: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Burnt { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Burnt"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Spending has finished; this is the amount that rolls over until next spend."] + pub struct Rollover { + pub rollover_balance: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Rollover { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Rollover"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Some funds have been deposited."] + pub struct Deposit { + pub value: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Deposit { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "Deposit"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A new spend proposal has been approved."] + pub struct SpendApproved { + pub proposal_index: ::core::primitive::u32, + pub amount: ::core::primitive::u128, + pub beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for SpendApproved { + const PALLET: &'static str = "Treasury"; + const EVENT: &'static str = "SpendApproved"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Number of proposals that have been made."] + pub fn proposal_count( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Treasury", + "ProposalCount", + vec![], + [ + 132u8, 145u8, 78u8, 218u8, 51u8, 189u8, 55u8, 172u8, 143u8, 33u8, + 140u8, 99u8, 124u8, 208u8, 57u8, 232u8, 154u8, 110u8, 32u8, 142u8, + 24u8, 149u8, 109u8, 105u8, 30u8, 83u8, 39u8, 177u8, 127u8, 160u8, 34u8, + 70u8, + ], + ) + } + #[doc = " Proposals that have been made."] + pub fn proposals( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_treasury::Proposal< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Treasury", + "Proposals", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 62u8, 223u8, 55u8, 209u8, 151u8, 134u8, 122u8, 65u8, 207u8, 38u8, + 113u8, 213u8, 237u8, 48u8, 129u8, 32u8, 91u8, 228u8, 108u8, 91u8, 37u8, + 49u8, 94u8, 4u8, 75u8, 122u8, 25u8, 34u8, 198u8, 224u8, 246u8, 160u8, + ], + ) + } + #[doc = " Proposals that have been made."] + pub fn proposals_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_treasury::Proposal< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Treasury", + "Proposals", + Vec::new(), + [ + 62u8, 223u8, 55u8, 209u8, 151u8, 134u8, 122u8, 65u8, 207u8, 38u8, + 113u8, 213u8, 237u8, 48u8, 129u8, 32u8, 91u8, 228u8, 108u8, 91u8, 37u8, + 49u8, 94u8, 4u8, 75u8, 122u8, 25u8, 34u8, 198u8, 224u8, 246u8, 160u8, + ], + ) + } + #[doc = " Proposal indices that have been approved but not yet awarded."] + pub fn approvals( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u32, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Treasury", + "Approvals", + vec![], + [ + 202u8, 106u8, 189u8, 40u8, 127u8, 172u8, 108u8, 50u8, 193u8, 4u8, + 248u8, 226u8, 176u8, 101u8, 212u8, 222u8, 64u8, 206u8, 244u8, 175u8, + 111u8, 106u8, 86u8, 96u8, 19u8, 109u8, 218u8, 152u8, 30u8, 59u8, 96u8, + 1u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Fraction of a proposal's value that should be bonded in order to place the proposal."] + #[doc = " An accepted proposal gets these back. A rejected proposal does not."] + pub fn proposal_bond( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_arithmetic::per_things::Permill, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "Treasury", + "ProposalBond", + [ + 225u8, 236u8, 95u8, 157u8, 90u8, 94u8, 106u8, 192u8, 254u8, 19u8, 87u8, + 80u8, 16u8, 62u8, 42u8, 204u8, 136u8, 106u8, 225u8, 53u8, 212u8, 52u8, + 177u8, 79u8, 4u8, 116u8, 201u8, 104u8, 222u8, 75u8, 86u8, 227u8, + ], + ) + } + #[doc = " Minimum amount of funds that should be placed in a deposit for making a proposal."] + pub fn proposal_bond_minimum( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Treasury", + "ProposalBondMinimum", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + #[doc = " Maximum amount of funds that should be placed in a deposit for making a proposal."] + pub fn proposal_bond_maximum( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + ::core::option::Option<::core::primitive::u128>, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "Treasury", + "ProposalBondMaximum", + [ + 84u8, 154u8, 218u8, 83u8, 84u8, 189u8, 32u8, 20u8, 120u8, 194u8, 88u8, + 205u8, 109u8, 216u8, 114u8, 193u8, 120u8, 198u8, 154u8, 237u8, 134u8, + 204u8, 102u8, 247u8, 52u8, 103u8, 231u8, 43u8, 243u8, 122u8, 60u8, + 216u8, + ], + ) + } + #[doc = " Period between successive spends."] + pub fn spend_period( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Treasury", + "SpendPeriod", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " Percentage of spare funds (if any) that are burnt per spend period."] + pub fn burn( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_arithmetic::per_things::Permill, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "Treasury", + "Burn", + [ + 225u8, 236u8, 95u8, 157u8, 90u8, 94u8, 106u8, 192u8, 254u8, 19u8, 87u8, + 80u8, 16u8, 62u8, 42u8, 204u8, 136u8, 106u8, 225u8, 53u8, 212u8, 52u8, + 177u8, 79u8, 4u8, 116u8, 201u8, 104u8, 222u8, 75u8, 86u8, 227u8, + ], + ) + } + #[doc = " The treasury's pallet id, used for deriving its sovereign account ID."] + pub fn pallet_id( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType, + > { + ::subxt::constants::StaticConstantAddress::new( + "Treasury", + "PalletId", + [ + 139u8, 109u8, 228u8, 151u8, 252u8, 32u8, 130u8, 69u8, 112u8, 154u8, + 174u8, 45u8, 83u8, 245u8, 51u8, 132u8, 173u8, 5u8, 186u8, 24u8, 243u8, + 9u8, 12u8, 214u8, 80u8, 74u8, 69u8, 189u8, 30u8, 94u8, 22u8, 39u8, + ], + ) + } + #[doc = " The maximum number of approvals that can wait in the spending queue."] + #[doc = ""] + #[doc = " NOTE: This parameter is also used within the Bounties Pallet extension if enabled."] + pub fn max_approvals( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Treasury", + "MaxApprovals", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + } + } + } + pub mod vesting { + use super::{root_mod, runtime_types}; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Vest; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct VestOther { + pub target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct VestedTransfer { + pub target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + pub schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ForceVestedTransfer { + pub source: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + pub target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + pub schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct MergeSchedules { + pub schedule1_index: ::core::primitive::u32, + pub schedule2_index: ::core::primitive::u32, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Unlock any vested funds of the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have funds still"] + #[doc = "locked under this pallet."] + #[doc = ""] + #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- DbWeight: 2 Reads, 2 Writes"] + #[doc = " - Reads: Vesting Storage, Balances Locks, [Sender Account]"] + #[doc = " - Writes: Vesting Storage, Balances Locks, [Sender Account]"] + #[doc = "# "] + pub fn vest(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Vesting", + "vest", + Vest {}, + [ + 123u8, 54u8, 10u8, 208u8, 154u8, 24u8, 39u8, 166u8, 64u8, 27u8, 74u8, + 29u8, 243u8, 97u8, 155u8, 5u8, 130u8, 155u8, 65u8, 181u8, 196u8, 125u8, + 45u8, 133u8, 25u8, 33u8, 3u8, 34u8, 21u8, 167u8, 172u8, 54u8, + ], + ) + } + #[doc = "Unlock any vested funds of a `target` account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account whose vested funds should be unlocked. Must have funds still"] + #[doc = "locked under this pallet."] + #[doc = ""] + #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- DbWeight: 3 Reads, 3 Writes"] + #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account"] + #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account"] + #[doc = "# "] + pub fn vest_other( + &self, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Vesting", + "vest_other", + VestOther { target }, + [ + 164u8, 19u8, 93u8, 81u8, 235u8, 101u8, 18u8, 52u8, 187u8, 81u8, 243u8, + 216u8, 116u8, 84u8, 188u8, 135u8, 1u8, 241u8, 128u8, 90u8, 117u8, + 164u8, 111u8, 0u8, 251u8, 148u8, 250u8, 248u8, 102u8, 79u8, 165u8, + 175u8, + ], + ) + } + #[doc = "Create a vested transfer."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account receiving the vested funds."] + #[doc = "- `schedule`: The vesting schedule attached to the transfer."] + #[doc = ""] + #[doc = "Emits `VestingCreated`."] + #[doc = ""] + #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- DbWeight: 3 Reads, 3 Writes"] + #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account, [Sender Account]"] + #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account, [Sender Account]"] + #[doc = "# "] + pub fn vested_transfer( + &self, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Vesting", + "vested_transfer", + VestedTransfer { target, schedule }, + [ + 135u8, 172u8, 56u8, 97u8, 45u8, 141u8, 93u8, 173u8, 111u8, 252u8, 75u8, + 246u8, 92u8, 181u8, 138u8, 87u8, 145u8, 174u8, 71u8, 108u8, 126u8, + 118u8, 49u8, 122u8, 249u8, 132u8, 19u8, 2u8, 132u8, 160u8, 247u8, + 195u8, + ], + ) + } + #[doc = "Force a vested transfer."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "- `source`: The account whose funds should be transferred."] + #[doc = "- `target`: The account that should be transferred the vested funds."] + #[doc = "- `schedule`: The vesting schedule attached to the transfer."] + #[doc = ""] + #[doc = "Emits `VestingCreated`."] + #[doc = ""] + #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- DbWeight: 4 Reads, 4 Writes"] + #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account, Source Account"] + #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account, Source Account"] + #[doc = "# "] + pub fn force_vested_transfer( + &self, + source: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Vesting", + "force_vested_transfer", + ForceVestedTransfer { + source, + target, + schedule, + }, + [ + 110u8, 142u8, 63u8, 148u8, 90u8, 229u8, 237u8, 183u8, 240u8, 237u8, + 242u8, 32u8, 88u8, 48u8, 220u8, 101u8, 210u8, 212u8, 27u8, 7u8, 186u8, + 98u8, 28u8, 197u8, 148u8, 140u8, 77u8, 59u8, 202u8, 166u8, 63u8, 97u8, + ], + ) + } + #[doc = "Merge two vesting schedules together, creating a new vesting schedule that unlocks over"] + #[doc = "the highest possible start and end blocks. If both schedules have already started the"] + #[doc = "current block will be used as the schedule start; with the caveat that if one schedule"] + #[doc = "is finished by the current block, the other will be treated as the new merged schedule,"] + #[doc = "unmodified."] + #[doc = ""] + #[doc = "NOTE: If `schedule1_index == schedule2_index` this is a no-op."] + #[doc = "NOTE: This will unlock all schedules through the current block prior to merging."] + #[doc = "NOTE: If both schedules have ended by the current block, no new schedule will be created"] + #[doc = "and both will be removed."] + #[doc = ""] + #[doc = "Merged schedule attributes:"] + #[doc = "- `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,"] + #[doc = " current_block)`."] + #[doc = "- `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`."] + #[doc = "- `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `schedule1_index`: index of the first schedule to merge."] + #[doc = "- `schedule2_index`: index of the second schedule to merge."] + pub fn merge_schedules( + &self, + schedule1_index: ::core::primitive::u32, + schedule2_index: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Vesting", + "merge_schedules", + MergeSchedules { + schedule1_index, + schedule2_index, + }, + [ + 95u8, 255u8, 147u8, 12u8, 49u8, 25u8, 70u8, 112u8, 55u8, 154u8, 183u8, + 97u8, 56u8, 244u8, 148u8, 61u8, 107u8, 163u8, 220u8, 31u8, 153u8, 25u8, + 193u8, 251u8, 131u8, 26u8, 166u8, 157u8, 75u8, 4u8, 110u8, 125u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_vesting::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The amount vested has been updated. This could indicate a change in funds available."] + #[doc = "The balance given is the amount which is left unvested (and thus locked)."] + pub struct VestingUpdated { + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + pub unvested: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for VestingUpdated { + const PALLET: &'static str = "Vesting"; + const EVENT: &'static str = "VestingUpdated"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An \\[account\\] has become fully vested."] + pub struct VestingCompleted { + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for VestingCompleted { + const PALLET: &'static str = "Vesting"; + const EVENT: &'static str = "VestingCompleted"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Information regarding the vesting of a given account."] + pub fn vesting( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + >, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Vesting", + "Vesting", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 23u8, 209u8, 233u8, 126u8, 89u8, 156u8, 193u8, 204u8, 100u8, 90u8, + 14u8, 120u8, 36u8, 167u8, 148u8, 239u8, 179u8, 74u8, 207u8, 83u8, 54u8, + 77u8, 27u8, 135u8, 74u8, 31u8, 33u8, 11u8, 168u8, 239u8, 212u8, 36u8, + ], + ) + } + #[doc = " Information regarding the vesting of a given account."] + pub fn vesting_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Vesting", + "Vesting", + Vec::new(), + [ + 23u8, 209u8, 233u8, 126u8, 89u8, 156u8, 193u8, 204u8, 100u8, 90u8, + 14u8, 120u8, 36u8, 167u8, 148u8, 239u8, 179u8, 74u8, 207u8, 83u8, 54u8, + 77u8, 27u8, 135u8, 74u8, 31u8, 33u8, 11u8, 168u8, 239u8, 212u8, 36u8, + ], + ) + } + #[doc = " Storage version of the pallet."] + #[doc = ""] + #[doc = " New networks start with latest version, as determined by the genesis build."] + pub fn storage_version( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Vesting", + "StorageVersion", + vec![], + [ + 50u8, 143u8, 26u8, 88u8, 129u8, 31u8, 61u8, 118u8, 19u8, 202u8, 119u8, + 160u8, 34u8, 219u8, 60u8, 57u8, 189u8, 66u8, 93u8, 239u8, 121u8, 114u8, + 241u8, 116u8, 0u8, 122u8, 232u8, 94u8, 189u8, 23u8, 45u8, 191u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The minimum amount transferred to call `vested_transfer`."] + pub fn min_vested_transfer( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Vesting", + "MinVestedTransfer", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + pub fn max_vesting_schedules( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Vesting", + "MaxVestingSchedules", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + } + } + } + pub mod utility { + use super::{root_mod, runtime_types}; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Batch { + pub calls: ::std::vec::Vec, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct AsDerivative { + pub index: ::core::primitive::u16, + pub call: ::std::boxed::Box, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BatchAll { + pub calls: ::std::vec::Vec, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct DispatchAs { + pub as_origin: ::std::boxed::Box, + pub call: ::std::boxed::Box, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ForceBatch { + pub calls: ::std::vec::Vec, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Send a batch of dispatch calls."] + #[doc = ""] + #[doc = "May be called from any origin."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] + #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] + #[doc = "# "] + #[doc = ""] + #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] + #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] + #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] + #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] + #[doc = "event is deposited."] + pub fn batch( + &self, + calls: ::std::vec::Vec, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Utility", + "batch", + Batch { calls }, + [ + 248u8, 73u8, 16u8, 255u8, 21u8, 225u8, 121u8, 194u8, 40u8, 206u8, + 178u8, 127u8, 3u8, 111u8, 86u8, 134u8, 164u8, 19u8, 245u8, 211u8, 36u8, + 156u8, 156u8, 29u8, 47u8, 78u8, 176u8, 168u8, 200u8, 161u8, 194u8, + 175u8, + ], + ) + } + #[doc = "Send a call through an indexed pseudonym of the sender."] + #[doc = ""] + #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] + #[doc = "use the same filter as the origin of this call."] + #[doc = ""] + #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] + #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] + #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] + #[doc = "in the Multisig pallet instead."] + #[doc = ""] + #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + pub fn as_derivative( + &self, + index: ::core::primitive::u16, + call: runtime_types::aleph_runtime::Call, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Utility", + "as_derivative", + AsDerivative { + index, + call: ::std::boxed::Box::new(call), + }, + [ + 122u8, 219u8, 185u8, 101u8, 96u8, 34u8, 17u8, 22u8, 155u8, 171u8, 35u8, + 46u8, 38u8, 127u8, 40u8, 36u8, 79u8, 136u8, 35u8, 128u8, 7u8, 174u8, + 245u8, 20u8, 235u8, 227u8, 174u8, 40u8, 123u8, 131u8, 18u8, 247u8, + ], + ) + } + #[doc = "Send a batch of dispatch calls and atomically execute them."] + #[doc = "The whole transaction will rollback and fail if any of the calls failed."] + #[doc = ""] + #[doc = "May be called from any origin."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] + #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] + #[doc = "# "] + pub fn batch_all( + &self, + calls: ::std::vec::Vec, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Utility", + "batch_all", + BatchAll { calls }, + [ + 15u8, 35u8, 102u8, 174u8, 118u8, 216u8, 123u8, 86u8, 206u8, 227u8, + 252u8, 163u8, 51u8, 115u8, 80u8, 212u8, 72u8, 131u8, 95u8, 230u8, + 246u8, 188u8, 236u8, 226u8, 194u8, 101u8, 235u8, 67u8, 132u8, 166u8, + 105u8, 230u8, + ], + ) + } + #[doc = "Dispatches a function call with a provided origin."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "- Limited storage reads."] + #[doc = "- One DB write (event)."] + #[doc = "- Weight of derivative `call` execution + T::WeightInfo::dispatch_as()."] + #[doc = "# "] + pub fn dispatch_as( + &self, + as_origin: runtime_types::aleph_runtime::OriginCaller, + call: runtime_types::aleph_runtime::Call, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Utility", + "dispatch_as", + DispatchAs { + as_origin: ::std::boxed::Box::new(as_origin), + call: ::std::boxed::Box::new(call), + }, + [ + 236u8, 210u8, 178u8, 222u8, 59u8, 57u8, 20u8, 80u8, 21u8, 90u8, 222u8, + 227u8, 65u8, 98u8, 182u8, 150u8, 126u8, 250u8, 33u8, 79u8, 57u8, 223u8, + 228u8, 221u8, 117u8, 113u8, 191u8, 144u8, 229u8, 205u8, 204u8, 216u8, + ], + ) + } + #[doc = "Send a batch of dispatch calls."] + #[doc = "Unlike `batch`, it allows errors and won't interrupt."] + #[doc = ""] + #[doc = "May be called from any origin."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] + #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] + #[doc = "# "] + pub fn force_batch( + &self, + calls: ::std::vec::Vec, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Utility", + "force_batch", + ForceBatch { calls }, + [ + 126u8, 213u8, 238u8, 69u8, 61u8, 82u8, 10u8, 147u8, 38u8, 119u8, 241u8, + 4u8, 43u8, 97u8, 140u8, 55u8, 131u8, 53u8, 118u8, 207u8, 211u8, 250u8, + 62u8, 163u8, 67u8, 69u8, 151u8, 70u8, 242u8, 202u8, 252u8, 75u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_utility::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Batch of dispatches did not complete fully. Index of first failing dispatch given, as"] + #[doc = "well as the error."] + pub struct BatchInterrupted { + pub index: ::core::primitive::u32, + pub error: runtime_types::sp_runtime::DispatchError, + } + impl ::subxt::events::StaticEvent for BatchInterrupted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchInterrupted"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Batch of dispatches completed fully with no error."] + pub struct BatchCompleted; + impl ::subxt::events::StaticEvent for BatchCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchCompleted"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Batch of dispatches completed but has errors."] + pub struct BatchCompletedWithErrors; + impl ::subxt::events::StaticEvent for BatchCompletedWithErrors { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "BatchCompletedWithErrors"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A single item within a Batch of dispatches has completed with no error."] + pub struct ItemCompleted; + impl ::subxt::events::StaticEvent for ItemCompleted { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "ItemCompleted"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A single item within a Batch of dispatches has completed with error."] + pub struct ItemFailed { + pub error: runtime_types::sp_runtime::DispatchError, + } + impl ::subxt::events::StaticEvent for ItemFailed { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "ItemFailed"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A call was dispatched."] + pub struct DispatchedAs { + pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::events::StaticEvent for DispatchedAs { + const PALLET: &'static str = "Utility"; + const EVENT: &'static str = "DispatchedAs"; + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The limit on the number of batched calls."] + pub fn batched_calls_limit( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Utility", + "batched_calls_limit", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + } + } + } + pub mod multisig { + use super::{root_mod, runtime_types}; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct AsMultiThreshold1 { + pub other_signatories: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + pub call: ::std::boxed::Box, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct AsMulti { + pub threshold: ::core::primitive::u16, + pub other_signatories: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + pub maybe_timepoint: ::core::option::Option< + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + >, + pub call: ::subxt::utils::WrapperKeepOpaque, + pub store_call: ::core::primitive::bool, + pub max_weight: ::core::primitive::u64, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ApproveAsMulti { + pub threshold: ::core::primitive::u16, + pub other_signatories: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + pub maybe_timepoint: ::core::option::Option< + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + >, + pub call_hash: [::core::primitive::u8; 32usize], + pub max_weight: ::core::primitive::u64, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CancelAsMulti { + pub threshold: ::core::primitive::u16, + pub other_signatories: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + pub timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + pub call_hash: [::core::primitive::u8; 32usize], + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Immediately dispatch a multi-signature call using a single approval from the caller."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `other_signatories`: The accounts (other than the sender) who are part of the"] + #[doc = "multi-signature, but do not participate in the approval process."] + #[doc = "- `call`: The call to be executed."] + #[doc = ""] + #[doc = "Result is equivalent to the dispatched result."] + #[doc = ""] + #[doc = "# "] + #[doc = "O(Z + C) where Z is the length of the call and C its execution weight."] + #[doc = "-------------------------------"] + #[doc = "- DB Weight: None"] + #[doc = "- Plus Call Weight"] + #[doc = "# "] + pub fn as_multi_threshold_1( + &self, + other_signatories: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + call: runtime_types::aleph_runtime::Call, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Multisig", + "as_multi_threshold_1", + AsMultiThreshold1 { + other_signatories, + call: ::std::boxed::Box::new(call), + }, + [ + 247u8, 171u8, 115u8, 147u8, 223u8, 173u8, 211u8, 231u8, 93u8, 31u8, + 41u8, 110u8, 207u8, 202u8, 102u8, 216u8, 233u8, 130u8, 169u8, 188u8, + 3u8, 0u8, 5u8, 77u8, 58u8, 5u8, 22u8, 24u8, 20u8, 126u8, 69u8, 240u8, + ], + ) + } + #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] + #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] + #[doc = ""] + #[doc = "If there are enough, then dispatch the call."] + #[doc = ""] + #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] + #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] + #[doc = "is cancelled."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] + #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] + #[doc = "transaction index) of the first approval transaction."] + #[doc = "- `call`: The call to be executed."] + #[doc = ""] + #[doc = "NOTE: Unless this is the final approval, you will generally want to use"] + #[doc = "`approve_as_multi` instead, since it only requires a hash of the call."] + #[doc = ""] + #[doc = "Result is equivalent to the dispatched result if `threshold` is exactly `1`. Otherwise"] + #[doc = "on success, result is `Ok` and the result from the interior call, if it was executed,"] + #[doc = "may be found in the deposited `MultisigExecuted` event."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(S + Z + Call)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One call encode & hash, both of complexity `O(Z)` where `Z` is tx-len."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] + #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] + #[doc = "- One event."] + #[doc = "- The weight of the `call`."] + #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] + #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] + #[doc = "-------------------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Reads: Multisig Storage, [Caller Account], Calls (if `store_call`)"] + #[doc = " - Writes: Multisig Storage, [Caller Account], Calls (if `store_call`)"] + #[doc = "- Plus Call Weight"] + #[doc = "# "] + pub fn as_multi( + &self, + threshold: ::core::primitive::u16, + other_signatories: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + maybe_timepoint: ::core::option::Option< + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + >, + call: ::subxt::utils::WrapperKeepOpaque, + store_call: ::core::primitive::bool, + max_weight: ::core::primitive::u64, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Multisig", + "as_multi", + AsMulti { + threshold, + other_signatories, + maybe_timepoint, + call, + store_call, + max_weight, + }, + [ + 83u8, 122u8, 123u8, 255u8, 187u8, 151u8, 115u8, 27u8, 236u8, 123u8, + 13u8, 245u8, 54u8, 176u8, 35u8, 10u8, 224u8, 49u8, 39u8, 4u8, 55u8, + 140u8, 218u8, 38u8, 93u8, 177u8, 159u8, 146u8, 131u8, 241u8, 177u8, + 122u8, + ], + ) + } + #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] + #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] + #[doc = ""] + #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] + #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] + #[doc = "is cancelled."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] + #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] + #[doc = "transaction index) of the first approval transaction."] + #[doc = "- `call_hash`: The hash of the call to be executed."] + #[doc = ""] + #[doc = "NOTE: If this is the final approval, you will want to use `as_multi` instead."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(S)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] + #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] + #[doc = "- One event."] + #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] + #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] + #[doc = "----------------------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Read: Multisig Storage, [Caller Account]"] + #[doc = " - Write: Multisig Storage, [Caller Account]"] + #[doc = "# "] + pub fn approve_as_multi( + &self, + threshold: ::core::primitive::u16, + other_signatories: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + maybe_timepoint: ::core::option::Option< + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + >, + call_hash: [::core::primitive::u8; 32usize], + max_weight: ::core::primitive::u64, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Multisig", + "approve_as_multi", + ApproveAsMulti { + threshold, + other_signatories, + maybe_timepoint, + call_hash, + max_weight, + }, + [ + 55u8, 94u8, 230u8, 217u8, 37u8, 143u8, 44u8, 108u8, 123u8, 250u8, 26u8, + 44u8, 236u8, 69u8, 63u8, 90u8, 126u8, 15u8, 233u8, 142u8, 213u8, 11u8, + 141u8, 147u8, 151u8, 24u8, 167u8, 62u8, 96u8, 227u8, 181u8, 140u8, + ], + ) + } + #[doc = "Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously"] + #[doc = "for this operation will be unreserved on success."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `timepoint`: The timepoint (block number and transaction index) of the first approval"] + #[doc = "transaction for this dispatch."] + #[doc = "- `call_hash`: The hash of the call to be executed."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(S)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- One event."] + #[doc = "- I/O: 1 read `O(S)`, one remove."] + #[doc = "- Storage: removes one item."] + #[doc = "----------------------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Read: Multisig Storage, [Caller Account], Refund Account, Calls"] + #[doc = " - Write: Multisig Storage, [Caller Account], Refund Account, Calls"] + #[doc = "# "] + pub fn cancel_as_multi( + &self, + threshold: ::core::primitive::u16, + other_signatories: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + call_hash: [::core::primitive::u8; 32usize], + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Multisig", + "cancel_as_multi", + CancelAsMulti { + threshold, + other_signatories, + timepoint, + call_hash, + }, + [ + 30u8, 25u8, 186u8, 142u8, 168u8, 81u8, 235u8, 164u8, 82u8, 209u8, 66u8, + 129u8, 209u8, 78u8, 172u8, 9u8, 163u8, 222u8, 125u8, 57u8, 2u8, 43u8, + 169u8, 174u8, 159u8, 167u8, 25u8, 226u8, 254u8, 110u8, 80u8, 216u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_multisig::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A new multisig operation has begun."] + pub struct NewMultisig { + pub approving: ::subxt::ext::sp_core::crypto::AccountId32, + pub multisig: ::subxt::ext::sp_core::crypto::AccountId32, + pub call_hash: [::core::primitive::u8; 32usize], + } + impl ::subxt::events::StaticEvent for NewMultisig { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "NewMultisig"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A multisig operation has been approved by someone."] + pub struct MultisigApproval { + pub approving: ::subxt::ext::sp_core::crypto::AccountId32, + pub timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + pub multisig: ::subxt::ext::sp_core::crypto::AccountId32, + pub call_hash: [::core::primitive::u8; 32usize], + } + impl ::subxt::events::StaticEvent for MultisigApproval { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "MultisigApproval"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A multisig operation has been executed."] + pub struct MultisigExecuted { + pub approving: ::subxt::ext::sp_core::crypto::AccountId32, + pub timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + pub multisig: ::subxt::ext::sp_core::crypto::AccountId32, + pub call_hash: [::core::primitive::u8; 32usize], + pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::events::StaticEvent for MultisigExecuted { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "MultisigExecuted"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A multisig operation has been cancelled."] + pub struct MultisigCancelled { + pub cancelling: ::subxt::ext::sp_core::crypto::AccountId32, + pub timepoint: runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + pub multisig: ::subxt::ext::sp_core::crypto::AccountId32, + pub call_hash: [::core::primitive::u8; 32usize], + } + impl ::subxt::events::StaticEvent for MultisigCancelled { + const PALLET: &'static str = "Multisig"; + const EVENT: &'static str = "MultisigCancelled"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The set of open multisig operations."] + pub fn multisigs( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + _1: impl ::std::borrow::Borrow<[::core::primitive::u8; 32usize]>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_multisig::Multisig< + ::core::primitive::u32, + ::core::primitive::u128, + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Multisig", + "Multisigs", + vec![ + ::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + ), + ::subxt::storage::address::StorageMapKey::new( + _1.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + ), + ], + [ + 145u8, 78u8, 57u8, 171u8, 199u8, 158u8, 226u8, 250u8, 224u8, 133u8, + 45u8, 251u8, 202u8, 22u8, 171u8, 132u8, 229u8, 110u8, 248u8, 233u8, + 38u8, 2u8, 247u8, 140u8, 150u8, 103u8, 211u8, 209u8, 160u8, 158u8, + 23u8, 215u8, + ], + ) + } + #[doc = " The set of open multisig operations."] + pub fn multisigs_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_multisig::Multisig< + ::core::primitive::u32, + ::core::primitive::u128, + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Multisig", + "Multisigs", + Vec::new(), + [ + 145u8, 78u8, 57u8, 171u8, 199u8, 158u8, 226u8, 250u8, 224u8, 133u8, + 45u8, 251u8, 202u8, 22u8, 171u8, 132u8, 229u8, 110u8, 248u8, 233u8, + 38u8, 2u8, 247u8, 140u8, 150u8, 103u8, 211u8, 209u8, 160u8, 158u8, + 23u8, 215u8, + ], + ) + } + pub fn calls( + &self, + _0: impl ::std::borrow::Borrow<[::core::primitive::u8; 32usize]>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::subxt::utils::WrapperKeepOpaque, + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Multisig", + "Calls", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 245u8, 208u8, 157u8, 111u8, 182u8, 73u8, 236u8, 91u8, 235u8, 244u8, + 150u8, 126u8, 236u8, 26u8, 219u8, 124u8, 107u8, 255u8, 81u8, 47u8, + 155u8, 163u8, 214u8, 197u8, 63u8, 76u8, 127u8, 101u8, 29u8, 121u8, + 135u8, 220u8, + ], + ) + } + pub fn calls_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::subxt::utils::WrapperKeepOpaque, + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Multisig", + "Calls", + Vec::new(), + [ + 245u8, 208u8, 157u8, 111u8, 182u8, 73u8, 236u8, 91u8, 235u8, 244u8, + 150u8, 126u8, 236u8, 26u8, 219u8, 124u8, 107u8, 255u8, 81u8, 47u8, + 155u8, 163u8, 214u8, 197u8, 63u8, 76u8, 127u8, 101u8, 29u8, 121u8, + 135u8, 220u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The base amount of currency needed to reserve for creating a multisig execution or to"] + #[doc = " store a dispatch call for later."] + #[doc = ""] + #[doc = " This is held for an additional storage item whose value size is"] + #[doc = " `4 + sizeof((BlockNumber, Balance, AccountId))` bytes and whose key size is"] + #[doc = " `32 + sizeof(AccountId)` bytes."] + pub fn deposit_base( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Multisig", + "DepositBase", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + #[doc = " The amount of currency needed per unit threshold when creating a multisig execution."] + #[doc = ""] + #[doc = " This is held for adding 32 bytes more into a pre-existing storage value."] + pub fn deposit_factor( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Multisig", + "DepositFactor", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + #[doc = " The maximum amount of signatories allowed in the multisig."] + pub fn max_signatories( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u16>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Multisig", + "MaxSignatories", + [ + 116u8, 33u8, 2u8, 170u8, 181u8, 147u8, 171u8, 169u8, 167u8, 227u8, + 41u8, 144u8, 11u8, 236u8, 82u8, 100u8, 74u8, 60u8, 184u8, 72u8, 169u8, + 90u8, 208u8, 135u8, 15u8, 117u8, 10u8, 123u8, 128u8, 193u8, 29u8, 70u8, + ], + ) + } + } + } + } + pub mod sudo { + use super::{root_mod, runtime_types}; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Sudo { + pub call: ::std::boxed::Box, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SudoUncheckedWeight { + pub call: ::std::boxed::Box, + pub weight: ::core::primitive::u64, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetKey { + pub new: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SudoAs { + pub who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + pub call: ::std::boxed::Box, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "- Limited storage reads."] + #[doc = "- One DB write (event)."] + #[doc = "- Weight of derivative `call` execution + 10,000."] + #[doc = "# "] + pub fn sudo( + &self, + call: runtime_types::aleph_runtime::Call, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Sudo", + "sudo", + Sudo { + call: ::std::boxed::Box::new(call), + }, + [ + 196u8, 104u8, 24u8, 12u8, 26u8, 123u8, 201u8, 129u8, 238u8, 147u8, + 209u8, 157u8, 104u8, 120u8, 191u8, 41u8, 224u8, 131u8, 183u8, 155u8, + 228u8, 52u8, 191u8, 103u8, 252u8, 138u8, 106u8, 225u8, 38u8, 161u8, + 210u8, 39u8, + ], + ) + } + #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] + #[doc = "This function does not check the weight of the call, and instead allows the"] + #[doc = "Sudo user to specify the weight of the call."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "- The weight of this call is defined by the caller."] + #[doc = "# "] + pub fn sudo_unchecked_weight( + &self, + call: runtime_types::aleph_runtime::Call, + weight: ::core::primitive::u64, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Sudo", + "sudo_unchecked_weight", + SudoUncheckedWeight { + call: ::std::boxed::Box::new(call), + weight, + }, + [ + 135u8, 78u8, 105u8, 196u8, 123u8, 10u8, 62u8, 134u8, 91u8, 206u8, 41u8, + 152u8, 64u8, 52u8, 106u8, 64u8, 68u8, 201u8, 112u8, 136u8, 56u8, 245u8, + 172u8, 179u8, 168u8, 22u8, 110u8, 198u8, 59u8, 25u8, 39u8, 60u8, + ], + ) + } + #[doc = "Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo"] + #[doc = "key."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "- Limited storage reads."] + #[doc = "- One DB change."] + #[doc = "# "] + pub fn set_key( + &self, + new: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Sudo", + "set_key", + SetKey { new }, + [ + 23u8, 224u8, 218u8, 169u8, 8u8, 28u8, 111u8, 199u8, 26u8, 88u8, 225u8, + 105u8, 17u8, 19u8, 87u8, 156u8, 97u8, 67u8, 89u8, 173u8, 70u8, 0u8, + 5u8, 246u8, 198u8, 135u8, 182u8, 180u8, 44u8, 9u8, 212u8, 95u8, + ], + ) + } + #[doc = "Authenticates the sudo key and dispatches a function call with `Signed` origin from"] + #[doc = "a given account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "- Limited storage reads."] + #[doc = "- One DB write (event)."] + #[doc = "- Weight of derivative `call` execution + 10,000."] + #[doc = "# "] + pub fn sudo_as( + &self, + who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + call: runtime_types::aleph_runtime::Call, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Sudo", + "sudo_as", + SudoAs { + who, + call: ::std::boxed::Box::new(call), + }, + [ + 140u8, 39u8, 202u8, 191u8, 235u8, 44u8, 171u8, 120u8, 71u8, 236u8, + 116u8, 7u8, 243u8, 61u8, 34u8, 24u8, 31u8, 67u8, 21u8, 79u8, 229u8, + 71u8, 49u8, 193u8, 199u8, 220u8, 184u8, 72u8, 79u8, 22u8, 73u8, 86u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_sudo::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A sudo just took place. \\[result\\]"] + pub struct Sudid { + pub sudo_result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::events::StaticEvent for Sudid { + const PALLET: &'static str = "Sudo"; + const EVENT: &'static str = "Sudid"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The \\[sudoer\\] just switched identity; the old key is supplied if one existed."] + pub struct KeyChanged { + pub old_sudoer: ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + } + impl ::subxt::events::StaticEvent for KeyChanged { + const PALLET: &'static str = "Sudo"; + const EVENT: &'static str = "KeyChanged"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A sudo just took place. \\[result\\]"] + pub struct SudoAsDone { + pub sudo_result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::events::StaticEvent for SudoAsDone { + const PALLET: &'static str = "Sudo"; + const EVENT: &'static str = "SudoAsDone"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The `AccountId` of the sudo key."] + pub fn key( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::crypto::AccountId32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Sudo", + "Key", + vec![], + [ + 244u8, 73u8, 188u8, 136u8, 218u8, 163u8, 68u8, 179u8, 122u8, 173u8, + 34u8, 108u8, 137u8, 28u8, 182u8, 16u8, 196u8, 92u8, 138u8, 34u8, 102u8, + 80u8, 199u8, 88u8, 107u8, 207u8, 36u8, 22u8, 168u8, 167u8, 20u8, 142u8, + ], + ) + } + } + } + } + pub mod contracts { + use super::{root_mod, runtime_types}; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Call { + pub dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + pub value: ::core::primitive::u128, + #[codec(compact)] + pub gas_limit: ::core::primitive::u64, + pub storage_deposit_limit: + ::core::option::Option<::subxt::ext::codec::Compact<::core::primitive::u128>>, + pub data: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct InstantiateWithCode { + #[codec(compact)] + pub value: ::core::primitive::u128, + #[codec(compact)] + pub gas_limit: ::core::primitive::u64, + pub storage_deposit_limit: + ::core::option::Option<::subxt::ext::codec::Compact<::core::primitive::u128>>, + pub code: ::std::vec::Vec<::core::primitive::u8>, + pub data: ::std::vec::Vec<::core::primitive::u8>, + pub salt: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Instantiate { + #[codec(compact)] + pub value: ::core::primitive::u128, + #[codec(compact)] + pub gas_limit: ::core::primitive::u64, + pub storage_deposit_limit: + ::core::option::Option<::subxt::ext::codec::Compact<::core::primitive::u128>>, + pub code_hash: ::subxt::ext::sp_core::H256, + pub data: ::std::vec::Vec<::core::primitive::u8>, + pub salt: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct UploadCode { + pub code: ::std::vec::Vec<::core::primitive::u8>, + pub storage_deposit_limit: + ::core::option::Option<::subxt::ext::codec::Compact<::core::primitive::u128>>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RemoveCode { + pub code_hash: ::subxt::ext::sp_core::H256, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetCode { + pub dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + pub code_hash: ::subxt::ext::sp_core::H256, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Makes a call to an account, optionally transferring some balance."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `dest`: Address of the contract to call."] + #[doc = "* `value`: The balance to transfer from the `origin` to `dest`."] + #[doc = "* `gas_limit`: The gas limit enforced when executing the constructor."] + #[doc = "* `storage_deposit_limit`: The maximum amount of balance that can be charged from the"] + #[doc = " caller to pay for the storage consumed."] + #[doc = "* `data`: The input data to pass to the contract."] + #[doc = ""] + #[doc = "* If the account is a smart-contract account, the associated code will be"] + #[doc = "executed and any value will be transferred."] + #[doc = "* If the account is a regular account, any value will be transferred."] + #[doc = "* If no account exists and the call value is not less than `existential_deposit`,"] + #[doc = "a regular account will be created and any value will be transferred."] + pub fn call( + &self, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + value: ::core::primitive::u128, + gas_limit: ::core::primitive::u64, + storage_deposit_limit: ::core::option::Option< + ::subxt::ext::codec::Compact<::core::primitive::u128>, + >, + data: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Contracts", + "call", + Call { + dest, + value, + gas_limit, + storage_deposit_limit, + data, + }, + [ + 22u8, 148u8, 225u8, 3u8, 113u8, 132u8, 125u8, 117u8, 187u8, 51u8, 32u8, + 8u8, 2u8, 125u8, 76u8, 14u8, 227u8, 139u8, 67u8, 136u8, 55u8, 98u8, + 181u8, 163u8, 105u8, 175u8, 43u8, 125u8, 17u8, 123u8, 191u8, 228u8, + ], + ) + } + #[doc = "Instantiates a new contract from the supplied `code` optionally transferring"] + #[doc = "some balance."] + #[doc = ""] + #[doc = "This dispatchable has the same effect as calling [`Self::upload_code`] +"] + #[doc = "[`Self::instantiate`]. Bundling them together provides efficiency gains. Please"] + #[doc = "also check the documentation of [`Self::upload_code`]."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `value`: The balance to transfer from the `origin` to the newly created contract."] + #[doc = "* `gas_limit`: The gas limit enforced when executing the constructor."] + #[doc = "* `storage_deposit_limit`: The maximum amount of balance that can be charged/reserved"] + #[doc = " from the caller to pay for the storage consumed."] + #[doc = "* `code`: The contract code to deploy in raw bytes."] + #[doc = "* `data`: The input data to pass to the contract constructor."] + #[doc = "* `salt`: Used for the address derivation. See [`Pallet::contract_address`]."] + #[doc = ""] + #[doc = "Instantiation is executed as follows:"] + #[doc = ""] + #[doc = "- The supplied `code` is instrumented, deployed, and a `code_hash` is created for that"] + #[doc = " code."] + #[doc = "- If the `code_hash` already exists on the chain the underlying `code` will be shared."] + #[doc = "- The destination address is computed based on the sender, code_hash and the salt."] + #[doc = "- The smart-contract account is created at the computed address."] + #[doc = "- The `value` is transferred to the new account."] + #[doc = "- The `deploy` function is executed in the context of the newly-created account."] + pub fn instantiate_with_code( + &self, + value: ::core::primitive::u128, + gas_limit: ::core::primitive::u64, + storage_deposit_limit: ::core::option::Option< + ::subxt::ext::codec::Compact<::core::primitive::u128>, + >, + code: ::std::vec::Vec<::core::primitive::u8>, + data: ::std::vec::Vec<::core::primitive::u8>, + salt: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Contracts", + "instantiate_with_code", + InstantiateWithCode { + value, + gas_limit, + storage_deposit_limit, + code, + data, + salt, + }, + [ + 232u8, 229u8, 46u8, 91u8, 11u8, 117u8, 3u8, 81u8, 213u8, 34u8, 184u8, + 125u8, 77u8, 214u8, 71u8, 103u8, 244u8, 131u8, 1u8, 211u8, 191u8, + 153u8, 1u8, 80u8, 177u8, 177u8, 205u8, 126u8, 194u8, 166u8, 136u8, + 191u8, + ], + ) + } + #[doc = "Instantiates a contract from a previously deployed wasm binary."] + #[doc = ""] + #[doc = "This function is identical to [`Self::instantiate_with_code`] but without the"] + #[doc = "code deployment step. Instead, the `code_hash` of an on-chain deployed wasm binary"] + #[doc = "must be supplied."] + pub fn instantiate( + &self, + value: ::core::primitive::u128, + gas_limit: ::core::primitive::u64, + storage_deposit_limit: ::core::option::Option< + ::subxt::ext::codec::Compact<::core::primitive::u128>, + >, + code_hash: ::subxt::ext::sp_core::H256, + data: ::std::vec::Vec<::core::primitive::u8>, + salt: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Contracts", + "instantiate", + Instantiate { + value, + gas_limit, + storage_deposit_limit, + code_hash, + data, + salt, + }, + [ + 69u8, 161u8, 178u8, 243u8, 14u8, 29u8, 15u8, 210u8, 29u8, 106u8, 129u8, + 211u8, 90u8, 73u8, 66u8, 177u8, 245u8, 1u8, 232u8, 117u8, 119u8, 216u8, + 84u8, 160u8, 207u8, 7u8, 237u8, 88u8, 25u8, 85u8, 213u8, 235u8, + ], + ) + } + #[doc = "Upload new `code` without instantiating a contract from it."] + #[doc = ""] + #[doc = "If the code does not already exist a deposit is reserved from the caller"] + #[doc = "and unreserved only when [`Self::remove_code`] is called. The size of the reserve"] + #[doc = "depends on the instrumented size of the the supplied `code`."] + #[doc = ""] + #[doc = "If the code already exists in storage it will still return `Ok` and upgrades"] + #[doc = "the in storage version to the current"] + #[doc = "[`InstructionWeights::version`](InstructionWeights)."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "Anyone can instantiate a contract from any uploaded code and thus prevent its removal."] + #[doc = "To avoid this situation a constructor could employ access control so that it can"] + #[doc = "only be instantiated by permissioned entities. The same is true when uploading"] + #[doc = "through [`Self::instantiate_with_code`]."] + pub fn upload_code( + &self, + code: ::std::vec::Vec<::core::primitive::u8>, + storage_deposit_limit: ::core::option::Option< + ::subxt::ext::codec::Compact<::core::primitive::u128>, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Contracts", + "upload_code", + UploadCode { + code, + storage_deposit_limit, + }, + [ + 8u8, 32u8, 174u8, 226u8, 212u8, 86u8, 47u8, 247u8, 123u8, 155u8, 40u8, + 192u8, 184u8, 216u8, 61u8, 57u8, 94u8, 23u8, 76u8, 59u8, 4u8, 124u8, + 252u8, 248u8, 87u8, 233u8, 13u8, 184u8, 133u8, 236u8, 174u8, 85u8, + ], + ) + } + #[doc = "Remove the code stored under `code_hash` and refund the deposit to its owner."] + #[doc = ""] + #[doc = "A code can only be removed by its original uploader (its owner) and only if it is"] + #[doc = "not used by any contract."] + pub fn remove_code( + &self, + code_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Contracts", + "remove_code", + RemoveCode { code_hash }, + [ + 43u8, 192u8, 198u8, 182u8, 108u8, 76u8, 21u8, 42u8, 169u8, 41u8, 195u8, + 73u8, 31u8, 179u8, 162u8, 56u8, 91u8, 5u8, 64u8, 7u8, 252u8, 194u8, + 255u8, 170u8, 67u8, 137u8, 143u8, 192u8, 2u8, 149u8, 38u8, 180u8, + ], + ) + } + #[doc = "Privileged function that changes the code of an existing contract."] + #[doc = ""] + #[doc = "This takes care of updating refcounts and all other necessary operations. Returns"] + #[doc = "an error if either the `code_hash` or `dest` do not exist."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "This does **not** change the address of the contract in question. This means"] + #[doc = "that the contract address is no longer derived from its code hash after calling"] + #[doc = "this dispatchable."] + pub fn set_code( + &self, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + code_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Contracts", + "set_code", + SetCode { dest, code_hash }, + [ + 106u8, 141u8, 239u8, 113u8, 99u8, 74u8, 14u8, 171u8, 80u8, 115u8, + 214u8, 203u8, 232u8, 142u8, 48u8, 207u8, 214u8, 59u8, 204u8, 157u8, + 101u8, 142u8, 12u8, 69u8, 230u8, 188u8, 60u8, 197u8, 238u8, 146u8, + 17u8, 190u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_contracts::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contract deployed by address at the specified address."] + pub struct Instantiated { + pub deployer: ::subxt::ext::sp_core::crypto::AccountId32, + pub contract: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for Instantiated { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "Instantiated"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contract has been removed."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "The only way for a contract to be removed and emitting this event is by calling"] + #[doc = "`seal_terminate`."] + pub struct Terminated { + pub contract: ::subxt::ext::sp_core::crypto::AccountId32, + pub beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for Terminated { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "Terminated"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Code with the specified hash has been stored."] + pub struct CodeStored { + pub code_hash: ::subxt::ext::sp_core::H256, + } + impl ::subxt::events::StaticEvent for CodeStored { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "CodeStored"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A custom event emitted by the contract."] + pub struct ContractEmitted { + pub contract: ::subxt::ext::sp_core::crypto::AccountId32, + pub data: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::events::StaticEvent for ContractEmitted { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "ContractEmitted"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A code with the specified hash was removed."] + pub struct CodeRemoved { + pub code_hash: ::subxt::ext::sp_core::H256, + } + impl ::subxt::events::StaticEvent for CodeRemoved { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "CodeRemoved"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A contract's code was updated."] + pub struct ContractCodeUpdated { + pub contract: ::subxt::ext::sp_core::crypto::AccountId32, + pub new_code_hash: ::subxt::ext::sp_core::H256, + pub old_code_hash: ::subxt::ext::sp_core::H256, + } + impl ::subxt::events::StaticEvent for ContractCodeUpdated { + const PALLET: &'static str = "Contracts"; + const EVENT: &'static str = "ContractCodeUpdated"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " A mapping from an original code hash to the original code, untouched by instrumentation."] + pub fn pristine_code( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Contracts", + "PristineCode", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 244u8, 169u8, 220u8, 235u8, 62u8, 153u8, 226u8, 187u8, 220u8, 141u8, + 149u8, 75u8, 224u8, 117u8, 181u8, 147u8, 140u8, 84u8, 9u8, 109u8, + 230u8, 25u8, 186u8, 26u8, 171u8, 147u8, 19u8, 78u8, 62u8, 170u8, 27u8, + 105u8, + ], + ) + } + #[doc = " A mapping from an original code hash to the original code, untouched by instrumentation."] + pub fn pristine_code_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Contracts", + "PristineCode", + Vec::new(), + [ + 244u8, 169u8, 220u8, 235u8, 62u8, 153u8, 226u8, 187u8, 220u8, 141u8, + 149u8, 75u8, 224u8, 117u8, 181u8, 147u8, 140u8, 84u8, 9u8, 109u8, + 230u8, 25u8, 186u8, 26u8, 171u8, 147u8, 19u8, 78u8, 62u8, 170u8, 27u8, + 105u8, + ], + ) + } + #[doc = " A mapping between an original code hash and instrumented wasm code, ready for execution."] + pub fn code_storage( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_contracts::wasm::PrefabWasmModule, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Contracts", + "CodeStorage", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 167u8, 247u8, 131u8, 220u8, 90u8, 100u8, 172u8, 16u8, 129u8, 235u8, + 119u8, 88u8, 60u8, 196u8, 74u8, 173u8, 192u8, 110u8, 106u8, 187u8, + 111u8, 255u8, 114u8, 39u8, 76u8, 52u8, 245u8, 79u8, 132u8, 108u8, + 141u8, 176u8, + ], + ) + } + #[doc = " A mapping between an original code hash and instrumented wasm code, ready for execution."] + pub fn code_storage_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_contracts::wasm::PrefabWasmModule, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Contracts", + "CodeStorage", + Vec::new(), + [ + 167u8, 247u8, 131u8, 220u8, 90u8, 100u8, 172u8, 16u8, 129u8, 235u8, + 119u8, 88u8, 60u8, 196u8, 74u8, 173u8, 192u8, 110u8, 106u8, 187u8, + 111u8, 255u8, 114u8, 39u8, 76u8, 52u8, 245u8, 79u8, 132u8, 108u8, + 141u8, 176u8, + ], + ) + } + #[doc = " A mapping between an original code hash and its owner information."] + pub fn owner_info_of( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_contracts::wasm::OwnerInfo, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Contracts", + "OwnerInfoOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 147u8, 6u8, 225u8, 62u8, 211u8, 236u8, 61u8, 116u8, 152u8, 219u8, + 220u8, 17u8, 82u8, 221u8, 156u8, 88u8, 63u8, 204u8, 16u8, 11u8, 184u8, + 236u8, 181u8, 189u8, 170u8, 160u8, 60u8, 64u8, 71u8, 250u8, 202u8, + 186u8, + ], + ) + } + #[doc = " A mapping between an original code hash and its owner information."] + pub fn owner_info_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_contracts::wasm::OwnerInfo, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Contracts", + "OwnerInfoOf", + Vec::new(), + [ + 147u8, 6u8, 225u8, 62u8, 211u8, 236u8, 61u8, 116u8, 152u8, 219u8, + 220u8, 17u8, 82u8, 221u8, 156u8, 88u8, 63u8, 204u8, 16u8, 11u8, 184u8, + 236u8, 181u8, 189u8, 170u8, 160u8, 60u8, 64u8, 71u8, 250u8, 202u8, + 186u8, + ], + ) + } + #[doc = " This is a **monotonic** counter incremented on contract instantiation."] + #[doc = ""] + #[doc = " This is used in order to generate unique trie ids for contracts."] + #[doc = " The trie id of a new contract is calculated from hash(account_id, nonce)."] + #[doc = " The nonce is required because otherwise the following sequence would lead to"] + #[doc = " a possible collision of storage:"] + #[doc = ""] + #[doc = " 1. Create a new contract."] + #[doc = " 2. Terminate the contract."] + #[doc = " 3. Immediately recreate the contract with the same account_id."] + #[doc = ""] + #[doc = " This is bad because the contents of a trie are deleted lazily and there might be"] + #[doc = " storage of the old instantiation still in it when the new contract is created. Please"] + #[doc = " note that we can't replace the counter by the block number because the sequence above"] + #[doc = " can happen in the same block. We also can't keep the account counter in memory only"] + #[doc = " because storage is the only way to communicate across different extrinsics in the"] + #[doc = " same block."] + #[doc = ""] + #[doc = " # Note"] + #[doc = ""] + #[doc = " Do not use it to determine the number of contracts. It won't be decremented if"] + #[doc = " a contract is destroyed."] + pub fn nonce( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Contracts", + "Nonce", + vec![], + [ + 122u8, 169u8, 95u8, 131u8, 85u8, 32u8, 154u8, 114u8, 143u8, 56u8, 12u8, + 182u8, 64u8, 150u8, 241u8, 249u8, 254u8, 251u8, 160u8, 235u8, 192u8, + 41u8, 101u8, 232u8, 186u8, 108u8, 187u8, 149u8, 210u8, 91u8, 179u8, + 98u8, + ], + ) + } + #[doc = " The code associated with a given account."] + #[doc = ""] + #[doc = " TWOX-NOTE: SAFE since `AccountId` is a secure hash."] + pub fn contract_info_of( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_contracts::storage::RawContractInfo< + ::subxt::ext::sp_core::H256, + ::core::primitive::u128, + >, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Contracts", + "ContractInfoOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 249u8, 249u8, 163u8, 158u8, 30u8, 66u8, 127u8, 176u8, 156u8, 185u8, + 75u8, 198u8, 120u8, 208u8, 233u8, 131u8, 161u8, 49u8, 45u8, 175u8, + 242u8, 171u8, 63u8, 39u8, 76u8, 31u8, 167u8, 140u8, 210u8, 235u8, + 185u8, 240u8, + ], + ) + } + #[doc = " The code associated with a given account."] + #[doc = ""] + #[doc = " TWOX-NOTE: SAFE since `AccountId` is a secure hash."] + pub fn contract_info_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_contracts::storage::RawContractInfo< + ::subxt::ext::sp_core::H256, + ::core::primitive::u128, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Contracts", + "ContractInfoOf", + Vec::new(), + [ + 249u8, 249u8, 163u8, 158u8, 30u8, 66u8, 127u8, 176u8, 156u8, 185u8, + 75u8, 198u8, 120u8, 208u8, 233u8, 131u8, 161u8, 49u8, 45u8, 175u8, + 242u8, 171u8, 63u8, 39u8, 76u8, 31u8, 167u8, 140u8, 210u8, 235u8, + 185u8, 240u8, + ], + ) + } + #[doc = " Evicted contracts that await child trie deletion."] + #[doc = ""] + #[doc = " Child trie deletion is a heavy operation depending on the amount of storage items"] + #[doc = " stored in said trie. Therefore this operation is performed lazily in `on_initialize`."] + pub fn deletion_queue( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + runtime_types::pallet_contracts::storage::DeletedContract, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Contracts", + "DeletionQueue", + vec![], + [ + 119u8, 169u8, 146u8, 210u8, 21u8, 216u8, 51u8, 225u8, 107u8, 61u8, + 42u8, 155u8, 169u8, 127u8, 140u8, 106u8, 255u8, 137u8, 163u8, 199u8, + 91u8, 137u8, 73u8, 61u8, 9u8, 167u8, 16u8, 157u8, 183u8, 212u8, 35u8, + 88u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Cost schedule and limits."] + pub fn schedule( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_contracts::schedule::Schedule, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "Contracts", + "Schedule", + [ + 106u8, 133u8, 138u8, 78u8, 95u8, 52u8, 197u8, 85u8, 4u8, 33u8, 173u8, + 239u8, 169u8, 196u8, 91u8, 38u8, 210u8, 50u8, 62u8, 67u8, 180u8, 184u8, + 32u8, 190u8, 106u8, 252u8, 104u8, 173u8, 5u8, 140u8, 244u8, 249u8, + ], + ) + } + #[doc = " The maximum number of contracts that can be pending for deletion."] + #[doc = ""] + #[doc = " When a contract is deleted by calling `seal_terminate` it becomes inaccessible"] + #[doc = " immediately, but the deletion of the storage items it has accumulated is performed"] + #[doc = " later. The contract is put into the deletion queue. This defines how many"] + #[doc = " contracts can be queued up at the same time. If that limit is reached `seal_terminate`"] + #[doc = " will fail. The action must be retried in a later block in that case."] + #[doc = ""] + #[doc = " The reasons for limiting the queue depth are:"] + #[doc = ""] + #[doc = " 1. The queue is in storage in order to be persistent between blocks. We want to limit"] + #[doc = " \tthe amount of storage that can be consumed."] + #[doc = " 2. The queue is stored in a vector and needs to be decoded as a whole when reading"] + #[doc = "\t\tit at the end of each block. Longer queues take more weight to decode and hence"] + #[doc = "\t\tlimit the amount of items that can be deleted per block."] + pub fn deletion_queue_depth( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Contracts", + "DeletionQueueDepth", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " The maximum amount of weight that can be consumed per block for lazy trie removal."] + #[doc = ""] + #[doc = " The amount of weight that is dedicated per block to work on the deletion queue. Larger"] + #[doc = " values allow more trie keys to be deleted in each block but reduce the amount of"] + #[doc = " weight that is left for transactions. See [`Self::DeletionQueueDepth`] for more"] + #[doc = " information about the deletion queue."] + pub fn deletion_weight_limit( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Contracts", + "DeletionWeightLimit", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, + 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, + 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, + 246u8, + ], + ) + } + #[doc = " The amount of balance a caller has to pay for each byte of storage."] + #[doc = ""] + #[doc = " # Note"] + #[doc = ""] + #[doc = " Changing this value for an existing chain might need a storage migration."] + pub fn deposit_per_byte( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Contracts", + "DepositPerByte", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + #[doc = " The weight per byte of code that is charged when loading a contract from storage."] + #[doc = ""] + #[doc = " Currently, FRAME only charges fees for computation incurred but not for PoV"] + #[doc = " consumption caused for storage access. This is usually not exploitable because"] + #[doc = " accessing storage carries some substantial weight costs, too. However in case"] + #[doc = " of contract code very much PoV consumption can be caused while consuming very little"] + #[doc = " computation. This could be used to keep the chain busy without paying the"] + #[doc = " proper fee for it. Until this is resolved we charge from the weight meter for"] + #[doc = " contract access."] + #[doc = ""] + #[doc = " For more information check out: "] + #[doc = ""] + #[doc = " [`DefaultContractAccessWeight`] is a safe default to be used for Polkadot or Kusama"] + #[doc = " parachains."] + #[doc = ""] + #[doc = " # Note"] + #[doc = ""] + #[doc = " This is only relevant for parachains. Set to zero in case of a standalone chain."] + pub fn contract_access_weight( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Contracts", + "ContractAccessWeight", + [ + 128u8, 214u8, 205u8, 242u8, 181u8, 142u8, 124u8, 231u8, 190u8, 146u8, + 59u8, 226u8, 157u8, 101u8, 103u8, 117u8, 249u8, 65u8, 18u8, 191u8, + 103u8, 119u8, 53u8, 85u8, 81u8, 96u8, 220u8, 42u8, 184u8, 239u8, 42u8, + 246u8, + ], + ) + } + #[doc = " The amount of balance a caller has to pay for each storage item."] + #[doc = ""] + #[doc = " # Note"] + #[doc = ""] + #[doc = " Changing this value for an existing chain might need a storage migration."] + pub fn deposit_per_item( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Contracts", + "DepositPerItem", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + } + } + } + pub mod nomination_pools { + use super::{root_mod, runtime_types}; + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Join { + #[codec(compact)] + pub amount: ::core::primitive::u128, + pub pool_id: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BondExtra { + pub extra: + runtime_types::pallet_nomination_pools::BondExtra<::core::primitive::u128>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ClaimPayout; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Unbond { + pub member_account: ::subxt::ext::sp_core::crypto::AccountId32, + #[codec(compact)] + pub unbonding_points: ::core::primitive::u128, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct PoolWithdrawUnbonded { + pub pool_id: ::core::primitive::u32, + pub num_slashing_spans: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct WithdrawUnbonded { + pub member_account: ::subxt::ext::sp_core::crypto::AccountId32, + pub num_slashing_spans: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Create { + #[codec(compact)] + pub amount: ::core::primitive::u128, + pub root: ::subxt::ext::sp_core::crypto::AccountId32, + pub nominator: ::subxt::ext::sp_core::crypto::AccountId32, + pub state_toggler: ::subxt::ext::sp_core::crypto::AccountId32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Nominate { + pub pool_id: ::core::primitive::u32, + pub validators: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetState { + pub pool_id: ::core::primitive::u32, + pub state: runtime_types::pallet_nomination_pools::PoolState, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetMetadata { + pub pool_id: ::core::primitive::u32, + pub metadata: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetConfigs { + pub min_join_bond: + runtime_types::pallet_nomination_pools::ConfigOp<::core::primitive::u128>, + pub min_create_bond: + runtime_types::pallet_nomination_pools::ConfigOp<::core::primitive::u128>, + pub max_pools: + runtime_types::pallet_nomination_pools::ConfigOp<::core::primitive::u32>, + pub max_members: + runtime_types::pallet_nomination_pools::ConfigOp<::core::primitive::u32>, + pub max_members_per_pool: + runtime_types::pallet_nomination_pools::ConfigOp<::core::primitive::u32>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct UpdateRoles { + pub pool_id: ::core::primitive::u32, + pub new_root: runtime_types::pallet_nomination_pools::ConfigOp< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + pub new_nominator: runtime_types::pallet_nomination_pools::ConfigOp< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + pub new_state_toggler: runtime_types::pallet_nomination_pools::ConfigOp< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Chill { + pub pool_id: ::core::primitive::u32, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Stake funds with a pool. The amount to bond is transferred from the member to the"] + #[doc = "pools account and immediately increases the pools bond."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "* An account can only be a member of a single pool."] + #[doc = "* An account cannot join the same pool multiple times."] + #[doc = "* This call will *not* dust the member account, so the member must have at least"] + #[doc = " `existential deposit + amount` in their account."] + #[doc = "* Only a pool with [`PoolState::Open`] can be joined"] + pub fn join( + &self, + amount: ::core::primitive::u128, + pool_id: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NominationPools", + "join", + Join { amount, pool_id }, + [ + 205u8, 66u8, 42u8, 72u8, 146u8, 148u8, 119u8, 162u8, 101u8, 183u8, + 46u8, 176u8, 221u8, 204u8, 197u8, 20u8, 75u8, 226u8, 29u8, 118u8, + 208u8, 60u8, 192u8, 247u8, 222u8, 100u8, 69u8, 80u8, 172u8, 13u8, 69u8, + 250u8, + ], + ) + } + #[doc = "Bond `extra` more funds from `origin` into the pool to which they already belong."] + #[doc = ""] + #[doc = "Additional funds can come from either the free balance of the account, of from the"] + #[doc = "accumulated rewards, see [`BondExtra`]."] + #[doc = ""] + #[doc = "Bonding extra funds implies an automatic payout of all pending rewards as well."] + pub fn bond_extra( + &self, + extra: runtime_types::pallet_nomination_pools::BondExtra< + ::core::primitive::u128, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NominationPools", + "bond_extra", + BondExtra { extra }, + [ + 50u8, 72u8, 181u8, 216u8, 249u8, 27u8, 250u8, 177u8, 253u8, 22u8, + 240u8, 100u8, 184u8, 202u8, 197u8, 34u8, 21u8, 188u8, 248u8, 191u8, + 11u8, 10u8, 236u8, 161u8, 168u8, 37u8, 38u8, 238u8, 61u8, 183u8, 86u8, + 55u8, + ], + ) + } + #[doc = "A bonded member can use this to claim their payout based on the rewards that the pool"] + #[doc = "has accumulated since their last claimed payout (OR since joining if this is there first"] + #[doc = "time claiming rewards). The payout will be transferred to the member's account."] + #[doc = ""] + #[doc = "The member will earn rewards pro rata based on the members stake vs the sum of the"] + #[doc = "members in the pools stake. Rewards do not \"expire\"."] + pub fn claim_payout(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NominationPools", + "claim_payout", + ClaimPayout {}, + [ + 128u8, 58u8, 138u8, 55u8, 64u8, 16u8, 129u8, 25u8, 211u8, 229u8, 193u8, + 115u8, 47u8, 45u8, 155u8, 221u8, 218u8, 1u8, 222u8, 5u8, 236u8, 32u8, + 88u8, 0u8, 198u8, 72u8, 196u8, 181u8, 104u8, 16u8, 212u8, 29u8, + ], + ) + } + #[doc = "Unbond up to `unbonding_points` of the `member_account`'s funds from the pool. It"] + #[doc = "implicitly collects the rewards one last time, since not doing so would mean some"] + #[doc = "rewards would be forfeited."] + #[doc = ""] + #[doc = "Under certain conditions, this call can be dispatched permissionlessly (i.e. by any"] + #[doc = "account)."] + #[doc = ""] + #[doc = "# Conditions for a permissionless dispatch."] + #[doc = ""] + #[doc = "* The pool is blocked and the caller is either the root or state-toggler. This is"] + #[doc = " refereed to as a kick."] + #[doc = "* The pool is destroying and the member is not the depositor."] + #[doc = "* The pool is destroying, the member is the depositor and no other members are in the"] + #[doc = " pool."] + #[doc = ""] + #[doc = "## Conditions for permissioned dispatch (i.e. the caller is also the"] + #[doc = "`member_account`):"] + #[doc = ""] + #[doc = "* The caller is not the depositor."] + #[doc = "* The caller is the depositor, the pool is destroying and no other members are in the"] + #[doc = " pool."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "If there are too many unlocking chunks to unbond with the pool account,"] + #[doc = "[`Call::pool_withdraw_unbonded`] can be called to try and minimize unlocking chunks. If"] + #[doc = "there are too many unlocking chunks, the result of this call will likely be the"] + #[doc = "`NoMoreChunks` error from the staking system."] + pub fn unbond( + &self, + member_account: ::subxt::ext::sp_core::crypto::AccountId32, + unbonding_points: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NominationPools", + "unbond", + Unbond { + member_account, + unbonding_points, + }, + [ + 59u8, 250u8, 74u8, 2u8, 210u8, 41u8, 108u8, 239u8, 55u8, 4u8, 232u8, + 77u8, 115u8, 224u8, 60u8, 216u8, 107u8, 47u8, 3u8, 178u8, 245u8, 113u8, + 67u8, 227u8, 199u8, 241u8, 223u8, 123u8, 97u8, 79u8, 245u8, 239u8, + ], + ) + } + #[doc = "Call `withdraw_unbonded` for the pools account. This call can be made by any account."] + #[doc = ""] + #[doc = "This is useful if their are too many unlocking chunks to call `unbond`, and some"] + #[doc = "can be cleared by withdrawing. In the case there are too many unlocking chunks, the user"] + #[doc = "would probably see an error like `NoMoreChunks` emitted from the staking system when"] + #[doc = "they attempt to unbond."] + pub fn pool_withdraw_unbonded( + &self, + pool_id: ::core::primitive::u32, + num_slashing_spans: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NominationPools", + "pool_withdraw_unbonded", + PoolWithdrawUnbonded { + pool_id, + num_slashing_spans, + }, + [ + 152u8, 245u8, 131u8, 247u8, 106u8, 214u8, 154u8, 8u8, 7u8, 210u8, + 149u8, 218u8, 118u8, 46u8, 242u8, 182u8, 191u8, 119u8, 28u8, 199u8, + 36u8, 49u8, 219u8, 123u8, 58u8, 203u8, 211u8, 226u8, 217u8, 36u8, 56u8, + 0u8, + ], + ) + } + #[doc = "Withdraw unbonded funds from `member_account`. If no bonded funds can be unbonded, an"] + #[doc = "error is returned."] + #[doc = ""] + #[doc = "Under certain conditions, this call can be dispatched permissionlessly (i.e. by any"] + #[doc = "account)."] + #[doc = ""] + #[doc = "# Conditions for a permissionless dispatch"] + #[doc = ""] + #[doc = "* The pool is in destroy mode and the target is not the depositor."] + #[doc = "* The target is the depositor and they are the only member in the sub pools."] + #[doc = "* The pool is blocked and the caller is either the root or state-toggler."] + #[doc = ""] + #[doc = "# Conditions for permissioned dispatch"] + #[doc = ""] + #[doc = "* The caller is the target and they are not the depositor."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "If the target is the depositor, the pool will be destroyed."] + pub fn withdraw_unbonded( + &self, + member_account: ::subxt::ext::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NominationPools", + "withdraw_unbonded", + WithdrawUnbonded { + member_account, + num_slashing_spans, + }, + [ + 123u8, 29u8, 174u8, 20u8, 225u8, 121u8, 34u8, 168u8, 62u8, 199u8, + 115u8, 154u8, 36u8, 12u8, 228u8, 181u8, 179u8, 25u8, 141u8, 8u8, 189u8, + 146u8, 117u8, 178u8, 211u8, 236u8, 194u8, 154u8, 35u8, 51u8, 158u8, + 255u8, + ], + ) + } + #[doc = "Create a new delegation pool."] + #[doc = ""] + #[doc = "# Arguments"] + #[doc = ""] + #[doc = "* `amount` - The amount of funds to delegate to the pool. This also acts of a sort of"] + #[doc = " deposit since the pools creator cannot fully unbond funds until the pool is being"] + #[doc = " destroyed."] + #[doc = "* `index` - A disambiguation index for creating the account. Likely only useful when"] + #[doc = " creating multiple pools in the same extrinsic."] + #[doc = "* `root` - The account to set as [`PoolRoles::root`]."] + #[doc = "* `nominator` - The account to set as the [`PoolRoles::nominator`]."] + #[doc = "* `state_toggler` - The account to set as the [`PoolRoles::state_toggler`]."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "In addition to `amount`, the caller will transfer the existential deposit; so the caller"] + #[doc = "needs at have at least `amount + existential_deposit` transferrable."] + pub fn create( + &self, + amount: ::core::primitive::u128, + root: ::subxt::ext::sp_core::crypto::AccountId32, + nominator: ::subxt::ext::sp_core::crypto::AccountId32, + state_toggler: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NominationPools", + "create", + Create { + amount, + root, + nominator, + state_toggler, + }, + [ + 82u8, 231u8, 186u8, 244u8, 193u8, 132u8, 21u8, 23u8, 49u8, 163u8, + 151u8, 181u8, 77u8, 181u8, 191u8, 170u8, 175u8, 62u8, 253u8, 2u8, + 162u8, 229u8, 78u8, 147u8, 79u8, 12u8, 215u8, 9u8, 100u8, 27u8, 95u8, + 242u8, + ], + ) + } + #[doc = "Nominate on behalf of the pool."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed by the pool nominator or the pool"] + #[doc = "root role."] + #[doc = ""] + #[doc = "This directly forward the call to the staking pallet, on behalf of the pool bonded"] + #[doc = "account."] + pub fn nominate( + &self, + pool_id: ::core::primitive::u32, + validators: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NominationPools", + "nominate", + Nominate { + pool_id, + validators, + }, + [ + 10u8, 235u8, 64u8, 157u8, 36u8, 249u8, 186u8, 27u8, 79u8, 172u8, 25u8, + 3u8, 203u8, 19u8, 192u8, 182u8, 36u8, 103u8, 13u8, 20u8, 89u8, 140u8, + 159u8, 4u8, 132u8, 242u8, 192u8, 146u8, 55u8, 251u8, 216u8, 255u8, + ], + ) + } + #[doc = "Set a new state for the pool."] + #[doc = ""] + #[doc = "If a pool is already in the `Destroying` state, then under no condition can its state"] + #[doc = "change again."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be either:"] + #[doc = ""] + #[doc = "1. signed by the state toggler, or the root role of the pool,"] + #[doc = "2. if the pool conditions to be open are NOT met (as described by `ok_to_be_open`), and"] + #[doc = " then the state of the pool can be permissionlessly changed to `Destroying`."] + pub fn set_state( + &self, + pool_id: ::core::primitive::u32, + state: runtime_types::pallet_nomination_pools::PoolState, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NominationPools", + "set_state", + SetState { pool_id, state }, + [ + 104u8, 40u8, 213u8, 88u8, 159u8, 115u8, 35u8, 249u8, 78u8, 180u8, 99u8, + 1u8, 225u8, 218u8, 192u8, 151u8, 25u8, 194u8, 192u8, 187u8, 39u8, + 170u8, 212u8, 125u8, 75u8, 250u8, 248u8, 175u8, 159u8, 161u8, 151u8, + 162u8, + ], + ) + } + #[doc = "Set a new metadata for the pool."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed by the state toggler, or the root role"] + #[doc = "of the pool."] + pub fn set_metadata( + &self, + pool_id: ::core::primitive::u32, + metadata: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NominationPools", + "set_metadata", + SetMetadata { pool_id, metadata }, + [ + 156u8, 81u8, 170u8, 161u8, 34u8, 100u8, 183u8, 174u8, 5u8, 81u8, 31u8, + 76u8, 12u8, 42u8, 77u8, 1u8, 6u8, 26u8, 168u8, 7u8, 8u8, 115u8, 158u8, + 151u8, 30u8, 211u8, 52u8, 177u8, 234u8, 87u8, 125u8, 127u8, + ], + ) + } + #[doc = "Update configurations for the nomination pools. The origin for this call must be"] + #[doc = "Root."] + #[doc = ""] + #[doc = "# Arguments"] + #[doc = ""] + #[doc = "* `min_join_bond` - Set [`MinJoinBond`]."] + #[doc = "* `min_create_bond` - Set [`MinCreateBond`]."] + #[doc = "* `max_pools` - Set [`MaxPools`]."] + #[doc = "* `max_members` - Set [`MaxPoolMembers`]."] + #[doc = "* `max_members_per_pool` - Set [`MaxPoolMembersPerPool`]."] + pub fn set_configs( + &self, + min_join_bond: runtime_types::pallet_nomination_pools::ConfigOp< + ::core::primitive::u128, + >, + min_create_bond: runtime_types::pallet_nomination_pools::ConfigOp< + ::core::primitive::u128, + >, + max_pools: runtime_types::pallet_nomination_pools::ConfigOp< + ::core::primitive::u32, + >, + max_members: runtime_types::pallet_nomination_pools::ConfigOp< + ::core::primitive::u32, + >, + max_members_per_pool: runtime_types::pallet_nomination_pools::ConfigOp< + ::core::primitive::u32, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NominationPools", + "set_configs", + SetConfigs { + min_join_bond, + min_create_bond, + max_pools, + max_members, + max_members_per_pool, + }, + [ + 143u8, 196u8, 211u8, 30u8, 71u8, 15u8, 150u8, 243u8, 7u8, 178u8, 179u8, + 168u8, 40u8, 116u8, 220u8, 140u8, 18u8, 206u8, 6u8, 189u8, 190u8, 37u8, + 68u8, 41u8, 45u8, 233u8, 247u8, 172u8, 185u8, 34u8, 243u8, 187u8, + ], + ) + } + #[doc = "Update the roles of the pool."] + #[doc = ""] + #[doc = "The root is the only entity that can change any of the roles, including itself,"] + #[doc = "excluding the depositor, who can never change."] + #[doc = ""] + #[doc = "It emits an event, notifying UIs of the role change. This event is quite relevant to"] + #[doc = "most pool members and they should be informed of changes to pool roles."] + pub fn update_roles( + &self, + pool_id: ::core::primitive::u32, + new_root: runtime_types::pallet_nomination_pools::ConfigOp< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + new_nominator: runtime_types::pallet_nomination_pools::ConfigOp< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + new_state_toggler: runtime_types::pallet_nomination_pools::ConfigOp< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NominationPools", + "update_roles", + UpdateRoles { + pool_id, + new_root, + new_nominator, + new_state_toggler, + }, + [ + 247u8, 95u8, 234u8, 56u8, 181u8, 229u8, 158u8, 97u8, 69u8, 165u8, 38u8, + 17u8, 27u8, 209u8, 204u8, 250u8, 91u8, 193u8, 35u8, 93u8, 215u8, 131u8, + 148u8, 73u8, 67u8, 188u8, 92u8, 32u8, 34u8, 37u8, 113u8, 93u8, + ], + ) + } + #[doc = "Chill on behalf of the pool."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed by the pool nominator or the pool"] + #[doc = "root role, same as [`Pallet::nominate`]."] + #[doc = ""] + #[doc = "This directly forward the call to the staking pallet, on behalf of the pool bonded"] + #[doc = "account."] + pub fn chill( + &self, + pool_id: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NominationPools", + "chill", + Chill { pool_id }, + [ + 41u8, 114u8, 128u8, 121u8, 244u8, 15u8, 15u8, 52u8, 129u8, 88u8, 239u8, + 167u8, 216u8, 38u8, 123u8, 240u8, 172u8, 229u8, 132u8, 64u8, 175u8, + 87u8, 217u8, 27u8, 11u8, 124u8, 1u8, 140u8, 40u8, 191u8, 187u8, 36u8, + ], + ) + } + } + } + #[doc = "Events of this pallet."] + pub type Event = runtime_types::pallet_nomination_pools::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A pool has been created."] + pub struct Created { + pub depositor: ::subxt::ext::sp_core::crypto::AccountId32, + pub pool_id: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for Created { + const PALLET: &'static str = "NominationPools"; + const EVENT: &'static str = "Created"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A member has became bonded in a pool."] + pub struct Bonded { + pub member: ::subxt::ext::sp_core::crypto::AccountId32, + pub pool_id: ::core::primitive::u32, + pub bonded: ::core::primitive::u128, + pub joined: ::core::primitive::bool, + } + impl ::subxt::events::StaticEvent for Bonded { + const PALLET: &'static str = "NominationPools"; + const EVENT: &'static str = "Bonded"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A payout has been made to a member."] + pub struct PaidOut { + pub member: ::subxt::ext::sp_core::crypto::AccountId32, + pub pool_id: ::core::primitive::u32, + pub payout: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for PaidOut { + const PALLET: &'static str = "NominationPools"; + const EVENT: &'static str = "PaidOut"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A member has unbonded from their pool."] + #[doc = ""] + #[doc = "- `balance` is the corresponding balance of the number of points that has been"] + #[doc = " requested to be unbonded (the argument of the `unbond` transaction) from the bonded"] + #[doc = " pool."] + #[doc = "- `points` is the number of points that are issued as a result of `balance` being"] + #[doc = "dissolved into the corresponding unbonding pool."] + #[doc = "- `era` is the era in which the balance will be unbonded."] + #[doc = "In the absence of slashing, these values will match. In the presence of slashing, the"] + #[doc = "number of points that are issued in the unbonding pool will be less than the amount"] + #[doc = "requested to be unbonded."] + pub struct Unbonded { + pub member: ::subxt::ext::sp_core::crypto::AccountId32, + pub pool_id: ::core::primitive::u32, + pub balance: ::core::primitive::u128, + pub points: ::core::primitive::u128, + pub era: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for Unbonded { + const PALLET: &'static str = "NominationPools"; + const EVENT: &'static str = "Unbonded"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A member has withdrawn from their pool."] + #[doc = ""] + #[doc = "The given number of `points` have been dissolved in return of `balance`."] + #[doc = ""] + #[doc = "Similar to `Unbonded` event, in the absence of slashing, the ratio of point to balance"] + #[doc = "will be 1."] + pub struct Withdrawn { + pub member: ::subxt::ext::sp_core::crypto::AccountId32, + pub pool_id: ::core::primitive::u32, + pub balance: ::core::primitive::u128, + pub points: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Withdrawn { + const PALLET: &'static str = "NominationPools"; + const EVENT: &'static str = "Withdrawn"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A pool has been destroyed."] + pub struct Destroyed { + pub pool_id: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for Destroyed { + const PALLET: &'static str = "NominationPools"; + const EVENT: &'static str = "Destroyed"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The state of a pool has changed"] + pub struct StateChanged { + pub pool_id: ::core::primitive::u32, + pub new_state: runtime_types::pallet_nomination_pools::PoolState, + } + impl ::subxt::events::StaticEvent for StateChanged { + const PALLET: &'static str = "NominationPools"; + const EVENT: &'static str = "StateChanged"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A member has been removed from a pool."] + #[doc = ""] + #[doc = "The removal can be voluntary (withdrawn all unbonded funds) or involuntary (kicked)."] + pub struct MemberRemoved { + pub pool_id: ::core::primitive::u32, + pub member: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for MemberRemoved { + const PALLET: &'static str = "NominationPools"; + const EVENT: &'static str = "MemberRemoved"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The roles of a pool have been updated to the given new roles. Note that the depositor"] + #[doc = "can never change."] + pub struct RolesUpdated { + pub root: ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + pub state_toggler: + ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + pub nominator: ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + } + impl ::subxt::events::StaticEvent for RolesUpdated { + const PALLET: &'static str = "NominationPools"; + const EVENT: &'static str = "RolesUpdated"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The active balance of pool `pool_id` has been slashed to `balance`."] + pub struct PoolSlashed { + pub pool_id: ::core::primitive::u32, + pub balance: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for PoolSlashed { + const PALLET: &'static str = "NominationPools"; + const EVENT: &'static str = "PoolSlashed"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The unbond pool at `era` of pool `pool_id` has been slashed to `balance`."] + pub struct UnbondingPoolSlashed { + pub pool_id: ::core::primitive::u32, + pub era: ::core::primitive::u32, + pub balance: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for UnbondingPoolSlashed { + const PALLET: &'static str = "NominationPools"; + const EVENT: &'static str = "UnbondingPoolSlashed"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Minimum amount to bond to join a pool."] + pub fn min_join_bond( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "MinJoinBond", + vec![], + [ + 125u8, 239u8, 45u8, 225u8, 74u8, 129u8, 247u8, 184u8, 205u8, 58u8, + 45u8, 186u8, 126u8, 170u8, 112u8, 120u8, 23u8, 190u8, 247u8, 97u8, + 131u8, 126u8, 215u8, 44u8, 147u8, 122u8, 132u8, 212u8, 217u8, 84u8, + 240u8, 91u8, + ], + ) + } + #[doc = " Minimum bond required to create a pool."] + #[doc = ""] + #[doc = " This is the amount that the depositor must put as their initial stake in the pool, as an"] + #[doc = " indication of \"skin in the game\"."] + #[doc = ""] + #[doc = " This is the value that will always exist in the staking ledger of the pool bonded account"] + #[doc = " while all other accounts leave."] + pub fn min_create_bond( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "MinCreateBond", + vec![], + [ + 31u8, 208u8, 240u8, 158u8, 23u8, 218u8, 212u8, 138u8, 92u8, 210u8, + 207u8, 170u8, 32u8, 60u8, 5u8, 21u8, 84u8, 162u8, 1u8, 111u8, 181u8, + 243u8, 24u8, 148u8, 193u8, 253u8, 248u8, 190u8, 16u8, 222u8, 219u8, + 67u8, + ], + ) + } + #[doc = " Maximum number of nomination pools that can exist. If `None`, then an unbounded number of"] + #[doc = " pools can exist."] + pub fn max_pools( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "MaxPools", + vec![], + [ + 216u8, 111u8, 68u8, 103u8, 33u8, 50u8, 109u8, 3u8, 176u8, 195u8, 23u8, + 73u8, 112u8, 138u8, 9u8, 194u8, 233u8, 73u8, 68u8, 215u8, 162u8, 255u8, + 217u8, 173u8, 141u8, 27u8, 72u8, 199u8, 7u8, 240u8, 25u8, 34u8, + ], + ) + } + #[doc = " Maximum number of members that can exist in the system. If `None`, then the count"] + #[doc = " members are not bound on a system wide basis."] + pub fn max_pool_members( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "MaxPoolMembers", + vec![], + [ + 82u8, 217u8, 26u8, 234u8, 223u8, 241u8, 66u8, 182u8, 43u8, 233u8, 59u8, + 242u8, 202u8, 254u8, 69u8, 50u8, 254u8, 196u8, 166u8, 89u8, 120u8, + 87u8, 76u8, 148u8, 31u8, 197u8, 49u8, 88u8, 206u8, 41u8, 242u8, 62u8, + ], + ) + } + #[doc = " Maximum number of members that may belong to pool. If `None`, then the count of"] + #[doc = " members is not bound on a per pool basis."] + pub fn max_pool_members_per_pool( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "MaxPoolMembersPerPool", + vec![], + [ + 93u8, 241u8, 16u8, 169u8, 138u8, 199u8, 128u8, 149u8, 65u8, 30u8, 55u8, + 11u8, 41u8, 252u8, 83u8, 250u8, 9u8, 33u8, 152u8, 239u8, 195u8, 147u8, + 16u8, 248u8, 180u8, 153u8, 88u8, 231u8, 248u8, 169u8, 186u8, 48u8, + ], + ) + } + #[doc = " Active members."] + pub fn pool_members( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_nomination_pools::PoolMember, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "PoolMembers", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 252u8, 236u8, 201u8, 127u8, 219u8, 1u8, 19u8, 144u8, 5u8, 108u8, 70u8, + 30u8, 177u8, 232u8, 253u8, 237u8, 211u8, 91u8, 63u8, 62u8, 155u8, + 151u8, 153u8, 165u8, 206u8, 53u8, 111u8, 31u8, 60u8, 120u8, 100u8, + 249u8, + ], + ) + } + #[doc = " Active members."] + pub fn pool_members_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_nomination_pools::PoolMember, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "PoolMembers", + Vec::new(), + [ + 252u8, 236u8, 201u8, 127u8, 219u8, 1u8, 19u8, 144u8, 5u8, 108u8, 70u8, + 30u8, 177u8, 232u8, 253u8, 237u8, 211u8, 91u8, 63u8, 62u8, 155u8, + 151u8, 153u8, 165u8, 206u8, 53u8, 111u8, 31u8, 60u8, 120u8, 100u8, + 249u8, + ], + ) + } + #[doc = "Counter for the related counted storage map"] + pub fn counter_for_pool_members( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "CounterForPoolMembers", + vec![], + [ + 114u8, 126u8, 27u8, 138u8, 119u8, 44u8, 45u8, 129u8, 84u8, 107u8, + 171u8, 206u8, 117u8, 141u8, 20u8, 75u8, 229u8, 237u8, 31u8, 229u8, + 124u8, 190u8, 27u8, 124u8, 63u8, 59u8, 167u8, 42u8, 62u8, 212u8, 160u8, + 2u8, + ], + ) + } + #[doc = " Storage for bonded pools."] + pub fn bonded_pools( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_nomination_pools::BondedPoolInner, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "BondedPools", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 34u8, 51u8, 86u8, 95u8, 237u8, 118u8, 40u8, 212u8, 128u8, 227u8, 113u8, + 6u8, 116u8, 28u8, 96u8, 223u8, 63u8, 249u8, 33u8, 152u8, 61u8, 7u8, + 205u8, 220u8, 221u8, 174u8, 207u8, 39u8, 53u8, 176u8, 13u8, 74u8, + ], + ) + } + #[doc = " Storage for bonded pools."] + pub fn bonded_pools_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_nomination_pools::BondedPoolInner, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "BondedPools", + Vec::new(), + [ + 34u8, 51u8, 86u8, 95u8, 237u8, 118u8, 40u8, 212u8, 128u8, 227u8, 113u8, + 6u8, 116u8, 28u8, 96u8, 223u8, 63u8, 249u8, 33u8, 152u8, 61u8, 7u8, + 205u8, 220u8, 221u8, 174u8, 207u8, 39u8, 53u8, 176u8, 13u8, 74u8, + ], + ) + } + #[doc = "Counter for the related counted storage map"] + pub fn counter_for_bonded_pools( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "CounterForBondedPools", + vec![], + [ + 134u8, 94u8, 199u8, 73u8, 174u8, 253u8, 66u8, 242u8, 233u8, 244u8, + 140u8, 170u8, 242u8, 40u8, 41u8, 185u8, 183u8, 151u8, 58u8, 111u8, + 221u8, 225u8, 81u8, 71u8, 169u8, 219u8, 223u8, 135u8, 8u8, 171u8, + 180u8, 236u8, + ], + ) + } + #[doc = " Reward pools. This is where there rewards for each pool accumulate. When a members payout"] + #[doc = " is claimed, the balance comes out fo the reward pool. Keyed by the bonded pools account."] + pub fn reward_pools( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_nomination_pools::RewardPool, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "RewardPools", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 139u8, 123u8, 46u8, 107u8, 9u8, 83u8, 141u8, 12u8, 188u8, 225u8, 170u8, + 215u8, 154u8, 21u8, 100u8, 95u8, 237u8, 245u8, 46u8, 216u8, 199u8, + 184u8, 187u8, 155u8, 8u8, 16u8, 34u8, 177u8, 153u8, 65u8, 109u8, 198u8, + ], + ) + } + #[doc = " Reward pools. This is where there rewards for each pool accumulate. When a members payout"] + #[doc = " is claimed, the balance comes out fo the reward pool. Keyed by the bonded pools account."] + pub fn reward_pools_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_nomination_pools::RewardPool, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "RewardPools", + Vec::new(), + [ + 139u8, 123u8, 46u8, 107u8, 9u8, 83u8, 141u8, 12u8, 188u8, 225u8, 170u8, + 215u8, 154u8, 21u8, 100u8, 95u8, 237u8, 245u8, 46u8, 216u8, 199u8, + 184u8, 187u8, 155u8, 8u8, 16u8, 34u8, 177u8, 153u8, 65u8, 109u8, 198u8, + ], + ) + } + #[doc = "Counter for the related counted storage map"] + pub fn counter_for_reward_pools( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "CounterForRewardPools", + vec![], + [ + 209u8, 139u8, 212u8, 116u8, 210u8, 178u8, 213u8, 38u8, 75u8, 23u8, + 188u8, 57u8, 253u8, 213u8, 95u8, 118u8, 182u8, 250u8, 45u8, 205u8, + 17u8, 175u8, 17u8, 201u8, 234u8, 14u8, 98u8, 49u8, 143u8, 135u8, 201u8, + 81u8, + ], + ) + } + #[doc = " Groups of unbonding pools. Each group of unbonding pools belongs to a bonded pool,"] + #[doc = " hence the name sub-pools. Keyed by the bonded pools account."] + pub fn sub_pools_storage( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_nomination_pools::SubPools, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "SubPoolsStorage", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 231u8, 13u8, 111u8, 248u8, 1u8, 208u8, 179u8, 134u8, 224u8, 196u8, + 94u8, 201u8, 229u8, 29u8, 155u8, 211u8, 163u8, 150u8, 157u8, 34u8, + 68u8, 238u8, 55u8, 4u8, 222u8, 96u8, 186u8, 29u8, 205u8, 237u8, 80u8, + 42u8, + ], + ) + } + #[doc = " Groups of unbonding pools. Each group of unbonding pools belongs to a bonded pool,"] + #[doc = " hence the name sub-pools. Keyed by the bonded pools account."] + pub fn sub_pools_storage_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_nomination_pools::SubPools, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "SubPoolsStorage", + Vec::new(), + [ + 231u8, 13u8, 111u8, 248u8, 1u8, 208u8, 179u8, 134u8, 224u8, 196u8, + 94u8, 201u8, 229u8, 29u8, 155u8, 211u8, 163u8, 150u8, 157u8, 34u8, + 68u8, 238u8, 55u8, 4u8, 222u8, 96u8, 186u8, 29u8, 205u8, 237u8, 80u8, + 42u8, + ], + ) + } + #[doc = "Counter for the related counted storage map"] + pub fn counter_for_sub_pools_storage( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "CounterForSubPoolsStorage", + vec![], + [ + 212u8, 145u8, 212u8, 226u8, 234u8, 31u8, 26u8, 240u8, 107u8, 91u8, + 171u8, 120u8, 41u8, 195u8, 16u8, 86u8, 55u8, 127u8, 103u8, 93u8, 128u8, + 48u8, 69u8, 104u8, 168u8, 236u8, 81u8, 54u8, 2u8, 184u8, 215u8, 51u8, + ], + ) + } + #[doc = " Metadata for the pool."] + pub fn metadata( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "Metadata", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 108u8, 250u8, 163u8, 54u8, 192u8, 143u8, 239u8, 62u8, 97u8, 163u8, + 161u8, 215u8, 171u8, 225u8, 49u8, 18u8, 37u8, 200u8, 143u8, 254u8, + 136u8, 26u8, 54u8, 187u8, 39u8, 3u8, 216u8, 24u8, 188u8, 25u8, 243u8, + 251u8, + ], + ) + } + #[doc = " Metadata for the pool."] + pub fn metadata_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "Metadata", + Vec::new(), + [ + 108u8, 250u8, 163u8, 54u8, 192u8, 143u8, 239u8, 62u8, 97u8, 163u8, + 161u8, 215u8, 171u8, 225u8, 49u8, 18u8, 37u8, 200u8, 143u8, 254u8, + 136u8, 26u8, 54u8, 187u8, 39u8, 3u8, 216u8, 24u8, 188u8, 25u8, 243u8, + 251u8, + ], + ) + } + #[doc = "Counter for the related counted storage map"] + pub fn counter_for_metadata( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "CounterForMetadata", + vec![], + [ + 190u8, 232u8, 77u8, 134u8, 245u8, 89u8, 160u8, 187u8, 163u8, 68u8, + 188u8, 204u8, 31u8, 145u8, 219u8, 165u8, 213u8, 1u8, 167u8, 90u8, + 175u8, 218u8, 147u8, 144u8, 158u8, 226u8, 23u8, 233u8, 55u8, 168u8, + 161u8, 237u8, + ], + ) + } + #[doc = " Ever increasing number of all pools created so far."] + pub fn last_pool_id( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "LastPoolId", + vec![], + [ + 50u8, 254u8, 218u8, 41u8, 213u8, 184u8, 170u8, 166u8, 31u8, 29u8, + 196u8, 57u8, 215u8, 20u8, 40u8, 40u8, 19u8, 22u8, 9u8, 184u8, 11u8, + 21u8, 21u8, 125u8, 97u8, 38u8, 219u8, 209u8, 2u8, 238u8, 247u8, 51u8, + ], + ) + } + #[doc = " A reverse lookup from the pool's account id to its id."] + #[doc = ""] + #[doc = " This is only used for slashing. In all other instances, the pool id is used, and the"] + #[doc = " accounts are deterministically derived from it."] + pub fn reverse_pool_id_lookup( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "ReversePoolIdLookup", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 178u8, 161u8, 51u8, 220u8, 128u8, 1u8, 135u8, 83u8, 236u8, 159u8, 36u8, + 237u8, 120u8, 128u8, 6u8, 191u8, 41u8, 159u8, 94u8, 178u8, 174u8, + 235u8, 221u8, 173u8, 44u8, 81u8, 211u8, 255u8, 231u8, 81u8, 16u8, 87u8, + ], + ) + } + #[doc = " A reverse lookup from the pool's account id to its id."] + #[doc = ""] + #[doc = " This is only used for slashing. In all other instances, the pool id is used, and the"] + #[doc = " accounts are deterministically derived from it."] + pub fn reverse_pool_id_lookup_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "ReversePoolIdLookup", + Vec::new(), + [ + 178u8, 161u8, 51u8, 220u8, 128u8, 1u8, 135u8, 83u8, 236u8, 159u8, 36u8, + 237u8, 120u8, 128u8, 6u8, 191u8, 41u8, 159u8, 94u8, 178u8, 174u8, + 235u8, 221u8, 173u8, 44u8, 81u8, 211u8, 255u8, 231u8, 81u8, 16u8, 87u8, + ], + ) + } + #[doc = "Counter for the related counted storage map"] + pub fn counter_for_reverse_pool_id_lookup( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NominationPools", + "CounterForReversePoolIdLookup", + vec![], + [ + 148u8, 83u8, 81u8, 33u8, 188u8, 72u8, 148u8, 208u8, 245u8, 178u8, 52u8, + 245u8, 229u8, 140u8, 100u8, 152u8, 8u8, 217u8, 161u8, 80u8, 226u8, + 42u8, 15u8, 252u8, 90u8, 197u8, 120u8, 114u8, 144u8, 90u8, 199u8, + 123u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The nomination pool's pallet id."] + pub fn pallet_id( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType, + > { + ::subxt::constants::StaticConstantAddress::new( + "NominationPools", + "PalletId", + [ + 139u8, 109u8, 228u8, 151u8, 252u8, 32u8, 130u8, 69u8, 112u8, 154u8, + 174u8, 45u8, 83u8, 245u8, 51u8, 132u8, 173u8, 5u8, 186u8, 24u8, 243u8, + 9u8, 12u8, 214u8, 80u8, 74u8, 69u8, 189u8, 30u8, 94u8, 22u8, 39u8, + ], + ) + } + #[doc = " The maximum pool points-to-balance ratio that an `open` pool can have."] + #[doc = ""] + #[doc = " This is important in the event slashing takes place and the pool's points-to-balance"] + #[doc = " ratio becomes disproportional."] + #[doc = ""] + #[doc = " Moreover, this relates to the `RewardCounter` type as well, as the arithmetic operations"] + #[doc = " are a function of number of points, and by setting this value to e.g. 10, you ensure"] + #[doc = " that the total number of points in the system are at most 10 times the total_issuance of"] + #[doc = " the chain, in the absolute worse case."] + #[doc = ""] + #[doc = " For a value of 10, the threshold would be a pool points-to-balance ratio of 10:1."] + #[doc = " Such a scenario would also be the equivalent of the pool being 90% slashed."] + pub fn max_points_to_balance( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u8>, + > { + ::subxt::constants::StaticConstantAddress::new( + "NominationPools", + "MaxPointsToBalance", + [ + 141u8, 130u8, 11u8, 35u8, 226u8, 114u8, 92u8, 179u8, 168u8, 110u8, + 28u8, 91u8, 221u8, 64u8, 4u8, 148u8, 201u8, 193u8, 185u8, 66u8, 226u8, + 114u8, 97u8, 79u8, 62u8, 212u8, 202u8, 114u8, 237u8, 228u8, 183u8, + 165u8, + ], + ) + } + } + } + } + pub mod identity { + use super::{root_mod, runtime_types}; + #[doc = "Identity pallet declaration."] + pub mod calls { + use super::{root_mod, runtime_types}; + type DispatchError = runtime_types::sp_runtime::DispatchError; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct AddRegistrar { + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetIdentity { + pub info: ::std::boxed::Box, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetSubs { + pub subs: ::std::vec::Vec<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ClearIdentity; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RequestJudgement { + #[codec(compact)] + pub reg_index: ::core::primitive::u32, + #[codec(compact)] + pub max_fee: ::core::primitive::u128, + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CancelRequest { + pub reg_index: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetFee { + #[codec(compact)] + pub index: ::core::primitive::u32, + #[codec(compact)] + pub fee: ::core::primitive::u128, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetAccountId { + #[codec(compact)] + pub index: ::core::primitive::u32, + pub new: ::subxt::ext::sp_core::crypto::AccountId32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetFields { + #[codec(compact)] + pub index: ::core::primitive::u32, + pub fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ProvideJudgement { + #[codec(compact)] + pub reg_index: ::core::primitive::u32, + pub target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + pub judgement: + runtime_types::pallet_identity::types::Judgement<::core::primitive::u128>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct KillIdentity { + pub target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct AddSub { + pub sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + pub data: runtime_types::pallet_identity::types::Data, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RenameSub { + pub sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + pub data: runtime_types::pallet_identity::types::Data, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RemoveSub { + pub sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct QuitSub; + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Add a registrar to the system."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `T::RegistrarOrigin`."] + #[doc = ""] + #[doc = "- `account`: the account of the registrar."] + #[doc = ""] + #[doc = "Emits `RegistrarAdded` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R)` where `R` registrar-count (governance-bounded and code-bounded)."] + #[doc = "- One storage mutation (codec `O(R)`)."] + #[doc = "- One event."] + #[doc = "# "] + pub fn add_registrar( + &self, + account: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "add_registrar", + AddRegistrar { account }, + [ + 231u8, 221u8, 79u8, 233u8, 107u8, 34u8, 195u8, 186u8, 192u8, 129u8, + 103u8, 159u8, 159u8, 83u8, 151u8, 161u8, 137u8, 164u8, 143u8, 31u8, + 75u8, 42u8, 27u8, 203u8, 19u8, 70u8, 173u8, 11u8, 241u8, 189u8, 137u8, + 127u8, + ], + ) + } + #[doc = "Set an account's identity information and reserve the appropriate deposit."] + #[doc = ""] + #[doc = "If the account already has identity information, the deposit is taken as part payment"] + #[doc = "for the new deposit."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `info`: The identity information."] + #[doc = ""] + #[doc = "Emits `IdentitySet` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(X + X' + R)`"] + #[doc = " - where `X` additional-field-count (deposit-bounded and code-bounded)"] + #[doc = " - where `R` judgements-count (registrar-count-bounded)"] + #[doc = "- One balance reserve operation."] + #[doc = "- One storage mutation (codec-read `O(X' + R)`, codec-write `O(X + R)`)."] + #[doc = "- One event."] + #[doc = "# "] + pub fn set_identity( + &self, + info: runtime_types::pallet_identity::types::IdentityInfo, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "set_identity", + SetIdentity { + info: ::std::boxed::Box::new(info), + }, + [ + 130u8, 89u8, 118u8, 6u8, 134u8, 166u8, 35u8, 192u8, 73u8, 6u8, 171u8, + 20u8, 225u8, 255u8, 152u8, 142u8, 111u8, 8u8, 206u8, 200u8, 64u8, 52u8, + 110u8, 123u8, 42u8, 101u8, 191u8, 242u8, 133u8, 139u8, 154u8, 205u8, + ], + ) + } + #[doc = "Set the sub-accounts of the sender."] + #[doc = ""] + #[doc = "Payment: Any aggregate balance reserved by previous `set_subs` calls will be returned"] + #[doc = "and an amount `SubAccountDeposit` will be reserved for each item in `subs`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "identity."] + #[doc = ""] + #[doc = "- `subs`: The identity's (new) sub-accounts."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(P + S)`"] + #[doc = " - where `P` old-subs-count (hard- and deposit-bounded)."] + #[doc = " - where `S` subs-count (hard- and deposit-bounded)."] + #[doc = "- At most one balance operations."] + #[doc = "- DB:"] + #[doc = " - `P + S` storage mutations (codec complexity `O(1)`)"] + #[doc = " - One storage read (codec complexity `O(P)`)."] + #[doc = " - One storage write (codec complexity `O(S)`)."] + #[doc = " - One storage-exists (`IdentityOf::contains_key`)."] + #[doc = "# "] + pub fn set_subs( + &self, + subs: ::std::vec::Vec<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "set_subs", + SetSubs { subs }, + [ + 177u8, 219u8, 84u8, 183u8, 5u8, 32u8, 192u8, 82u8, 174u8, 68u8, 198u8, + 224u8, 56u8, 85u8, 134u8, 171u8, 30u8, 132u8, 140u8, 236u8, 117u8, + 24u8, 150u8, 218u8, 146u8, 194u8, 144u8, 92u8, 103u8, 206u8, 46u8, + 90u8, + ], + ) + } + #[doc = "Clear an account's identity info and all sub-accounts and return all deposits."] + #[doc = ""] + #[doc = "Payment: All reserved balances on the account are returned."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "identity."] + #[doc = ""] + #[doc = "Emits `IdentityCleared` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + S + X)`"] + #[doc = " - where `R` registrar-count (governance-bounded)."] + #[doc = " - where `S` subs-count (hard- and deposit-bounded)."] + #[doc = " - where `X` additional-field-count (deposit-bounded and code-bounded)."] + #[doc = "- One balance-unreserve operation."] + #[doc = "- `2` storage reads and `S + 2` storage deletions."] + #[doc = "- One event."] + #[doc = "# "] + pub fn clear_identity(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "clear_identity", + ClearIdentity {}, + [ + 75u8, 44u8, 74u8, 122u8, 149u8, 202u8, 114u8, 230u8, 0u8, 255u8, 140u8, + 122u8, 14u8, 196u8, 205u8, 249u8, 220u8, 94u8, 216u8, 34u8, 63u8, 14u8, + 8u8, 205u8, 74u8, 23u8, 181u8, 129u8, 252u8, 110u8, 231u8, 114u8, + ], + ) + } + #[doc = "Request a judgement from a registrar."] + #[doc = ""] + #[doc = "Payment: At most `max_fee` will be reserved for payment to the registrar if judgement"] + #[doc = "given."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] + #[doc = "registered identity."] + #[doc = ""] + #[doc = "- `reg_index`: The index of the registrar whose judgement is requested."] + #[doc = "- `max_fee`: The maximum fee that may be paid. This should just be auto-populated as:"] + #[doc = ""] + #[doc = "```nocompile"] + #[doc = "Self::registrars().get(reg_index).unwrap().fee"] + #[doc = "```"] + #[doc = ""] + #[doc = "Emits `JudgementRequested` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + X)`."] + #[doc = "- One balance-reserve operation."] + #[doc = "- Storage: 1 read `O(R)`, 1 mutate `O(X + R)`."] + #[doc = "- One event."] + #[doc = "# "] + pub fn request_judgement( + &self, + reg_index: ::core::primitive::u32, + max_fee: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "request_judgement", + RequestJudgement { reg_index, max_fee }, + [ + 186u8, 149u8, 61u8, 54u8, 159u8, 194u8, 77u8, 161u8, 220u8, 157u8, 3u8, + 216u8, 23u8, 105u8, 119u8, 76u8, 144u8, 198u8, 157u8, 45u8, 235u8, + 139u8, 87u8, 82u8, 81u8, 12u8, 25u8, 134u8, 225u8, 92u8, 182u8, 101u8, + ], + ) + } + #[doc = "Cancel a previous request."] + #[doc = ""] + #[doc = "Payment: A previously reserved deposit is returned on success."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] + #[doc = "registered identity."] + #[doc = ""] + #[doc = "- `reg_index`: The index of the registrar whose judgement is no longer requested."] + #[doc = ""] + #[doc = "Emits `JudgementUnrequested` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + X)`."] + #[doc = "- One balance-reserve operation."] + #[doc = "- One storage mutation `O(R + X)`."] + #[doc = "- One event"] + #[doc = "# "] + pub fn cancel_request( + &self, + reg_index: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "cancel_request", + CancelRequest { reg_index }, + [ + 83u8, 180u8, 239u8, 126u8, 32u8, 51u8, 17u8, 20u8, 180u8, 3u8, 59u8, + 96u8, 24u8, 32u8, 136u8, 92u8, 58u8, 254u8, 68u8, 70u8, 50u8, 11u8, + 51u8, 91u8, 180u8, 79u8, 81u8, 84u8, 216u8, 138u8, 6u8, 215u8, + ], + ) + } + #[doc = "Set the fee required for a judgement to be requested from a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `fee`: the new fee."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R)`."] + #[doc = "- One storage mutation `O(R)`."] + #[doc = "- Benchmark: 7.315 + R * 0.329 µs (min squares analysis)"] + #[doc = "# "] + pub fn set_fee( + &self, + index: ::core::primitive::u32, + fee: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "set_fee", + SetFee { index, fee }, + [ + 21u8, 157u8, 123u8, 182u8, 160u8, 190u8, 117u8, 37u8, 136u8, 133u8, + 104u8, 234u8, 31u8, 145u8, 115u8, 154u8, 125u8, 40u8, 2u8, 87u8, 118u8, + 56u8, 247u8, 73u8, 89u8, 0u8, 251u8, 3u8, 58u8, 105u8, 239u8, 211u8, + ], + ) + } + #[doc = "Change the account associated with a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `new`: the new account ID."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R)`."] + #[doc = "- One storage mutation `O(R)`."] + #[doc = "- Benchmark: 8.823 + R * 0.32 µs (min squares analysis)"] + #[doc = "# "] + pub fn set_account_id( + &self, + index: ::core::primitive::u32, + new: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "set_account_id", + SetAccountId { index, new }, + [ + 245u8, 76u8, 110u8, 237u8, 219u8, 246u8, 219u8, 136u8, 146u8, 42u8, + 139u8, 60u8, 30u8, 188u8, 87u8, 10u8, 231u8, 89u8, 225u8, 24u8, 152u8, + 188u8, 59u8, 194u8, 199u8, 78u8, 169u8, 90u8, 122u8, 29u8, 80u8, 42u8, + ], + ) + } + #[doc = "Set the field information for a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `fields`: the fields that the registrar concerns themselves with."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R)`."] + #[doc = "- One storage mutation `O(R)`."] + #[doc = "- Benchmark: 7.464 + R * 0.325 µs (min squares analysis)"] + #[doc = "# "] + pub fn set_fields( + &self, + index: ::core::primitive::u32, + fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "set_fields", + SetFields { index, fields }, + [ + 50u8, 196u8, 179u8, 71u8, 66u8, 65u8, 235u8, 7u8, 51u8, 14u8, 81u8, + 173u8, 201u8, 58u8, 6u8, 151u8, 174u8, 245u8, 102u8, 184u8, 28u8, 84u8, + 125u8, 93u8, 126u8, 134u8, 92u8, 203u8, 200u8, 129u8, 240u8, 252u8, + ], + ) + } + #[doc = "Provide a judgement for an account's identity."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `reg_index`."] + #[doc = ""] + #[doc = "- `reg_index`: the index of the registrar whose judgement is being made."] + #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] + #[doc = " with a registered identity."] + #[doc = "- `judgement`: the judgement of the registrar of index `reg_index` about `target`."] + #[doc = ""] + #[doc = "Emits `JudgementGiven` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + X)`."] + #[doc = "- One balance-transfer operation."] + #[doc = "- Up to one account-lookup operation."] + #[doc = "- Storage: 1 read `O(R)`, 1 mutate `O(R + X)`."] + #[doc = "- One event."] + #[doc = "# "] + pub fn provide_judgement( + &self, + reg_index: ::core::primitive::u32, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + judgement: runtime_types::pallet_identity::types::Judgement< + ::core::primitive::u128, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "provide_judgement", + ProvideJudgement { + reg_index, + target, + judgement, + }, + [ + 221u8, 244u8, 12u8, 17u8, 197u8, 130u8, 189u8, 136u8, 253u8, 143u8, + 5u8, 145u8, 177u8, 105u8, 220u8, 8u8, 157u8, 63u8, 131u8, 5u8, 152u8, + 167u8, 158u8, 47u8, 123u8, 86u8, 225u8, 88u8, 218u8, 20u8, 82u8, 230u8, + ], + ) + } + #[doc = "Remove an account's identity and sub-account information and slash the deposits."] + #[doc = ""] + #[doc = "Payment: Reserved balances from `set_subs` and `set_identity` are slashed and handled by"] + #[doc = "`Slash`. Verification request deposits are not returned; they should be cancelled"] + #[doc = "manually using `cancel_request`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] + #[doc = ""] + #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] + #[doc = " with a registered identity."] + #[doc = ""] + #[doc = "Emits `IdentityKilled` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + S + X)`."] + #[doc = "- One balance-reserve operation."] + #[doc = "- `S + 2` storage mutations."] + #[doc = "- One event."] + #[doc = "# "] + pub fn kill_identity( + &self, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "kill_identity", + KillIdentity { target }, + [ + 76u8, 13u8, 158u8, 219u8, 221u8, 0u8, 151u8, 241u8, 137u8, 136u8, + 179u8, 194u8, 188u8, 230u8, 56u8, 16u8, 254u8, 28u8, 127u8, 216u8, + 205u8, 117u8, 224u8, 121u8, 240u8, 231u8, 126u8, 181u8, 230u8, 68u8, + 13u8, 174u8, + ], + ) + } + #[doc = "Add the given account to the sender's subs."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + pub fn add_sub( + &self, + sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + data: runtime_types::pallet_identity::types::Data, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "add_sub", + AddSub { sub, data }, + [ + 122u8, 218u8, 25u8, 93u8, 33u8, 176u8, 191u8, 254u8, 223u8, 147u8, + 100u8, 135u8, 86u8, 71u8, 47u8, 163u8, 105u8, 222u8, 162u8, 173u8, + 207u8, 182u8, 130u8, 128u8, 214u8, 242u8, 101u8, 250u8, 242u8, 24u8, + 17u8, 84u8, + ], + ) + } + #[doc = "Alter the associated name of the given sub-account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + pub fn rename_sub( + &self, + sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + data: runtime_types::pallet_identity::types::Data, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "rename_sub", + RenameSub { sub, data }, + [ + 166u8, 167u8, 49u8, 114u8, 199u8, 168u8, 187u8, 221u8, 100u8, 85u8, + 147u8, 211u8, 157u8, 31u8, 109u8, 135u8, 194u8, 135u8, 15u8, 89u8, + 59u8, 57u8, 252u8, 163u8, 9u8, 138u8, 216u8, 189u8, 177u8, 42u8, 96u8, + 34u8, + ], + ) + } + #[doc = "Remove the given account from the sender's subs."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + pub fn remove_sub( + &self, + sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "remove_sub", + RemoveSub { sub }, + [ + 106u8, 223u8, 210u8, 67u8, 54u8, 11u8, 144u8, 222u8, 42u8, 46u8, 157u8, + 33u8, 13u8, 245u8, 166u8, 195u8, 227u8, 81u8, 224u8, 149u8, 154u8, + 158u8, 187u8, 203u8, 215u8, 91u8, 43u8, 105u8, 69u8, 213u8, 141u8, + 124u8, + ], + ) + } + #[doc = "Remove the sender as a sub-account."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender (*not* the original depositor)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "super-identity."] + #[doc = ""] + #[doc = "NOTE: This should not normally be used, but is provided in the case that the non-"] + #[doc = "controller of an account is maliciously registered as a sub-account."] + pub fn quit_sub(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Identity", + "quit_sub", + QuitSub {}, + [ + 62u8, 57u8, 73u8, 72u8, 119u8, 216u8, 250u8, 155u8, 57u8, 169u8, 157u8, + 44u8, 87u8, 51u8, 63u8, 231u8, 77u8, 7u8, 0u8, 119u8, 244u8, 42u8, + 179u8, 51u8, 254u8, 240u8, 55u8, 25u8, 142u8, 38u8, 87u8, 44u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_identity::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A name was set or reset (which will remove all judgements)."] + pub struct IdentitySet { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for IdentitySet { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "IdentitySet"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A name was cleared, and the given balance returned."] + pub struct IdentityCleared { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for IdentityCleared { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "IdentityCleared"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A name was removed and the given balance slashed."] + pub struct IdentityKilled { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for IdentityKilled { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "IdentityKilled"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A judgement was asked from a registrar."] + pub struct JudgementRequested { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub registrar_index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for JudgementRequested { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "JudgementRequested"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A judgement request was retracted."] + pub struct JudgementUnrequested { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub registrar_index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for JudgementUnrequested { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "JudgementUnrequested"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A judgement was given by a registrar."] + pub struct JudgementGiven { + pub target: ::subxt::ext::sp_core::crypto::AccountId32, + pub registrar_index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for JudgementGiven { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "JudgementGiven"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A registrar was added."] + pub struct RegistrarAdded { + pub registrar_index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for RegistrarAdded { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "RegistrarAdded"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A sub-identity was added to an identity and the deposit paid."] + pub struct SubIdentityAdded { + pub sub: ::subxt::ext::sp_core::crypto::AccountId32, + pub main: ::subxt::ext::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for SubIdentityAdded { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "SubIdentityAdded"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A sub-identity was removed from an identity and the deposit freed."] + pub struct SubIdentityRemoved { + pub sub: ::subxt::ext::sp_core::crypto::AccountId32, + pub main: ::subxt::ext::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for SubIdentityRemoved { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "SubIdentityRemoved"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A sub-identity was cleared, and the given deposit repatriated from the"] + #[doc = "main identity account to the sub-identity account."] + pub struct SubIdentityRevoked { + pub sub: ::subxt::ext::sp_core::crypto::AccountId32, + pub main: ::subxt::ext::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for SubIdentityRevoked { + const PALLET: &'static str = "Identity"; + const EVENT: &'static str = "SubIdentityRevoked"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Information that is pertinent to identify the entity behind an account."] + #[doc = ""] + #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] + pub fn identity_of( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_identity::types::Registration< + ::core::primitive::u128, + >, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Identity", + "IdentityOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 193u8, 195u8, 180u8, 188u8, 129u8, 250u8, 180u8, 219u8, 22u8, 95u8, + 175u8, 170u8, 143u8, 188u8, 80u8, 124u8, 234u8, 228u8, 245u8, 39u8, + 72u8, 153u8, 107u8, 199u8, 23u8, 75u8, 47u8, 247u8, 104u8, 208u8, + 171u8, 82u8, + ], + ) + } + #[doc = " Information that is pertinent to identify the entity behind an account."] + #[doc = ""] + #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] + pub fn identity_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_identity::types::Registration< + ::core::primitive::u128, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Identity", + "IdentityOf", + Vec::new(), + [ + 193u8, 195u8, 180u8, 188u8, 129u8, 250u8, 180u8, 219u8, 22u8, 95u8, + 175u8, 170u8, 143u8, 188u8, 80u8, 124u8, 234u8, 228u8, 245u8, 39u8, + 72u8, 153u8, 107u8, 199u8, 23u8, 75u8, 47u8, 247u8, 104u8, 208u8, + 171u8, 82u8, + ], + ) + } + #[doc = " The super-identity of an alternative \"sub\" identity together with its name, within that"] + #[doc = " context. If the account is not some other account's sub-identity, then just `None`."] + pub fn super_of( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Identity", + "SuperOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 170u8, 249u8, 112u8, 249u8, 75u8, 176u8, 21u8, 29u8, 152u8, 149u8, + 69u8, 113u8, 20u8, 92u8, 113u8, 130u8, 135u8, 62u8, 18u8, 204u8, 166u8, + 193u8, 133u8, 167u8, 248u8, 117u8, 80u8, 137u8, 158u8, 111u8, 100u8, + 137u8, + ], + ) + } + #[doc = " The super-identity of an alternative \"sub\" identity together with its name, within that"] + #[doc = " context. If the account is not some other account's sub-identity, then just `None`."] + pub fn super_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Identity", + "SuperOf", + Vec::new(), + [ + 170u8, 249u8, 112u8, 249u8, 75u8, 176u8, 21u8, 29u8, 152u8, 149u8, + 69u8, 113u8, 20u8, 92u8, 113u8, 130u8, 135u8, 62u8, 18u8, 204u8, 166u8, + 193u8, 133u8, 167u8, 248u8, 117u8, 80u8, 137u8, 158u8, 111u8, 100u8, + 137u8, + ], + ) + } + #[doc = " Alternative \"sub\" identities of this account."] + #[doc = ""] + #[doc = " The first item is the deposit, the second is a vector of the accounts."] + #[doc = ""] + #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] + pub fn subs_of( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u128, + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + )>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Identity", + "SubsOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 128u8, 15u8, 175u8, 155u8, 216u8, 225u8, 200u8, 169u8, 215u8, 206u8, + 110u8, 22u8, 204u8, 89u8, 212u8, 210u8, 159u8, 169u8, 53u8, 7u8, 44u8, + 164u8, 91u8, 151u8, 7u8, 227u8, 38u8, 230u8, 175u8, 84u8, 6u8, 4u8, + ], + ) + } + #[doc = " Alternative \"sub\" identities of this account."] + #[doc = ""] + #[doc = " The first item is the deposit, the second is a vector of the accounts."] + #[doc = ""] + #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] + pub fn subs_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u128, + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + )>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Identity", + "SubsOf", + Vec::new(), + [ + 128u8, 15u8, 175u8, 155u8, 216u8, 225u8, 200u8, 169u8, 215u8, 206u8, + 110u8, 22u8, 204u8, 89u8, 212u8, 210u8, 159u8, 169u8, 53u8, 7u8, 44u8, + 164u8, 91u8, 151u8, 7u8, 227u8, 38u8, 230u8, 175u8, 84u8, 6u8, 4u8, + ], + ) + } + #[doc = " The set of registrars. Not expected to get very big as can only be added through a"] + #[doc = " special origin (likely a council motion)."] + #[doc = ""] + #[doc = " The index into this can be cast to `RegistrarIndex` to get a valid value."] + pub fn registrars( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::option::Option< + runtime_types::pallet_identity::types::RegistrarInfo< + ::core::primitive::u128, + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Identity", + "Registrars", + vec![], + [ + 157u8, 87u8, 39u8, 240u8, 154u8, 54u8, 241u8, 229u8, 76u8, 9u8, 62u8, + 252u8, 40u8, 143u8, 186u8, 182u8, 233u8, 187u8, 251u8, 61u8, 236u8, + 229u8, 19u8, 55u8, 42u8, 36u8, 82u8, 173u8, 215u8, 155u8, 229u8, 111u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The amount held on deposit for a registered identity"] + pub fn basic_deposit( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Identity", + "BasicDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + #[doc = " The amount held on deposit per additional field for a registered identity."] + pub fn field_deposit( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Identity", + "FieldDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + #[doc = " The amount held on deposit for a registered subaccount. This should account for the fact"] + #[doc = " that one storage item's value will increase by the size of an account ID, and there will"] + #[doc = " be another trie item whose value is the size of an account ID plus 32 bytes."] + pub fn sub_account_deposit( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Identity", + "SubAccountDeposit", + [ + 84u8, 157u8, 140u8, 4u8, 93u8, 57u8, 29u8, 133u8, 105u8, 200u8, 214u8, + 27u8, 144u8, 208u8, 218u8, 160u8, 130u8, 109u8, 101u8, 54u8, 210u8, + 136u8, 71u8, 63u8, 49u8, 237u8, 234u8, 15u8, 178u8, 98u8, 148u8, 156u8, + ], + ) + } + #[doc = " The maximum number of sub-accounts allowed per identified account."] + pub fn max_sub_accounts( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Identity", + "MaxSubAccounts", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " Maximum number of additional fields that may be stored in an ID. Needed to bound the I/O"] + #[doc = " required to access an identity, but can be pretty high."] + pub fn max_additional_fields( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Identity", + "MaxAdditionalFields", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + #[doc = " Maxmimum number of registrars allowed in the system. Needed to bound the complexity"] + #[doc = " of, e.g., updating judgements."] + pub fn max_registrars( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Identity", + "MaxRegistrars", + [ + 98u8, 252u8, 116u8, 72u8, 26u8, 180u8, 225u8, 83u8, 200u8, 157u8, + 125u8, 151u8, 53u8, 76u8, 168u8, 26u8, 10u8, 9u8, 98u8, 68u8, 9u8, + 178u8, 197u8, 113u8, 31u8, 79u8, 200u8, 90u8, 203u8, 100u8, 41u8, + 145u8, + ], + ) + } + } + } + } + pub mod runtime_types { + use super::runtime_types; + pub mod aleph_runtime { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Call { + #[codec(index = 0)] + System(runtime_types::frame_system::pallet::Call), + #[codec(index = 2)] + Scheduler(runtime_types::pallet_scheduler::pallet::Call), + #[codec(index = 4)] + Timestamp(runtime_types::pallet_timestamp::pallet::Call), + #[codec(index = 5)] + Balances(runtime_types::pallet_balances::pallet::Call), + #[codec(index = 7)] + Authorship(runtime_types::pallet_authorship::pallet::Call), + #[codec(index = 8)] + Staking(runtime_types::pallet_staking::pallet::pallet::Call), + #[codec(index = 10)] + Session(runtime_types::pallet_session::pallet::Call), + #[codec(index = 11)] + Aleph(runtime_types::pallet_aleph::pallet::Call), + #[codec(index = 12)] + Elections(runtime_types::pallet_elections::pallet::Call), + #[codec(index = 13)] + Treasury(runtime_types::pallet_treasury::pallet::Call), + #[codec(index = 14)] + Vesting(runtime_types::pallet_vesting::pallet::Call), + #[codec(index = 15)] + Utility(runtime_types::pallet_utility::pallet::Call), + #[codec(index = 16)] + Multisig(runtime_types::pallet_multisig::pallet::Call), + #[codec(index = 17)] + Sudo(runtime_types::pallet_sudo::pallet::Call), + #[codec(index = 18)] + Contracts(runtime_types::pallet_contracts::pallet::Call), + #[codec(index = 19)] + NominationPools(runtime_types::pallet_nomination_pools::pallet::Call), + #[codec(index = 20)] + Identity(runtime_types::pallet_identity::pallet::Call), + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Event { + #[codec(index = 0)] + System(runtime_types::frame_system::pallet::Event), + #[codec(index = 2)] + Scheduler(runtime_types::pallet_scheduler::pallet::Event), + #[codec(index = 5)] + Balances(runtime_types::pallet_balances::pallet::Event), + #[codec(index = 6)] + TransactionPayment(runtime_types::pallet_transaction_payment::pallet::Event), + #[codec(index = 8)] + Staking(runtime_types::pallet_staking::pallet::pallet::Event), + #[codec(index = 10)] + Session(runtime_types::pallet_session::pallet::Event), + #[codec(index = 11)] + Aleph(runtime_types::pallet_aleph::pallet::Event), + #[codec(index = 12)] + Elections(runtime_types::pallet_elections::pallet::Event), + #[codec(index = 13)] + Treasury(runtime_types::pallet_treasury::pallet::Event), + #[codec(index = 14)] + Vesting(runtime_types::pallet_vesting::pallet::Event), + #[codec(index = 15)] + Utility(runtime_types::pallet_utility::pallet::Event), + #[codec(index = 16)] + Multisig(runtime_types::pallet_multisig::pallet::Event), + #[codec(index = 17)] + Sudo(runtime_types::pallet_sudo::pallet::Event), + #[codec(index = 18)] + Contracts(runtime_types::pallet_contracts::pallet::Event), + #[codec(index = 19)] + NominationPools(runtime_types::pallet_nomination_pools::pallet::Event), + #[codec(index = 20)] + Identity(runtime_types::pallet_identity::pallet::Event), + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum OriginCaller { + #[codec(index = 0)] + system( + runtime_types::frame_support::dispatch::RawOrigin< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ), + #[codec(index = 1)] + Void(runtime_types::sp_core::Void), + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Runtime; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SessionKeys { + pub aura: runtime_types::sp_consensus_aura::sr25519::app_sr25519::Public, + pub aleph: runtime_types::primitives::app::Public, + } + } + pub mod frame_support { + use super::runtime_types; + pub mod dispatch { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum RawOrigin<_0> { + #[codec(index = 0)] + Root, + #[codec(index = 1)] + Signed(_0), + #[codec(index = 2)] + None, + } + } + pub mod traits { + use super::runtime_types; + pub mod misc { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct WrapperKeepOpaque<_0>( + #[codec(compact)] pub ::core::primitive::u32, + pub _0, + ); + } + pub mod schedule { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum LookupError { + #[codec(index = 0)] + Unknown, + #[codec(index = 1)] + BadFormat, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum MaybeHashed<_0, _1> { + #[codec(index = 0)] + Value(_0), + #[codec(index = 1)] + Hash(_1), + } + } + pub mod tokens { + use super::runtime_types; + pub mod misc { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum BalanceStatus { + #[codec(index = 0)] + Free, + #[codec(index = 1)] + Reserved, + } + } + } + } + pub mod weights { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum DispatchClass { + #[codec(index = 0)] + Normal, + #[codec(index = 1)] + Operational, + #[codec(index = 2)] + Mandatory, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct DispatchInfo { + pub weight: ::core::primitive::u64, + pub class: runtime_types::frame_support::weights::DispatchClass, + pub pays_fee: runtime_types::frame_support::weights::Pays, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Pays { + #[codec(index = 0)] + Yes, + #[codec(index = 1)] + No, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct PerDispatchClass<_0> { + pub normal: _0, + pub operational: _0, + pub mandatory: _0, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RuntimeDbWeight { + pub read: ::core::primitive::u64, + pub write: ::core::primitive::u64, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct PalletId(pub [::core::primitive::u8; 8usize]); + } + pub mod frame_system { + use super::runtime_types; + pub mod extensions { + use super::runtime_types; + pub mod check_genesis { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CheckGenesis; + } + pub mod check_mortality { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CheckMortality(pub runtime_types::sp_runtime::generic::era::Era); + } + pub mod check_nonce { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CheckNonce(#[codec(compact)] pub ::core::primitive::u32); + } + pub mod check_spec_version { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CheckSpecVersion; + } + pub mod check_tx_version { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CheckTxVersion; + } + pub mod check_weight { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CheckWeight; + } + } + pub mod limits { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BlockLength { + pub max: runtime_types::frame_support::weights::PerDispatchClass< + ::core::primitive::u32, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BlockWeights { + pub base_block: ::core::primitive::u64, + pub max_block: ::core::primitive::u64, + pub per_class: runtime_types::frame_support::weights::PerDispatchClass< + runtime_types::frame_system::limits::WeightsPerClass, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct WeightsPerClass { + pub base_extrinsic: ::core::primitive::u64, + pub max_extrinsic: ::core::option::Option<::core::primitive::u64>, + pub max_total: ::core::option::Option<::core::primitive::u64>, + pub reserved: ::core::option::Option<::core::primitive::u64>, + } + } + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "A dispatch that will fill the block weight up to the given ratio."] + fill_block { + ratio: runtime_types::sp_arithmetic::per_things::Perbill, + }, + #[codec(index = 1)] + #[doc = "Make some on-chain remark."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`"] + #[doc = "# "] + remark { + remark: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 2)] + #[doc = "Set the number of pages in the WebAssembly environment's heap."] + set_heap_pages { pages: ::core::primitive::u64 }, + #[codec(index = 3)] + #[doc = "Set the new runtime code."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(C + S)` where `C` length of `code` and `S` complexity of `can_set_code`"] + #[doc = "- 1 call to `can_set_code`: `O(S)` (calls `sp_io::misc::runtime_version` which is"] + #[doc = " expensive)."] + #[doc = "- 1 storage write (codec `O(C)`)."] + #[doc = "- 1 digest item."] + #[doc = "- 1 event."] + #[doc = "The weight of this function is dependent on the runtime, but generally this is very"] + #[doc = "expensive. We will treat this as a full block."] + #[doc = "# "] + set_code { + code: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 4)] + #[doc = "Set the new runtime code without doing any checks of the given `code`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(C)` where `C` length of `code`"] + #[doc = "- 1 storage write (codec `O(C)`)."] + #[doc = "- 1 digest item."] + #[doc = "- 1 event."] + #[doc = "The weight of this function is dependent on the runtime. We will treat this as a full"] + #[doc = "block. # "] + set_code_without_checks { + code: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 5)] + #[doc = "Set some items of storage."] + set_storage { + items: ::std::vec::Vec<( + ::std::vec::Vec<::core::primitive::u8>, + ::std::vec::Vec<::core::primitive::u8>, + )>, + }, + #[codec(index = 6)] + #[doc = "Kill some items from storage."] + kill_storage { + keys: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, + }, + #[codec(index = 7)] + #[doc = "Kill all storage items with a key that starts with the given prefix."] + #[doc = ""] + #[doc = "**NOTE:** We rely on the Root origin to provide us the number of subkeys under"] + #[doc = "the prefix we are removing to accurately calculate the weight of this function."] + kill_prefix { + prefix: ::std::vec::Vec<::core::primitive::u8>, + subkeys: ::core::primitive::u32, + }, + #[codec(index = 8)] + #[doc = "Make some on-chain remark and emit event."] + remark_with_event { + remark: ::std::vec::Vec<::core::primitive::u8>, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Error for the System pallet"] + pub enum Error { + #[codec(index = 0)] + #[doc = "The name of specification does not match between the current runtime"] + #[doc = "and the new runtime."] + InvalidSpecName, + #[codec(index = 1)] + #[doc = "The specification version is not allowed to decrease between the current runtime"] + #[doc = "and the new runtime."] + SpecVersionNeedsToIncrease, + #[codec(index = 2)] + #[doc = "Failed to extract the runtime version from the new runtime."] + #[doc = ""] + #[doc = "Either calling `Core_version` or decoding `RuntimeVersion` failed."] + FailedToExtractRuntimeVersion, + #[codec(index = 3)] + #[doc = "Suicide called when the account has non-default composite data."] + NonDefaultComposite, + #[codec(index = 4)] + #[doc = "There is a non-zero reference count preventing the account from being purged."] + NonZeroRefCount, + #[codec(index = 5)] + #[doc = "The origin filter prevent the call to be dispatched."] + CallFiltered, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Event for the System pallet."] + pub enum Event { + #[codec(index = 0)] + #[doc = "An extrinsic completed successfully."] + ExtrinsicSuccess { + dispatch_info: runtime_types::frame_support::weights::DispatchInfo, + }, + #[codec(index = 1)] + #[doc = "An extrinsic failed."] + ExtrinsicFailed { + dispatch_error: runtime_types::sp_runtime::DispatchError, + dispatch_info: runtime_types::frame_support::weights::DispatchInfo, + }, + #[codec(index = 2)] + #[doc = "`:code` was updated."] + CodeUpdated, + #[codec(index = 3)] + #[doc = "A new account was created."] + NewAccount { + account: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 4)] + #[doc = "An account was reaped."] + KilledAccount { + account: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 5)] + #[doc = "On on-chain remark happened."] + Remarked { + sender: ::subxt::ext::sp_core::crypto::AccountId32, + hash: ::subxt::ext::sp_core::H256, + }, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct AccountInfo<_0, _1> { + pub nonce: _0, + pub consumers: _0, + pub providers: _0, + pub sufficients: _0, + pub data: _1, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct EventRecord<_0, _1> { + pub phase: runtime_types::frame_system::Phase, + pub event: _0, + pub topics: ::std::vec::Vec<_1>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct LastRuntimeUpgradeInfo { + #[codec(compact)] + pub spec_version: ::core::primitive::u32, + pub spec_name: ::std::string::String, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Phase { + #[codec(index = 0)] + ApplyExtrinsic(::core::primitive::u32), + #[codec(index = 1)] + Finalization, + #[codec(index = 2)] + Initialization, + } + } + pub mod pallet_aleph { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Sets the emergency finalization key. If called in session `N` the key can be used to"] + #[doc = "finalize blocks from session `N+2` onwards, until it gets overridden."] + set_emergency_finalizer { + emergency_finalizer: runtime_types::primitives::app::Public, + }, + #[codec(index = 1)] + #[doc = "Schedules a finality version change for a future session. If such a scheduled future"] + #[doc = "version is already set, it is replaced with the provided one."] + #[doc = "Any rescheduling of a future version change needs to occur at least 2 sessions in"] + #[doc = "advance of the provided session of the version change."] + #[doc = "In order to cancel a scheduled version change, a new version change should be scheduled"] + #[doc = "with the same version as the current one."] + schedule_finality_version_change { + version_incoming: ::core::primitive::u32, + session: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + ChangeEmergencyFinalizer(runtime_types::primitives::app::Public), + #[codec(index = 1)] + ScheduleFinalityVersionChange(runtime_types::primitives::VersionChange), + #[codec(index = 2)] + FinalityVersionChange(runtime_types::primitives::VersionChange), + } + } + } + pub mod pallet_authorship { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Provide a set of uncles."] + set_uncles { + new_uncles: ::std::vec::Vec< + runtime_types::sp_runtime::generic::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "The uncle parent not in the chain."] + InvalidUncleParent, + #[codec(index = 1)] + #[doc = "Uncles already set in the block."] + UnclesAlreadySet, + #[codec(index = 2)] + #[doc = "Too many uncles."] + TooManyUncles, + #[codec(index = 3)] + #[doc = "The uncle is genesis."] + GenesisUncle, + #[codec(index = 4)] + #[doc = "The uncle is too high in chain."] + TooHighUncle, + #[codec(index = 5)] + #[doc = "The uncle is already included."] + UncleAlreadyIncluded, + #[codec(index = 6)] + #[doc = "The uncle isn't recent enough to be included."] + OldUncle, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum UncleEntryItem<_0, _1, _2> { + #[codec(index = 0)] + InclusionHeight(_0), + #[codec(index = 1)] + Uncle(_1, ::core::option::Option<_2>), + } + } + pub mod pallet_balances { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Transfer some liquid free balance to another account."] + #[doc = ""] + #[doc = "`transfer` will set the `FreeBalance` of the sender and receiver."] + #[doc = "If the sender's account is below the existential deposit as a result"] + #[doc = "of the transfer, the account will be reaped."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Signed` by the transactor."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Dependent on arguments but not critical, given proper implementations for input config"] + #[doc = " types. See related functions below."] + #[doc = "- It contains a limited number of reads and writes internally and no complex"] + #[doc = " computation."] + #[doc = ""] + #[doc = "Related functions:"] + #[doc = ""] + #[doc = " - `ensure_can_withdraw` is always called internally but has a bounded complexity."] + #[doc = " - Transferring balances to accounts that did not exist before will cause"] + #[doc = " `T::OnNewAccount::on_new_account` to be called."] + #[doc = " - Removing enough funds from an account will trigger `T::DustRemoval::on_unbalanced`."] + #[doc = " - `transfer_keep_alive` works the same way as `transfer`, but has an additional check"] + #[doc = " that the transfer will not kill the origin account."] + #[doc = "---------------------------------"] + #[doc = "- Origin account is already in memory, so no DB operations for them."] + #[doc = "# "] + transfer { + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 1)] + #[doc = "Set the balances of a given account."] + #[doc = ""] + #[doc = "This will alter `FreeBalance` and `ReservedBalance` in storage. it will"] + #[doc = "also alter the total issuance of the system (`TotalIssuance`) appropriately."] + #[doc = "If the new free or reserved balance is below the existential deposit,"] + #[doc = "it will reset the account nonce (`frame_system::AccountNonce`)."] + #[doc = ""] + #[doc = "The dispatch origin for this call is `root`."] + set_balance { + who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + new_free: ::core::primitive::u128, + #[codec(compact)] + new_reserved: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "Exactly as `transfer`, except the origin must be root and the source account may be"] + #[doc = "specified."] + #[doc = "# "] + #[doc = "- Same as transfer, but additional read and write because the source account is not"] + #[doc = " assumed to be in the overlay."] + #[doc = "# "] + force_transfer { + source: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "Same as the [`transfer`] call, but with a check that the transfer will not kill the"] + #[doc = "origin account."] + #[doc = ""] + #[doc = "99% of the time you want [`transfer`] instead."] + #[doc = ""] + #[doc = "[`transfer`]: struct.Pallet.html#method.transfer"] + transfer_keep_alive { + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 4)] + #[doc = "Transfer the entire transferable balance from the caller account."] + #[doc = ""] + #[doc = "NOTE: This function only attempts to transfer _transferable_ balances. This means that"] + #[doc = "any locked, reserved, or existential deposits (when `keep_alive` is `true`), will not be"] + #[doc = "transferred by this function. To ensure that this function results in a killed account,"] + #[doc = "you might need to prepare the account by removing any reference counters, storage"] + #[doc = "deposits, etc..."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be Signed."] + #[doc = ""] + #[doc = "- `dest`: The recipient of the transfer."] + #[doc = "- `keep_alive`: A boolean to determine if the `transfer_all` operation should send all"] + #[doc = " of the funds the account has, causing the sender account to be killed (false), or"] + #[doc = " transfer everything except at least the existential deposit, which will guarantee to"] + #[doc = " keep the sender account alive (true). # "] + #[doc = "- O(1). Just like transfer, but reading the user's transferable balance first."] + #[doc = " #"] + transfer_all { + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + keep_alive: ::core::primitive::bool, + }, + #[codec(index = 5)] + #[doc = "Unreserve some balance from a user by force."] + #[doc = ""] + #[doc = "Can only be called by ROOT."] + force_unreserve { + who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + amount: ::core::primitive::u128, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "Vesting balance too high to send value"] + VestingBalance, + #[codec(index = 1)] + #[doc = "Account liquidity restrictions prevent withdrawal"] + LiquidityRestrictions, + #[codec(index = 2)] + #[doc = "Balance too low to send value"] + InsufficientBalance, + #[codec(index = 3)] + #[doc = "Value too low to create account due to existential deposit"] + ExistentialDeposit, + #[codec(index = 4)] + #[doc = "Transfer/payment would kill account"] + KeepAlive, + #[codec(index = 5)] + #[doc = "A vesting schedule already exists for this account"] + ExistingVestingSchedule, + #[codec(index = 6)] + #[doc = "Beneficiary account must pre-exist"] + DeadAccount, + #[codec(index = 7)] + #[doc = "Number of named reserves exceed MaxReserves"] + TooManyReserves, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "An account was created with some free balance."] + Endowed { + account: ::subxt::ext::sp_core::crypto::AccountId32, + free_balance: ::core::primitive::u128, + }, + #[codec(index = 1)] + #[doc = "An account was removed whose balance was non-zero but below ExistentialDeposit,"] + #[doc = "resulting in an outright loss."] + DustLost { + account: ::subxt::ext::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "Transfer succeeded."] + Transfer { + from: ::subxt::ext::sp_core::crypto::AccountId32, + to: ::subxt::ext::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "A balance was set by root."] + BalanceSet { + who: ::subxt::ext::sp_core::crypto::AccountId32, + free: ::core::primitive::u128, + reserved: ::core::primitive::u128, + }, + #[codec(index = 4)] + #[doc = "Some balance was reserved (moved from free to reserved)."] + Reserved { + who: ::subxt::ext::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 5)] + #[doc = "Some balance was unreserved (moved from reserved to free)."] + Unreserved { + who: ::subxt::ext::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 6)] + #[doc = "Some balance was moved from the reserve of the first account to the second account."] + #[doc = "Final argument indicates the destination balance type."] + ReserveRepatriated { + from: ::subxt::ext::sp_core::crypto::AccountId32, + to: ::subxt::ext::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + destination_status: + runtime_types::frame_support::traits::tokens::misc::BalanceStatus, + }, + #[codec(index = 7)] + #[doc = "Some amount was deposited (e.g. for transaction fees)."] + Deposit { + who: ::subxt::ext::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 8)] + #[doc = "Some amount was withdrawn from the account (e.g. for transaction fees)."] + Withdraw { + who: ::subxt::ext::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 9)] + #[doc = "Some amount was removed from the account (e.g. for misbehavior)."] + Slashed { + who: ::subxt::ext::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct AccountData<_0> { + pub free: _0, + pub reserved: _0, + pub misc_frozen: _0, + pub fee_frozen: _0, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BalanceLock<_0> { + pub id: [::core::primitive::u8; 8usize], + pub amount: _0, + pub reasons: runtime_types::pallet_balances::Reasons, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Reasons { + #[codec(index = 0)] + Fee, + #[codec(index = 1)] + Misc, + #[codec(index = 2)] + All, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Releases { + #[codec(index = 0)] + V1_0_0, + #[codec(index = 1)] + V2_0_0, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ReserveData<_0, _1> { + pub id: _0, + pub amount: _1, + } + } + pub mod pallet_contracts { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Makes a call to an account, optionally transferring some balance."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `dest`: Address of the contract to call."] + #[doc = "* `value`: The balance to transfer from the `origin` to `dest`."] + #[doc = "* `gas_limit`: The gas limit enforced when executing the constructor."] + #[doc = "* `storage_deposit_limit`: The maximum amount of balance that can be charged from the"] + #[doc = " caller to pay for the storage consumed."] + #[doc = "* `data`: The input data to pass to the contract."] + #[doc = ""] + #[doc = "* If the account is a smart-contract account, the associated code will be"] + #[doc = "executed and any value will be transferred."] + #[doc = "* If the account is a regular account, any value will be transferred."] + #[doc = "* If no account exists and the call value is not less than `existential_deposit`,"] + #[doc = "a regular account will be created and any value will be transferred."] + call { + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + value: ::core::primitive::u128, + #[codec(compact)] + gas_limit: ::core::primitive::u64, + storage_deposit_limit: ::core::option::Option< + ::subxt::ext::codec::Compact<::core::primitive::u128>, + >, + data: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 1)] + #[doc = "Instantiates a new contract from the supplied `code` optionally transferring"] + #[doc = "some balance."] + #[doc = ""] + #[doc = "This dispatchable has the same effect as calling [`Self::upload_code`] +"] + #[doc = "[`Self::instantiate`]. Bundling them together provides efficiency gains. Please"] + #[doc = "also check the documentation of [`Self::upload_code`]."] + #[doc = ""] + #[doc = "# Parameters"] + #[doc = ""] + #[doc = "* `value`: The balance to transfer from the `origin` to the newly created contract."] + #[doc = "* `gas_limit`: The gas limit enforced when executing the constructor."] + #[doc = "* `storage_deposit_limit`: The maximum amount of balance that can be charged/reserved"] + #[doc = " from the caller to pay for the storage consumed."] + #[doc = "* `code`: The contract code to deploy in raw bytes."] + #[doc = "* `data`: The input data to pass to the contract constructor."] + #[doc = "* `salt`: Used for the address derivation. See [`Pallet::contract_address`]."] + #[doc = ""] + #[doc = "Instantiation is executed as follows:"] + #[doc = ""] + #[doc = "- The supplied `code` is instrumented, deployed, and a `code_hash` is created for that"] + #[doc = " code."] + #[doc = "- If the `code_hash` already exists on the chain the underlying `code` will be shared."] + #[doc = "- The destination address is computed based on the sender, code_hash and the salt."] + #[doc = "- The smart-contract account is created at the computed address."] + #[doc = "- The `value` is transferred to the new account."] + #[doc = "- The `deploy` function is executed in the context of the newly-created account."] + instantiate_with_code { + #[codec(compact)] + value: ::core::primitive::u128, + #[codec(compact)] + gas_limit: ::core::primitive::u64, + storage_deposit_limit: ::core::option::Option< + ::subxt::ext::codec::Compact<::core::primitive::u128>, + >, + code: ::std::vec::Vec<::core::primitive::u8>, + data: ::std::vec::Vec<::core::primitive::u8>, + salt: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 2)] + #[doc = "Instantiates a contract from a previously deployed wasm binary."] + #[doc = ""] + #[doc = "This function is identical to [`Self::instantiate_with_code`] but without the"] + #[doc = "code deployment step. Instead, the `code_hash` of an on-chain deployed wasm binary"] + #[doc = "must be supplied."] + instantiate { + #[codec(compact)] + value: ::core::primitive::u128, + #[codec(compact)] + gas_limit: ::core::primitive::u64, + storage_deposit_limit: ::core::option::Option< + ::subxt::ext::codec::Compact<::core::primitive::u128>, + >, + code_hash: ::subxt::ext::sp_core::H256, + data: ::std::vec::Vec<::core::primitive::u8>, + salt: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 3)] + #[doc = "Upload new `code` without instantiating a contract from it."] + #[doc = ""] + #[doc = "If the code does not already exist a deposit is reserved from the caller"] + #[doc = "and unreserved only when [`Self::remove_code`] is called. The size of the reserve"] + #[doc = "depends on the instrumented size of the the supplied `code`."] + #[doc = ""] + #[doc = "If the code already exists in storage it will still return `Ok` and upgrades"] + #[doc = "the in storage version to the current"] + #[doc = "[`InstructionWeights::version`](InstructionWeights)."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "Anyone can instantiate a contract from any uploaded code and thus prevent its removal."] + #[doc = "To avoid this situation a constructor could employ access control so that it can"] + #[doc = "only be instantiated by permissioned entities. The same is true when uploading"] + #[doc = "through [`Self::instantiate_with_code`]."] + upload_code { + code: ::std::vec::Vec<::core::primitive::u8>, + storage_deposit_limit: ::core::option::Option< + ::subxt::ext::codec::Compact<::core::primitive::u128>, + >, + }, + #[codec(index = 4)] + #[doc = "Remove the code stored under `code_hash` and refund the deposit to its owner."] + #[doc = ""] + #[doc = "A code can only be removed by its original uploader (its owner) and only if it is"] + #[doc = "not used by any contract."] + remove_code { + code_hash: ::subxt::ext::sp_core::H256, + }, + #[codec(index = 5)] + #[doc = "Privileged function that changes the code of an existing contract."] + #[doc = ""] + #[doc = "This takes care of updating refcounts and all other necessary operations. Returns"] + #[doc = "an error if either the `code_hash` or `dest` do not exist."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "This does **not** change the address of the contract in question. This means"] + #[doc = "that the contract address is no longer derived from its code hash after calling"] + #[doc = "this dispatchable."] + set_code { + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + code_hash: ::subxt::ext::sp_core::H256, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "A new schedule must have a greater version than the current one."] + InvalidScheduleVersion, + #[codec(index = 1)] + #[doc = "Invalid combination of flags supplied to `seal_call` or `seal_delegate_call`."] + InvalidCallFlags, + #[codec(index = 2)] + #[doc = "The executed contract exhausted its gas limit."] + OutOfGas, + #[codec(index = 3)] + #[doc = "The output buffer supplied to a contract API call was too small."] + OutputBufferTooSmall, + #[codec(index = 4)] + #[doc = "Performing the requested transfer failed. Probably because there isn't enough"] + #[doc = "free balance in the sender's account."] + TransferFailed, + #[codec(index = 5)] + #[doc = "Performing a call was denied because the calling depth reached the limit"] + #[doc = "of what is specified in the schedule."] + MaxCallDepthReached, + #[codec(index = 6)] + #[doc = "No contract was found at the specified address."] + ContractNotFound, + #[codec(index = 7)] + #[doc = "The code supplied to `instantiate_with_code` exceeds the limit specified in the"] + #[doc = "current schedule."] + CodeTooLarge, + #[codec(index = 8)] + #[doc = "No code could be found at the supplied code hash."] + CodeNotFound, + #[codec(index = 9)] + #[doc = "A buffer outside of sandbox memory was passed to a contract API function."] + OutOfBounds, + #[codec(index = 10)] + #[doc = "Input passed to a contract API function failed to decode as expected type."] + DecodingFailed, + #[codec(index = 11)] + #[doc = "Contract trapped during execution."] + ContractTrapped, + #[codec(index = 12)] + #[doc = "The size defined in `T::MaxValueSize` was exceeded."] + ValueTooLarge, + #[codec(index = 13)] + #[doc = "Termination of a contract is not allowed while the contract is already"] + #[doc = "on the call stack. Can be triggered by `seal_terminate`."] + TerminatedWhileReentrant, + #[codec(index = 14)] + #[doc = "`seal_call` forwarded this contracts input. It therefore is no longer available."] + InputForwarded, + #[codec(index = 15)] + #[doc = "The subject passed to `seal_random` exceeds the limit."] + RandomSubjectTooLong, + #[codec(index = 16)] + #[doc = "The amount of topics passed to `seal_deposit_events` exceeds the limit."] + TooManyTopics, + #[codec(index = 17)] + #[doc = "The topics passed to `seal_deposit_events` contains at least one duplicate."] + DuplicateTopics, + #[codec(index = 18)] + #[doc = "The chain does not provide a chain extension. Calling the chain extension results"] + #[doc = "in this error. Note that this usually shouldn't happen as deploying such contracts"] + #[doc = "is rejected."] + NoChainExtension, + #[codec(index = 19)] + #[doc = "Removal of a contract failed because the deletion queue is full."] + #[doc = ""] + #[doc = "This can happen when calling `seal_terminate`."] + #[doc = "The queue is filled by deleting contracts and emptied by a fixed amount each block."] + #[doc = "Trying again during another block is the only way to resolve this issue."] + DeletionQueueFull, + #[codec(index = 20)] + #[doc = "A contract with the same AccountId already exists."] + DuplicateContract, + #[codec(index = 21)] + #[doc = "A contract self destructed in its constructor."] + #[doc = ""] + #[doc = "This can be triggered by a call to `seal_terminate`."] + TerminatedInConstructor, + #[codec(index = 22)] + #[doc = "The debug message specified to `seal_debug_message` does contain invalid UTF-8."] + DebugMessageInvalidUTF8, + #[codec(index = 23)] + #[doc = "A call tried to invoke a contract that is flagged as non-reentrant."] + ReentranceDenied, + #[codec(index = 24)] + #[doc = "Origin doesn't have enough balance to pay the required storage deposits."] + StorageDepositNotEnoughFunds, + #[codec(index = 25)] + #[doc = "More storage was created than allowed by the storage deposit limit."] + StorageDepositLimitExhausted, + #[codec(index = 26)] + #[doc = "Code removal was denied because the code is still in use by at least one contract."] + CodeInUse, + #[codec(index = 27)] + #[doc = "The contract ran to completion but decided to revert its storage changes."] + #[doc = "Please note that this error is only returned from extrinsics. When called directly"] + #[doc = "or via RPC an `Ok` will be returned. In this case the caller needs to inspect the flags"] + #[doc = "to determine whether a reversion has taken place."] + ContractReverted, + #[codec(index = 28)] + #[doc = "The contract's code was found to be invalid during validation or instrumentation."] + #[doc = "A more detailed error can be found on the node console if debug messages are enabled"] + #[doc = "or in the debug buffer which is returned to RPC clients."] + CodeRejected, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "Contract deployed by address at the specified address."] + Instantiated { + deployer: ::subxt::ext::sp_core::crypto::AccountId32, + contract: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 1)] + #[doc = "Contract has been removed."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "The only way for a contract to be removed and emitting this event is by calling"] + #[doc = "`seal_terminate`."] + Terminated { + contract: ::subxt::ext::sp_core::crypto::AccountId32, + beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 2)] + #[doc = "Code with the specified hash has been stored."] + CodeStored { + code_hash: ::subxt::ext::sp_core::H256, + }, + #[codec(index = 3)] + #[doc = "A custom event emitted by the contract."] + ContractEmitted { + contract: ::subxt::ext::sp_core::crypto::AccountId32, + data: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 4)] + #[doc = "A code with the specified hash was removed."] + CodeRemoved { + code_hash: ::subxt::ext::sp_core::H256, + }, + #[codec(index = 5)] + #[doc = "A contract's code was updated."] + ContractCodeUpdated { + contract: ::subxt::ext::sp_core::crypto::AccountId32, + new_code_hash: ::subxt::ext::sp_core::H256, + old_code_hash: ::subxt::ext::sp_core::H256, + }, + } + } + pub mod schedule { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct HostFnWeights { + pub caller: ::core::primitive::u64, + pub is_contract: ::core::primitive::u64, + pub code_hash: ::core::primitive::u64, + pub own_code_hash: ::core::primitive::u64, + pub caller_is_origin: ::core::primitive::u64, + pub address: ::core::primitive::u64, + pub gas_left: ::core::primitive::u64, + pub balance: ::core::primitive::u64, + pub value_transferred: ::core::primitive::u64, + pub minimum_balance: ::core::primitive::u64, + pub block_number: ::core::primitive::u64, + pub now: ::core::primitive::u64, + pub weight_to_fee: ::core::primitive::u64, + pub gas: ::core::primitive::u64, + pub input: ::core::primitive::u64, + pub input_per_byte: ::core::primitive::u64, + pub r#return: ::core::primitive::u64, + pub return_per_byte: ::core::primitive::u64, + pub terminate: ::core::primitive::u64, + pub random: ::core::primitive::u64, + pub deposit_event: ::core::primitive::u64, + pub deposit_event_per_topic: ::core::primitive::u64, + pub deposit_event_per_byte: ::core::primitive::u64, + pub debug_message: ::core::primitive::u64, + pub set_storage: ::core::primitive::u64, + pub set_storage_per_new_byte: ::core::primitive::u64, + pub set_storage_per_old_byte: ::core::primitive::u64, + pub set_code_hash: ::core::primitive::u64, + pub clear_storage: ::core::primitive::u64, + pub clear_storage_per_byte: ::core::primitive::u64, + pub contains_storage: ::core::primitive::u64, + pub contains_storage_per_byte: ::core::primitive::u64, + pub get_storage: ::core::primitive::u64, + pub get_storage_per_byte: ::core::primitive::u64, + pub take_storage: ::core::primitive::u64, + pub take_storage_per_byte: ::core::primitive::u64, + pub transfer: ::core::primitive::u64, + pub call: ::core::primitive::u64, + pub delegate_call: ::core::primitive::u64, + pub call_transfer_surcharge: ::core::primitive::u64, + pub call_per_cloned_byte: ::core::primitive::u64, + pub instantiate: ::core::primitive::u64, + pub instantiate_transfer_surcharge: ::core::primitive::u64, + pub instantiate_per_salt_byte: ::core::primitive::u64, + pub hash_sha2_256: ::core::primitive::u64, + pub hash_sha2_256_per_byte: ::core::primitive::u64, + pub hash_keccak_256: ::core::primitive::u64, + pub hash_keccak_256_per_byte: ::core::primitive::u64, + pub hash_blake2_256: ::core::primitive::u64, + pub hash_blake2_256_per_byte: ::core::primitive::u64, + pub hash_blake2_128: ::core::primitive::u64, + pub hash_blake2_128_per_byte: ::core::primitive::u64, + pub ecdsa_recover: ::core::primitive::u64, + pub ecdsa_to_eth_address: ::core::primitive::u64, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct InstructionWeights { + pub version: ::core::primitive::u32, + pub i64const: ::core::primitive::u32, + pub i64load: ::core::primitive::u32, + pub i64store: ::core::primitive::u32, + pub select: ::core::primitive::u32, + pub r#if: ::core::primitive::u32, + pub br: ::core::primitive::u32, + pub br_if: ::core::primitive::u32, + pub br_table: ::core::primitive::u32, + pub br_table_per_entry: ::core::primitive::u32, + pub call: ::core::primitive::u32, + pub call_indirect: ::core::primitive::u32, + pub call_indirect_per_param: ::core::primitive::u32, + pub local_get: ::core::primitive::u32, + pub local_set: ::core::primitive::u32, + pub local_tee: ::core::primitive::u32, + pub global_get: ::core::primitive::u32, + pub global_set: ::core::primitive::u32, + pub memory_current: ::core::primitive::u32, + pub memory_grow: ::core::primitive::u32, + pub i64clz: ::core::primitive::u32, + pub i64ctz: ::core::primitive::u32, + pub i64popcnt: ::core::primitive::u32, + pub i64eqz: ::core::primitive::u32, + pub i64extendsi32: ::core::primitive::u32, + pub i64extendui32: ::core::primitive::u32, + pub i32wrapi64: ::core::primitive::u32, + pub i64eq: ::core::primitive::u32, + pub i64ne: ::core::primitive::u32, + pub i64lts: ::core::primitive::u32, + pub i64ltu: ::core::primitive::u32, + pub i64gts: ::core::primitive::u32, + pub i64gtu: ::core::primitive::u32, + pub i64les: ::core::primitive::u32, + pub i64leu: ::core::primitive::u32, + pub i64ges: ::core::primitive::u32, + pub i64geu: ::core::primitive::u32, + pub i64add: ::core::primitive::u32, + pub i64sub: ::core::primitive::u32, + pub i64mul: ::core::primitive::u32, + pub i64divs: ::core::primitive::u32, + pub i64divu: ::core::primitive::u32, + pub i64rems: ::core::primitive::u32, + pub i64remu: ::core::primitive::u32, + pub i64and: ::core::primitive::u32, + pub i64or: ::core::primitive::u32, + pub i64xor: ::core::primitive::u32, + pub i64shl: ::core::primitive::u32, + pub i64shrs: ::core::primitive::u32, + pub i64shru: ::core::primitive::u32, + pub i64rotl: ::core::primitive::u32, + pub i64rotr: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Limits { + pub event_topics: ::core::primitive::u32, + pub stack_height: ::core::option::Option<::core::primitive::u32>, + pub globals: ::core::primitive::u32, + pub parameters: ::core::primitive::u32, + pub memory_pages: ::core::primitive::u32, + pub table_size: ::core::primitive::u32, + pub br_table_size: ::core::primitive::u32, + pub subject_len: ::core::primitive::u32, + pub call_depth: ::core::primitive::u32, + pub payload_len: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Schedule { + pub limits: runtime_types::pallet_contracts::schedule::Limits, + pub instruction_weights: + runtime_types::pallet_contracts::schedule::InstructionWeights, + pub host_fn_weights: runtime_types::pallet_contracts::schedule::HostFnWeights, + } + } + pub mod storage { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct DeletedContract { + pub trie_id: runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RawContractInfo<_0, _1> { + pub trie_id: runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub code_hash: _0, + pub storage_deposit: _1, + } + } + pub mod wasm { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct OwnerInfo { + pub owner: ::subxt::ext::sp_core::crypto::AccountId32, + #[codec(compact)] + pub deposit: ::core::primitive::u128, + #[codec(compact)] + pub refcount: ::core::primitive::u64, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct PrefabWasmModule { + #[codec(compact)] + pub instruction_weights_version: ::core::primitive::u32, + #[codec(compact)] + pub initial: ::core::primitive::u32, + #[codec(compact)] + pub maximum: ::core::primitive::u32, + pub code: runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + } + } + } + pub mod pallet_elections { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + change_validators { + reserved_validators: ::core::option::Option< + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + >, + non_reserved_validators: ::core::option::Option< + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + >, + committee_size: + ::core::option::Option, + }, + #[codec(index = 1)] + #[doc = "Sets ban config, it has an immediate effect"] + set_ban_config { + minimal_expected_performance: ::core::option::Option<::core::primitive::u8>, + underperformed_session_count_threshold: + ::core::option::Option<::core::primitive::u32>, + clean_session_counter_delay: ::core::option::Option<::core::primitive::u32>, + ban_period: ::core::option::Option<::core::primitive::u32>, + }, + #[codec(index = 2)] + #[doc = "Schedule a non-reserved node to be banned out from the committee at the end of the era"] + ban_from_committee { + banned: ::subxt::ext::sp_core::crypto::AccountId32, + ban_reason: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 3)] + #[doc = "Schedule a non-reserved node to be banned out from the committee at the end of the era"] + cancel_ban { + banned: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 4)] + #[doc = "Set openness of the elections"] + set_elections_openness { + openness: runtime_types::primitives::ElectionOpenness, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + NotEnoughValidators, + #[codec(index = 1)] + NotEnoughReservedValidators, + #[codec(index = 2)] + NotEnoughNonReservedValidators, + #[codec(index = 3)] + NonUniqueListOfValidators, + #[codec(index = 4)] + #[doc = "Raised in any scenario [`BanConfig`] is invalid"] + #[doc = "* `performance_ratio_threshold` must be a number in range [0; 100]"] + #[doc = "* `underperformed_session_count_threshold` must be a positive number,"] + #[doc = "* `clean_session_counter_delay` must be a positive number."] + InvalidBanConfig, + #[codec(index = 5)] + #[doc = "Ban reason is too big, ie given vector of bytes is greater than"] + #[doc = "[`Config::MaximumBanReasonLength`]"] + BanReasonTooBig, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "Committee for the next era has changed"] + ChangeValidators( + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + runtime_types::primitives::CommitteeSeats, + ), + #[codec(index = 1)] + #[doc = "Ban thresholds for the next era has changed"] + SetBanConfig(runtime_types::primitives::BanConfig), + #[codec(index = 2)] + #[doc = "Validators have been banned from the committee"] + BanValidators( + ::std::vec::Vec<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::primitives::BanInfo, + )>, + ), + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ValidatorTotalRewards<_0>( + pub ::subxt::utils::KeyedVec<_0, ::core::primitive::u32>, + ); + } + pub mod pallet_identity { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Identity pallet declaration."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Add a registrar to the system."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `T::RegistrarOrigin`."] + #[doc = ""] + #[doc = "- `account`: the account of the registrar."] + #[doc = ""] + #[doc = "Emits `RegistrarAdded` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R)` where `R` registrar-count (governance-bounded and code-bounded)."] + #[doc = "- One storage mutation (codec `O(R)`)."] + #[doc = "- One event."] + #[doc = "# "] + add_registrar { + account: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 1)] + #[doc = "Set an account's identity information and reserve the appropriate deposit."] + #[doc = ""] + #[doc = "If the account already has identity information, the deposit is taken as part payment"] + #[doc = "for the new deposit."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `info`: The identity information."] + #[doc = ""] + #[doc = "Emits `IdentitySet` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(X + X' + R)`"] + #[doc = " - where `X` additional-field-count (deposit-bounded and code-bounded)"] + #[doc = " - where `R` judgements-count (registrar-count-bounded)"] + #[doc = "- One balance reserve operation."] + #[doc = "- One storage mutation (codec-read `O(X' + R)`, codec-write `O(X + R)`)."] + #[doc = "- One event."] + #[doc = "# "] + set_identity { + info: + ::std::boxed::Box, + }, + #[codec(index = 2)] + #[doc = "Set the sub-accounts of the sender."] + #[doc = ""] + #[doc = "Payment: Any aggregate balance reserved by previous `set_subs` calls will be returned"] + #[doc = "and an amount `SubAccountDeposit` will be reserved for each item in `subs`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "identity."] + #[doc = ""] + #[doc = "- `subs`: The identity's (new) sub-accounts."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(P + S)`"] + #[doc = " - where `P` old-subs-count (hard- and deposit-bounded)."] + #[doc = " - where `S` subs-count (hard- and deposit-bounded)."] + #[doc = "- At most one balance operations."] + #[doc = "- DB:"] + #[doc = " - `P + S` storage mutations (codec complexity `O(1)`)"] + #[doc = " - One storage read (codec complexity `O(P)`)."] + #[doc = " - One storage write (codec complexity `O(S)`)."] + #[doc = " - One storage-exists (`IdentityOf::contains_key`)."] + #[doc = "# "] + set_subs { + subs: ::std::vec::Vec<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::pallet_identity::types::Data, + )>, + }, + #[codec(index = 3)] + #[doc = "Clear an account's identity info and all sub-accounts and return all deposits."] + #[doc = ""] + #[doc = "Payment: All reserved balances on the account are returned."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "identity."] + #[doc = ""] + #[doc = "Emits `IdentityCleared` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + S + X)`"] + #[doc = " - where `R` registrar-count (governance-bounded)."] + #[doc = " - where `S` subs-count (hard- and deposit-bounded)."] + #[doc = " - where `X` additional-field-count (deposit-bounded and code-bounded)."] + #[doc = "- One balance-unreserve operation."] + #[doc = "- `2` storage reads and `S + 2` storage deletions."] + #[doc = "- One event."] + #[doc = "# "] + clear_identity, + #[codec(index = 4)] + #[doc = "Request a judgement from a registrar."] + #[doc = ""] + #[doc = "Payment: At most `max_fee` will be reserved for payment to the registrar if judgement"] + #[doc = "given."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] + #[doc = "registered identity."] + #[doc = ""] + #[doc = "- `reg_index`: The index of the registrar whose judgement is requested."] + #[doc = "- `max_fee`: The maximum fee that may be paid. This should just be auto-populated as:"] + #[doc = ""] + #[doc = "```nocompile"] + #[doc = "Self::registrars().get(reg_index).unwrap().fee"] + #[doc = "```"] + #[doc = ""] + #[doc = "Emits `JudgementRequested` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + X)`."] + #[doc = "- One balance-reserve operation."] + #[doc = "- Storage: 1 read `O(R)`, 1 mutate `O(X + R)`."] + #[doc = "- One event."] + #[doc = "# "] + request_judgement { + #[codec(compact)] + reg_index: ::core::primitive::u32, + #[codec(compact)] + max_fee: ::core::primitive::u128, + }, + #[codec(index = 5)] + #[doc = "Cancel a previous request."] + #[doc = ""] + #[doc = "Payment: A previously reserved deposit is returned on success."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a"] + #[doc = "registered identity."] + #[doc = ""] + #[doc = "- `reg_index`: The index of the registrar whose judgement is no longer requested."] + #[doc = ""] + #[doc = "Emits `JudgementUnrequested` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + X)`."] + #[doc = "- One balance-reserve operation."] + #[doc = "- One storage mutation `O(R + X)`."] + #[doc = "- One event"] + #[doc = "# "] + cancel_request { reg_index: ::core::primitive::u32 }, + #[codec(index = 6)] + #[doc = "Set the fee required for a judgement to be requested from a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `fee`: the new fee."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R)`."] + #[doc = "- One storage mutation `O(R)`."] + #[doc = "- Benchmark: 7.315 + R * 0.329 µs (min squares analysis)"] + #[doc = "# "] + set_fee { + #[codec(compact)] + index: ::core::primitive::u32, + #[codec(compact)] + fee: ::core::primitive::u128, + }, + #[codec(index = 7)] + #[doc = "Change the account associated with a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `new`: the new account ID."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R)`."] + #[doc = "- One storage mutation `O(R)`."] + #[doc = "- Benchmark: 8.823 + R * 0.32 µs (min squares analysis)"] + #[doc = "# "] + set_account_id { + #[codec(compact)] + index: ::core::primitive::u32, + new: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 8)] + #[doc = "Set the field information for a registrar."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `index`."] + #[doc = ""] + #[doc = "- `index`: the index of the registrar whose fee is to be set."] + #[doc = "- `fields`: the fields that the registrar concerns themselves with."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R)`."] + #[doc = "- One storage mutation `O(R)`."] + #[doc = "- Benchmark: 7.464 + R * 0.325 µs (min squares analysis)"] + #[doc = "# "] + set_fields { + #[codec(compact)] + index: ::core::primitive::u32, + fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + }, + #[codec(index = 9)] + #[doc = "Provide a judgement for an account's identity."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must be the account"] + #[doc = "of the registrar whose index is `reg_index`."] + #[doc = ""] + #[doc = "- `reg_index`: the index of the registrar whose judgement is being made."] + #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] + #[doc = " with a registered identity."] + #[doc = "- `judgement`: the judgement of the registrar of index `reg_index` about `target`."] + #[doc = ""] + #[doc = "Emits `JudgementGiven` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + X)`."] + #[doc = "- One balance-transfer operation."] + #[doc = "- Up to one account-lookup operation."] + #[doc = "- Storage: 1 read `O(R)`, 1 mutate `O(R + X)`."] + #[doc = "- One event."] + #[doc = "# "] + provide_judgement { + #[codec(compact)] + reg_index: ::core::primitive::u32, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + judgement: runtime_types::pallet_identity::types::Judgement< + ::core::primitive::u128, + >, + }, + #[codec(index = 10)] + #[doc = "Remove an account's identity and sub-account information and slash the deposits."] + #[doc = ""] + #[doc = "Payment: Reserved balances from `set_subs` and `set_identity` are slashed and handled by"] + #[doc = "`Slash`. Verification request deposits are not returned; they should be cancelled"] + #[doc = "manually using `cancel_request`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must match `T::ForceOrigin`."] + #[doc = ""] + #[doc = "- `target`: the account whose identity the judgement is upon. This must be an account"] + #[doc = " with a registered identity."] + #[doc = ""] + #[doc = "Emits `IdentityKilled` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(R + S + X)`."] + #[doc = "- One balance-reserve operation."] + #[doc = "- `S + 2` storage mutations."] + #[doc = "- One event."] + #[doc = "# "] + kill_identity { + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 11)] + #[doc = "Add the given account to the sender's subs."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + add_sub { + sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + data: runtime_types::pallet_identity::types::Data, + }, + #[codec(index = 12)] + #[doc = "Alter the associated name of the given sub-account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + rename_sub { + sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + data: runtime_types::pallet_identity::types::Data, + }, + #[codec(index = 13)] + #[doc = "Remove the given account from the sender's subs."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "sub identity of `sub`."] + remove_sub { + sub: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 14)] + #[doc = "Remove the sender as a sub-account."] + #[doc = ""] + #[doc = "Payment: Balance reserved by a previous `set_subs` call for one sub will be repatriated"] + #[doc = "to the sender (*not* the original depositor)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have a registered"] + #[doc = "super-identity."] + #[doc = ""] + #[doc = "NOTE: This should not normally be used, but is provided in the case that the non-"] + #[doc = "controller of an account is maliciously registered as a sub-account."] + quit_sub, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "Too many subs-accounts."] + TooManySubAccounts, + #[codec(index = 1)] + #[doc = "Account isn't found."] + NotFound, + #[codec(index = 2)] + #[doc = "Account isn't named."] + NotNamed, + #[codec(index = 3)] + #[doc = "Empty index."] + EmptyIndex, + #[codec(index = 4)] + #[doc = "Fee is changed."] + FeeChanged, + #[codec(index = 5)] + #[doc = "No identity found."] + NoIdentity, + #[codec(index = 6)] + #[doc = "Sticky judgement."] + StickyJudgement, + #[codec(index = 7)] + #[doc = "Judgement given."] + JudgementGiven, + #[codec(index = 8)] + #[doc = "Invalid judgement."] + InvalidJudgement, + #[codec(index = 9)] + #[doc = "The index is invalid."] + InvalidIndex, + #[codec(index = 10)] + #[doc = "The target is invalid."] + InvalidTarget, + #[codec(index = 11)] + #[doc = "Too many additional fields."] + TooManyFields, + #[codec(index = 12)] + #[doc = "Maximum amount of registrars reached. Cannot add any more."] + TooManyRegistrars, + #[codec(index = 13)] + #[doc = "Account ID is already named."] + AlreadyClaimed, + #[codec(index = 14)] + #[doc = "Sender is not a sub-account."] + NotSub, + #[codec(index = 15)] + #[doc = "Sub-account isn't owned by sender."] + NotOwned, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A name was set or reset (which will remove all judgements)."] + IdentitySet { + who: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 1)] + #[doc = "A name was cleared, and the given balance returned."] + IdentityCleared { + who: ::subxt::ext::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "A name was removed and the given balance slashed."] + IdentityKilled { + who: ::subxt::ext::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "A judgement was asked from a registrar."] + JudgementRequested { + who: ::subxt::ext::sp_core::crypto::AccountId32, + registrar_index: ::core::primitive::u32, + }, + #[codec(index = 4)] + #[doc = "A judgement request was retracted."] + JudgementUnrequested { + who: ::subxt::ext::sp_core::crypto::AccountId32, + registrar_index: ::core::primitive::u32, + }, + #[codec(index = 5)] + #[doc = "A judgement was given by a registrar."] + JudgementGiven { + target: ::subxt::ext::sp_core::crypto::AccountId32, + registrar_index: ::core::primitive::u32, + }, + #[codec(index = 6)] + #[doc = "A registrar was added."] + RegistrarAdded { + registrar_index: ::core::primitive::u32, + }, + #[codec(index = 7)] + #[doc = "A sub-identity was added to an identity and the deposit paid."] + SubIdentityAdded { + sub: ::subxt::ext::sp_core::crypto::AccountId32, + main: ::subxt::ext::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 8)] + #[doc = "A sub-identity was removed from an identity and the deposit freed."] + SubIdentityRemoved { + sub: ::subxt::ext::sp_core::crypto::AccountId32, + main: ::subxt::ext::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 9)] + #[doc = "A sub-identity was cleared, and the given deposit repatriated from the"] + #[doc = "main identity account to the sub-identity account."] + SubIdentityRevoked { + sub: ::subxt::ext::sp_core::crypto::AccountId32, + main: ::subxt::ext::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + } + } + pub mod types { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BitFlags<_0>( + pub ::core::primitive::u64, + #[codec(skip)] pub ::core::marker::PhantomData<_0>, + ); + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Data { + #[codec(index = 0)] + None, + #[codec(index = 1)] + Raw0([::core::primitive::u8; 0usize]), + #[codec(index = 2)] + Raw1([::core::primitive::u8; 1usize]), + #[codec(index = 3)] + Raw2([::core::primitive::u8; 2usize]), + #[codec(index = 4)] + Raw3([::core::primitive::u8; 3usize]), + #[codec(index = 5)] + Raw4([::core::primitive::u8; 4usize]), + #[codec(index = 6)] + Raw5([::core::primitive::u8; 5usize]), + #[codec(index = 7)] + Raw6([::core::primitive::u8; 6usize]), + #[codec(index = 8)] + Raw7([::core::primitive::u8; 7usize]), + #[codec(index = 9)] + Raw8([::core::primitive::u8; 8usize]), + #[codec(index = 10)] + Raw9([::core::primitive::u8; 9usize]), + #[codec(index = 11)] + Raw10([::core::primitive::u8; 10usize]), + #[codec(index = 12)] + Raw11([::core::primitive::u8; 11usize]), + #[codec(index = 13)] + Raw12([::core::primitive::u8; 12usize]), + #[codec(index = 14)] + Raw13([::core::primitive::u8; 13usize]), + #[codec(index = 15)] + Raw14([::core::primitive::u8; 14usize]), + #[codec(index = 16)] + Raw15([::core::primitive::u8; 15usize]), + #[codec(index = 17)] + Raw16([::core::primitive::u8; 16usize]), + #[codec(index = 18)] + Raw17([::core::primitive::u8; 17usize]), + #[codec(index = 19)] + Raw18([::core::primitive::u8; 18usize]), + #[codec(index = 20)] + Raw19([::core::primitive::u8; 19usize]), + #[codec(index = 21)] + Raw20([::core::primitive::u8; 20usize]), + #[codec(index = 22)] + Raw21([::core::primitive::u8; 21usize]), + #[codec(index = 23)] + Raw22([::core::primitive::u8; 22usize]), + #[codec(index = 24)] + Raw23([::core::primitive::u8; 23usize]), + #[codec(index = 25)] + Raw24([::core::primitive::u8; 24usize]), + #[codec(index = 26)] + Raw25([::core::primitive::u8; 25usize]), + #[codec(index = 27)] + Raw26([::core::primitive::u8; 26usize]), + #[codec(index = 28)] + Raw27([::core::primitive::u8; 27usize]), + #[codec(index = 29)] + Raw28([::core::primitive::u8; 28usize]), + #[codec(index = 30)] + Raw29([::core::primitive::u8; 29usize]), + #[codec(index = 31)] + Raw30([::core::primitive::u8; 30usize]), + #[codec(index = 32)] + Raw31([::core::primitive::u8; 31usize]), + #[codec(index = 33)] + Raw32([::core::primitive::u8; 32usize]), + #[codec(index = 34)] + BlakeTwo256([::core::primitive::u8; 32usize]), + #[codec(index = 35)] + Sha256([::core::primitive::u8; 32usize]), + #[codec(index = 36)] + Keccak256([::core::primitive::u8; 32usize]), + #[codec(index = 37)] + ShaThree256([::core::primitive::u8; 32usize]), + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum IdentityField { + #[codec(index = 1)] + Display, + #[codec(index = 2)] + Legal, + #[codec(index = 4)] + Web, + #[codec(index = 8)] + Riot, + #[codec(index = 16)] + Email, + #[codec(index = 32)] + PgpFingerprint, + #[codec(index = 64)] + Image, + #[codec(index = 128)] + Twitter, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct IdentityInfo { + pub additional: runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec<( + runtime_types::pallet_identity::types::Data, + runtime_types::pallet_identity::types::Data, + )>, + pub display: runtime_types::pallet_identity::types::Data, + pub legal: runtime_types::pallet_identity::types::Data, + pub web: runtime_types::pallet_identity::types::Data, + pub riot: runtime_types::pallet_identity::types::Data, + pub email: runtime_types::pallet_identity::types::Data, + pub pgp_fingerprint: ::core::option::Option<[::core::primitive::u8; 20usize]>, + pub image: runtime_types::pallet_identity::types::Data, + pub twitter: runtime_types::pallet_identity::types::Data, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Judgement<_0> { + #[codec(index = 0)] + Unknown, + #[codec(index = 1)] + FeePaid(_0), + #[codec(index = 2)] + Reasonable, + #[codec(index = 3)] + KnownGood, + #[codec(index = 4)] + OutOfDate, + #[codec(index = 5)] + LowQuality, + #[codec(index = 6)] + Erroneous, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RegistrarInfo<_0, _1> { + pub account: _1, + pub fee: _0, + pub fields: runtime_types::pallet_identity::types::BitFlags< + runtime_types::pallet_identity::types::IdentityField, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Registration<_0> { + pub judgements: runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec<( + ::core::primitive::u32, + runtime_types::pallet_identity::types::Judgement<_0>, + )>, + pub deposit: _0, + pub info: runtime_types::pallet_identity::types::IdentityInfo, + } + } + } + pub mod pallet_multisig { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Immediately dispatch a multi-signature call using a single approval from the caller."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `other_signatories`: The accounts (other than the sender) who are part of the"] + #[doc = "multi-signature, but do not participate in the approval process."] + #[doc = "- `call`: The call to be executed."] + #[doc = ""] + #[doc = "Result is equivalent to the dispatched result."] + #[doc = ""] + #[doc = "# "] + #[doc = "O(Z + C) where Z is the length of the call and C its execution weight."] + #[doc = "-------------------------------"] + #[doc = "- DB Weight: None"] + #[doc = "- Plus Call Weight"] + #[doc = "# "] + as_multi_threshold_1 { + other_signatories: + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + call: ::std::boxed::Box, + }, + #[codec(index = 1)] + #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] + #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] + #[doc = ""] + #[doc = "If there are enough, then dispatch the call."] + #[doc = ""] + #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] + #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] + #[doc = "is cancelled."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] + #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] + #[doc = "transaction index) of the first approval transaction."] + #[doc = "- `call`: The call to be executed."] + #[doc = ""] + #[doc = "NOTE: Unless this is the final approval, you will generally want to use"] + #[doc = "`approve_as_multi` instead, since it only requires a hash of the call."] + #[doc = ""] + #[doc = "Result is equivalent to the dispatched result if `threshold` is exactly `1`. Otherwise"] + #[doc = "on success, result is `Ok` and the result from the interior call, if it was executed,"] + #[doc = "may be found in the deposited `MultisigExecuted` event."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(S + Z + Call)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One call encode & hash, both of complexity `O(Z)` where `Z` is tx-len."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] + #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] + #[doc = "- One event."] + #[doc = "- The weight of the `call`."] + #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] + #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] + #[doc = "-------------------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Reads: Multisig Storage, [Caller Account], Calls (if `store_call`)"] + #[doc = " - Writes: Multisig Storage, [Caller Account], Calls (if `store_call`)"] + #[doc = "- Plus Call Weight"] + #[doc = "# "] + as_multi { + threshold: ::core::primitive::u16, + other_signatories: + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + maybe_timepoint: ::core::option::Option< + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + >, + call: ::subxt::utils::WrapperKeepOpaque, + store_call: ::core::primitive::bool, + max_weight: ::core::primitive::u64, + }, + #[codec(index = 2)] + #[doc = "Register approval for a dispatch to be made from a deterministic composite account if"] + #[doc = "approved by a total of `threshold - 1` of `other_signatories`."] + #[doc = ""] + #[doc = "Payment: `DepositBase` will be reserved if this is the first approval, plus"] + #[doc = "`threshold` times `DepositFactor`. It is returned once this dispatch happens or"] + #[doc = "is cancelled."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `maybe_timepoint`: If this is the first approval, then this must be `None`. If it is"] + #[doc = "not the first approval, then it must be `Some`, with the timepoint (block number and"] + #[doc = "transaction index) of the first approval transaction."] + #[doc = "- `call_hash`: The hash of the call to be executed."] + #[doc = ""] + #[doc = "NOTE: If this is the final approval, you will want to use `as_multi` instead."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(S)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- Up to one binary search and insert (`O(logS + S)`)."] + #[doc = "- I/O: 1 read `O(S)`, up to 1 mutate `O(S)`. Up to one remove."] + #[doc = "- One event."] + #[doc = "- Storage: inserts one item, value size bounded by `MaxSignatories`, with a deposit"] + #[doc = " taken for its lifetime of `DepositBase + threshold * DepositFactor`."] + #[doc = "----------------------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Read: Multisig Storage, [Caller Account]"] + #[doc = " - Write: Multisig Storage, [Caller Account]"] + #[doc = "# "] + approve_as_multi { + threshold: ::core::primitive::u16, + other_signatories: + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + maybe_timepoint: ::core::option::Option< + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + >, + call_hash: [::core::primitive::u8; 32usize], + max_weight: ::core::primitive::u64, + }, + #[codec(index = 3)] + #[doc = "Cancel a pre-existing, on-going multisig transaction. Any deposit reserved previously"] + #[doc = "for this operation will be unreserved on success."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `threshold`: The total number of approvals for this dispatch before it is executed."] + #[doc = "- `other_signatories`: The accounts (other than the sender) who can approve this"] + #[doc = "dispatch. May not be empty."] + #[doc = "- `timepoint`: The timepoint (block number and transaction index) of the first approval"] + #[doc = "transaction for this dispatch."] + #[doc = "- `call_hash`: The hash of the call to be executed."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(S)`."] + #[doc = "- Up to one balance-reserve or unreserve operation."] + #[doc = "- One passthrough operation, one insert, both `O(S)` where `S` is the number of"] + #[doc = " signatories. `S` is capped by `MaxSignatories`, with weight being proportional."] + #[doc = "- One encode & hash, both of complexity `O(S)`."] + #[doc = "- One event."] + #[doc = "- I/O: 1 read `O(S)`, one remove."] + #[doc = "- Storage: removes one item."] + #[doc = "----------------------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Read: Multisig Storage, [Caller Account], Refund Account, Calls"] + #[doc = " - Write: Multisig Storage, [Caller Account], Refund Account, Calls"] + #[doc = "# "] + cancel_as_multi { + threshold: ::core::primitive::u16, + other_signatories: + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + timepoint: + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + call_hash: [::core::primitive::u8; 32usize], + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "Threshold must be 2 or greater."] + MinimumThreshold, + #[codec(index = 1)] + #[doc = "Call is already approved by this signatory."] + AlreadyApproved, + #[codec(index = 2)] + #[doc = "Call doesn't need any (more) approvals."] + NoApprovalsNeeded, + #[codec(index = 3)] + #[doc = "There are too few signatories in the list."] + TooFewSignatories, + #[codec(index = 4)] + #[doc = "There are too many signatories in the list."] + TooManySignatories, + #[codec(index = 5)] + #[doc = "The signatories were provided out of order; they should be ordered."] + SignatoriesOutOfOrder, + #[codec(index = 6)] + #[doc = "The sender was contained in the other signatories; it shouldn't be."] + SenderInSignatories, + #[codec(index = 7)] + #[doc = "Multisig operation not found when attempting to cancel."] + NotFound, + #[codec(index = 8)] + #[doc = "Only the account that originally created the multisig is able to cancel it."] + NotOwner, + #[codec(index = 9)] + #[doc = "No timepoint was given, yet the multisig operation is already underway."] + NoTimepoint, + #[codec(index = 10)] + #[doc = "A different timepoint was given to the multisig operation that is underway."] + WrongTimepoint, + #[codec(index = 11)] + #[doc = "A timepoint was given, yet no multisig operation is underway."] + UnexpectedTimepoint, + #[codec(index = 12)] + #[doc = "The maximum weight information provided was too low."] + MaxWeightTooLow, + #[codec(index = 13)] + #[doc = "The data to be stored is already stored."] + AlreadyStored, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A new multisig operation has begun."] + NewMultisig { + approving: ::subxt::ext::sp_core::crypto::AccountId32, + multisig: ::subxt::ext::sp_core::crypto::AccountId32, + call_hash: [::core::primitive::u8; 32usize], + }, + #[codec(index = 1)] + #[doc = "A multisig operation has been approved by someone."] + MultisigApproval { + approving: ::subxt::ext::sp_core::crypto::AccountId32, + timepoint: + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + multisig: ::subxt::ext::sp_core::crypto::AccountId32, + call_hash: [::core::primitive::u8; 32usize], + }, + #[codec(index = 2)] + #[doc = "A multisig operation has been executed."] + MultisigExecuted { + approving: ::subxt::ext::sp_core::crypto::AccountId32, + timepoint: + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + multisig: ::subxt::ext::sp_core::crypto::AccountId32, + call_hash: [::core::primitive::u8; 32usize], + result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + }, + #[codec(index = 3)] + #[doc = "A multisig operation has been cancelled."] + MultisigCancelled { + cancelling: ::subxt::ext::sp_core::crypto::AccountId32, + timepoint: + runtime_types::pallet_multisig::Timepoint<::core::primitive::u32>, + multisig: ::subxt::ext::sp_core::crypto::AccountId32, + call_hash: [::core::primitive::u8; 32usize], + }, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Multisig<_0, _1, _2> { + pub when: runtime_types::pallet_multisig::Timepoint<_0>, + pub deposit: _1, + pub depositor: _2, + pub approvals: ::std::vec::Vec<_2>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Timepoint<_0> { + pub height: _0, + pub index: _0, + } + } + pub mod pallet_nomination_pools { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Stake funds with a pool. The amount to bond is transferred from the member to the"] + #[doc = "pools account and immediately increases the pools bond."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "* An account can only be a member of a single pool."] + #[doc = "* An account cannot join the same pool multiple times."] + #[doc = "* This call will *not* dust the member account, so the member must have at least"] + #[doc = " `existential deposit + amount` in their account."] + #[doc = "* Only a pool with [`PoolState::Open`] can be joined"] + join { + #[codec(compact)] + amount: ::core::primitive::u128, + pool_id: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "Bond `extra` more funds from `origin` into the pool to which they already belong."] + #[doc = ""] + #[doc = "Additional funds can come from either the free balance of the account, of from the"] + #[doc = "accumulated rewards, see [`BondExtra`]."] + #[doc = ""] + #[doc = "Bonding extra funds implies an automatic payout of all pending rewards as well."] + bond_extra { + extra: runtime_types::pallet_nomination_pools::BondExtra< + ::core::primitive::u128, + >, + }, + #[codec(index = 2)] + #[doc = "A bonded member can use this to claim their payout based on the rewards that the pool"] + #[doc = "has accumulated since their last claimed payout (OR since joining if this is there first"] + #[doc = "time claiming rewards). The payout will be transferred to the member's account."] + #[doc = ""] + #[doc = "The member will earn rewards pro rata based on the members stake vs the sum of the"] + #[doc = "members in the pools stake. Rewards do not \"expire\"."] + claim_payout, + #[codec(index = 3)] + #[doc = "Unbond up to `unbonding_points` of the `member_account`'s funds from the pool. It"] + #[doc = "implicitly collects the rewards one last time, since not doing so would mean some"] + #[doc = "rewards would be forfeited."] + #[doc = ""] + #[doc = "Under certain conditions, this call can be dispatched permissionlessly (i.e. by any"] + #[doc = "account)."] + #[doc = ""] + #[doc = "# Conditions for a permissionless dispatch."] + #[doc = ""] + #[doc = "* The pool is blocked and the caller is either the root or state-toggler. This is"] + #[doc = " refereed to as a kick."] + #[doc = "* The pool is destroying and the member is not the depositor."] + #[doc = "* The pool is destroying, the member is the depositor and no other members are in the"] + #[doc = " pool."] + #[doc = ""] + #[doc = "## Conditions for permissioned dispatch (i.e. the caller is also the"] + #[doc = "`member_account`):"] + #[doc = ""] + #[doc = "* The caller is not the depositor."] + #[doc = "* The caller is the depositor, the pool is destroying and no other members are in the"] + #[doc = " pool."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "If there are too many unlocking chunks to unbond with the pool account,"] + #[doc = "[`Call::pool_withdraw_unbonded`] can be called to try and minimize unlocking chunks. If"] + #[doc = "there are too many unlocking chunks, the result of this call will likely be the"] + #[doc = "`NoMoreChunks` error from the staking system."] + unbond { + member_account: ::subxt::ext::sp_core::crypto::AccountId32, + #[codec(compact)] + unbonding_points: ::core::primitive::u128, + }, + #[codec(index = 4)] + #[doc = "Call `withdraw_unbonded` for the pools account. This call can be made by any account."] + #[doc = ""] + #[doc = "This is useful if their are too many unlocking chunks to call `unbond`, and some"] + #[doc = "can be cleared by withdrawing. In the case there are too many unlocking chunks, the user"] + #[doc = "would probably see an error like `NoMoreChunks` emitted from the staking system when"] + #[doc = "they attempt to unbond."] + pool_withdraw_unbonded { + pool_id: ::core::primitive::u32, + num_slashing_spans: ::core::primitive::u32, + }, + #[codec(index = 5)] + #[doc = "Withdraw unbonded funds from `member_account`. If no bonded funds can be unbonded, an"] + #[doc = "error is returned."] + #[doc = ""] + #[doc = "Under certain conditions, this call can be dispatched permissionlessly (i.e. by any"] + #[doc = "account)."] + #[doc = ""] + #[doc = "# Conditions for a permissionless dispatch"] + #[doc = ""] + #[doc = "* The pool is in destroy mode and the target is not the depositor."] + #[doc = "* The target is the depositor and they are the only member in the sub pools."] + #[doc = "* The pool is blocked and the caller is either the root or state-toggler."] + #[doc = ""] + #[doc = "# Conditions for permissioned dispatch"] + #[doc = ""] + #[doc = "* The caller is the target and they are not the depositor."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "If the target is the depositor, the pool will be destroyed."] + withdraw_unbonded { + member_account: ::subxt::ext::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + }, + #[codec(index = 6)] + #[doc = "Create a new delegation pool."] + #[doc = ""] + #[doc = "# Arguments"] + #[doc = ""] + #[doc = "* `amount` - The amount of funds to delegate to the pool. This also acts of a sort of"] + #[doc = " deposit since the pools creator cannot fully unbond funds until the pool is being"] + #[doc = " destroyed."] + #[doc = "* `index` - A disambiguation index for creating the account. Likely only useful when"] + #[doc = " creating multiple pools in the same extrinsic."] + #[doc = "* `root` - The account to set as [`PoolRoles::root`]."] + #[doc = "* `nominator` - The account to set as the [`PoolRoles::nominator`]."] + #[doc = "* `state_toggler` - The account to set as the [`PoolRoles::state_toggler`]."] + #[doc = ""] + #[doc = "# Note"] + #[doc = ""] + #[doc = "In addition to `amount`, the caller will transfer the existential deposit; so the caller"] + #[doc = "needs at have at least `amount + existential_deposit` transferrable."] + create { + #[codec(compact)] + amount: ::core::primitive::u128, + root: ::subxt::ext::sp_core::crypto::AccountId32, + nominator: ::subxt::ext::sp_core::crypto::AccountId32, + state_toggler: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 7)] + #[doc = "Nominate on behalf of the pool."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed by the pool nominator or the pool"] + #[doc = "root role."] + #[doc = ""] + #[doc = "This directly forward the call to the staking pallet, on behalf of the pool bonded"] + #[doc = "account."] + nominate { + pool_id: ::core::primitive::u32, + validators: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + }, + #[codec(index = 8)] + #[doc = "Set a new state for the pool."] + #[doc = ""] + #[doc = "If a pool is already in the `Destroying` state, then under no condition can its state"] + #[doc = "change again."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be either:"] + #[doc = ""] + #[doc = "1. signed by the state toggler, or the root role of the pool,"] + #[doc = "2. if the pool conditions to be open are NOT met (as described by `ok_to_be_open`), and"] + #[doc = " then the state of the pool can be permissionlessly changed to `Destroying`."] + set_state { + pool_id: ::core::primitive::u32, + state: runtime_types::pallet_nomination_pools::PoolState, + }, + #[codec(index = 9)] + #[doc = "Set a new metadata for the pool."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed by the state toggler, or the root role"] + #[doc = "of the pool."] + set_metadata { + pool_id: ::core::primitive::u32, + metadata: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 10)] + #[doc = "Update configurations for the nomination pools. The origin for this call must be"] + #[doc = "Root."] + #[doc = ""] + #[doc = "# Arguments"] + #[doc = ""] + #[doc = "* `min_join_bond` - Set [`MinJoinBond`]."] + #[doc = "* `min_create_bond` - Set [`MinCreateBond`]."] + #[doc = "* `max_pools` - Set [`MaxPools`]."] + #[doc = "* `max_members` - Set [`MaxPoolMembers`]."] + #[doc = "* `max_members_per_pool` - Set [`MaxPoolMembersPerPool`]."] + set_configs { + min_join_bond: runtime_types::pallet_nomination_pools::ConfigOp< + ::core::primitive::u128, + >, + min_create_bond: runtime_types::pallet_nomination_pools::ConfigOp< + ::core::primitive::u128, + >, + max_pools: runtime_types::pallet_nomination_pools::ConfigOp< + ::core::primitive::u32, + >, + max_members: runtime_types::pallet_nomination_pools::ConfigOp< + ::core::primitive::u32, + >, + max_members_per_pool: runtime_types::pallet_nomination_pools::ConfigOp< + ::core::primitive::u32, + >, + }, + #[codec(index = 11)] + #[doc = "Update the roles of the pool."] + #[doc = ""] + #[doc = "The root is the only entity that can change any of the roles, including itself,"] + #[doc = "excluding the depositor, who can never change."] + #[doc = ""] + #[doc = "It emits an event, notifying UIs of the role change. This event is quite relevant to"] + #[doc = "most pool members and they should be informed of changes to pool roles."] + update_roles { + pool_id: ::core::primitive::u32, + new_root: runtime_types::pallet_nomination_pools::ConfigOp< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + new_nominator: runtime_types::pallet_nomination_pools::ConfigOp< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + new_state_toggler: runtime_types::pallet_nomination_pools::ConfigOp< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + }, + #[codec(index = 12)] + #[doc = "Chill on behalf of the pool."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed by the pool nominator or the pool"] + #[doc = "root role, same as [`Pallet::nominate`]."] + #[doc = ""] + #[doc = "This directly forward the call to the staking pallet, on behalf of the pool bonded"] + #[doc = "account."] + chill { pool_id: ::core::primitive::u32 }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum DefensiveError { + #[codec(index = 0)] + NotEnoughSpaceInUnbondPool, + #[codec(index = 1)] + PoolNotFound, + #[codec(index = 2)] + RewardPoolNotFound, + #[codec(index = 3)] + SubPoolsNotFound, + #[codec(index = 4)] + BondedStashKilledPrematurely, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "A (bonded) pool id does not exist."] + PoolNotFound, + #[codec(index = 1)] + #[doc = "An account is not a member."] + PoolMemberNotFound, + #[codec(index = 2)] + #[doc = "A reward pool does not exist. In all cases this is a system logic error."] + RewardPoolNotFound, + #[codec(index = 3)] + #[doc = "A sub pool does not exist."] + SubPoolsNotFound, + #[codec(index = 4)] + #[doc = "An account is already delegating in another pool. An account may only belong to one"] + #[doc = "pool at a time."] + AccountBelongsToOtherPool, + #[codec(index = 5)] + #[doc = "The member is fully unbonded (and thus cannot access the bonded and reward pool"] + #[doc = "anymore to, for example, collect rewards)."] + FullyUnbonding, + #[codec(index = 6)] + #[doc = "The member cannot unbond further chunks due to reaching the limit."] + MaxUnbondingLimit, + #[codec(index = 7)] + #[doc = "None of the funds can be withdrawn yet because the bonding duration has not passed."] + CannotWithdrawAny, + #[codec(index = 8)] + #[doc = "The amount does not meet the minimum bond to either join or create a pool."] + #[doc = ""] + #[doc = "The depositor can never unbond to a value less than"] + #[doc = "`Pallet::depositor_min_bond`. The caller does not have nominating"] + #[doc = "permissions for the pool. Members can never unbond to a value below `MinJoinBond`."] + MinimumBondNotMet, + #[codec(index = 9)] + #[doc = "The transaction could not be executed due to overflow risk for the pool."] + OverflowRisk, + #[codec(index = 10)] + #[doc = "A pool must be in [`PoolState::Destroying`] in order for the depositor to unbond or for"] + #[doc = "other members to be permissionlessly unbonded."] + NotDestroying, + #[codec(index = 11)] + #[doc = "The caller does not have nominating permissions for the pool."] + NotNominator, + #[codec(index = 12)] + #[doc = "Either a) the caller cannot make a valid kick or b) the pool is not destroying."] + NotKickerOrDestroying, + #[codec(index = 13)] + #[doc = "The pool is not open to join"] + NotOpen, + #[codec(index = 14)] + #[doc = "The system is maxed out on pools."] + MaxPools, + #[codec(index = 15)] + #[doc = "Too many members in the pool or system."] + MaxPoolMembers, + #[codec(index = 16)] + #[doc = "The pools state cannot be changed."] + CanNotChangeState, + #[codec(index = 17)] + #[doc = "The caller does not have adequate permissions."] + DoesNotHavePermission, + #[codec(index = 18)] + #[doc = "Metadata exceeds [`Config::MaxMetadataLen`]"] + MetadataExceedsMaxLen, + #[codec(index = 19)] + #[doc = "Some error occurred that should never happen. This should be reported to the"] + #[doc = "maintainers."] + Defensive(runtime_types::pallet_nomination_pools::pallet::DefensiveError), + #[codec(index = 20)] + #[doc = "Partial unbonding now allowed permissionlessly."] + PartialUnbondNotAllowedPermissionlessly, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Events of this pallet."] + pub enum Event { + #[codec(index = 0)] + #[doc = "A pool has been created."] + Created { + depositor: ::subxt::ext::sp_core::crypto::AccountId32, + pool_id: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "A member has became bonded in a pool."] + Bonded { + member: ::subxt::ext::sp_core::crypto::AccountId32, + pool_id: ::core::primitive::u32, + bonded: ::core::primitive::u128, + joined: ::core::primitive::bool, + }, + #[codec(index = 2)] + #[doc = "A payout has been made to a member."] + PaidOut { + member: ::subxt::ext::sp_core::crypto::AccountId32, + pool_id: ::core::primitive::u32, + payout: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "A member has unbonded from their pool."] + #[doc = ""] + #[doc = "- `balance` is the corresponding balance of the number of points that has been"] + #[doc = " requested to be unbonded (the argument of the `unbond` transaction) from the bonded"] + #[doc = " pool."] + #[doc = "- `points` is the number of points that are issued as a result of `balance` being"] + #[doc = "dissolved into the corresponding unbonding pool."] + #[doc = "- `era` is the era in which the balance will be unbonded."] + #[doc = "In the absence of slashing, these values will match. In the presence of slashing, the"] + #[doc = "number of points that are issued in the unbonding pool will be less than the amount"] + #[doc = "requested to be unbonded."] + Unbonded { + member: ::subxt::ext::sp_core::crypto::AccountId32, + pool_id: ::core::primitive::u32, + balance: ::core::primitive::u128, + points: ::core::primitive::u128, + era: ::core::primitive::u32, + }, + #[codec(index = 4)] + #[doc = "A member has withdrawn from their pool."] + #[doc = ""] + #[doc = "The given number of `points` have been dissolved in return of `balance`."] + #[doc = ""] + #[doc = "Similar to `Unbonded` event, in the absence of slashing, the ratio of point to balance"] + #[doc = "will be 1."] + Withdrawn { + member: ::subxt::ext::sp_core::crypto::AccountId32, + pool_id: ::core::primitive::u32, + balance: ::core::primitive::u128, + points: ::core::primitive::u128, + }, + #[codec(index = 5)] + #[doc = "A pool has been destroyed."] + Destroyed { pool_id: ::core::primitive::u32 }, + #[codec(index = 6)] + #[doc = "The state of a pool has changed"] + StateChanged { + pool_id: ::core::primitive::u32, + new_state: runtime_types::pallet_nomination_pools::PoolState, + }, + #[codec(index = 7)] + #[doc = "A member has been removed from a pool."] + #[doc = ""] + #[doc = "The removal can be voluntary (withdrawn all unbonded funds) or involuntary (kicked)."] + MemberRemoved { + pool_id: ::core::primitive::u32, + member: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 8)] + #[doc = "The roles of a pool have been updated to the given new roles. Note that the depositor"] + #[doc = "can never change."] + RolesUpdated { + root: ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + state_toggler: + ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + nominator: + ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + }, + #[codec(index = 9)] + #[doc = "The active balance of pool `pool_id` has been slashed to `balance`."] + PoolSlashed { + pool_id: ::core::primitive::u32, + balance: ::core::primitive::u128, + }, + #[codec(index = 10)] + #[doc = "The unbond pool at `era` of pool `pool_id` has been slashed to `balance`."] + UnbondingPoolSlashed { + pool_id: ::core::primitive::u32, + era: ::core::primitive::u32, + balance: ::core::primitive::u128, + }, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum BondExtra<_0> { + #[codec(index = 0)] + FreeBalance(_0), + #[codec(index = 1)] + Rewards, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BondedPoolInner { + pub points: ::core::primitive::u128, + pub state: runtime_types::pallet_nomination_pools::PoolState, + pub member_counter: ::core::primitive::u32, + pub roles: runtime_types::pallet_nomination_pools::PoolRoles< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum ConfigOp<_0> { + #[codec(index = 0)] + Noop, + #[codec(index = 1)] + Set(_0), + #[codec(index = 2)] + Remove, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct PoolMember { + pub pool_id: ::core::primitive::u32, + pub points: ::core::primitive::u128, + pub last_recorded_reward_counter: + runtime_types::sp_arithmetic::fixed_point::FixedU128, + pub unbonding_eras: + runtime_types::sp_runtime::bounded::bounded_btree_map::BoundedBTreeMap< + ::core::primitive::u32, + ::core::primitive::u128, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct PoolRoles<_0> { + pub depositor: _0, + pub root: ::core::option::Option<_0>, + pub nominator: ::core::option::Option<_0>, + pub state_toggler: ::core::option::Option<_0>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum PoolState { + #[codec(index = 0)] + Open, + #[codec(index = 1)] + Blocked, + #[codec(index = 2)] + Destroying, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RewardPool { + pub last_recorded_reward_counter: + runtime_types::sp_arithmetic::fixed_point::FixedU128, + pub last_recorded_total_payouts: ::core::primitive::u128, + pub total_rewards_claimed: ::core::primitive::u128, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SubPools { + pub no_era: runtime_types::pallet_nomination_pools::UnbondPool, + pub with_era: + runtime_types::sp_runtime::bounded::bounded_btree_map::BoundedBTreeMap< + ::core::primitive::u32, + runtime_types::pallet_nomination_pools::UnbondPool, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct UnbondPool { + pub points: ::core::primitive::u128, + pub balance: ::core::primitive::u128, + } + } + pub mod pallet_scheduler { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Anonymously schedule a task."] + schedule { + when: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: ::std::boxed::Box< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::aleph_runtime::Call, + ::subxt::ext::sp_core::H256, + >, + >, + }, + #[codec(index = 1)] + #[doc = "Cancel an anonymously scheduled task."] + cancel { + when: ::core::primitive::u32, + index: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Schedule a named task."] + schedule_named { + id: ::std::vec::Vec<::core::primitive::u8>, + when: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: ::std::boxed::Box< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::aleph_runtime::Call, + ::subxt::ext::sp_core::H256, + >, + >, + }, + #[codec(index = 3)] + #[doc = "Cancel a named scheduled task."] + cancel_named { + id: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 4)] + #[doc = "Anonymously schedule a task after a delay."] + #[doc = ""] + #[doc = "# "] + #[doc = "Same as [`schedule`]."] + #[doc = "# "] + schedule_after { + after: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: ::std::boxed::Box< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::aleph_runtime::Call, + ::subxt::ext::sp_core::H256, + >, + >, + }, + #[codec(index = 5)] + #[doc = "Schedule a named task after a delay."] + #[doc = ""] + #[doc = "# "] + #[doc = "Same as [`schedule_named`](Self::schedule_named)."] + #[doc = "# "] + schedule_named_after { + id: ::std::vec::Vec<::core::primitive::u8>, + after: ::core::primitive::u32, + maybe_periodic: ::core::option::Option<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + priority: ::core::primitive::u8, + call: ::std::boxed::Box< + runtime_types::frame_support::traits::schedule::MaybeHashed< + runtime_types::aleph_runtime::Call, + ::subxt::ext::sp_core::H256, + >, + >, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "Failed to schedule a call"] + FailedToSchedule, + #[codec(index = 1)] + #[doc = "Cannot find the scheduled call."] + NotFound, + #[codec(index = 2)] + #[doc = "Given target block number is in the past."] + TargetBlockNumberInPast, + #[codec(index = 3)] + #[doc = "Reschedule failed because it does not change scheduled time."] + RescheduleNoChange, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Events type."] + pub enum Event { + #[codec(index = 0)] + #[doc = "Scheduled some task."] + Scheduled { + when: ::core::primitive::u32, + index: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "Canceled some task."] + Canceled { + when: ::core::primitive::u32, + index: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Dispatched some task."] + Dispatched { + task: (::core::primitive::u32, ::core::primitive::u32), + id: ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + }, + #[codec(index = 3)] + #[doc = "The call for the provided hash was not found so the task has been aborted."] + CallLookupFailed { + task: (::core::primitive::u32, ::core::primitive::u32), + id: ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + error: runtime_types::frame_support::traits::schedule::LookupError, + }, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ScheduledV3<_0, _1, _2, _3> { + pub maybe_id: ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + pub priority: ::core::primitive::u8, + pub call: _0, + pub maybe_periodic: ::core::option::Option<(_1, _1)>, + pub origin: _2, + #[codec(skip)] + pub __subxt_unused_type_params: ::core::marker::PhantomData<_3>, + } + } + pub mod pallet_session { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Sets the session key(s) of the function caller to `keys`."] + #[doc = "Allows an account to set its session key prior to becoming a validator."] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "The dispatch origin of this function must be signed."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(1)`. Actual cost depends on the number of length of"] + #[doc = " `T::Keys::key_ids()` which is fixed."] + #[doc = "- DbReads: `origin account`, `T::ValidatorIdOf`, `NextKeys`"] + #[doc = "- DbWrites: `origin account`, `NextKeys`"] + #[doc = "- DbReads per key id: `KeyOwner`"] + #[doc = "- DbWrites per key id: `KeyOwner`"] + #[doc = "# "] + set_keys { + keys: runtime_types::aleph_runtime::SessionKeys, + proof: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 1)] + #[doc = "Removes any session key(s) of the function caller."] + #[doc = ""] + #[doc = "This doesn't take effect until the next session."] + #[doc = ""] + #[doc = "The dispatch origin of this function must be Signed and the account must be either be"] + #[doc = "convertible to a validator ID using the chain's typical addressing system (this usually"] + #[doc = "means being a controller account) or directly convertible into a validator ID (which"] + #[doc = "usually means being a stash account)."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(1)` in number of key types. Actual cost depends on the number of length"] + #[doc = " of `T::Keys::key_ids()` which is fixed."] + #[doc = "- DbReads: `T::ValidatorIdOf`, `NextKeys`, `origin account`"] + #[doc = "- DbWrites: `NextKeys`, `origin account`"] + #[doc = "- DbWrites per key id: `KeyOwner`"] + #[doc = "# "] + purge_keys, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Error for the session pallet."] + pub enum Error { + #[codec(index = 0)] + #[doc = "Invalid ownership proof."] + InvalidProof, + #[codec(index = 1)] + #[doc = "No associated validator ID for account."] + NoAssociatedValidatorId, + #[codec(index = 2)] + #[doc = "Registered duplicate key."] + DuplicatedKey, + #[codec(index = 3)] + #[doc = "No keys are associated with this account."] + NoKeys, + #[codec(index = 4)] + #[doc = "Key setting account is not live, so it's impossible to associate keys."] + NoAccount, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "New session has happened. Note that the argument is the session index, not the"] + #[doc = "block number as the type might suggest."] + NewSession { + session_index: ::core::primitive::u32, + }, + } + } + } + pub mod pallet_staking { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Take the origin account as a stash and lock up `value` of its balance. `controller` will"] + #[doc = "be the account that controls it."] + #[doc = ""] + #[doc = "`value` must be more than the `minimum_balance` specified by `T::Currency`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the stash account."] + #[doc = ""] + #[doc = "Emits `Bonded`."] + #[doc = "# "] + #[doc = "- Independent of the arguments. Moderate complexity."] + #[doc = "- O(1)."] + #[doc = "- Three extra DB entries."] + #[doc = ""] + #[doc = "NOTE: Two of the storage writes (`Self::bonded`, `Self::payee`) are _never_ cleaned"] + #[doc = "unless the `origin` falls below _existential deposit_ and gets removed as dust."] + #[doc = "------------------"] + #[doc = "# "] + bond { + controller: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + #[codec(compact)] + value: ::core::primitive::u128, + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + }, + #[codec(index = 1)] + #[doc = "Add some extra amount that have appeared in the stash `free_balance` into the balance up"] + #[doc = "for staking."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the stash, not the controller."] + #[doc = ""] + #[doc = "Use this if there are additional funds in your stash account that you wish to bond."] + #[doc = "Unlike [`bond`](Self::bond) or [`unbond`](Self::unbond) this function does not impose"] + #[doc = "any limitation on the amount that can be added."] + #[doc = ""] + #[doc = "Emits `Bonded`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Independent of the arguments. Insignificant complexity."] + #[doc = "- O(1)."] + #[doc = "# "] + bond_extra { + #[codec(compact)] + max_additional: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "Schedule a portion of the stash to be unlocked ready for transfer out after the bond"] + #[doc = "period ends. If this leaves an amount actively bonded less than"] + #[doc = "T::Currency::minimum_balance(), then it is increased to the full amount."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "Once the unlock period is done, you can call `withdraw_unbonded` to actually move"] + #[doc = "the funds out of management ready for transfer."] + #[doc = ""] + #[doc = "No more than a limited number of unlocking chunks (see `MaxUnlockingChunks`)"] + #[doc = "can co-exists at the same time. In that case, [`Call::withdraw_unbonded`] need"] + #[doc = "to be called first to remove some of the chunks (if possible)."] + #[doc = ""] + #[doc = "If a user encounters the `InsufficientBond` error when calling this extrinsic,"] + #[doc = "they should call `chill` first in order to free up their bonded funds."] + #[doc = ""] + #[doc = "Emits `Unbonded`."] + #[doc = ""] + #[doc = "See also [`Call::withdraw_unbonded`]."] + unbond { + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "Remove any unlocked chunks from the `unlocking` queue from our management."] + #[doc = ""] + #[doc = "This essentially frees up that balance to be used by the stash account to do"] + #[doc = "whatever it wants."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller."] + #[doc = ""] + #[doc = "Emits `Withdrawn`."] + #[doc = ""] + #[doc = "See also [`Call::unbond`]."] + #[doc = ""] + #[doc = "# "] + #[doc = "Complexity O(S) where S is the number of slashing spans to remove"] + #[doc = "NOTE: Weight annotation is the kill scenario, we refund otherwise."] + #[doc = "# "] + withdraw_unbonded { + num_slashing_spans: ::core::primitive::u32, + }, + #[codec(index = 4)] + #[doc = "Declare the desire to validate for the origin controller."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + validate { + prefs: runtime_types::pallet_staking::ValidatorPrefs, + }, + #[codec(index = 5)] + #[doc = "Declare the desire to nominate `targets` for the origin controller."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "# "] + #[doc = "- The transaction's complexity is proportional to the size of `targets` (N)"] + #[doc = "which is capped at CompactAssignments::LIMIT (T::MaxNominations)."] + #[doc = "- Both the reads and writes follow a similar pattern."] + #[doc = "# "] + nominate { + targets: ::std::vec::Vec< + ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + >, + }, + #[codec(index = 6)] + #[doc = "Declare no desire to either validate or nominate."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Independent of the arguments. Insignificant complexity."] + #[doc = "- Contains one read."] + #[doc = "- Writes are limited to the `origin` account key."] + #[doc = "# "] + chill, + #[codec(index = 7)] + #[doc = "(Re-)set the payment target for a controller."] + #[doc = ""] + #[doc = "Effects will be felt instantly (as soon as this function is completed successfully)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Independent of the arguments. Insignificant complexity."] + #[doc = "- Contains a limited number of reads."] + #[doc = "- Writes are limited to the `origin` account key."] + #[doc = "---------"] + #[doc = "- Weight: O(1)"] + #[doc = "- DB Weight:"] + #[doc = " - Read: Ledger"] + #[doc = " - Write: Payee"] + #[doc = "# "] + set_payee { + payee: runtime_types::pallet_staking::RewardDestination< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + }, + #[codec(index = 8)] + #[doc = "(Re-)set the controller of a stash."] + #[doc = ""] + #[doc = "Effects will be felt instantly (as soon as this function is completed successfully)."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the stash, not the controller."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Independent of the arguments. Insignificant complexity."] + #[doc = "- Contains a limited number of reads."] + #[doc = "- Writes are limited to the `origin` account key."] + #[doc = "----------"] + #[doc = "Weight: O(1)"] + #[doc = "DB Weight:"] + #[doc = "- Read: Bonded, Ledger New Controller, Ledger Old Controller"] + #[doc = "- Write: Bonded, Ledger New Controller, Ledger Old Controller"] + #[doc = "# "] + set_controller { + controller: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 9)] + #[doc = "Sets the ideal number of validators."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# "] + #[doc = "Weight: O(1)"] + #[doc = "Write: Validator Count"] + #[doc = "# "] + set_validator_count { + #[codec(compact)] + new: ::core::primitive::u32, + }, + #[codec(index = 10)] + #[doc = "Increments the ideal number of validators."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# "] + #[doc = "Same as [`Self::set_validator_count`]."] + #[doc = "# "] + increase_validator_count { + #[codec(compact)] + additional: ::core::primitive::u32, + }, + #[codec(index = 11)] + #[doc = "Scale up the ideal number of validators by a factor."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# "] + #[doc = "Same as [`Self::set_validator_count`]."] + #[doc = "# "] + scale_validator_count { + factor: runtime_types::sp_arithmetic::per_things::Percent, + }, + #[codec(index = 12)] + #[doc = "Force there to be no new eras indefinitely."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# Warning"] + #[doc = ""] + #[doc = "The election process starts multiple blocks before the end of the era."] + #[doc = "Thus the election process may be ongoing when this is called. In this case the"] + #[doc = "election will continue until the next era is triggered."] + #[doc = ""] + #[doc = "# "] + #[doc = "- No arguments."] + #[doc = "- Weight: O(1)"] + #[doc = "- Write: ForceEra"] + #[doc = "# "] + force_no_eras, + #[codec(index = 13)] + #[doc = "Force there to be a new era at the end of the next session. After this, it will be"] + #[doc = "reset to normal (non-forced) behaviour."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# Warning"] + #[doc = ""] + #[doc = "The election process starts multiple blocks before the end of the era."] + #[doc = "If this is called just before a new era is triggered, the election process may not"] + #[doc = "have enough blocks to get a result."] + #[doc = ""] + #[doc = "# "] + #[doc = "- No arguments."] + #[doc = "- Weight: O(1)"] + #[doc = "- Write ForceEra"] + #[doc = "# "] + force_new_era, + #[codec(index = 14)] + #[doc = "Set the validators who cannot be slashed (if any)."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + set_invulnerables { + invulnerables: + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + }, + #[codec(index = 15)] + #[doc = "Force a current staker to become completely unstaked, immediately."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + force_unstake { + stash: ::subxt::ext::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + }, + #[codec(index = 16)] + #[doc = "Force there to be a new era at the end of sessions indefinitely."] + #[doc = ""] + #[doc = "The dispatch origin must be Root."] + #[doc = ""] + #[doc = "# Warning"] + #[doc = ""] + #[doc = "The election process starts multiple blocks before the end of the era."] + #[doc = "If this is called just before a new era is triggered, the election process may not"] + #[doc = "have enough blocks to get a result."] + force_new_era_always, + #[codec(index = 17)] + #[doc = "Cancel enactment of a deferred slash."] + #[doc = ""] + #[doc = "Can be called by the `T::SlashCancelOrigin`."] + #[doc = ""] + #[doc = "Parameters: era and indices of the slashes for that era to kill."] + cancel_deferred_slash { + era: ::core::primitive::u32, + slash_indices: ::std::vec::Vec<::core::primitive::u32>, + }, + #[codec(index = 18)] + #[doc = "Pay out all the stakers behind a single validator for a single era."] + #[doc = ""] + #[doc = "- `validator_stash` is the stash account of the validator. Their nominators, up to"] + #[doc = " `T::MaxNominatorRewardedPerValidator`, will also receive their rewards."] + #[doc = "- `era` may be any era between `[current_era - history_depth; current_era]`."] + #[doc = ""] + #[doc = "The origin of this call must be _Signed_. Any account can call this function, even if"] + #[doc = "it is not one of the stakers."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Time complexity: at most O(MaxNominatorRewardedPerValidator)."] + #[doc = "- Contains a limited number of reads and writes."] + #[doc = "-----------"] + #[doc = "N is the Number of payouts for the validator (including the validator)"] + #[doc = "Weight:"] + #[doc = "- Reward Destination Staked: O(N)"] + #[doc = "- Reward Destination Controller (Creating): O(N)"] + #[doc = ""] + #[doc = " NOTE: weights are assuming that payouts are made to alive stash account (Staked)."] + #[doc = " Paying even a dead controller is cheaper weight-wise. We don't do any refunds here."] + #[doc = "# "] + payout_stakers { + validator_stash: ::subxt::ext::sp_core::crypto::AccountId32, + era: ::core::primitive::u32, + }, + #[codec(index = 19)] + #[doc = "Rebond a portion of the stash scheduled to be unlocked."] + #[doc = ""] + #[doc = "The dispatch origin must be signed by the controller."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Time complexity: O(L), where L is unlocking chunks"] + #[doc = "- Bounded by `MaxUnlockingChunks`."] + #[doc = "- Storage changes: Can't increase storage, only decrease it."] + #[doc = "# "] + rebond { + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 20)] + #[doc = "Set `HistoryDepth` value. This function will delete any history information"] + #[doc = "when `HistoryDepth` is reduced."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "- `new_history_depth`: The new history depth you would like to set."] + #[doc = "- `era_items_deleted`: The number of items that will be deleted by this dispatch. This"] + #[doc = " should report all the storage items that will be deleted by clearing old era history."] + #[doc = " Needed to report an accurate weight for the dispatch. Trusted by `Root` to report an"] + #[doc = " accurate number."] + #[doc = ""] + #[doc = "Origin must be root."] + #[doc = ""] + #[doc = "# "] + #[doc = "- E: Number of history depths removed, i.e. 10 -> 7 = 3"] + #[doc = "- Weight: O(E)"] + #[doc = "- DB Weight:"] + #[doc = " - Reads: Current Era, History Depth"] + #[doc = " - Writes: History Depth"] + #[doc = " - Clear Prefix Each: Era Stakers, EraStakersClipped, ErasValidatorPrefs"] + #[doc = " - Writes Each: ErasValidatorReward, ErasRewardPoints, ErasTotalStake,"] + #[doc = " ErasStartSessionIndex"] + #[doc = "# "] + set_history_depth { + #[codec(compact)] + new_history_depth: ::core::primitive::u32, + #[codec(compact)] + era_items_deleted: ::core::primitive::u32, + }, + #[codec(index = 21)] + #[doc = "Remove all data structures concerning a staker/stash once it is at a state where it can"] + #[doc = "be considered `dust` in the staking system. The requirements are:"] + #[doc = ""] + #[doc = "1. the `total_balance` of the stash is below existential deposit."] + #[doc = "2. or, the `ledger.total` of the stash is below existential deposit."] + #[doc = ""] + #[doc = "The former can happen in cases like a slash; the latter when a fully unbonded account"] + #[doc = "is still receiving staking rewards in `RewardDestination::Staked`."] + #[doc = ""] + #[doc = "It can be called by anyone, as long as `stash` meets the above requirements."] + #[doc = ""] + #[doc = "Refunds the transaction fees upon successful execution."] + reap_stash { + stash: ::subxt::ext::sp_core::crypto::AccountId32, + num_slashing_spans: ::core::primitive::u32, + }, + #[codec(index = 22)] + #[doc = "Remove the given nominations from the calling validator."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ by the controller, not the stash."] + #[doc = ""] + #[doc = "- `who`: A list of nominator stash accounts who are nominating this validator which"] + #[doc = " should no longer be nominating this validator."] + #[doc = ""] + #[doc = "Note: Making this call only makes sense if you first set the validator preferences to"] + #[doc = "block any further nominations."] + kick { + who: ::std::vec::Vec< + ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + >, + }, + #[codec(index = 23)] + #[doc = "Update the various staking configurations ."] + #[doc = ""] + #[doc = "* `min_nominator_bond`: The minimum active bond needed to be a nominator."] + #[doc = "* `min_validator_bond`: The minimum active bond needed to be a validator."] + #[doc = "* `max_nominator_count`: The max number of users who can be a nominator at once. When"] + #[doc = " set to `None`, no limit is enforced."] + #[doc = "* `max_validator_count`: The max number of users who can be a validator at once. When"] + #[doc = " set to `None`, no limit is enforced."] + #[doc = "* `chill_threshold`: The ratio of `max_nominator_count` or `max_validator_count` which"] + #[doc = " should be filled in order for the `chill_other` transaction to work."] + #[doc = "* `min_commission`: The minimum amount of commission that each validators must maintain."] + #[doc = " This is checked only upon calling `validate`. Existing validators are not affected."] + #[doc = ""] + #[doc = "Origin must be Root to call this function."] + #[doc = ""] + #[doc = "NOTE: Existing nominators and validators will not be affected by this update."] + #[doc = "to kick people under the new limits, `chill_other` should be called."] + set_staking_configs { + min_nominator_bond: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u128, + >, + min_validator_bond: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u128, + >, + max_nominator_count: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u32, + >, + max_validator_count: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + ::core::primitive::u32, + >, + chill_threshold: + runtime_types::pallet_staking::pallet::pallet::ConfigOp< + runtime_types::sp_arithmetic::per_things::Percent, + >, + min_commission: runtime_types::pallet_staking::pallet::pallet::ConfigOp< + runtime_types::sp_arithmetic::per_things::Perbill, + >, + }, + #[codec(index = 24)] + #[doc = "Declare a `controller` to stop participating as either a validator or nominator."] + #[doc = ""] + #[doc = "Effects will be felt at the beginning of the next era."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_, but can be called by anyone."] + #[doc = ""] + #[doc = "If the caller is the same as the controller being targeted, then no further checks are"] + #[doc = "enforced, and this function behaves just like `chill`."] + #[doc = ""] + #[doc = "If the caller is different than the controller being targeted, the following conditions"] + #[doc = "must be met:"] + #[doc = ""] + #[doc = "* `controller` must belong to a nominator who has become non-decodable,"] + #[doc = ""] + #[doc = "Or:"] + #[doc = ""] + #[doc = "* A `ChillThreshold` must be set and checked which defines how close to the max"] + #[doc = " nominators or validators we must reach before users can start chilling one-another."] + #[doc = "* A `MaxNominatorCount` and `MaxValidatorCount` must be set which is used to determine"] + #[doc = " how close we are to the threshold."] + #[doc = "* A `MinNominatorBond` and `MinValidatorBond` must be set and checked, which determines"] + #[doc = " if this is a person that should be chilled because they have not met the threshold"] + #[doc = " bond required."] + #[doc = ""] + #[doc = "This can be helpful if bond requirements are updated, and we need to remove old users"] + #[doc = "who do not satisfy these requirements."] + chill_other { + controller: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 25)] + #[doc = "Force a validator to have at least the minimum commission. This will not affect a"] + #[doc = "validator who already has a commission greater than or equal to the minimum. Any account"] + #[doc = "can call this."] + force_apply_min_commission { + validator_stash: ::subxt::ext::sp_core::crypto::AccountId32, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum ConfigOp<_0> { + #[codec(index = 0)] + Noop, + #[codec(index = 1)] + Set(_0), + #[codec(index = 2)] + Remove, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "Not a controller account."] + NotController, + #[codec(index = 1)] + #[doc = "Not a stash account."] + NotStash, + #[codec(index = 2)] + #[doc = "Stash is already bonded."] + AlreadyBonded, + #[codec(index = 3)] + #[doc = "Controller is already paired."] + AlreadyPaired, + #[codec(index = 4)] + #[doc = "Targets cannot be empty."] + EmptyTargets, + #[codec(index = 5)] + #[doc = "Duplicate index."] + DuplicateIndex, + #[codec(index = 6)] + #[doc = "Slash record index out of bounds."] + InvalidSlashIndex, + #[codec(index = 7)] + #[doc = "Cannot have a validator or nominator role, with value less than the minimum defined by"] + #[doc = "governance (see `MinValidatorBond` and `MinNominatorBond`). If unbonding is the"] + #[doc = "intention, `chill` first to remove one's role as validator/nominator."] + InsufficientBond, + #[codec(index = 8)] + #[doc = "Can not schedule more unlock chunks."] + NoMoreChunks, + #[codec(index = 9)] + #[doc = "Can not rebond without unlocking chunks."] + NoUnlockChunk, + #[codec(index = 10)] + #[doc = "Attempting to target a stash that still has funds."] + FundedTarget, + #[codec(index = 11)] + #[doc = "Invalid era to reward."] + InvalidEraToReward, + #[codec(index = 12)] + #[doc = "Invalid number of nominations."] + InvalidNumberOfNominations, + #[codec(index = 13)] + #[doc = "Items are not sorted and unique."] + NotSortedAndUnique, + #[codec(index = 14)] + #[doc = "Rewards for this era have already been claimed for this validator."] + AlreadyClaimed, + #[codec(index = 15)] + #[doc = "Incorrect previous history depth input provided."] + IncorrectHistoryDepth, + #[codec(index = 16)] + #[doc = "Incorrect number of slashing spans provided."] + IncorrectSlashingSpans, + #[codec(index = 17)] + #[doc = "Internal state has become somehow corrupted and the operation cannot continue."] + BadState, + #[codec(index = 18)] + #[doc = "Too many nomination targets supplied."] + TooManyTargets, + #[codec(index = 19)] + #[doc = "A nomination target was supplied that was blocked or otherwise not a validator."] + BadTarget, + #[codec(index = 20)] + #[doc = "The user has enough bond and thus cannot be chilled forcefully by an external person."] + CannotChillOther, + #[codec(index = 21)] + #[doc = "There are too many nominators in the system. Governance needs to adjust the staking"] + #[doc = "settings to keep things safe for the runtime."] + TooManyNominators, + #[codec(index = 22)] + #[doc = "There are too many validators in the system. Governance needs to adjust the staking"] + #[doc = "settings to keep things safe for the runtime."] + TooManyValidators, + #[codec(index = 23)] + #[doc = "Commission is too low. Must be at least `MinCommission`."] + CommissionTooLow, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "The era payout has been set; the first balance is the validator-payout; the second is"] + #[doc = "the remainder from the maximum amount of reward."] + #[doc = "\\[era_index, validator_payout, remainder\\]"] + EraPaid( + ::core::primitive::u32, + ::core::primitive::u128, + ::core::primitive::u128, + ), + #[codec(index = 1)] + #[doc = "The nominator has been rewarded by this amount. \\[stash, amount\\]"] + Rewarded( + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 2)] + #[doc = "One validator (and its nominators) has been slashed by the given amount."] + #[doc = "\\[validator, amount\\]"] + Slashed( + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 3)] + #[doc = "An old slashing report from a prior era was discarded because it could"] + #[doc = "not be processed. \\[session_index\\]"] + OldSlashingReportDiscarded(::core::primitive::u32), + #[codec(index = 4)] + #[doc = "A new set of stakers was elected."] + StakersElected, + #[codec(index = 5)] + #[doc = "An account has bonded this amount. \\[stash, amount\\]"] + #[doc = ""] + #[doc = "NOTE: This event is only emitted when funds are bonded via a dispatchable. Notably,"] + #[doc = "it will not be emitted for staking rewards when they are added to stake."] + Bonded( + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 6)] + #[doc = "An account has unbonded this amount. \\[stash, amount\\]"] + Unbonded( + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 7)] + #[doc = "An account has called `withdraw_unbonded` and removed unbonding chunks worth `Balance`"] + #[doc = "from the unlocking queue. \\[stash, amount\\]"] + Withdrawn( + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ), + #[codec(index = 8)] + #[doc = "A nominator has been kicked from a validator. \\[nominator, stash\\]"] + Kicked( + ::subxt::ext::sp_core::crypto::AccountId32, + ::subxt::ext::sp_core::crypto::AccountId32, + ), + #[codec(index = 9)] + #[doc = "The election failed. No new era is planned."] + StakingElectionFailed, + #[codec(index = 10)] + #[doc = "An account has stopped participating as either a validator or nominator."] + #[doc = "\\[stash\\]"] + Chilled(::subxt::ext::sp_core::crypto::AccountId32), + #[codec(index = 11)] + #[doc = "The stakers' rewards are getting paid. \\[era_index, validator_stash\\]"] + PayoutStarted( + ::core::primitive::u32, + ::subxt::ext::sp_core::crypto::AccountId32, + ), + #[codec(index = 12)] + #[doc = "A validator has set their preferences."] + ValidatorPrefsSet( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::ValidatorPrefs, + ), + } + } + } + pub mod slashing { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SlashingSpans { + pub span_index: ::core::primitive::u32, + pub last_start: ::core::primitive::u32, + pub last_nonzero_slash: ::core::primitive::u32, + pub prior: ::std::vec::Vec<::core::primitive::u32>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SpanRecord<_0> { + pub slashed: _0, + pub paid_out: _0, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ActiveEraInfo { + pub index: ::core::primitive::u32, + pub start: ::core::option::Option<::core::primitive::u64>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct EraRewardPoints<_0> { + pub total: ::core::primitive::u32, + pub individual: ::subxt::utils::KeyedVec<_0, ::core::primitive::u32>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Exposure<_0, _1> { + #[codec(compact)] + pub total: _1, + #[codec(compact)] + pub own: _1, + pub others: + ::std::vec::Vec>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Forcing { + #[codec(index = 0)] + NotForcing, + #[codec(index = 1)] + ForceNew, + #[codec(index = 2)] + ForceNone, + #[codec(index = 3)] + ForceAlways, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct IndividualExposure<_0, _1> { + pub who: _0, + #[codec(compact)] + pub value: _1, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Nominations { + pub targets: runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + pub submitted_in: ::core::primitive::u32, + pub suppressed: ::core::primitive::bool, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Releases { + #[codec(index = 0)] + V1_0_0Ancient, + #[codec(index = 1)] + V2_0_0, + #[codec(index = 2)] + V3_0_0, + #[codec(index = 3)] + V4_0_0, + #[codec(index = 4)] + V5_0_0, + #[codec(index = 5)] + V6_0_0, + #[codec(index = 6)] + V7_0_0, + #[codec(index = 7)] + V8_0_0, + #[codec(index = 8)] + V9_0_0, + #[codec(index = 9)] + V10_0_0, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum RewardDestination<_0> { + #[codec(index = 0)] + Staked, + #[codec(index = 1)] + Stash, + #[codec(index = 2)] + Controller, + #[codec(index = 3)] + Account(_0), + #[codec(index = 4)] + None, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct StakingLedger { + pub stash: ::subxt::ext::sp_core::crypto::AccountId32, + #[codec(compact)] + pub total: ::core::primitive::u128, + #[codec(compact)] + pub active: ::core::primitive::u128, + pub unlocking: runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + runtime_types::pallet_staking::UnlockChunk<::core::primitive::u128>, + >, + pub claimed_rewards: ::std::vec::Vec<::core::primitive::u32>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct UnappliedSlash<_0, _1> { + pub validator: _0, + pub own: _1, + pub others: ::std::vec::Vec<(_0, _1)>, + pub reporters: ::std::vec::Vec<_0>, + pub payout: _1, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct UnlockChunk<_0> { + #[codec(compact)] + pub value: _0, + #[codec(compact)] + pub era: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ValidatorPrefs { + #[codec(compact)] + pub commission: runtime_types::sp_arithmetic::per_things::Perbill, + pub blocked: ::core::primitive::bool, + } + } + pub mod pallet_sudo { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "- Limited storage reads."] + #[doc = "- One DB write (event)."] + #[doc = "- Weight of derivative `call` execution + 10,000."] + #[doc = "# "] + sudo { + call: ::std::boxed::Box, + }, + #[codec(index = 1)] + #[doc = "Authenticates the sudo key and dispatches a function call with `Root` origin."] + #[doc = "This function does not check the weight of the call, and instead allows the"] + #[doc = "Sudo user to specify the weight of the call."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "- The weight of this call is defined by the caller."] + #[doc = "# "] + sudo_unchecked_weight { + call: ::std::boxed::Box, + weight: ::core::primitive::u64, + }, + #[codec(index = 2)] + #[doc = "Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo"] + #[doc = "key."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "- Limited storage reads."] + #[doc = "- One DB change."] + #[doc = "# "] + set_key { + new: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 3)] + #[doc = "Authenticates the sudo key and dispatches a function call with `Signed` origin from"] + #[doc = "a given account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "- Limited storage reads."] + #[doc = "- One DB write (event)."] + #[doc = "- Weight of derivative `call` execution + 10,000."] + #[doc = "# "] + sudo_as { + who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + call: ::std::boxed::Box, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Error for the Sudo pallet"] + pub enum Error { + #[codec(index = 0)] + #[doc = "Sender must be the Sudo account"] + RequireSudo, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A sudo just took place. \\[result\\]"] + Sudid { + sudo_result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + }, + #[codec(index = 1)] + #[doc = "The \\[sudoer\\] just switched identity; the old key is supplied if one existed."] + KeyChanged { + old_sudoer: + ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + }, + #[codec(index = 2)] + #[doc = "A sudo just took place. \\[result\\]"] + SudoAsDone { + sudo_result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + }, + } + } + } + pub mod pallet_timestamp { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Set the current time."] + #[doc = ""] + #[doc = "This call should be invoked exactly once per block. It will panic at the finalization"] + #[doc = "phase, if this call hasn't been invoked by that time."] + #[doc = ""] + #[doc = "The timestamp should be greater than the previous one by the amount specified by"] + #[doc = "`MinimumPeriod`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be `Inherent`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)` (Note that implementations of `OnTimestampSet` must also be `O(1)`)"] + #[doc = "- 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in"] + #[doc = " `on_finalize`)"] + #[doc = "- 1 event handler `on_timestamp_set`. Must be `O(1)`."] + #[doc = "# "] + set { + #[codec(compact)] + now: ::core::primitive::u64, + }, + } + } + } + pub mod pallet_transaction_payment { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A transaction fee `actual_fee`, of which `tip` was added to the minimum inclusion fee,"] + #[doc = "has been paid by `who`."] + TransactionFeePaid { + who: ::subxt::ext::sp_core::crypto::AccountId32, + actual_fee: ::core::primitive::u128, + tip: ::core::primitive::u128, + }, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ChargeTransactionPayment(#[codec(compact)] pub ::core::primitive::u128); + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Releases { + #[codec(index = 0)] + V1Ancient, + #[codec(index = 1)] + V2, + } + } + pub mod pallet_treasury { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Put forward a suggestion for spending. A deposit proportional to the value"] + #[doc = "is reserved and slashed if the proposal is rejected. It is returned once the"] + #[doc = "proposal is awarded."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(1)"] + #[doc = "- DbReads: `ProposalCount`, `origin account`"] + #[doc = "- DbWrites: `ProposalCount`, `Proposals`, `origin account`"] + #[doc = "# "] + propose_spend { + #[codec(compact)] + value: ::core::primitive::u128, + beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 1)] + #[doc = "Reject a proposed spend. The original deposit will be slashed."] + #[doc = ""] + #[doc = "May only be called from `T::RejectOrigin`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(1)"] + #[doc = "- DbReads: `Proposals`, `rejected proposer account`"] + #[doc = "- DbWrites: `Proposals`, `rejected proposer account`"] + #[doc = "# "] + reject_proposal { + #[codec(compact)] + proposal_id: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Approve a proposal. At a later time, the proposal will be allocated to the beneficiary"] + #[doc = "and the original deposit will be returned."] + #[doc = ""] + #[doc = "May only be called from `T::ApproveOrigin`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(1)."] + #[doc = "- DbReads: `Proposals`, `Approvals`"] + #[doc = "- DbWrite: `Approvals`"] + #[doc = "# "] + approve_proposal { + #[codec(compact)] + proposal_id: ::core::primitive::u32, + }, + #[codec(index = 3)] + #[doc = "Propose and approve a spend of treasury funds."] + #[doc = ""] + #[doc = "- `origin`: Must be `SpendOrigin` with the `Success` value being at least `amount`."] + #[doc = "- `amount`: The amount to be transferred from the treasury to the `beneficiary`."] + #[doc = "- `beneficiary`: The destination account for the transfer."] + #[doc = ""] + #[doc = "NOTE: For record-keeping purposes, the proposer is deemed to be equivalent to the"] + #[doc = "beneficiary."] + spend { + #[codec(compact)] + amount: ::core::primitive::u128, + beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 4)] + #[doc = "Force a previously approved proposal to be removed from the approval queue."] + #[doc = "The original deposit will no longer be returned."] + #[doc = ""] + #[doc = "May only be called from `T::RejectOrigin`."] + #[doc = "- `proposal_id`: The index of a proposal"] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(A) where `A` is the number of approvals"] + #[doc = "- Db reads and writes: `Approvals`"] + #[doc = "# "] + #[doc = ""] + #[doc = "Errors:"] + #[doc = "- `ProposalNotApproved`: The `proposal_id` supplied was not found in the approval queue,"] + #[doc = "i.e., the proposal has not been approved. This could also mean the proposal does not"] + #[doc = "exist altogether, thus there is no way it would have been approved in the first place."] + remove_approval { + #[codec(compact)] + proposal_id: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Error for the treasury pallet."] + pub enum Error { + #[codec(index = 0)] + #[doc = "Proposer's balance is too low."] + InsufficientProposersBalance, + #[codec(index = 1)] + #[doc = "No proposal or bounty at that index."] + InvalidIndex, + #[codec(index = 2)] + #[doc = "Too many approvals in the queue."] + TooManyApprovals, + #[codec(index = 3)] + #[doc = "The spend origin is valid but the amount it is allowed to spend is lower than the"] + #[doc = "amount to be spent."] + InsufficientPermission, + #[codec(index = 4)] + #[doc = "Proposal has not been approved."] + ProposalNotApproved, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "New proposal."] + Proposed { + proposal_index: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "We have ended a spend period and will now allocate funds."] + Spending { + budget_remaining: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "Some funds have been allocated."] + Awarded { + proposal_index: ::core::primitive::u32, + award: ::core::primitive::u128, + account: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 3)] + #[doc = "A proposal was rejected; funds were slashed."] + Rejected { + proposal_index: ::core::primitive::u32, + slashed: ::core::primitive::u128, + }, + #[codec(index = 4)] + #[doc = "Some of our funds have been burnt."] + Burnt { + burnt_funds: ::core::primitive::u128, + }, + #[codec(index = 5)] + #[doc = "Spending has finished; this is the amount that rolls over until next spend."] + Rollover { + rollover_balance: ::core::primitive::u128, + }, + #[codec(index = 6)] + #[doc = "Some funds have been deposited."] + Deposit { value: ::core::primitive::u128 }, + #[codec(index = 7)] + #[doc = "A new spend proposal has been approved."] + SpendApproved { + proposal_index: ::core::primitive::u32, + amount: ::core::primitive::u128, + beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, + }, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Proposal<_0, _1> { + pub proposer: _0, + pub value: _1, + pub beneficiary: _0, + pub bond: _1, + } + } + pub mod pallet_utility { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Send a batch of dispatch calls."] + #[doc = ""] + #[doc = "May be called from any origin."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] + #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] + #[doc = "# "] + #[doc = ""] + #[doc = "This will return `Ok` in all circumstances. To determine the success of the batch, an"] + #[doc = "event is deposited. If a call failed and the batch was interrupted, then the"] + #[doc = "`BatchInterrupted` event is deposited, along with the number of successful calls made"] + #[doc = "and the error of the failed call. If all were successful, then the `BatchCompleted`"] + #[doc = "event is deposited."] + batch { + calls: ::std::vec::Vec, + }, + #[codec(index = 1)] + #[doc = "Send a call through an indexed pseudonym of the sender."] + #[doc = ""] + #[doc = "Filter from origin are passed along. The call will be dispatched with an origin which"] + #[doc = "use the same filter as the origin of this call."] + #[doc = ""] + #[doc = "NOTE: If you need to ensure that any account-based filtering is not honored (i.e."] + #[doc = "because you expect `proxy` to have been used prior in the call stack and you do not want"] + #[doc = "the call restrictions to apply to any sub-accounts), then use `as_multi_threshold_1`"] + #[doc = "in the Multisig pallet instead."] + #[doc = ""] + #[doc = "NOTE: Prior to version *12, this was called `as_limited_sub`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + as_derivative { + index: ::core::primitive::u16, + call: ::std::boxed::Box, + }, + #[codec(index = 2)] + #[doc = "Send a batch of dispatch calls and atomically execute them."] + #[doc = "The whole transaction will rollback and fail if any of the calls failed."] + #[doc = ""] + #[doc = "May be called from any origin."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] + #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] + #[doc = "# "] + batch_all { + calls: ::std::vec::Vec, + }, + #[codec(index = 3)] + #[doc = "Dispatches a function call with a provided origin."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "- Limited storage reads."] + #[doc = "- One DB write (event)."] + #[doc = "- Weight of derivative `call` execution + T::WeightInfo::dispatch_as()."] + #[doc = "# "] + dispatch_as { + as_origin: ::std::boxed::Box, + call: ::std::boxed::Box, + }, + #[codec(index = 4)] + #[doc = "Send a batch of dispatch calls."] + #[doc = "Unlike `batch`, it allows errors and won't interrupt."] + #[doc = ""] + #[doc = "May be called from any origin."] + #[doc = ""] + #[doc = "- `calls`: The calls to be dispatched from the same origin. The number of call must not"] + #[doc = " exceed the constant: `batched_calls_limit` (available in constant metadata)."] + #[doc = ""] + #[doc = "If origin is root then call are dispatch without checking origin filter. (This includes"] + #[doc = "bypassing `frame_system::Config::BaseCallFilter`)."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: O(C) where C is the number of calls to be batched."] + #[doc = "# "] + force_batch { + calls: ::std::vec::Vec, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/main-docs/build/events-errors/)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "Too many calls batched."] + TooManyCalls, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "Batch of dispatches did not complete fully. Index of first failing dispatch given, as"] + #[doc = "well as the error."] + BatchInterrupted { + index: ::core::primitive::u32, + error: runtime_types::sp_runtime::DispatchError, + }, + #[codec(index = 1)] + #[doc = "Batch of dispatches completed fully with no error."] + BatchCompleted, + #[codec(index = 2)] + #[doc = "Batch of dispatches completed but has errors."] + BatchCompletedWithErrors, + #[codec(index = 3)] + #[doc = "A single item within a Batch of dispatches has completed with no error."] + ItemCompleted, + #[codec(index = 4)] + #[doc = "A single item within a Batch of dispatches has completed with error."] + ItemFailed { + error: runtime_types::sp_runtime::DispatchError, + }, + #[codec(index = 5)] + #[doc = "A call was dispatched."] + DispatchedAs { + result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + }, + } + } + } + pub mod pallet_vesting { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Contains one variant per dispatchable that can be called by an extrinsic."] + pub enum Call { + #[codec(index = 0)] + #[doc = "Unlock any vested funds of the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must have funds still"] + #[doc = "locked under this pallet."] + #[doc = ""] + #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- DbWeight: 2 Reads, 2 Writes"] + #[doc = " - Reads: Vesting Storage, Balances Locks, [Sender Account]"] + #[doc = " - Writes: Vesting Storage, Balances Locks, [Sender Account]"] + #[doc = "# "] + vest, + #[codec(index = 1)] + #[doc = "Unlock any vested funds of a `target` account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account whose vested funds should be unlocked. Must have funds still"] + #[doc = "locked under this pallet."] + #[doc = ""] + #[doc = "Emits either `VestingCompleted` or `VestingUpdated`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- DbWeight: 3 Reads, 3 Writes"] + #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account"] + #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account"] + #[doc = "# "] + vest_other { + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + }, + #[codec(index = 2)] + #[doc = "Create a vested transfer."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account receiving the vested funds."] + #[doc = "- `schedule`: The vesting schedule attached to the transfer."] + #[doc = ""] + #[doc = "Emits `VestingCreated`."] + #[doc = ""] + #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- DbWeight: 3 Reads, 3 Writes"] + #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account, [Sender Account]"] + #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account, [Sender Account]"] + #[doc = "# "] + vested_transfer { + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + }, + #[codec(index = 3)] + #[doc = "Force a vested transfer."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "- `source`: The account whose funds should be transferred."] + #[doc = "- `target`: The account that should be transferred the vested funds."] + #[doc = "- `schedule`: The vesting schedule attached to the transfer."] + #[doc = ""] + #[doc = "Emits `VestingCreated`."] + #[doc = ""] + #[doc = "NOTE: This will unlock all schedules through the current block."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- DbWeight: 4 Reads, 4 Writes"] + #[doc = " - Reads: Vesting Storage, Balances Locks, Target Account, Source Account"] + #[doc = " - Writes: Vesting Storage, Balances Locks, Target Account, Source Account"] + #[doc = "# "] + force_vested_transfer { + source: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + target: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + (), + >, + schedule: runtime_types::pallet_vesting::vesting_info::VestingInfo< + ::core::primitive::u128, + ::core::primitive::u32, + >, + }, + #[codec(index = 4)] + #[doc = "Merge two vesting schedules together, creating a new vesting schedule that unlocks over"] + #[doc = "the highest possible start and end blocks. If both schedules have already started the"] + #[doc = "current block will be used as the schedule start; with the caveat that if one schedule"] + #[doc = "is finished by the current block, the other will be treated as the new merged schedule,"] + #[doc = "unmodified."] + #[doc = ""] + #[doc = "NOTE: If `schedule1_index == schedule2_index` this is a no-op."] + #[doc = "NOTE: This will unlock all schedules through the current block prior to merging."] + #[doc = "NOTE: If both schedules have ended by the current block, no new schedule will be created"] + #[doc = "and both will be removed."] + #[doc = ""] + #[doc = "Merged schedule attributes:"] + #[doc = "- `starting_block`: `MAX(schedule1.starting_block, scheduled2.starting_block,"] + #[doc = " current_block)`."] + #[doc = "- `ending_block`: `MAX(schedule1.ending_block, schedule2.ending_block)`."] + #[doc = "- `locked`: `schedule1.locked_at(current_block) + schedule2.locked_at(current_block)`."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `schedule1_index`: index of the first schedule to merge."] + #[doc = "- `schedule2_index`: index of the second schedule to merge."] + merge_schedules { + schedule1_index: ::core::primitive::u32, + schedule2_index: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Error for the vesting pallet."] + pub enum Error { + #[codec(index = 0)] + #[doc = "The account given is not vesting."] + NotVesting, + #[codec(index = 1)] + #[doc = "The account already has `MaxVestingSchedules` count of schedules and thus"] + #[doc = "cannot add another one. Consider merging existing schedules in order to add another."] + AtMaxVestingSchedules, + #[codec(index = 2)] + #[doc = "Amount being transferred is too low to create a vesting schedule."] + AmountLow, + #[codec(index = 3)] + #[doc = "An index was out of bounds of the vesting schedules."] + ScheduleIndexOutOfBounds, + #[codec(index = 4)] + #[doc = "Failed to create a new schedule because some parameter was invalid."] + InvalidScheduleParams, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/main-docs/build/events-errors/) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "The amount vested has been updated. This could indicate a change in funds available."] + #[doc = "The balance given is the amount which is left unvested (and thus locked)."] + VestingUpdated { + account: ::subxt::ext::sp_core::crypto::AccountId32, + unvested: ::core::primitive::u128, + }, + #[codec(index = 1)] + #[doc = "An \\[account\\] has become fully vested."] + VestingCompleted { + account: ::subxt::ext::sp_core::crypto::AccountId32, + }, + } + } + pub mod vesting_info { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct VestingInfo<_0, _1> { + pub locked: _0, + pub per_block: _0, + pub starting_block: _1, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Releases { + #[codec(index = 0)] + V0, + #[codec(index = 1)] + V1, + } + } + pub mod primitive_types { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct H256(pub [::core::primitive::u8; 32usize]); + } + pub mod primitives { + use super::runtime_types; + pub mod app { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Public(pub runtime_types::sp_core::ed25519::Public); + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BanConfig { + pub minimal_expected_performance: runtime_types::sp_arithmetic::per_things::Perbill, + pub underperformed_session_count_threshold: ::core::primitive::u32, + pub clean_session_counter_delay: ::core::primitive::u32, + pub ban_period: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BanInfo { + pub reason: runtime_types::primitives::BanReason, + pub start: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum BanReason { + #[codec(index = 0)] + InsufficientUptime(::core::primitive::u32), + #[codec(index = 1)] + OtherReason( + runtime_types::sp_runtime::bounded::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ), + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CommitteeSeats { + pub reserved_seats: ::core::primitive::u32, + pub non_reserved_seats: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum ElectionOpenness { + #[codec(index = 0)] + Permissioned, + #[codec(index = 1)] + Permissionless, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct EraValidators<_0> { + pub reserved: ::std::vec::Vec<_0>, + pub non_reserved: ::std::vec::Vec<_0>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct VersionChange { + pub version_incoming: ::core::primitive::u32, + pub session: ::core::primitive::u32, + } + } + pub mod sp_arithmetic { + use super::runtime_types; + pub mod fixed_point { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct FixedU128(pub ::core::primitive::u128); + } + pub mod per_things { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Perbill(pub ::core::primitive::u32); + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Percent(pub ::core::primitive::u8); + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Permill(pub ::core::primitive::u32); + } + } + pub mod sp_consensus_aura { + use super::runtime_types; + pub mod sr25519 { + use super::runtime_types; + pub mod app_sr25519 { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Public(pub runtime_types::sp_core::sr25519::Public); + } + } + } + pub mod sp_consensus_slots { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Slot(pub ::core::primitive::u64); + } + pub mod sp_core { + use super::runtime_types; + pub mod crypto { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct AccountId32(pub [::core::primitive::u8; 32usize]); + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct KeyTypeId(pub [::core::primitive::u8; 4usize]); + } + pub mod ecdsa { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Signature(pub [::core::primitive::u8; 65usize]); + } + pub mod ed25519 { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Public(pub [::core::primitive::u8; 32usize]); + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Signature(pub [::core::primitive::u8; 64usize]); + } + pub mod sr25519 { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Public(pub [::core::primitive::u8; 32usize]); + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Signature(pub [::core::primitive::u8; 64usize]); + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Void {} + } + pub mod sp_runtime { + use super::runtime_types; + pub mod bounded { + use super::runtime_types; + pub mod bounded_btree_map { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BoundedBTreeMap<_0, _1>(pub ::subxt::utils::KeyedVec<_0, _1>); + } + pub mod bounded_vec { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BoundedVec<_0>(pub ::std::vec::Vec<_0>); + } + pub mod weak_bounded_vec { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct WeakBoundedVec<_0>(pub ::std::vec::Vec<_0>); + } + } + pub mod generic { + use super::runtime_types; + pub mod digest { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Digest { + pub logs: + ::std::vec::Vec, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum DigestItem { + #[codec(index = 6)] + PreRuntime( + [::core::primitive::u8; 4usize], + ::std::vec::Vec<::core::primitive::u8>, + ), + #[codec(index = 4)] + Consensus( + [::core::primitive::u8; 4usize], + ::std::vec::Vec<::core::primitive::u8>, + ), + #[codec(index = 5)] + Seal( + [::core::primitive::u8; 4usize], + ::std::vec::Vec<::core::primitive::u8>, + ), + #[codec(index = 0)] + Other(::std::vec::Vec<::core::primitive::u8>), + #[codec(index = 8)] + RuntimeEnvironmentUpdated, + } + } + pub mod era { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Era { + #[codec(index = 0)] + Immortal, + #[codec(index = 1)] + Mortal1(::core::primitive::u8), + #[codec(index = 2)] + Mortal2(::core::primitive::u8), + #[codec(index = 3)] + Mortal3(::core::primitive::u8), + #[codec(index = 4)] + Mortal4(::core::primitive::u8), + #[codec(index = 5)] + Mortal5(::core::primitive::u8), + #[codec(index = 6)] + Mortal6(::core::primitive::u8), + #[codec(index = 7)] + Mortal7(::core::primitive::u8), + #[codec(index = 8)] + Mortal8(::core::primitive::u8), + #[codec(index = 9)] + Mortal9(::core::primitive::u8), + #[codec(index = 10)] + Mortal10(::core::primitive::u8), + #[codec(index = 11)] + Mortal11(::core::primitive::u8), + #[codec(index = 12)] + Mortal12(::core::primitive::u8), + #[codec(index = 13)] + Mortal13(::core::primitive::u8), + #[codec(index = 14)] + Mortal14(::core::primitive::u8), + #[codec(index = 15)] + Mortal15(::core::primitive::u8), + #[codec(index = 16)] + Mortal16(::core::primitive::u8), + #[codec(index = 17)] + Mortal17(::core::primitive::u8), + #[codec(index = 18)] + Mortal18(::core::primitive::u8), + #[codec(index = 19)] + Mortal19(::core::primitive::u8), + #[codec(index = 20)] + Mortal20(::core::primitive::u8), + #[codec(index = 21)] + Mortal21(::core::primitive::u8), + #[codec(index = 22)] + Mortal22(::core::primitive::u8), + #[codec(index = 23)] + Mortal23(::core::primitive::u8), + #[codec(index = 24)] + Mortal24(::core::primitive::u8), + #[codec(index = 25)] + Mortal25(::core::primitive::u8), + #[codec(index = 26)] + Mortal26(::core::primitive::u8), + #[codec(index = 27)] + Mortal27(::core::primitive::u8), + #[codec(index = 28)] + Mortal28(::core::primitive::u8), + #[codec(index = 29)] + Mortal29(::core::primitive::u8), + #[codec(index = 30)] + Mortal30(::core::primitive::u8), + #[codec(index = 31)] + Mortal31(::core::primitive::u8), + #[codec(index = 32)] + Mortal32(::core::primitive::u8), + #[codec(index = 33)] + Mortal33(::core::primitive::u8), + #[codec(index = 34)] + Mortal34(::core::primitive::u8), + #[codec(index = 35)] + Mortal35(::core::primitive::u8), + #[codec(index = 36)] + Mortal36(::core::primitive::u8), + #[codec(index = 37)] + Mortal37(::core::primitive::u8), + #[codec(index = 38)] + Mortal38(::core::primitive::u8), + #[codec(index = 39)] + Mortal39(::core::primitive::u8), + #[codec(index = 40)] + Mortal40(::core::primitive::u8), + #[codec(index = 41)] + Mortal41(::core::primitive::u8), + #[codec(index = 42)] + Mortal42(::core::primitive::u8), + #[codec(index = 43)] + Mortal43(::core::primitive::u8), + #[codec(index = 44)] + Mortal44(::core::primitive::u8), + #[codec(index = 45)] + Mortal45(::core::primitive::u8), + #[codec(index = 46)] + Mortal46(::core::primitive::u8), + #[codec(index = 47)] + Mortal47(::core::primitive::u8), + #[codec(index = 48)] + Mortal48(::core::primitive::u8), + #[codec(index = 49)] + Mortal49(::core::primitive::u8), + #[codec(index = 50)] + Mortal50(::core::primitive::u8), + #[codec(index = 51)] + Mortal51(::core::primitive::u8), + #[codec(index = 52)] + Mortal52(::core::primitive::u8), + #[codec(index = 53)] + Mortal53(::core::primitive::u8), + #[codec(index = 54)] + Mortal54(::core::primitive::u8), + #[codec(index = 55)] + Mortal55(::core::primitive::u8), + #[codec(index = 56)] + Mortal56(::core::primitive::u8), + #[codec(index = 57)] + Mortal57(::core::primitive::u8), + #[codec(index = 58)] + Mortal58(::core::primitive::u8), + #[codec(index = 59)] + Mortal59(::core::primitive::u8), + #[codec(index = 60)] + Mortal60(::core::primitive::u8), + #[codec(index = 61)] + Mortal61(::core::primitive::u8), + #[codec(index = 62)] + Mortal62(::core::primitive::u8), + #[codec(index = 63)] + Mortal63(::core::primitive::u8), + #[codec(index = 64)] + Mortal64(::core::primitive::u8), + #[codec(index = 65)] + Mortal65(::core::primitive::u8), + #[codec(index = 66)] + Mortal66(::core::primitive::u8), + #[codec(index = 67)] + Mortal67(::core::primitive::u8), + #[codec(index = 68)] + Mortal68(::core::primitive::u8), + #[codec(index = 69)] + Mortal69(::core::primitive::u8), + #[codec(index = 70)] + Mortal70(::core::primitive::u8), + #[codec(index = 71)] + Mortal71(::core::primitive::u8), + #[codec(index = 72)] + Mortal72(::core::primitive::u8), + #[codec(index = 73)] + Mortal73(::core::primitive::u8), + #[codec(index = 74)] + Mortal74(::core::primitive::u8), + #[codec(index = 75)] + Mortal75(::core::primitive::u8), + #[codec(index = 76)] + Mortal76(::core::primitive::u8), + #[codec(index = 77)] + Mortal77(::core::primitive::u8), + #[codec(index = 78)] + Mortal78(::core::primitive::u8), + #[codec(index = 79)] + Mortal79(::core::primitive::u8), + #[codec(index = 80)] + Mortal80(::core::primitive::u8), + #[codec(index = 81)] + Mortal81(::core::primitive::u8), + #[codec(index = 82)] + Mortal82(::core::primitive::u8), + #[codec(index = 83)] + Mortal83(::core::primitive::u8), + #[codec(index = 84)] + Mortal84(::core::primitive::u8), + #[codec(index = 85)] + Mortal85(::core::primitive::u8), + #[codec(index = 86)] + Mortal86(::core::primitive::u8), + #[codec(index = 87)] + Mortal87(::core::primitive::u8), + #[codec(index = 88)] + Mortal88(::core::primitive::u8), + #[codec(index = 89)] + Mortal89(::core::primitive::u8), + #[codec(index = 90)] + Mortal90(::core::primitive::u8), + #[codec(index = 91)] + Mortal91(::core::primitive::u8), + #[codec(index = 92)] + Mortal92(::core::primitive::u8), + #[codec(index = 93)] + Mortal93(::core::primitive::u8), + #[codec(index = 94)] + Mortal94(::core::primitive::u8), + #[codec(index = 95)] + Mortal95(::core::primitive::u8), + #[codec(index = 96)] + Mortal96(::core::primitive::u8), + #[codec(index = 97)] + Mortal97(::core::primitive::u8), + #[codec(index = 98)] + Mortal98(::core::primitive::u8), + #[codec(index = 99)] + Mortal99(::core::primitive::u8), + #[codec(index = 100)] + Mortal100(::core::primitive::u8), + #[codec(index = 101)] + Mortal101(::core::primitive::u8), + #[codec(index = 102)] + Mortal102(::core::primitive::u8), + #[codec(index = 103)] + Mortal103(::core::primitive::u8), + #[codec(index = 104)] + Mortal104(::core::primitive::u8), + #[codec(index = 105)] + Mortal105(::core::primitive::u8), + #[codec(index = 106)] + Mortal106(::core::primitive::u8), + #[codec(index = 107)] + Mortal107(::core::primitive::u8), + #[codec(index = 108)] + Mortal108(::core::primitive::u8), + #[codec(index = 109)] + Mortal109(::core::primitive::u8), + #[codec(index = 110)] + Mortal110(::core::primitive::u8), + #[codec(index = 111)] + Mortal111(::core::primitive::u8), + #[codec(index = 112)] + Mortal112(::core::primitive::u8), + #[codec(index = 113)] + Mortal113(::core::primitive::u8), + #[codec(index = 114)] + Mortal114(::core::primitive::u8), + #[codec(index = 115)] + Mortal115(::core::primitive::u8), + #[codec(index = 116)] + Mortal116(::core::primitive::u8), + #[codec(index = 117)] + Mortal117(::core::primitive::u8), + #[codec(index = 118)] + Mortal118(::core::primitive::u8), + #[codec(index = 119)] + Mortal119(::core::primitive::u8), + #[codec(index = 120)] + Mortal120(::core::primitive::u8), + #[codec(index = 121)] + Mortal121(::core::primitive::u8), + #[codec(index = 122)] + Mortal122(::core::primitive::u8), + #[codec(index = 123)] + Mortal123(::core::primitive::u8), + #[codec(index = 124)] + Mortal124(::core::primitive::u8), + #[codec(index = 125)] + Mortal125(::core::primitive::u8), + #[codec(index = 126)] + Mortal126(::core::primitive::u8), + #[codec(index = 127)] + Mortal127(::core::primitive::u8), + #[codec(index = 128)] + Mortal128(::core::primitive::u8), + #[codec(index = 129)] + Mortal129(::core::primitive::u8), + #[codec(index = 130)] + Mortal130(::core::primitive::u8), + #[codec(index = 131)] + Mortal131(::core::primitive::u8), + #[codec(index = 132)] + Mortal132(::core::primitive::u8), + #[codec(index = 133)] + Mortal133(::core::primitive::u8), + #[codec(index = 134)] + Mortal134(::core::primitive::u8), + #[codec(index = 135)] + Mortal135(::core::primitive::u8), + #[codec(index = 136)] + Mortal136(::core::primitive::u8), + #[codec(index = 137)] + Mortal137(::core::primitive::u8), + #[codec(index = 138)] + Mortal138(::core::primitive::u8), + #[codec(index = 139)] + Mortal139(::core::primitive::u8), + #[codec(index = 140)] + Mortal140(::core::primitive::u8), + #[codec(index = 141)] + Mortal141(::core::primitive::u8), + #[codec(index = 142)] + Mortal142(::core::primitive::u8), + #[codec(index = 143)] + Mortal143(::core::primitive::u8), + #[codec(index = 144)] + Mortal144(::core::primitive::u8), + #[codec(index = 145)] + Mortal145(::core::primitive::u8), + #[codec(index = 146)] + Mortal146(::core::primitive::u8), + #[codec(index = 147)] + Mortal147(::core::primitive::u8), + #[codec(index = 148)] + Mortal148(::core::primitive::u8), + #[codec(index = 149)] + Mortal149(::core::primitive::u8), + #[codec(index = 150)] + Mortal150(::core::primitive::u8), + #[codec(index = 151)] + Mortal151(::core::primitive::u8), + #[codec(index = 152)] + Mortal152(::core::primitive::u8), + #[codec(index = 153)] + Mortal153(::core::primitive::u8), + #[codec(index = 154)] + Mortal154(::core::primitive::u8), + #[codec(index = 155)] + Mortal155(::core::primitive::u8), + #[codec(index = 156)] + Mortal156(::core::primitive::u8), + #[codec(index = 157)] + Mortal157(::core::primitive::u8), + #[codec(index = 158)] + Mortal158(::core::primitive::u8), + #[codec(index = 159)] + Mortal159(::core::primitive::u8), + #[codec(index = 160)] + Mortal160(::core::primitive::u8), + #[codec(index = 161)] + Mortal161(::core::primitive::u8), + #[codec(index = 162)] + Mortal162(::core::primitive::u8), + #[codec(index = 163)] + Mortal163(::core::primitive::u8), + #[codec(index = 164)] + Mortal164(::core::primitive::u8), + #[codec(index = 165)] + Mortal165(::core::primitive::u8), + #[codec(index = 166)] + Mortal166(::core::primitive::u8), + #[codec(index = 167)] + Mortal167(::core::primitive::u8), + #[codec(index = 168)] + Mortal168(::core::primitive::u8), + #[codec(index = 169)] + Mortal169(::core::primitive::u8), + #[codec(index = 170)] + Mortal170(::core::primitive::u8), + #[codec(index = 171)] + Mortal171(::core::primitive::u8), + #[codec(index = 172)] + Mortal172(::core::primitive::u8), + #[codec(index = 173)] + Mortal173(::core::primitive::u8), + #[codec(index = 174)] + Mortal174(::core::primitive::u8), + #[codec(index = 175)] + Mortal175(::core::primitive::u8), + #[codec(index = 176)] + Mortal176(::core::primitive::u8), + #[codec(index = 177)] + Mortal177(::core::primitive::u8), + #[codec(index = 178)] + Mortal178(::core::primitive::u8), + #[codec(index = 179)] + Mortal179(::core::primitive::u8), + #[codec(index = 180)] + Mortal180(::core::primitive::u8), + #[codec(index = 181)] + Mortal181(::core::primitive::u8), + #[codec(index = 182)] + Mortal182(::core::primitive::u8), + #[codec(index = 183)] + Mortal183(::core::primitive::u8), + #[codec(index = 184)] + Mortal184(::core::primitive::u8), + #[codec(index = 185)] + Mortal185(::core::primitive::u8), + #[codec(index = 186)] + Mortal186(::core::primitive::u8), + #[codec(index = 187)] + Mortal187(::core::primitive::u8), + #[codec(index = 188)] + Mortal188(::core::primitive::u8), + #[codec(index = 189)] + Mortal189(::core::primitive::u8), + #[codec(index = 190)] + Mortal190(::core::primitive::u8), + #[codec(index = 191)] + Mortal191(::core::primitive::u8), + #[codec(index = 192)] + Mortal192(::core::primitive::u8), + #[codec(index = 193)] + Mortal193(::core::primitive::u8), + #[codec(index = 194)] + Mortal194(::core::primitive::u8), + #[codec(index = 195)] + Mortal195(::core::primitive::u8), + #[codec(index = 196)] + Mortal196(::core::primitive::u8), + #[codec(index = 197)] + Mortal197(::core::primitive::u8), + #[codec(index = 198)] + Mortal198(::core::primitive::u8), + #[codec(index = 199)] + Mortal199(::core::primitive::u8), + #[codec(index = 200)] + Mortal200(::core::primitive::u8), + #[codec(index = 201)] + Mortal201(::core::primitive::u8), + #[codec(index = 202)] + Mortal202(::core::primitive::u8), + #[codec(index = 203)] + Mortal203(::core::primitive::u8), + #[codec(index = 204)] + Mortal204(::core::primitive::u8), + #[codec(index = 205)] + Mortal205(::core::primitive::u8), + #[codec(index = 206)] + Mortal206(::core::primitive::u8), + #[codec(index = 207)] + Mortal207(::core::primitive::u8), + #[codec(index = 208)] + Mortal208(::core::primitive::u8), + #[codec(index = 209)] + Mortal209(::core::primitive::u8), + #[codec(index = 210)] + Mortal210(::core::primitive::u8), + #[codec(index = 211)] + Mortal211(::core::primitive::u8), + #[codec(index = 212)] + Mortal212(::core::primitive::u8), + #[codec(index = 213)] + Mortal213(::core::primitive::u8), + #[codec(index = 214)] + Mortal214(::core::primitive::u8), + #[codec(index = 215)] + Mortal215(::core::primitive::u8), + #[codec(index = 216)] + Mortal216(::core::primitive::u8), + #[codec(index = 217)] + Mortal217(::core::primitive::u8), + #[codec(index = 218)] + Mortal218(::core::primitive::u8), + #[codec(index = 219)] + Mortal219(::core::primitive::u8), + #[codec(index = 220)] + Mortal220(::core::primitive::u8), + #[codec(index = 221)] + Mortal221(::core::primitive::u8), + #[codec(index = 222)] + Mortal222(::core::primitive::u8), + #[codec(index = 223)] + Mortal223(::core::primitive::u8), + #[codec(index = 224)] + Mortal224(::core::primitive::u8), + #[codec(index = 225)] + Mortal225(::core::primitive::u8), + #[codec(index = 226)] + Mortal226(::core::primitive::u8), + #[codec(index = 227)] + Mortal227(::core::primitive::u8), + #[codec(index = 228)] + Mortal228(::core::primitive::u8), + #[codec(index = 229)] + Mortal229(::core::primitive::u8), + #[codec(index = 230)] + Mortal230(::core::primitive::u8), + #[codec(index = 231)] + Mortal231(::core::primitive::u8), + #[codec(index = 232)] + Mortal232(::core::primitive::u8), + #[codec(index = 233)] + Mortal233(::core::primitive::u8), + #[codec(index = 234)] + Mortal234(::core::primitive::u8), + #[codec(index = 235)] + Mortal235(::core::primitive::u8), + #[codec(index = 236)] + Mortal236(::core::primitive::u8), + #[codec(index = 237)] + Mortal237(::core::primitive::u8), + #[codec(index = 238)] + Mortal238(::core::primitive::u8), + #[codec(index = 239)] + Mortal239(::core::primitive::u8), + #[codec(index = 240)] + Mortal240(::core::primitive::u8), + #[codec(index = 241)] + Mortal241(::core::primitive::u8), + #[codec(index = 242)] + Mortal242(::core::primitive::u8), + #[codec(index = 243)] + Mortal243(::core::primitive::u8), + #[codec(index = 244)] + Mortal244(::core::primitive::u8), + #[codec(index = 245)] + Mortal245(::core::primitive::u8), + #[codec(index = 246)] + Mortal246(::core::primitive::u8), + #[codec(index = 247)] + Mortal247(::core::primitive::u8), + #[codec(index = 248)] + Mortal248(::core::primitive::u8), + #[codec(index = 249)] + Mortal249(::core::primitive::u8), + #[codec(index = 250)] + Mortal250(::core::primitive::u8), + #[codec(index = 251)] + Mortal251(::core::primitive::u8), + #[codec(index = 252)] + Mortal252(::core::primitive::u8), + #[codec(index = 253)] + Mortal253(::core::primitive::u8), + #[codec(index = 254)] + Mortal254(::core::primitive::u8), + #[codec(index = 255)] + Mortal255(::core::primitive::u8), + } + } + pub mod header { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Header<_0, _1> { + pub parent_hash: ::subxt::ext::sp_core::H256, + #[codec(compact)] + pub number: _0, + pub state_root: ::subxt::ext::sp_core::H256, + pub extrinsics_root: ::subxt::ext::sp_core::H256, + pub digest: runtime_types::sp_runtime::generic::digest::Digest, + #[codec(skip)] + pub __subxt_unused_type_params: ::core::marker::PhantomData<_1>, + } + } + pub mod unchecked_extrinsic { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct UncheckedExtrinsic<_0, _1, _2, _3>( + pub ::std::vec::Vec<::core::primitive::u8>, + #[codec(skip)] pub ::core::marker::PhantomData<(_1, _0, _2, _3)>, + ); + } + } + pub mod multiaddress { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum MultiAddress<_0, _1> { + #[codec(index = 0)] + Id(_0), + #[codec(index = 1)] + Index(#[codec(compact)] _1), + #[codec(index = 2)] + Raw(::std::vec::Vec<::core::primitive::u8>), + #[codec(index = 3)] + Address32([::core::primitive::u8; 32usize]), + #[codec(index = 4)] + Address20([::core::primitive::u8; 20usize]), + } + } + pub mod traits { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BlakeTwo256; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum ArithmeticError { + #[codec(index = 0)] + Underflow, + #[codec(index = 1)] + Overflow, + #[codec(index = 2)] + DivisionByZero, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum DispatchError { + #[codec(index = 0)] + Other, + #[codec(index = 1)] + CannotLookup, + #[codec(index = 2)] + BadOrigin, + #[codec(index = 3)] + Module(runtime_types::sp_runtime::ModuleError), + #[codec(index = 4)] + ConsumerRemaining, + #[codec(index = 5)] + NoProviders, + #[codec(index = 6)] + TooManyConsumers, + #[codec(index = 7)] + Token(runtime_types::sp_runtime::TokenError), + #[codec(index = 8)] + Arithmetic(runtime_types::sp_runtime::ArithmeticError), + #[codec(index = 9)] + Transactional(runtime_types::sp_runtime::TransactionalError), + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ModuleError { + pub index: ::core::primitive::u8, + pub error: [::core::primitive::u8; 4usize], + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum MultiSignature { + #[codec(index = 0)] + Ed25519(runtime_types::sp_core::ed25519::Signature), + #[codec(index = 1)] + Sr25519(runtime_types::sp_core::sr25519::Signature), + #[codec(index = 2)] + Ecdsa(runtime_types::sp_core::ecdsa::Signature), + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum TokenError { + #[codec(index = 0)] + NoFunds, + #[codec(index = 1)] + WouldDie, + #[codec(index = 2)] + BelowMinimum, + #[codec(index = 3)] + CannotCreate, + #[codec(index = 4)] + UnknownAsset, + #[codec(index = 5)] + Frozen, + #[codec(index = 6)] + Unsupported, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum TransactionalError { + #[codec(index = 0)] + LimitReached, + #[codec(index = 1)] + NoLayer, + } + } + pub mod sp_version { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RuntimeVersion { + pub spec_name: ::std::string::String, + pub impl_name: ::std::string::String, + pub authoring_version: ::core::primitive::u32, + pub spec_version: ::core::primitive::u32, + pub impl_version: ::core::primitive::u32, + pub apis: + ::std::vec::Vec<([::core::primitive::u8; 8usize], ::core::primitive::u32)>, + pub transaction_version: ::core::primitive::u32, + pub state_version: ::core::primitive::u8, + } + } + } + #[doc = r" The default error type returned when there is a runtime issue,"] + #[doc = r" exposed here for ease of use."] + pub type DispatchError = runtime_types::sp_runtime::DispatchError; + pub fn constants() -> ConstantsApi { + ConstantsApi + } + pub fn storage() -> StorageApi { + StorageApi + } + pub fn tx() -> TransactionApi { + TransactionApi + } + pub struct ConstantsApi; + impl ConstantsApi { + pub fn system(&self) -> system::constants::ConstantsApi { + system::constants::ConstantsApi + } + pub fn scheduler(&self) -> scheduler::constants::ConstantsApi { + scheduler::constants::ConstantsApi + } + pub fn timestamp(&self) -> timestamp::constants::ConstantsApi { + timestamp::constants::ConstantsApi + } + pub fn balances(&self) -> balances::constants::ConstantsApi { + balances::constants::ConstantsApi + } + pub fn transaction_payment(&self) -> transaction_payment::constants::ConstantsApi { + transaction_payment::constants::ConstantsApi + } + pub fn authorship(&self) -> authorship::constants::ConstantsApi { + authorship::constants::ConstantsApi + } + pub fn staking(&self) -> staking::constants::ConstantsApi { + staking::constants::ConstantsApi + } + pub fn elections(&self) -> elections::constants::ConstantsApi { + elections::constants::ConstantsApi + } + pub fn treasury(&self) -> treasury::constants::ConstantsApi { + treasury::constants::ConstantsApi + } + pub fn vesting(&self) -> vesting::constants::ConstantsApi { + vesting::constants::ConstantsApi + } + pub fn utility(&self) -> utility::constants::ConstantsApi { + utility::constants::ConstantsApi + } + pub fn multisig(&self) -> multisig::constants::ConstantsApi { + multisig::constants::ConstantsApi + } + pub fn contracts(&self) -> contracts::constants::ConstantsApi { + contracts::constants::ConstantsApi + } + pub fn nomination_pools(&self) -> nomination_pools::constants::ConstantsApi { + nomination_pools::constants::ConstantsApi + } + pub fn identity(&self) -> identity::constants::ConstantsApi { + identity::constants::ConstantsApi + } + } + pub struct StorageApi; + impl StorageApi { + pub fn system(&self) -> system::storage::StorageApi { + system::storage::StorageApi + } + pub fn randomness_collective_flip( + &self, + ) -> randomness_collective_flip::storage::StorageApi { + randomness_collective_flip::storage::StorageApi + } + pub fn scheduler(&self) -> scheduler::storage::StorageApi { + scheduler::storage::StorageApi + } + pub fn aura(&self) -> aura::storage::StorageApi { + aura::storage::StorageApi + } + pub fn timestamp(&self) -> timestamp::storage::StorageApi { + timestamp::storage::StorageApi + } + pub fn balances(&self) -> balances::storage::StorageApi { + balances::storage::StorageApi + } + pub fn transaction_payment(&self) -> transaction_payment::storage::StorageApi { + transaction_payment::storage::StorageApi + } + pub fn authorship(&self) -> authorship::storage::StorageApi { + authorship::storage::StorageApi + } + pub fn staking(&self) -> staking::storage::StorageApi { + staking::storage::StorageApi + } + pub fn history(&self) -> history::storage::StorageApi { + history::storage::StorageApi + } + pub fn session(&self) -> session::storage::StorageApi { + session::storage::StorageApi + } + pub fn aleph(&self) -> aleph::storage::StorageApi { + aleph::storage::StorageApi + } + pub fn elections(&self) -> elections::storage::StorageApi { + elections::storage::StorageApi + } + pub fn treasury(&self) -> treasury::storage::StorageApi { + treasury::storage::StorageApi + } + pub fn vesting(&self) -> vesting::storage::StorageApi { + vesting::storage::StorageApi + } + pub fn multisig(&self) -> multisig::storage::StorageApi { + multisig::storage::StorageApi + } + pub fn sudo(&self) -> sudo::storage::StorageApi { + sudo::storage::StorageApi + } + pub fn contracts(&self) -> contracts::storage::StorageApi { + contracts::storage::StorageApi + } + pub fn nomination_pools(&self) -> nomination_pools::storage::StorageApi { + nomination_pools::storage::StorageApi + } + pub fn identity(&self) -> identity::storage::StorageApi { + identity::storage::StorageApi + } + } + pub struct TransactionApi; + impl TransactionApi { + pub fn system(&self) -> system::calls::TransactionApi { + system::calls::TransactionApi + } + pub fn scheduler(&self) -> scheduler::calls::TransactionApi { + scheduler::calls::TransactionApi + } + pub fn timestamp(&self) -> timestamp::calls::TransactionApi { + timestamp::calls::TransactionApi + } + pub fn balances(&self) -> balances::calls::TransactionApi { + balances::calls::TransactionApi + } + pub fn authorship(&self) -> authorship::calls::TransactionApi { + authorship::calls::TransactionApi + } + pub fn staking(&self) -> staking::calls::TransactionApi { + staking::calls::TransactionApi + } + pub fn session(&self) -> session::calls::TransactionApi { + session::calls::TransactionApi + } + pub fn aleph(&self) -> aleph::calls::TransactionApi { + aleph::calls::TransactionApi + } + pub fn elections(&self) -> elections::calls::TransactionApi { + elections::calls::TransactionApi + } + pub fn treasury(&self) -> treasury::calls::TransactionApi { + treasury::calls::TransactionApi + } + pub fn vesting(&self) -> vesting::calls::TransactionApi { + vesting::calls::TransactionApi + } + pub fn utility(&self) -> utility::calls::TransactionApi { + utility::calls::TransactionApi + } + pub fn multisig(&self) -> multisig::calls::TransactionApi { + multisig::calls::TransactionApi + } + pub fn sudo(&self) -> sudo::calls::TransactionApi { + sudo::calls::TransactionApi + } + pub fn contracts(&self) -> contracts::calls::TransactionApi { + contracts::calls::TransactionApi + } + pub fn nomination_pools(&self) -> nomination_pools::calls::TransactionApi { + nomination_pools::calls::TransactionApi + } + pub fn identity(&self) -> identity::calls::TransactionApi { + identity::calls::TransactionApi + } + } + #[doc = r" check whether the Client you are using is aligned with the statically generated codegen."] + pub fn validate_codegen>( + client: &C, + ) -> Result<(), ::subxt::error::MetadataError> { + let runtime_metadata_hash = client.metadata().metadata_hash(&PALLETS); + if runtime_metadata_hash + != [ + 7u8, 142u8, 66u8, 125u8, 15u8, 19u8, 17u8, 117u8, 30u8, 151u8, 44u8, 251u8, 51u8, + 42u8, 53u8, 85u8, 63u8, 235u8, 205u8, 5u8, 103u8, 125u8, 202u8, 7u8, 63u8, 61u8, + 252u8, 75u8, 48u8, 87u8, 252u8, 208u8, + ] + { + Err(::subxt::error::MetadataError::IncompatibleMetadata) + } else { + Ok(()) + } + } +} diff --git a/aleph-client/src/balances.rs b/aleph-client/src/balances.rs deleted file mode 100644 index ad589394e5..0000000000 --- a/aleph-client/src/balances.rs +++ /dev/null @@ -1,10 +0,0 @@ -use primitives::Balance; - -use crate::ReadStorage; - -/// Reads from the storage how much balance is currently on chain. -/// -/// Performs a single storage read. -pub fn total_issuance(connection: &C) -> Balance { - connection.read_storage_value("Balances", "TotalIssuance") -} diff --git a/aleph-client/src/connections.rs b/aleph-client/src/connections.rs new file mode 100644 index 0000000000..2fe9601d93 --- /dev/null +++ b/aleph-client/src/connections.rs @@ -0,0 +1,173 @@ +use codec::Decode; +use log::info; +use subxt::{ + ext::sp_core::{Bytes, H256}, + metadata::DecodeWithMetadata, + rpc::RpcParams, + storage::{address::Yes, StaticStorageAddress, StorageAddress}, + tx::{BaseExtrinsicParamsBuilder, PlainTip, TxPayload}, + SubstrateConfig, +}; + +use crate::{api, Call, Client, KeyPair, TxStatus}; + +#[derive(Clone)] +pub struct Connection { + pub client: Client, +} + +pub struct SignedConnection { + pub connection: Connection, + pub signer: KeyPair, +} + +pub struct RootConnection { + pub connection: Connection, + pub root: KeyPair, +} + +#[async_trait::async_trait] +pub trait SudoCall { + async fn sudo_unchecked(&self, call: Call, status: TxStatus) -> anyhow::Result; +} + +#[async_trait::async_trait] +impl SudoCall for RootConnection { + async fn sudo_unchecked(&self, call: Call, status: TxStatus) -> anyhow::Result { + info!(target: "aleph-client", "sending call as sudo {:?}", call); + let sudo = api::tx().sudo().sudo_unchecked_weight(call, 0); + + let progress = self + .connection + .client + .tx() + .sign_and_submit_then_watch_default(&sudo, &self.root) + .await?; + + let hash = match status { + TxStatus::InBlock => progress.wait_for_in_block().await?.block_hash(), + TxStatus::Finalized => progress.wait_for_finalized_success().await?.block_hash(), + }; + + Ok(hash) + } +} + +impl Connection { + pub async fn new(address: String) -> Self { + let client = Client::from_url(address) + .await + .expect("Should connect to the chain"); + + Self { client } + } + + pub async fn get_storage_entry( + &self, + addrs: &StaticStorageAddress, + at: Option, + ) -> T::Target { + self.get_storage_entry_maybe(addrs, at) + .await + .expect("There should be a value") + } + + pub async fn get_storage_entry_maybe( + &self, + addrs: &StaticStorageAddress, + at: Option, + ) -> Option { + info!(target: "aleph-client", "accessing storage at {}::{} at block {:?}", addrs.pallet_name(), addrs.entry_name(), at); + self.client + .storage() + .fetch(addrs, at) + .await + .expect("Should access storage") + } + + pub async fn rpc_call( + &self, + func_name: String, + params: RpcParams, + ) -> anyhow::Result { + info!(target: "aleph-client", "submitting rpc call `{}`, with params {:?}", func_name, params); + let bytes: Bytes = self.client.rpc().request(&func_name, params).await?; + + Ok(R::decode(&mut bytes.as_ref())?) + } +} + +impl SignedConnection { + pub async fn new(address: String, signer: KeyPair) -> Self { + Self::from_connection(Connection::new(address).await, signer) + } + + pub fn from_connection(connection: Connection, signer: KeyPair) -> Self { + Self { connection, signer } + } + + pub async fn send_tx( + &self, + tx: Call, + status: TxStatus, + ) -> anyhow::Result { + self.send_tx_with_params(tx, Default::default(), status) + .await + } + + pub async fn send_tx_with_params( + &self, + tx: Call, + params: BaseExtrinsicParamsBuilder, + status: TxStatus, + ) -> anyhow::Result { + if let Some(details) = tx.validation_details() { + info!(target:"aleph-client", "Sending extrinsic {}.{} with params: {:?}", details.pallet_name, details.call_name, params); + } + let progress = self + .connection + .client + .tx() + .sign_and_submit_then_watch(&tx, &self.signer, params) + .await?; + + let hash = match status { + TxStatus::InBlock => progress.wait_for_in_block().await?.block_hash(), + TxStatus::Finalized => progress.wait_for_finalized_success().await?.block_hash(), + }; + info!(target: "aleph-client", "tx included in block {:?}", hash); + + Ok(hash) + } +} + +impl RootConnection { + pub async fn new(address: String, root: KeyPair) -> Result { + RootConnection::try_from_connection(Connection::new(address).await, root).await + } + + pub async fn try_from_connection(connection: Connection, signer: KeyPair) -> Result { + let root_address = api::storage().sudo().key(); + + let root = match connection.client.storage().fetch(&root_address, None).await { + Ok(Some(account)) => account, + _ => return Err(()), + }; + + if root != *signer.account_id() { + return Err(()); + } + + Ok(Self { + connection, + root: signer, + }) + } + + pub fn as_signed(&self) -> SignedConnection { + SignedConnection { + connection: self.connection.clone(), + signer: KeyPair::new(self.root.signer().clone()), + } + } +} diff --git a/aleph-client/src/contract/event.rs b/aleph-client/src/contract/event.rs deleted file mode 100644 index 2377dc3bf8..0000000000 --- a/aleph-client/src/contract/event.rs +++ /dev/null @@ -1,235 +0,0 @@ -//! Utilities for listening for contract events. -//! -//! To use the module you will need to first create a subscription (a glorified `Receiver`), -//! then run the listen loop. You might want to run the loop in a separate thread. -//! -//! ```no_run -//! # use std::sync::Arc; -//! # use std::sync::mpsc::channel; -//! # use std::thread; -//! # use std::time::Duration; -//! # use aleph_client::{Connection, SignedConnection}; -//! # use aleph_client::contract::ContractInstance; -//! # use aleph_client::contract::event::{listen_contract_events, subscribe_events}; -//! # use anyhow::Result; -//! # use sp_core::crypto::AccountId32; -//! # fn example(conn: SignedConnection, address1: AccountId32, address2: AccountId32, path1: &str, path2: &str) -> Result<()> { -//! let subscription = subscribe_events(&conn)?; -//! -//! // The `Arc` makes it possible to pass a reference to the contract to another thread -//! let contract1 = Arc::new(ContractInstance::new(address1, path1)?); -//! let contract2 = Arc::new(ContractInstance::new(address2, path2)?); -//! let (cancel_tx, cancel_rx) = channel(); -//! -//! let contract1_copy = contract1.clone(); -//! let contract2_copy = contract2.clone(); -//! -//! thread::spawn(move || { -//! listen_contract_events( -//! subscription, -//! &[contract1_copy.as_ref(), &contract2_copy.as_ref()], -//! Some(cancel_rx), -//! |event_or_error| { println!("{:?}", event_or_error) } -//! ); -//! }); -//! -//! thread::sleep(Duration::from_secs(20)); -//! cancel_tx.send(()).unwrap(); -//! -//! contract1.contract_exec0(&conn, "some_method")?; -//! contract2.contract_exec0(&conn, "some_other_method")?; -//! -//! # Ok(()) -//! # } -//! ``` - -use std::{ - collections::HashMap, - sync::mpsc::{channel, Receiver}, -}; - -use ac_node_api::events::{EventsDecoder, Raw, RawEvent}; -use anyhow::{bail, Context, Result}; -use contract_transcode::{ContractMessageTranscoder, Transcoder, TranscoderBuilder, Value}; -use ink_metadata::InkProject; -use sp_core::crypto::{AccountId32, Ss58Codec}; -use substrate_api_client::Metadata; - -use crate::{contract::ContractInstance, AnyConnection}; - -/// Represents a single event emitted by a contract. -#[derive(Debug, Clone, Eq, PartialEq)] -pub struct ContractEvent { - /// The address of the contract that emitted the event. - pub contract: AccountId32, - /// The name of the event. - pub ident: Option, - /// Data contained in the event. - pub data: HashMap, -} - -/// An opaque wrapper around a `Receiver` that can be used to listen for contract events. -pub struct EventSubscription { - receiver: Receiver, - metadata: Metadata, -} - -/// Creates a subscription to all events that can be used to [listen_contract_events] -pub fn subscribe_events(conn: &C) -> Result { - let conn = conn.as_connection(); - let (sender, receiver) = channel(); - - conn.subscribe_events(sender)?; - - Ok(EventSubscription { - metadata: conn.metadata, - receiver, - }) -} - -/// Starts an event listening loop. -/// -/// Will execute the handler for every contract event and every error encountered while fetching -/// from `subscription`. Only events coming from the address of one of the `contracts` will be -/// decoded. -/// -/// The loop will terminate once `subscription` is closed or once any message is received on -/// `cancel` (if provided). -pub fn listen_contract_events)>( - subscription: EventSubscription, - contracts: &[&ContractInstance], - cancel: Option>, - handler: F, -) { - let events_decoder = EventsDecoder::new(subscription.metadata.clone()); - let events_transcoder = TranscoderBuilder::new(&subscription.metadata.runtime_metadata().types) - .with_default_custom_type_transcoders() - .done(); - let contracts = contracts - .iter() - .map(|contract| (contract.address().clone(), contract.ink_project())) - .collect::>(); - - for batch in subscription.receiver.iter() { - match decode_contract_event_batch( - &subscription.metadata, - &events_decoder, - &events_transcoder, - &contracts, - batch, - ) { - Ok(events) => { - for event in events { - handler(event); - } - } - Err(err) => handler(Err(err)), - } - - if cancel - .as_ref() - .map(|cancel| cancel.try_recv().is_ok()) - .unwrap_or(false) - { - break; - } - } -} - -use crate::contract::anyhow; - -/// Consumes a raw `batch` of chain events, and returns only those that are coming from `contracts`. -/// -/// This function, somewhat confusingly, returns a `Result>>` - this is to represent -/// the fact that an error might occur both while decoding the whole batch and for each event. This -/// is unwrapped in [listen_contract_events] and doesn't leak outside this module. -fn decode_contract_event_batch( - metadata: &Metadata, - events_decoder: &EventsDecoder, - events_transcoder: &Transcoder, - contracts: &HashMap, - batch: String, -) -> Result>> { - let mut results = vec![]; - - let batch = batch.replacen("0x", "", 1); - let bytes = hex::decode(batch)?; - let events = events_decoder - .decode_events(&mut bytes.as_slice()) - .map_err(|err| anyhow!("{:?}", err))?; - - for (_phase, raw_event) in events { - match raw_event { - Raw::Error(err) => results.push(Err(anyhow!("{:?}", err))), - Raw::Event(event) => { - if event.pallet == "Contracts" && event.variant == "ContractEmitted" { - results.push(decode_contract_event( - metadata, - contracts, - events_transcoder, - event, - )) - } - } - } - } - - Ok(results) -} - -fn decode_contract_event( - metadata: &Metadata, - contracts: &HashMap, - events_transcoder: &Transcoder, - event: RawEvent, -) -> Result { - let event_metadata = metadata - .event(event.pallet_index, event.variant_index) - .map_err(|err| anyhow!("{:?}", err))?; - - let parse_pointer = &mut event.data.0.as_slice(); - let mut raw_data = None; - let mut contract_address = None; - - for field in event_metadata.variant().fields() { - if field.name() == Some(&"data".to_string()) { - raw_data = Some(<&[u8]>::clone(parse_pointer)); - } else { - let field_value = events_transcoder.decode(field.ty().id(), parse_pointer); - - if field.name() == Some(&"contract".to_string()) { - contract_address = field_value.ok(); - } - } - } - - if let Some(Value::Literal(address)) = contract_address { - let address = AccountId32::from_string(&address)?; - let contract_metadata = contracts - .get(&address) - .context("Event from unknown contract")?; - - let mut raw_data = raw_data.context("Event data field not found")?; - let event_data = ContractMessageTranscoder::new(contract_metadata) - .decode_contract_event(&mut raw_data) - .context("Failed to decode contract event")?; - - build_event(address, event_data) - } else { - bail!("Contract event did not contain contract address"); - } -} - -fn build_event(address: AccountId32, event_data: Value) -> Result { - match event_data { - Value::Map(map) => Ok(ContractEvent { - contract: address, - ident: map.ident(), - data: map - .iter() - .map(|(key, value)| (key.to_string(), value.clone())) - .collect(), - }), - _ => bail!("Contract event data is not a map"), - } -} diff --git a/aleph-client/src/contract/mod.rs b/aleph-client/src/contract/mod.rs index 035008fd42..b1b7db75b9 100644 --- a/aleph-client/src/contract/mod.rs +++ b/aleph-client/src/contract/mod.rs @@ -6,7 +6,7 @@ //! ```no_run //! # use anyhow::{Result, Context}; //! # use sp_core::crypto::AccountId32; -//! # use aleph_client::{Connection, SignedConnection}; +//! # use aleph_client::{AccountId, Connection, SignedConnection}; //! # use aleph_client::contract::ContractInstance; //! # use aleph_client::contract::util::to_u128; //! # @@ -16,7 +16,7 @@ //! } //! //! impl PSP22TokenInstance { -//! fn new(address: AccountId32, metadata_path: &Option) -> Result { +//! fn new(address: AccountId, metadata_path: &Option) -> Result { //! let metadata_path = metadata_path //! .as_ref() //! .context("PSP22Token metadata not set.")?; @@ -25,7 +25,7 @@ //! }) //! } //! -//! fn transfer(&self, conn: &SignedConnection, to: AccountId32, amount: u128) -> Result<()> { +//! fn transfer(&self, conn: &SignedConnection, to: AccountId, amount: u128) -> Result<()> { //! self.contract.contract_exec( //! conn, //! "PSP22::transfer", @@ -33,7 +33,7 @@ //! ) //! } //! -//! fn balance_of(&self, conn: &Connection, account: AccountId32) -> Result { +//! fn balance_of(&self, conn: &Connection, account: AccountId) -> Result { //! to_u128(self.contract.contract_read( //! conn, //! "PSP22::balance_of", @@ -43,7 +43,6 @@ //! } //! ``` -pub mod event; pub mod util; use std::{ @@ -52,18 +51,20 @@ use std::{ }; use anyhow::{anyhow, Context, Result}; +use codec::{Compact, Decode}; use contract_metadata::ContractMetadata; -use contract_transcode::{ContractMessageTranscoder, Value}; +use contract_transcode::ContractMessageTranscoder; use ink_metadata::{InkProject, MetadataVersioned}; -use serde_json::{from_reader, from_str, from_value, json}; -use sp_core::crypto::AccountId32; -use substrate_api_client::{compose_extrinsic, GenericAddress, XtStatus}; +use serde_json::{from_reader, from_value}; -use crate::{try_send_xt, AnyConnection, SignedConnection}; +use crate::{ + pallets::contract::{ContractCallArgs, ContractRpc, ContractsUserApi}, + AccountId, Connection, SignedConnection, TxStatus, +}; /// Represents a contract instantiated on the chain. pub struct ContractInstance { - address: AccountId32, + address: AccountId, ink_project: InkProject, } @@ -71,10 +72,10 @@ impl ContractInstance { const MAX_READ_GAS: u64 = 500000000000u64; const MAX_GAS: u64 = 10000000000u64; const PAYABLE_VALUE: u64 = 0u64; - const STORAGE_FEE_LIMIT: Option = None; + const STORAGE_FEE_LIMIT: Option> = None; /// Creates a new contract instance under `address` with metadata read from `metadata_path`. - pub fn new(address: AccountId32, metadata_path: &str) -> Result { + pub fn new(address: AccountId, metadata_path: &str) -> Result { Ok(Self { address, ink_project: load_metadata(metadata_path)?, @@ -82,7 +83,7 @@ impl ContractInstance { } /// The address of this contract instance. - pub fn address(&self) -> &AccountId32 { + pub fn address(&self) -> &AccountId { &self.address } @@ -92,84 +93,60 @@ impl ContractInstance { } /// Reads the value of a read-only, 0-argument call via RPC. - pub fn contract_read0(&self, conn: &C, message: &str) -> Result { - self.contract_read(conn, message, &[]) + pub async fn contract_read0(&self, conn: &Connection, message: &str) -> Result { + self.contract_read(conn, message, &[]).await } /// Reads the value of a read-only call via RPC. - pub fn contract_read( + pub async fn contract_read( &self, - conn: &C, + conn: &Connection, message: &str, args: &[&str], - ) -> Result { + ) -> Result { let payload = self.encode(message, args)?; - let request = self.contract_read_request(&payload); - let response = conn - .as_connection() - .get_request(request)? - .context("RPC request error - there may be more info in node logs.")?; - let response_data = from_str::(&response)?; - let hex_data = response_data["result"]["Ok"]["data"] - .as_str() - .context("Contract response data not found - the contract address might be invalid.")?; - self.decode_response(message, hex_data) + let args = ContractCallArgs { + origin: self.address.clone(), + dest: self.address.clone(), + value: 0, + gas_limit: Self::MAX_READ_GAS, + input_data: payload, + }; + conn.call_and_get(args) + .await + .context("RPC request error - there may be more info in node logs.") } /// Executes a 0-argument contract call. - pub fn contract_exec0(&self, conn: &SignedConnection, message: &str) -> Result<()> { - self.contract_exec(conn, message, &[]) + pub async fn contract_exec0(&self, conn: &SignedConnection, message: &str) -> Result<()> { + self.contract_exec(conn, message, &[]).await } /// Executes a contract call. - pub fn contract_exec( + pub async fn contract_exec( &self, conn: &SignedConnection, message: &str, args: &[&str], ) -> Result<()> { let data = self.encode(message, args)?; - let xt = compose_extrinsic!( - conn.as_connection(), - "Contracts", - "call", - GenericAddress::Id(self.address.clone()), - Compact(Self::PAYABLE_VALUE), - Compact(Self::MAX_GAS), + conn.call( + self.address.clone(), + Self::PAYABLE_VALUE as u128, + Self::MAX_GAS, Self::STORAGE_FEE_LIMIT, - data - ); + data, + TxStatus::InBlock, + ) + .await + .context("Failed to exec contract message")?; - try_send_xt(conn, xt, Some("Contracts call"), XtStatus::InBlock) - .context("Failed to exec contract message")?; Ok(()) } - fn contract_read_request(&self, payload: &[u8]) -> serde_json::Value { - let payload = hex::encode(payload); - json!({ - "jsonrpc": "2.0", - "method": "contracts_call", - "params": [{ - "origin": self.address, - "dest": self.address, - "value": 0, - "gasLimit": Self::MAX_READ_GAS, - "inputData": payload - }], - "id": 1 - }) - } - fn encode(&self, message: &str, args: &[&str]) -> Result> { ContractMessageTranscoder::new(&self.ink_project).encode(message, args) } - - fn decode_response(&self, from: &str, contract_response: &str) -> Result { - let contract_response = contract_response.trim_start_matches("0x"); - let bytes = hex::decode(contract_response)?; - ContractMessageTranscoder::new(&self.ink_project).decode_return(from, &mut bytes.as_slice()) - } } impl Debug for ContractInstance { diff --git a/aleph-client/src/contract/util.rs b/aleph-client/src/contract/util.rs index d925e7e386..d2732fb533 100644 --- a/aleph-client/src/contract/util.rs +++ b/aleph-client/src/contract/util.rs @@ -2,7 +2,7 @@ use anyhow::{anyhow, Result}; use contract_transcode::Value; -use sp_core::crypto::Ss58Codec; +use subxt::ext::sp_core::crypto::Ss58Codec; use crate::AccountId; diff --git a/aleph-client/src/debug/aleph.rs b/aleph-client/src/debug/aleph.rs deleted file mode 100644 index 543a731ae2..0000000000 --- a/aleph-client/src/debug/aleph.rs +++ /dev/null @@ -1,20 +0,0 @@ -use primitives::AuthorityId; - -use crate::{ - debug::{element_prompt, entry_prompt, pallet_prompt}, - ReadStorage, -}; - -pub fn print_storage(connection: &C) { - let authorities: Vec = connection.read_storage_value("Aleph", "Authorities"); - - println!("{}", pallet_prompt("Aleph")); - println!("{}", entry_prompt("Authorities")); - - for auth in authorities { - println!( - "{}", - element_prompt(format!("\tAuthority {:?}", auth.to_string())) - ); - } -} diff --git a/aleph-client/src/debug/elections.rs b/aleph-client/src/debug/elections.rs deleted file mode 100644 index 1889a82304..0000000000 --- a/aleph-client/src/debug/elections.rs +++ /dev/null @@ -1,20 +0,0 @@ -use primitives::AuthorityId; - -use crate::{ - debug::{element_prompt, entry_prompt, pallet_prompt}, - ReadStorage, -}; - -pub fn print_storage(connection: &C) { - let members: Vec = connection.read_storage_value("Elections", "Members"); - - println!("{}", pallet_prompt("Elections")); - println!("{}", entry_prompt("Members")); - - for member in members { - println!( - "{}", - element_prompt(format!("\tMember {:?}", member.to_string())) - ); - } -} diff --git a/aleph-client/src/debug/mod.rs b/aleph-client/src/debug/mod.rs deleted file mode 100644 index 59cfa42017..0000000000 --- a/aleph-client/src/debug/mod.rs +++ /dev/null @@ -1,23 +0,0 @@ -use crate::ReadStorage; - -mod aleph; -mod elections; -mod treasury; - -fn pallet_prompt(name: &'static str) -> String { - format!("-----------{}-----------", name) -} - -fn entry_prompt(name: &'static str) -> String { - format!("----{}", name) -} - -fn element_prompt(el: String) -> String { - format!("\t{}", el) -} - -pub fn print_storages(connection: &C) { - treasury::print_storage(connection); - aleph::print_storage(connection); - elections::print_storage(connection); -} diff --git a/aleph-client/src/debug/treasury.rs b/aleph-client/src/debug/treasury.rs deleted file mode 100644 index 8286a80122..0000000000 --- a/aleph-client/src/debug/treasury.rs +++ /dev/null @@ -1,42 +0,0 @@ -use log::trace; -use pallet_treasury::{Proposal, ProposalIndex}; -use sp_core::crypto::AccountId32; -use substrate_api_client::Balance; - -use crate::{ - debug::{element_prompt, entry_prompt, pallet_prompt}, - ReadStorage, -}; - -const PALLET: &str = "Treasury"; - -pub fn print_storage(connection: &C) { - let proposal_count: u32 = connection.read_storage_value_or_default(PALLET, "ProposalCount"); - let approvals: Vec = - connection.read_storage_value_or_default(PALLET, "Approvals"); - - println!("{}", pallet_prompt(PALLET)); - println!("{}: {}", entry_prompt("ProposalCount"), proposal_count); - println!(); - println!("{}", entry_prompt("Approvals")); - for x in approvals { - println!( - "{}", - element_prompt(format!("Proposal id {} was approved ", x)) - ); - } - println!(); - println!("{}", entry_prompt("Proposals")); - for x in 0..=proposal_count { - let p: Option> = connection - .read_storage_map(PALLET, "Proposals", x, None) - .unwrap(); - - if let Some(p) = p { - println!("{}", element_prompt(format!("\tProposalId {}: {:?}", x, p))); - } else { - trace!("No proposal with id {:?} in the storage", x) - } - } - println!(); -} diff --git a/aleph-client/src/elections.rs b/aleph-client/src/elections.rs deleted file mode 100644 index 0735c6d916..0000000000 --- a/aleph-client/src/elections.rs +++ /dev/null @@ -1,121 +0,0 @@ -use primitives::{ - BanConfig, BanInfo, CommitteeSeats, EraIndex, EraValidators, SessionCount, SessionIndex, -}; -use sp_core::H256; -use substrate_api_client::{compose_call, compose_extrinsic, XtStatus}; - -use crate::{ - get_session_first_block, send_xt, AccountId, AnyConnection, ReadStorage, RootConnection, -}; - -const PALLET: &str = "Elections"; - -pub fn get_committee_seats( - connection: &C, - block_hash: Option, -) -> CommitteeSeats { - connection.read_storage_value_at_block(PALLET, "CommitteeSize", block_hash) -} - -pub fn get_next_era_committee_seats(connection: &C) -> CommitteeSeats { - connection.read_storage_value(PALLET, "NextEraCommitteeSize") -} - -pub fn get_validator_block_count( - connection: &C, - account_id: &AccountId, - block_hash: Option, -) -> Option { - connection.read_storage_map(PALLET, "SessionValidatorBlockCount", account_id, block_hash) -} - -pub fn get_current_era_validators(connection: &C) -> EraValidators { - connection.read_storage_value(PALLET, "CurrentEraValidators") -} - -pub fn get_current_era_reserved_validators(connection: &C) -> Vec { - get_current_era_validators(connection).reserved -} - -pub fn get_current_era_non_reserved_validators(connection: &C) -> Vec { - get_current_era_validators(connection).non_reserved -} - -pub fn get_next_era_reserved_validators(connection: &C) -> Vec { - connection.read_storage_value(PALLET, "NextEraReservedValidators") -} - -pub fn get_next_era_non_reserved_validators(connection: &C) -> Vec { - connection.read_storage_value(PALLET, "NextEraNonReservedValidators") -} - -pub fn get_next_era_validators(connection: &C) -> EraValidators { - let reserved: Vec = - connection.read_storage_value(PALLET, "NextEraReservedValidators"); - let non_reserved: Vec = - connection.read_storage_value(PALLET, "NextEraNonReservedValidators"); - EraValidators { - reserved, - non_reserved, - } -} - -pub fn get_era_validators( - connection: &C, - session: SessionIndex, -) -> EraValidators { - let block_hash = get_session_first_block(connection, session); - connection.read_storage_value_at_block(PALLET, "CurrentEraValidators", Some(block_hash)) -} - -pub fn get_ban_config(connection: &C) -> BanConfig { - connection.read_storage_value(PALLET, "BanConfig") -} - -pub fn get_underperformed_validator_session_count( - connection: &C, - account_id: &AccountId, -) -> SessionCount { - connection - .read_storage_map( - PALLET, - "UnderperformedValidatorSessionCount", - account_id, - None, - ) - .unwrap_or(0) -} - -pub fn get_ban_reason_for_validator( - connection: &C, - account_id: &AccountId, -) -> Option { - connection.read_storage_map(PALLET, "Banned", account_id, None) -} - -pub fn change_ban_config( - sudo_connection: &RootConnection, - minimal_expected_performance: Option, - underperformed_session_count_threshold: Option, - clean_session_counter_delay: Option, - ban_period: Option, - status: XtStatus, -) { - let call = compose_call!( - sudo_connection.as_connection().metadata, - PALLET, - "set_ban_config", - minimal_expected_performance, - underperformed_session_count_threshold, - clean_session_counter_delay, - ban_period - ); - let xt = compose_extrinsic!( - sudo_connection.as_connection(), - "Sudo", - "sudo_unchecked_weight", - call, - 0_u64 - ); - send_xt(sudo_connection, xt, Some("set_ban_config"), status); -} diff --git a/aleph-client/src/fee.rs b/aleph-client/src/fee.rs deleted file mode 100644 index 0a4e536bdc..0000000000 --- a/aleph-client/src/fee.rs +++ /dev/null @@ -1,33 +0,0 @@ -use substrate_api_client::Balance; - -use crate::{AnyConnection, BalanceTransfer, FeeInfo, GetTxInfo, ReadStorage, SignedConnection}; - -impl GetTxInfo<::TransferTx> for SignedConnection { - fn get_tx_info(&self, tx: &::TransferTx) -> FeeInfo { - let tx = self.create_transfer_extrinsic(tx.clone()); - let tx_hex = tx.hex_encode(); - let unadjusted_weight = self - .as_connection() - .get_payment_info(&tx_hex, None) - .expect("Should access payment info") - .expect("Payment info should be present") - .weight as Balance; - - let fee = self - .as_connection() - .get_fee_details(&tx_hex, None) - .expect("Should access fee details") - .expect("Should read fee details"); - let inclusion_fee = fee.inclusion_fee.expect("Transaction should be payable"); - - FeeInfo { - fee_without_weight: inclusion_fee.base_fee + inclusion_fee.len_fee + fee.tip, - unadjusted_weight, - adjusted_weight: inclusion_fee.adjusted_weight_fee, - } - } -} - -pub fn get_next_fee_multiplier(connection: &C) -> u128 { - connection.read_storage_value("TransactionPayment", "NextFeeMultiplier") -} diff --git a/aleph-client/src/finalization.rs b/aleph-client/src/finalization.rs deleted file mode 100644 index 78925e7d0b..0000000000 --- a/aleph-client/src/finalization.rs +++ /dev/null @@ -1,25 +0,0 @@ -use substrate_api_client::{compose_call, compose_extrinsic, AccountId, XtStatus}; - -use crate::{send_xt, AnyConnection, RootConnection}; - -/// Sets the emergency finalizer to the provided `AccountId`. -pub fn set_emergency_finalizer( - connection: &RootConnection, - finalizer: AccountId, - status: XtStatus, -) { - let set_emergency_finalizer_call = compose_call!( - connection.as_connection().metadata, - "Aleph", - "set_emergency_finalizer", - finalizer - ); - let xt = compose_extrinsic!( - connection.as_connection(), - "Sudo", - "sudo_unchecked_weight", - set_emergency_finalizer_call, - 0_u64 - ); - send_xt(connection, xt, Some("set_emergency_finalizer"), status); -} diff --git a/aleph-client/src/lib.rs b/aleph-client/src/lib.rs index 7d83794e0b..b6962ee172 100644 --- a/aleph-client/src/lib.rs +++ b/aleph-client/src/lib.rs @@ -1,472 +1,52 @@ -use std::{default::Default, error::Error as StdError, fmt::Debug, thread::sleep, time::Duration}; +extern crate core; -use ac_primitives::{PlainTip, PlainTipExtrinsicParamsBuilder, SubstrateDefaultSignedExtra}; -pub use account::{get_free_balance, locks}; -pub use balances::total_issuance; -use codec::{Decode, Encode}; -pub use debug::print_storages; -pub use elections::{ - change_ban_config, get_ban_config, get_ban_reason_for_validator, get_committee_seats, - get_current_era_non_reserved_validators, get_current_era_reserved_validators, - get_current_era_validators, get_era_validators, get_next_era_committee_seats, - get_next_era_non_reserved_validators, get_next_era_reserved_validators, - get_next_era_validators, get_underperformed_validator_session_count, get_validator_block_count, +pub use subxt::ext::sp_core::Pair; +use subxt::{ + ext::sp_core::{ed25519, sr25519}, + tx::PairSigner, + OnlineClient, PolkadotConfig, }; -pub use fee::get_next_fee_multiplier; -pub use finalization::set_emergency_finalizer as finalization_set_emergency_finalizer; -use log::{info, warn}; -pub use multisig::{ - compute_call_hash, perform_multisig_with_threshold_1, MultisigError, MultisigParty, - SignatureAggregation, -}; -pub use primitives::{Balance, BlockHash, BlockNumber, Header}; -pub use rpc::{emergency_finalize, rotate_keys, rotate_keys_raw_result, state_query_storage_at}; -pub use session::{ - change_next_era_reserved_validators, change_validators, get_current_session, - get_current_validator_count, get_current_validators, get_next_session_keys, get_session, - get_session_first_block, get_session_period, get_validators_for_session, set_keys, - wait_for as wait_for_session, wait_for_at_least as wait_for_at_least_session, - Keys as SessionKeys, -}; -use sp_core::{ed25519, sr25519, storage::StorageKey, Pair, H256}; -pub use staking::{ - batch_bond as staking_batch_bond, batch_nominate as staking_batch_nominate, - bond as staking_bond, bond_extra_stake, bonded as staking_bonded, - chill_validator as staking_chill_validator, chill_validators as staking_chill_validators, - force_new_era as staking_force_new_era, get_active_era, get_current_era, get_era, - get_era_reward_points, get_eras_stakers_storage_key, get_exposure, get_minimum_validator_count, - get_payout_for_era, get_sessions_per_era, get_stakers_as_storage_keys, - get_stakers_as_storage_keys_from_storage_key, ledger as staking_ledger, - multi_bond as staking_multi_bond, nominate as staking_nominate, payout_stakers, - payout_stakers_and_assert_locked_balance, set_staking_limits as staking_set_staking_limits, - validate as staking_validate, wait_for_at_least_era, wait_for_era_completion, - wait_for_full_era_completion, wait_for_next_era, RewardPoint, StakingLedger, -}; -pub use substrate_api_client::{self, AccountId, XtStatus}; -use substrate_api_client::{ - rpc::ws_client::WsRpcClient, std::error::Error, Api, ApiResult, PlainTipExtrinsicParams, - RpcClient, UncheckedExtrinsicV4, -}; -pub use system::set_code; -pub use transfer::{ - batch_transfer as balances_batch_transfer, transfer as balances_transfer, TransferTransaction, -}; -pub use treasury::{ - approve as approve_treasury_proposal, proposals_counter as treasury_proposals_counter, - propose as make_treasury_proposal, reject as reject_treasury_proposal, staking_treasury_payout, - treasury_account, -}; -pub use version_upgrade::{schedule_upgrade, Version}; -pub use vesting::{ - get_schedules, merge_schedules, vest, vest_other, vested_transfer, VestingError, - VestingSchedule, -}; -pub use waiting::{wait_for_event, wait_for_finalized_block}; -mod account; -mod balances; +use crate::api::runtime_types::aleph_runtime::Call; +// generated by running `subxt codegen --derive Clone Debug Eq PartialEq | rustfmt --edition=2018 > src/aleph_zero.rs` +mod aleph_zero; +mod connections; pub mod contract; -mod debug; -mod elections; -mod fee; -mod finalization; -mod multisig; -mod rpc; -mod session; -mod staking; -mod system; -mod transfer; -mod treasury; -mod version_upgrade; -mod vesting; -mod waiting; - -pub trait FromStr: Sized { - type Err; - - fn from_str(s: &str) -> Result; -} - -impl FromStr for WsRpcClient { - type Err = (); +pub mod pallets; +pub mod rpc; +mod runtime_types; +pub mod utility; +pub mod waiting; - fn from_str(url: &str) -> Result { - Ok(WsRpcClient::new(url)) - } -} +pub use aleph_zero::api; +pub use runtime_types::*; -pub type KeyPair = sr25519::Pair; +pub type AlephConfig = PolkadotConfig; pub type AlephKeyPair = ed25519::Pair; -pub type ExtrinsicParams = PlainTipExtrinsicParams; -pub type Connection = Api; -pub type Extrinsic = UncheckedExtrinsicV4>; - -/// Common abstraction for different types of connections. -pub trait AnyConnection: Clone + Send { - /// 'Castability' to `Connection`. - /// - /// Direct casting is often more handy than generic `.into()`. Justification: `Connection` - /// objects are often passed to some macro like `compose_extrinsic!` and thus there is not - /// enough information for type inferring required for `Into`. - fn as_connection(&self) -> Connection; -} - -pub trait ReadStorage: AnyConnection { - /// Reads value from storage. Panics if it couldn't be read. - fn read_storage_value(&self, pallet: &'static str, key: &'static str) -> T { - self.read_storage_value_or_else(pallet, key, || { - panic!("Value is `None` or couldn't have been decoded") - }) - } - - /// Reads value from storage at given block (empty means `best known`). Panics if it couldn't be read. - fn read_storage_value_at_block( - &self, - pallet: &'static str, - key: &'static str, - block_hash: Option, - ) -> T { - self.read_storage_value_at_block_or_else(pallet, key, block_hash, || { - panic!( - "Retrieved storage value ({}/{}) was equal `null`", - pallet, key - ) - }) - } - - /// Reads value from storage. In case value is `None` or couldn't have been decoded, result of - /// `fallback` is returned. - fn read_storage_value_or_else T, T: Decode>( - &self, - pallet: &'static str, - key: &'static str, - fallback: F, - ) -> T { - self.read_storage_value_at_block_or_else(pallet, key, None, fallback) - } - - /// Reads value from storage from a given block. In case value is `None` or couldn't have been decoded, result of - /// `fallback` is returned. - fn read_storage_value_at_block_or_else T, T: Decode>( - &self, - pallet: &'static str, - key: &'static str, - block_hash: Option, - fallback: F, - ) -> T { - self.as_connection() - .get_storage_value(pallet, key, block_hash) - .unwrap_or_else(|e| { - panic!( - "Unable to retrieve a storage value {}/{} at block {:#?}: {}", - pallet, key, block_hash, e - ) - }) - .unwrap_or_else(fallback) - } - - /// Reads value from storage. In case value is `None` or couldn't have been decoded, the default - /// value is returned. - fn read_storage_value_or_default( - &self, - pallet: &'static str, - key: &'static str, - ) -> T { - self.read_storage_value_or_else(pallet, key, Default::default) - } - - /// Reads pallet's constant from metadata. Panics if it couldn't be read. - fn read_constant(&self, pallet: &'static str, constant: &'static str) -> T { - self.read_constant_or_else(pallet, constant, || { - panic!( - "Constant `{}::{}` should be present and decodable", - pallet, constant - ) - }) - } - - /// Reads pallet's constant from metadata. In case value is `None` or couldn't have been - /// decoded, result of `fallback` is returned. - fn read_constant_or_else T, T: Decode>( - &self, - pallet: &'static str, - constant: &'static str, - fallback: F, - ) -> T { - self.as_connection() - .get_constant(pallet, constant) - .unwrap_or_else(|_| fallback()) - } - - /// Reads pallet's constant from metadata. In case value is `None` or couldn't have been - /// decoded, the default value is returned. - fn read_constant_or_default( - &self, - pallet: &'static str, - constant: &'static str, - ) -> T { - self.read_constant_or_else(pallet, constant, Default::default) - } - - fn read_storage_map( - &self, - pallet: &'static str, - map_name: &'static str, - map_key: K, - block_hash: Option, - ) -> Option { - self.as_connection() - .get_storage_map(pallet, map_name, map_key.clone(), block_hash) - .unwrap_or_else(|e| panic!("Unable to retrieve a storage map for pallet={} map_name={} map_key={:#?} block_hash={:#?}: {}", pallet, map_name, &map_key, block_hash, e)) - } -} - -impl ReadStorage for C {} - -pub trait BalanceTransfer { - type TransferTx; - type Error: StdError; - - fn create_transfer_tx(&self, account: AccountId, amount: Balance) -> Self::TransferTx; - fn transfer(&self, tx: Self::TransferTx, status: XtStatus) - -> Result, Self::Error>; -} - -pub trait BatchTransactions { - type Error: StdError; - - fn batch_and_send_transactions<'a>( - &self, - transactions: impl IntoIterator, - status: XtStatus, - ) -> Result, Self::Error> - where - Tx: 'a; -} - -#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Default)] -pub struct FeeInfo { - pub fee_without_weight: Balance, - pub unadjusted_weight: Balance, - pub adjusted_weight: Balance, -} - -pub trait GetTxInfo { - fn get_tx_info(&self, tx: &Tx) -> FeeInfo; -} - -pub trait CallSystem { - type Error: StdError; - - fn fill_block(&self, target_ratio: u32, status: XtStatus) -> Result<(), Self::Error>; -} - -pub trait ManageParams { - fn set_tip(self, tip: Balance) -> Self; -} - -impl ManageParams for SignedConnection { - fn set_tip(self, tip: Balance) -> Self { - let xt_params = PlainTipExtrinsicParamsBuilder::new().tip(tip); - let SignedConnection { mut inner, signer } = self; - inner = inner.set_extrinsic_params_builder(xt_params); - Self { inner, signer } - } -} - -impl AnyConnection for Connection { - fn as_connection(&self) -> Connection { - self.clone() - } -} - -/// A connection that is signed. -#[derive(Clone)] -pub struct SignedConnection { - inner: Connection, - signer: KeyPair, -} - -impl SignedConnection { - pub fn new(address: &str, signer: KeyPair) -> Self { - let unsigned = create_connection(address); - Self { - inner: unsigned.set_signer(signer.clone()), - signer, - } - } - - /// Semantically equivalent to `connection.set_signer(signer)`. - pub fn from_any_connection(connection: &C, signer: KeyPair) -> Self { - Self { - inner: connection - .clone() - .as_connection() - .set_signer(signer.clone()), - signer, - } - } - - /// A signer corresponding to `self.inner`. - pub fn signer(&self) -> KeyPair { - self.signer.clone() - } -} - -impl AnyConnection for SignedConnection { - fn as_connection(&self) -> Connection { - self.inner.clone() - } -} - -/// We can always try casting `AnyConnection` to `SignedConnection`, which fails if it is not -/// signed. -impl TryFrom for SignedConnection { - type Error = &'static str; - - fn try_from(connection: Connection) -> Result { - if let Some(signer) = connection.signer.clone() { - Ok(Self::from_any_connection(&connection, signer)) - } else { - Err("Connection should be signed.") - } - } -} - -/// A connection that is signed by the root account. -/// -/// Since verifying signature is expensive (requires interaction with the node for checking -/// storage), there is no guarantee that in fact the signer has sudo access. Hence, effectively it -/// is just a type wrapper requiring explicit casting. -#[derive(Clone)] -pub struct RootConnection { - inner: SignedConnection, -} - -impl RootConnection { - pub fn new(address: &str, root: KeyPair) -> Self { - Self { - inner: SignedConnection::new(address, root), - } - } - - /// A direct casting is often more handy than a generic `.into()`. - pub fn as_signed(&self) -> SignedConnection { - self.inner.clone() - } -} +pub type RawKeyPair = sr25519::Pair; +pub type KeyPair = PairSigner; +pub type AccountId = subxt::ext::sp_core::crypto::AccountId32; +pub type Client = OnlineClient; -impl From for RootConnection { - fn from(signed: SignedConnection) -> Self { - Self { inner: signed } - } -} - -impl AnyConnection for RootConnection { - fn as_connection(&self) -> Connection { - self.as_signed().as_connection() - } -} - -pub fn create_connection(address: &str) -> Connection { - create_custom_connection(address).expect("Connection should be created") -} +pub use connections::{Connection, RootConnection, SignedConnection, SudoCall}; -#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] -enum Protocol { - Ws, - Wss, +#[derive(Copy, Clone)] +pub enum TxStatus { + InBlock, + Finalized, } -impl Default for Protocol { - fn default() -> Self { - Protocol::Ws - } -} - -impl ToString for Protocol { - fn to_string(&self) -> String { - match self { - Protocol::Ws => String::from("ws://"), - Protocol::Wss => String::from("wss://"), - } - } -} - -/// Unless `address` already contains protocol, we prepend to it `ws://`. -fn ensure_protocol(address: &str) -> String { - if address.starts_with(&Protocol::Ws.to_string()) - || address.starts_with(&Protocol::Wss.to_string()) - { - return address.to_string(); - } - format!("{}{}", Protocol::default().to_string(), address) -} - -pub fn create_custom_connection( - address: &str, -) -> Result, ::Err> { - loop { - let client = Client::from_str(&ensure_protocol(address))?; - match Api::::new(client) { - Ok(api) => return Ok(api), - Err(why) => { - warn!( - "[+] Can't create_connection because {:?}, will try again in 1s", - why - ); - sleep(Duration::from_millis(1000)); - } - } - } -} - -/// `panic`able utility wrapper for `try_send_xt`. -pub fn send_xt( - connection: &C, - xt: Extrinsic, - xt_name: Option<&'static str>, - xt_status: XtStatus, -) -> Option { - try_send_xt(connection, xt, xt_name, xt_status).expect("Should manage to send extrinsic") -} - -/// Sends transaction `xt` using `connection`. -/// -/// If `tx_status` is either `Finalized` or `InBlock`, additionally returns hash of the containing -/// block. `xt_name` is used only for logging purposes. -/// -/// Recoverable. -pub fn try_send_xt( - connection: &C, - xt: Extrinsic, - xt_name: Option<&'static str>, - xt_status: XtStatus, -) -> ApiResult> { - let hash = connection - .as_connection() - .send_extrinsic(xt.hex_encode(), xt_status)? - .ok_or_else(|| Error::Other(String::from("Could not get tx/block hash").into()))?; - - match xt_status { - XtStatus::Finalized | XtStatus::InBlock => { - info!(target: "aleph-client", - "Transaction `{}` was included in block with hash {}.", - xt_name.unwrap_or_default(), hash); - Ok(Some(hash)) - } - // Other variants either do not return (see https://github.com/scs/substrate-api-client/issues/175) - // or return xt hash, which is kinda useless here. - _ => Ok(None), - } +pub fn keypair_from_string(seed: &str) -> KeyPair { + let pair = sr25519::Pair::from_string(seed, None).expect("Can't create pair from seed value"); + KeyPair::new(pair) } -pub fn keypair_from_string(seed: &str) -> KeyPair { - KeyPair::from_string(seed, None).expect("Can't create pair from seed value") +pub fn raw_keypair_from_string(seed: &str) -> RawKeyPair { + sr25519::Pair::from_string(seed, None).expect("Can't create pair from seed value") } pub fn aleph_keypair_from_string(seed: &str) -> AlephKeyPair { - AlephKeyPair::from_string(seed, None).expect("Can't create aleph pair from seed value") + ed25519::Pair::from_string(seed, None).expect("Can't create pair from seed value") } pub fn account_from_keypair

(keypair: &P) -> AccountId @@ -476,48 +56,3 @@ where { AccountId::from(keypair.public()) } - -fn storage_key(module: &str, version: &str) -> [u8; 32] { - let pallet_name = sp_core::hashing::twox_128(module.as_bytes()); - let postfix = sp_core::hashing::twox_128(version.as_bytes()); - let mut final_key = [0u8; 32]; - final_key[..16].copy_from_slice(&pallet_name); - final_key[16..].copy_from_slice(&postfix); - final_key -} - -/// Computes hash of given pallet's call. You can use that to pass result to `state.getKeys` RPC call. -/// * `pallet` name of the pallet -/// * `call` name of the pallet's call -/// -/// # Example -/// ``` -/// use aleph_client::get_storage_key; -/// -/// let staking_nominate_storage_key = get_storage_key("Staking", "Nominators"); -/// assert_eq!(staking_nominate_storage_key, String::from("5f3e4907f716ac89b6347d15ececedca9c6a637f62ae2af1c7e31eed7e96be04")); -/// ``` -pub fn get_storage_key(pallet: &str, call: &str) -> String { - let bytes = storage_key(pallet, call); - let storage_key = StorageKey(bytes.into()); - hex::encode(storage_key.0) -} - -pub fn get_block_hash(connection: &C, block_number: BlockNumber) -> BlockHash { - connection - .as_connection() - .get_block_hash(Some(block_number)) - .expect("Could not fetch block hash") - .unwrap_or_else(|| { - panic!("Failed to obtain block hash for block {}.", block_number); - }) -} - -pub fn get_current_block_number(connection: &C) -> BlockNumber { - connection - .as_connection() - .get_header::

(None) - .expect("Could not fetch header") - .expect("Block exists; qed") - .number -} diff --git a/aleph-client/src/multisig.rs b/aleph-client/src/multisig.rs deleted file mode 100644 index c98481a2e7..0000000000 --- a/aleph-client/src/multisig.rs +++ /dev/null @@ -1,480 +0,0 @@ -use std::{ - collections::HashSet, - fmt::{Debug, Formatter}, -}; - -use anyhow::{ensure, Result}; -use codec::{Decode, Encode}; -use log::{error, info}; -use primitives::Balance; -use sp_core::{blake2_256, crypto::AccountId32}; -use sp_runtime::traits::TrailingZeroInput; -use substrate_api_client::{compose_extrinsic, XtStatus::Finalized}; -use thiserror::Error; - -use crate::{ - account_from_keypair, try_send_xt, AccountId, AnyConnection, BlockNumber, Extrinsic, - SignedConnection, H256, -}; - -/// `MAX_WEIGHT` is the extrinsic parameter specifying upperbound for executing approved call. -/// Unless the approval is final, it has no effect. However, if due to your approval the -/// threshold is reached, you will be charged for execution process. By setting `max_weight` -/// low enough, you can avoid paying and left it for another member. -/// -/// However, passing such parameter everytime is cumbersome and introduces the need of either -/// estimating call weight or setting very high universal bound at every caller side. -/// Thus, we keep a fairly high limit, which should cover almost any call (0.05 token). -const MAX_WEIGHT: u64 = 500_000_000; - -/// Gathers all possible errors from this module. -#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Error)] -pub enum MultisigError { - #[error("👪❌ Threshold should be between 2 and {0}.")] - IncorrectThreshold(usize), - #[error("👪❌ There should be at least 2 unique members.")] - TooFewMembers, - #[error("👪❌ There is no such member in the party.")] - NoSuchMember, - #[error("👪❌ There is no entry for this multisig aggregation in the pallet storage.")] - NoAggregationFound, - #[error("👪❌ Trying to report approval for a different call that already registered.")] - CallConflict, - #[error("👪❌ Only the author can cancel aggregation.")] - NotAuthor, - #[error("👪❌ The connection is signed by an account that doesn't match to any member.")] - NonMemberSignature, -} - -type CallHash = [u8; 32]; -type Call = Vec; -type Timepoint = pallet_multisig::Timepoint; - -type ApproveAsMultiCall = Extrinsic<( - [u8; 2], // call index - u16, // threshold - Vec, // other signatories - Option, // timepoint, `None` for initiating - CallHash, // call hash - u64, // max weight -)>; - -type AsMultiCall = Extrinsic<( - [u8; 2], // call index - u16, // threshold - Vec, // other signatories - Option, // timepoint, `None` for initiating - Call, // call - bool, // whether to store call - u64, // max weight -)>; - -type CancelAsMultiCall = Extrinsic<( - [u8; 2], // call index - u16, // threshold - Vec, // other signatories - Timepoint, // timepoint, `None` for initiating - CallHash, // call hash -)>; - -pub fn compute_call_hash(call: &Extrinsic) -> CallHash { - blake2_256(&call.function.encode()) -} - -/// Unfortunately, we have to copy this struct from the pallet. We can get such object from storage -/// but there is no way of accessing the info within nor interacting in any manner 💩. -#[derive(Clone, Decode)] -#[allow(dead_code)] -struct Multisig { - when: Timepoint, - deposit: Balance, - depositor: AccountId, - approvals: Vec, -} - -/// This represents the ongoing procedure of aggregating approvals among members -/// of multisignature party. -#[derive(Eq, PartialEq, Debug)] -pub struct SignatureAggregation { - /// The point in 'time' when the aggregation was initiated on the chain. - /// Internally it is a pair: number of the block containing initial call and the position - /// of the corresponding extrinsic within block. - /// - /// It is actually the easiest (and the chosen) way of distinguishing between - /// independent aggregations within the same party for the same call. - timepoint: Timepoint, - /// The member, who initiated the aggregation. They also had to deposit money, and they - /// are the only person with power of canceling the procedure. - /// - /// We keep just their index within the (sorted) set of members. - author: usize, - /// The hash of the target call. - call_hash: CallHash, - /// The call to be dispatched. Maybe. - call: Option, - /// We keep counting approvals, just for information. - approvers: HashSet, -} - -impl SignatureAggregation { - /// How many approvals has already been aggregated. - pub fn num_of_approvals(&self) -> usize { - self.approvers.len() - } -} - -/// `MultisigParty` is representing a multiparty entity constructed from -/// a group of accounts (`members`) and a threshold (`threshold`). -#[derive(Clone)] -pub struct MultisigParty { - /// Derived multiparty account (public key). - account: AccountId, - /// *Sorted* collection of members. - members: Vec, - /// Minimum required approvals. - threshold: u16, -} - -impl Debug for MultisigParty { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - f.debug_struct("MultisigParty") - .field("account", &self.account) - .field("threshold", &self.threshold) - .field("member count", &self.members.len()) - .finish() - } -} - -impl MultisigParty { - /// Creates new party. `members` does *not* have to be already sorted. Also: - /// - `members` must be of length between 2 and `pallet_multisig::MaxSignatories`; - /// since checking the upperbound is expensive, it is the caller's responsibility - /// to ensure it is not exceeded - /// - `members` may contain duplicates, but they are ignored and not counted to the cardinality - /// - `threshold` must be between 2 and `members.len()` - pub fn new(members: &[AccountId], threshold: u16) -> Result { - let mut members = members.to_vec(); - members.sort(); - members.dedup(); - - ensure!(2 <= members.len(), MultisigError::TooFewMembers); - ensure!( - 2 <= threshold && threshold <= members.len() as u16, - MultisigError::IncorrectThreshold(members.len()) - ); - - let account = Self::multi_account_id(&members, threshold); - Ok(Self { - account, - members, - threshold, - }) - } - - /// This method generates deterministic account id for a given set of members and a threshold. - /// `who` must be sorted, otherwise the result will be incorrect. - /// - /// It comes from pallet multisig. However, since it is an associated method for a struct - /// `pallet_multisig::Pallet` it is easier to just copy - /// these two lines. - /// - /// *Note:* if this function changes in some newer Substrate version, this code should be adjusted. - pub fn multi_account_id(who: &[AccountId], threshold: u16) -> AccountId { - let entropy = (b"modlpy/utilisuba", who, threshold).using_encoded(blake2_256); - Decode::decode(&mut TrailingZeroInput::new(entropy.as_ref())) - .expect("infinite length input; no invalid inputs for type; qed") - } - - /// Provide the address corresponding to the party (and the threshold). - pub fn get_account(&self) -> AccountId { - self.account.clone() - } - - /// This is a convenience method, as usually you may want to perform an action - /// as a particular member, without sorting their public keys on the callee side. - pub fn get_member_index(&self, member: AccountId) -> Result { - self.members - .binary_search(&member) - .map_err(|_| MultisigError::NoSuchMember.into()) - } - - /// For all extrinsics we have to sign them with the caller (representative) and pass - /// accounts of the other party members (represented). - /// - /// Assumes that `representative_idx` is a valid index for `self.members`. - fn designate_represented(&self, representative_idx: usize) -> Vec { - let mut members = self.members.clone(); - members.remove(representative_idx); - members - } - - /// Compose extrinsic for `multisig::approve_as_multi` call. - fn construct_approve_as_multi( - &self, - connection: &SignedConnection, - other_signatories: Vec, - timepoint: Option, - call_hash: CallHash, - ) -> ApproveAsMultiCall { - compose_extrinsic!( - connection.as_connection(), - "Multisig", - "approve_as_multi", - self.threshold, - other_signatories, - timepoint, - call_hash, - MAX_WEIGHT - ) - } - - /// Tries sending `xt` with `connection` and waits for its finalization. Returns the hash - /// of the containing block. - fn finalize_xt( - &self, - connection: &C, - xt: Extrinsic, - description: &'static str, - ) -> Result { - Ok(try_send_xt(connection, xt, Some(description), Finalized)? - .expect("For `Finalized` status a block hash should be returned")) - } - - /// Reads the pallet storage and takes the timestamp regarding procedure for the `self` party - /// initiated at `block_hash`. - fn get_timestamp( - &self, - connection: &C, - call_hash: &CallHash, - block_hash: H256, - ) -> Result { - let multisig: Multisig = connection - .as_connection() - .get_storage_double_map( - "Multisig", - "Multisigs", - self.account.clone(), - *call_hash, - Some(block_hash), - )? - .ok_or(MultisigError::NoAggregationFound)?; - Ok(multisig.when) - } - - /// Checks whether `connection` is signed by some member and if so, returns their index. - fn map_signer_to_member_index(&self, connection: &SignedConnection) -> Result { - self.members - .binary_search(&account_from_keypair(&connection.signer)) - .map_err(|_| MultisigError::NonMemberSignature.into()) - } - - /// Effectively starts the aggregation process by calling `approveAsMulti`. - /// - /// `connection` should be signed by some member. - pub fn initiate_aggregation_with_hash( - &self, - connection: &SignedConnection, - call_hash: CallHash, - ) -> Result { - let author_idx = self.map_signer_to_member_index(connection)?; - - let other_signatories = self.designate_represented(author_idx); - let xt = self.construct_approve_as_multi(connection, other_signatories, None, call_hash); - - let block_hash = self.finalize_xt(connection, xt, "Initiate multisig aggregation")?; - info!(target: "aleph-client", "Initiating multisig aggregation for call hash: {:?}", call_hash); - - Ok(SignatureAggregation { - timepoint: self.get_timestamp(connection, &call_hash, block_hash)?, - author: author_idx, - call_hash, - call: None, - approvers: HashSet::from([self.members[author_idx].clone()]), - }) - } - - /// Compose extrinsic for `multisig::as_multi` call. - fn construct_as_multi( - &self, - connection: &SignedConnection, - other_signatories: Vec, - timepoint: Option, - call: Extrinsic, - store_call: bool, - ) -> AsMultiCall { - compose_extrinsic!( - connection.as_connection(), - "Multisig", - "as_multi", - self.threshold, - other_signatories, - timepoint, - call.function.encode(), - store_call, - MAX_WEIGHT - ) - } - - /// Effectively starts aggregation process by calling `asMulti`. - /// - /// `connection` should be signed by some member. - pub fn initiate_aggregation_with_call( - &self, - connection: &SignedConnection, - call: Extrinsic, - store_call: bool, - ) -> Result { - let author_idx = self.map_signer_to_member_index(connection)?; - - let xt = self.construct_as_multi( - connection, - self.designate_represented(author_idx), - None, - call.clone(), - store_call, - ); - - let block_hash = - self.finalize_xt(connection, xt, "Initiate multisig aggregation with call")?; - - let call_hash = compute_call_hash(&call); - info!(target: "aleph-client", "Initiating multisig aggregation for call hash: {:?}", call_hash); - - Ok(SignatureAggregation { - timepoint: self.get_timestamp(connection, &call_hash, block_hash)?, - author: author_idx, - call_hash, - call: Some(call.encode()), - approvers: HashSet::from([self.members[author_idx].clone()]), - }) - } - - /// Report approval for `sig_agg` aggregation. - /// - /// `connection` should be signed by some member. - pub fn approve( - &self, - connection: &SignedConnection, - mut sig_agg: SignatureAggregation, - ) -> Result { - let member_idx = self.map_signer_to_member_index(connection)?; - - let xt = self.construct_approve_as_multi( - connection, - self.designate_represented(member_idx), - Some(sig_agg.timepoint), - sig_agg.call_hash, - ); - - self.finalize_xt(connection, xt, "Report approval to multisig aggregation")?; - - info!(target: "aleph-client", "Registered multisig approval for call hash: {:?}", sig_agg.call_hash); - sig_agg.approvers.insert(self.members[member_idx].clone()); - Ok(sig_agg) - } - - /// Report approval for `sig_agg` aggregation. - /// - /// `connection` should be signed by some member. - pub fn approve_with_call( - &self, - connection: &SignedConnection, - mut sig_agg: SignatureAggregation, - call: Extrinsic, - store_call: bool, - ) -> Result { - let member_idx = self.map_signer_to_member_index(connection)?; - if let Some(ref reported_call) = sig_agg.call { - ensure!( - reported_call.eq(&call.encode()), - MultisigError::CallConflict - ); - } else { - ensure!( - compute_call_hash(&call) == sig_agg.call_hash, - MultisigError::CallConflict - ); - } - - let xt = self.construct_as_multi( - connection, - self.designate_represented(member_idx), - Some(sig_agg.timepoint), - call.clone(), - store_call, - ); - - self.finalize_xt( - connection, - xt, - "Report approval to multisig aggregation with call", - )?; - - info!(target: "aleph-client", "Registered multisig approval for call hash: {:?}", sig_agg.call_hash); - sig_agg.approvers.insert(self.members[member_idx].clone()); - sig_agg.call = Some(call.encode()); - Ok(sig_agg) - } - - /// Compose extrinsic for `multisig::cancel_as_multi` call. - fn construct_cancel_as_multi( - &self, - connection: &SignedConnection, - other_signatories: Vec, - timepoint: Timepoint, - call_hash: CallHash, - ) -> CancelAsMultiCall { - compose_extrinsic!( - connection.as_connection(), - "Multisig", - "cancel_as_multi", - self.threshold, - other_signatories, - timepoint, - call_hash - ) - } - - /// Cancel `sig_agg` aggregation. - /// - /// `connection` should be signed by the aggregation author. - pub fn cancel( - &self, - connection: &SignedConnection, - sig_agg: SignatureAggregation, - ) -> Result<()> { - let author_idx = self.map_signer_to_member_index(connection)?; - ensure!(sig_agg.author == author_idx, MultisigError::NotAuthor); - - let xt = self.construct_cancel_as_multi( - connection, - self.designate_represented(author_idx), - sig_agg.timepoint, - sig_agg.call_hash, - ); - self.finalize_xt(connection, xt, "Cancel multisig aggregation")?; - info!(target: "aleph-client", "Cancelled multisig aggregation for call hash: {:?}", sig_agg.call_hash); - Ok(()) - } -} - -/// Dispatch `call` on behalf of the multisig party of `connection.get_signer()` and -/// `other_signatories` with threshold 1. -/// -/// `other_signatories` *must* be sorted (according to the natural ordering on `AccountId`). -pub fn perform_multisig_with_threshold_1( - connection: &SignedConnection, - other_signatories: &[AccountId], - call: CallDetails, -) -> Result<()> { - let xt = compose_extrinsic!( - connection.as_connection(), - "Multisig", - "as_multi_threshold_1", - other_signatories, - call - ); - try_send_xt(connection, xt, Some("Multisig with threshold 1"), Finalized)? - .expect("For `Finalized` status a block hash should be returned"); - Ok(()) -} diff --git a/aleph-client/src/pallets/aleph.rs b/aleph-client/src/pallets/aleph.rs new file mode 100644 index 0000000000..60a509b60c --- /dev/null +++ b/aleph-client/src/pallets/aleph.rs @@ -0,0 +1,87 @@ +use codec::Encode; +use primitives::{BlockNumber, SessionIndex}; +use subxt::{ext::sp_core::H256, rpc_params}; + +use crate::{ + api::runtime_types::{ + pallet_aleph::pallet::Call::set_emergency_finalizer, primitives::app::Public, + sp_core::ed25519::Public as EdPublic, + }, + pallet_aleph::pallet::Call::schedule_finality_version_change, + AccountId, AlephKeyPair, + Call::Aleph, + Connection, Pair, RootConnection, SudoCall, TxStatus, +}; + +#[async_trait::async_trait] +pub trait AlephSudoApi { + async fn set_emergency_finalizer( + &self, + finalizer: AccountId, + status: TxStatus, + ) -> anyhow::Result; + + async fn schedule_finality_version_change( + &self, + version: u32, + session: SessionIndex, + status: TxStatus, + ) -> anyhow::Result; +} + +#[async_trait::async_trait] +pub trait AlephRpc { + async fn emergency_finalize( + &self, + number: BlockNumber, + hash: H256, + key_pair: AlephKeyPair, + ) -> anyhow::Result<()>; +} + +#[async_trait::async_trait] +impl AlephSudoApi for RootConnection { + async fn set_emergency_finalizer( + &self, + finalizer: AccountId, + status: TxStatus, + ) -> anyhow::Result { + let call = Aleph(set_emergency_finalizer { + emergency_finalizer: Public(EdPublic(finalizer.into())), + }); + self.sudo_unchecked(call, status).await + } + + async fn schedule_finality_version_change( + &self, + version: u32, + session: SessionIndex, + status: TxStatus, + ) -> anyhow::Result { + let call = Aleph(schedule_finality_version_change { + version_incoming: version, + session, + }); + + self.sudo_unchecked(call, status).await + } +} + +#[async_trait::async_trait] +impl AlephRpc for Connection { + async fn emergency_finalize( + &self, + number: BlockNumber, + hash: H256, + key_pair: AlephKeyPair, + ) -> anyhow::Result<()> { + let method = "alephNode_emergencyFinalize"; + let signature = key_pair.sign(&hash.encode()); + let raw_signature: &[u8] = signature.as_ref(); + let params = rpc_params![raw_signature, hash, number]; + + let _: () = self.rpc_call(method.to_string(), params).await?; + + Ok(()) + } +} diff --git a/aleph-client/src/pallets/balances.rs b/aleph-client/src/pallets/balances.rs new file mode 100644 index 0000000000..b831cf510c --- /dev/null +++ b/aleph-client/src/pallets/balances.rs @@ -0,0 +1,140 @@ +use primitives::Balance; +use subxt::{ + ext::{sp_core::H256, sp_runtime::MultiAddress}, + tx::PolkadotExtrinsicParamsBuilder, +}; + +use crate::{ + aleph_zero::{self, api, api::runtime_types::pallet_balances::BalanceLock}, + pallet_balances::pallet::Call::transfer, + pallets::utility::UtilityApi, + AccountId, + Call::Balances, + Connection, SignedConnection, TxStatus, +}; + +#[async_trait::async_trait] +pub trait BalanceApi { + async fn locks_for_account( + &self, + account: AccountId, + at: Option, + ) -> Vec>; + async fn locks( + &self, + accounts: &[AccountId], + at: Option, + ) -> Vec>>; + async fn total_issuance(&self, at: Option) -> Balance; +} + +#[async_trait::async_trait] +pub trait BalanceUserApi { + async fn transfer( + &self, + dest: AccountId, + amount: Balance, + status: TxStatus, + ) -> anyhow::Result; + async fn transfer_with_tip( + &self, + dest: AccountId, + amount: Balance, + tip: Balance, + status: TxStatus, + ) -> anyhow::Result; +} + +#[async_trait::async_trait] +pub trait BalanceUserBatchExtApi { + async fn batch_transfer( + &self, + dest: &[AccountId], + amount: Balance, + status: TxStatus, + ) -> anyhow::Result; +} + +#[async_trait::async_trait] +impl BalanceApi for Connection { + async fn locks_for_account( + &self, + account: AccountId, + at: Option, + ) -> Vec> { + let address = aleph_zero::api::storage().balances().locks(&account); + + self.get_storage_entry(&address, at).await.0 + } + + async fn locks( + &self, + accounts: &[AccountId], + at: Option, + ) -> Vec>> { + let mut locks = vec![]; + + for account in accounts { + locks.push(self.locks_for_account(account.clone(), at).await); + } + + locks + } + + async fn total_issuance(&self, at: Option) -> Balance { + let address = api::storage().balances().total_issuance(); + + self.get_storage_entry(&address, at).await + } +} + +#[async_trait::async_trait] +impl BalanceUserApi for SignedConnection { + async fn transfer( + &self, + dest: AccountId, + amount: Balance, + status: TxStatus, + ) -> anyhow::Result { + let tx = api::tx() + .balances() + .transfer(MultiAddress::Id(dest), amount); + self.send_tx(tx, status).await + } + + async fn transfer_with_tip( + &self, + dest: AccountId, + amount: Balance, + tip: Balance, + status: TxStatus, + ) -> anyhow::Result { + let tx = api::tx() + .balances() + .transfer(MultiAddress::Id(dest), amount); + + self.send_tx_with_params(tx, PolkadotExtrinsicParamsBuilder::new().tip(tip), status) + .await + } +} + +#[async_trait::async_trait] +impl BalanceUserBatchExtApi for SignedConnection { + async fn batch_transfer( + &self, + dests: &[AccountId], + amount: Balance, + status: TxStatus, + ) -> anyhow::Result { + let calls = dests + .iter() + .map(|dest| { + Balances(transfer { + dest: MultiAddress::Id(dest.clone()), + value: amount, + }) + }) + .collect(); + self.batch_call(calls, status).await + } +} diff --git a/aleph-client/src/pallets/contract.rs b/aleph-client/src/pallets/contract.rs new file mode 100644 index 0000000000..7072d459aa --- /dev/null +++ b/aleph-client/src/pallets/contract.rs @@ -0,0 +1,171 @@ +use codec::{Compact, Decode}; +use primitives::Balance; +use serde::Serialize; +use subxt::{ + ext::{sp_core::H256, sp_runtime::MultiAddress}, + rpc_params, +}; + +use crate::{ + api, pallet_contracts::wasm::OwnerInfo, AccountId, Connection, SignedConnection, TxStatus, +}; + +#[derive(Serialize)] +pub struct ContractCallArgs { + pub origin: AccountId, + pub dest: AccountId, + pub value: Balance, + pub gas_limit: u64, + pub input_data: Vec, +} + +#[async_trait::async_trait] +pub trait ContractsApi { + async fn get_owner_info(&self, code_hash: H256, at: Option) -> Option; +} + +#[async_trait::async_trait] +pub trait ContractsUserApi { + async fn upload_code( + &self, + code: Vec, + storage_limit: Option>, + status: TxStatus, + ) -> anyhow::Result; + async fn instantiate( + &self, + code_hash: H256, + balance: Balance, + gas_limit: u64, + storage_limit: Option>, + data: Vec, + salt: Vec, + status: TxStatus, + ) -> anyhow::Result; + async fn instantiate_with_code( + &self, + code: Vec, + balance: Balance, + gas_limit: u64, + storage_limit: Option>, + data: Vec, + salt: Vec, + status: TxStatus, + ) -> anyhow::Result; + async fn call( + &self, + destination: AccountId, + balance: Balance, + gas_limit: u64, + storage_limit: Option>, + data: Vec, + status: TxStatus, + ) -> anyhow::Result; + async fn remove_code(&self, code_hash: H256, status: TxStatus) -> anyhow::Result; +} + +#[async_trait::async_trait] +pub trait ContractRpc { + async fn call_and_get(&self, args: ContractCallArgs) -> anyhow::Result; +} + +#[async_trait::async_trait] +impl ContractsApi for Connection { + async fn get_owner_info(&self, code_hash: H256, at: Option) -> Option { + let addrs = api::storage().contracts().owner_info_of(code_hash); + + self.get_storage_entry_maybe(&addrs, at).await + } +} + +#[async_trait::async_trait] +impl ContractsUserApi for SignedConnection { + async fn upload_code( + &self, + code: Vec, + storage_limit: Option>, + status: TxStatus, + ) -> anyhow::Result { + let tx = api::tx().contracts().upload_code(code, storage_limit); + + self.send_tx(tx, status).await + } + + async fn instantiate( + &self, + code_hash: H256, + balance: Balance, + gas_limit: u64, + storage_limit: Option>, + data: Vec, + salt: Vec, + status: TxStatus, + ) -> anyhow::Result { + let tx = api::tx().contracts().instantiate( + balance, + gas_limit, + storage_limit, + code_hash, + data, + salt, + ); + + self.send_tx(tx, status).await + } + + async fn instantiate_with_code( + &self, + code: Vec, + balance: Balance, + gas_limit: u64, + storage_limit: Option>, + data: Vec, + salt: Vec, + status: TxStatus, + ) -> anyhow::Result { + let tx = api::tx().contracts().instantiate_with_code( + balance, + gas_limit, + storage_limit, + code, + data, + salt, + ); + + self.send_tx(tx, status).await + } + + async fn call( + &self, + destination: AccountId, + balance: Balance, + gas_limit: u64, + storage_limit: Option>, + data: Vec, + status: TxStatus, + ) -> anyhow::Result { + let tx = api::tx().contracts().call( + MultiAddress::Id(destination), + balance, + gas_limit, + storage_limit, + data, + ); + self.send_tx(tx, status).await + } + + async fn remove_code(&self, code_hash: H256, status: TxStatus) -> anyhow::Result { + let tx = api::tx().contracts().remove_code(code_hash); + + self.send_tx(tx, status).await + } +} + +#[async_trait::async_trait] +impl ContractRpc for Connection { + async fn call_and_get(&self, args: ContractCallArgs) -> anyhow::Result { + let params = rpc_params![args]; + + self.rpc_call("contracts_call".to_string(), params).await + } +} diff --git a/aleph-client/src/pallets/elections.rs b/aleph-client/src/pallets/elections.rs new file mode 100644 index 0000000000..c2c37108c3 --- /dev/null +++ b/aleph-client/src/pallets/elections.rs @@ -0,0 +1,197 @@ +use primitives::{EraIndex, SessionCount}; +use sp_core::H256; + +use crate::{ + api, + api::runtime_types::{ + pallet_elections::pallet::Call::set_ban_config, + primitives::{BanReason, CommitteeSeats, EraValidators}, + }, + pallet_elections::pallet::Call::change_validators, + primitives::{BanConfig, BanInfo}, + AccountId, + Call::Elections, + Connection, RootConnection, SudoCall, TxStatus, +}; + +#[async_trait::async_trait] +pub trait ElectionsApi { + async fn get_ban_config(&self, at: Option) -> BanConfig; + async fn get_committee_seats(&self, at: Option) -> CommitteeSeats; + async fn get_next_era_committee_seats(&self, at: Option) -> CommitteeSeats; + async fn get_validator_block_count( + &self, + validator: AccountId, + at: Option, + ) -> Option; + async fn get_current_era_validators(&self, at: Option) -> EraValidators; + async fn get_next_era_reserved_validators(&self, at: Option) -> Vec; + async fn get_next_era_non_reserved_validators(&self, at: Option) -> Vec; + async fn get_underperformed_validator_session_count( + &self, + validator: AccountId, + at: Option, + ) -> Option; + async fn get_ban_reason_for_validator( + &self, + validator: AccountId, + at: Option, + ) -> Option; + async fn get_ban_info_for_validator( + &self, + validator: AccountId, + at: Option, + ) -> Option; + async fn get_session_period(&self) -> u32; +} + +#[async_trait::async_trait] +pub trait ElectionsSudoApi { + async fn change_ban_config( + &self, + minimal_expected_performance: Option, + underperformed_session_count_threshold: Option, + clean_session_counter_delay: Option, + ban_period: Option, + status: TxStatus, + ) -> anyhow::Result; + + async fn change_validators( + &self, + new_reserved_validators: Option>, + new_non_reserved_validators: Option>, + committee_size: Option, + status: TxStatus, + ) -> anyhow::Result; +} + +#[async_trait::async_trait] +impl ElectionsApi for Connection { + async fn get_ban_config(&self, at: Option) -> BanConfig { + let addrs = api::storage().elections().ban_config(); + + self.get_storage_entry(&addrs, at).await + } + + async fn get_committee_seats(&self, at: Option) -> CommitteeSeats { + let addrs = api::storage().elections().committee_size(); + + self.get_storage_entry(&addrs, at).await + } + + async fn get_next_era_committee_seats(&self, at: Option) -> CommitteeSeats { + let addrs = api::storage().elections().next_era_committee_size(); + + self.get_storage_entry(&addrs, at).await + } + + async fn get_validator_block_count( + &self, + validator: AccountId, + at: Option, + ) -> Option { + let addrs = api::storage() + .elections() + .session_validator_block_count(&validator); + + self.get_storage_entry_maybe(&addrs, at).await + } + + async fn get_current_era_validators(&self, at: Option) -> EraValidators { + let addrs = api::storage().elections().current_era_validators(); + + self.get_storage_entry(&addrs, at).await + } + + async fn get_next_era_reserved_validators(&self, at: Option) -> Vec { + let addrs = api::storage().elections().next_era_reserved_validators(); + + self.get_storage_entry(&addrs, at).await + } + + async fn get_next_era_non_reserved_validators(&self, at: Option) -> Vec { + let addrs = api::storage() + .elections() + .next_era_non_reserved_validators(); + + self.get_storage_entry(&addrs, at).await + } + + async fn get_underperformed_validator_session_count( + &self, + validator: AccountId, + at: Option, + ) -> Option { + let addrs = api::storage() + .elections() + .underperformed_validator_session_count(&validator); + + self.get_storage_entry_maybe(&addrs, at).await + } + + async fn get_ban_reason_for_validator( + &self, + validator: AccountId, + at: Option, + ) -> Option { + let addrs = api::storage().elections().banned(validator); + + match self.get_storage_entry_maybe(&addrs, at).await { + None => None, + Some(x) => Some(x.reason), + } + } + + async fn get_ban_info_for_validator( + &self, + validator: AccountId, + at: Option, + ) -> Option { + let addrs = api::storage().elections().banned(validator); + + self.get_storage_entry_maybe(&addrs, at).await + } + + async fn get_session_period(&self) -> u32 { + let addrs = api::constants().elections().session_period(); + + self.client.constants().at(&addrs).unwrap() + } +} + +#[async_trait::async_trait] +impl ElectionsSudoApi for RootConnection { + async fn change_ban_config( + &self, + minimal_expected_performance: Option, + underperformed_session_count_threshold: Option, + clean_session_counter_delay: Option, + ban_period: Option, + status: TxStatus, + ) -> anyhow::Result { + let call = Elections(set_ban_config { + minimal_expected_performance, + underperformed_session_count_threshold, + clean_session_counter_delay, + ban_period, + }); + + self.sudo_unchecked(call, status).await + } + + async fn change_validators( + &self, + new_reserved_validators: Option>, + new_non_reserved_validators: Option>, + committee_size: Option, + status: TxStatus, + ) -> anyhow::Result { + let call = Elections(change_validators { + reserved_validators: new_reserved_validators, + non_reserved_validators: new_non_reserved_validators, + committee_size, + }); + + self.sudo_unchecked(call, status).await + } +} diff --git a/aleph-client/src/pallets/fee.rs b/aleph-client/src/pallets/fee.rs new file mode 100644 index 0000000000..6e2e22e56f --- /dev/null +++ b/aleph-client/src/pallets/fee.rs @@ -0,0 +1,22 @@ +use sp_core::H256; + +use crate::{api, Connection}; + +pub type FeeMultiplier = u128; + +#[async_trait::async_trait] +pub trait TransactionPaymentApi { + async fn get_next_fee_multiplier(&self, at: Option) -> FeeMultiplier; +} + +#[async_trait::async_trait] +impl TransactionPaymentApi for Connection { + async fn get_next_fee_multiplier(&self, at: Option) -> FeeMultiplier { + let addrs = api::storage().transaction_payment().next_fee_multiplier(); + + match self.get_storage_entry_maybe(&addrs, at).await { + Some(fm) => fm.0, + None => 1, + } + } +} diff --git a/aleph-client/src/pallets/mod.rs b/aleph-client/src/pallets/mod.rs new file mode 100644 index 0000000000..07944484d3 --- /dev/null +++ b/aleph-client/src/pallets/mod.rs @@ -0,0 +1,12 @@ +pub mod aleph; +pub mod balances; +pub mod contract; +pub mod elections; +pub mod fee; +pub mod multisig; +pub mod session; +pub mod staking; +pub mod system; +pub mod treasury; +pub mod utility; +pub mod vesting; diff --git a/aleph-client/src/pallets/multisig.rs b/aleph-client/src/pallets/multisig.rs new file mode 100644 index 0000000000..8192c5a4ae --- /dev/null +++ b/aleph-client/src/pallets/multisig.rs @@ -0,0 +1,78 @@ +use primitives::{Balance, BlockNumber}; +use subxt::ext::sp_core::H256; + +use crate::{api, api::runtime_types, AccountId, SignedConnection, TxStatus}; + +pub type CallHash = [u8; 32]; +pub type Call = Vec; +pub type Timepoint = api::runtime_types::pallet_multisig::Timepoint; +pub type Multisig = runtime_types::pallet_multisig::Multisig; + +// pub fn compute_call_hash(call: &Extrinsic) -> CallHash { +// blake2_256(&call.function.encode()) +// } + +#[async_trait::async_trait] +pub trait MultisigApi {} + +#[async_trait::async_trait] +pub trait MultisigUserApi { + async fn approve_as_multi( + &self, + threshold: u16, + other_signatories: Vec, + timepoint: Option, + max_weight: u64, + call_hash: CallHash, + status: TxStatus, + ) -> anyhow::Result; + async fn cancel_as_multi( + &self, + threshold: u16, + other_signatories: Vec, + timepoint: Timepoint, + call_hash: CallHash, + status: TxStatus, + ) -> anyhow::Result; +} + +#[async_trait::async_trait] +impl MultisigUserApi for SignedConnection { + async fn approve_as_multi( + &self, + threshold: u16, + other_signatories: Vec, + timepoint: Option, + max_weight: u64, + call_hash: CallHash, + status: TxStatus, + ) -> anyhow::Result { + let tx = api::tx().multisig().approve_as_multi( + threshold, + other_signatories, + timepoint, + call_hash, + max_weight, + ); + + self.send_tx(tx, status).await + } + + async fn cancel_as_multi( + &self, + threshold: u16, + other_signatories: Vec, + timepoint: Timepoint, + call_hash: CallHash, + status: TxStatus, + ) -> anyhow::Result { + let tx = api::tx().multisig().cancel_as_multi( + threshold, + other_signatories, + timepoint, + call_hash, + ); + + self.send_tx(tx, status).await + } +} diff --git a/aleph-client/src/pallets/session.rs b/aleph-client/src/pallets/session.rs new file mode 100644 index 0000000000..834ddc2528 --- /dev/null +++ b/aleph-client/src/pallets/session.rs @@ -0,0 +1,59 @@ +use primitives::SessionIndex; +use sp_core::H256; + +use crate::{ + api, api::runtime_types::aleph_runtime::SessionKeys, AccountId, Connection, SignedConnection, + TxStatus, +}; + +#[async_trait::async_trait] +pub trait SessionApi { + async fn get_next_session_keys( + &self, + account: AccountId, + at: Option, + ) -> Option; + async fn get_session(&self, at: Option) -> SessionIndex; + async fn get_validators(&self, at: Option) -> Vec; +} + +#[async_trait::async_trait] +pub trait SessionUserApi { + async fn set_keys(&self, new_keys: SessionKeys, status: TxStatus) -> anyhow::Result; +} + +#[async_trait::async_trait] +impl SessionApi for Connection { + async fn get_next_session_keys( + &self, + account: AccountId, + at: Option, + ) -> Option { + let addrs = api::storage().session().next_keys(account); + + self.get_storage_entry_maybe(&addrs, at).await + } + + async fn get_session(&self, at: Option) -> SessionIndex { + let addrs = api::storage().session().current_index(); + + self.get_storage_entry_maybe(&addrs, at) + .await + .unwrap_or_default() + } + + async fn get_validators(&self, at: Option) -> Vec { + let addrs = api::storage().session().validators(); + + self.get_storage_entry(&addrs, at).await + } +} + +#[async_trait::async_trait] +impl SessionUserApi for SignedConnection { + async fn set_keys(&self, new_keys: SessionKeys, status: TxStatus) -> anyhow::Result { + let tx = api::tx().session().set_keys(new_keys, vec![]); + + self.send_tx(tx, status).await + } +} diff --git a/aleph-client/src/pallets/staking.rs b/aleph-client/src/pallets/staking.rs new file mode 100644 index 0000000000..920b013299 --- /dev/null +++ b/aleph-client/src/pallets/staking.rs @@ -0,0 +1,375 @@ +use primitives::{Balance, EraIndex}; +use sp_core::H256; +use subxt::{ + ext::{ + sp_core::storage::StorageKey, + sp_runtime::{MultiAddress, Perbill as SPerbill}, + }, + storage::address::{StorageHasher, StorageMapKey}, +}; + +use crate::{ + api, + pallet_staking::{ + pallet::pallet::{ + Call::{bond, force_new_era, nominate, set_staking_configs}, + ConfigOp, + ConfigOp::Set, + }, + EraRewardPoints, Exposure, RewardDestination, StakingLedger, ValidatorPrefs, + }, + pallet_sudo::pallet::Call::sudo_as, + pallets::utility::UtilityApi, + sp_arithmetic::per_things::Perbill, + AccountId, + Call::{Staking, Sudo}, + Connection, RootConnection, SignedConnection, SudoCall, TxStatus, +}; + +#[async_trait::async_trait] +pub trait StakingApi { + async fn get_active_era(&self, at: Option) -> EraIndex; + async fn get_current_era(&self, at: Option) -> EraIndex; + async fn get_bonded(&self, stash: AccountId, at: Option) -> Option; + async fn get_ledger(&self, controller: AccountId, at: Option) -> StakingLedger; + async fn get_payout_for_era(&self, era: EraIndex, at: Option) -> u128; + async fn get_exposure( + &self, + era: EraIndex, + account_id: &AccountId, + at: Option, + ) -> Exposure; + async fn get_era_reward_points( + &self, + era: EraIndex, + at: Option, + ) -> Option>; + async fn get_minimum_validator_count(&self, at: Option) -> u32; + async fn get_session_per_era(&self) -> u32; +} + +#[async_trait::async_trait] +pub trait StakingUserApi { + async fn bond( + &self, + initial_stake: Balance, + controller_id: AccountId, + status: TxStatus, + ) -> anyhow::Result; + async fn validate( + &self, + validator_commission_percentage: u8, + status: TxStatus, + ) -> anyhow::Result; + async fn payout_stakers( + &self, + stash_account: AccountId, + era: EraIndex, + status: TxStatus, + ) -> anyhow::Result; + async fn nominate( + &self, + nominee_account_id: AccountId, + status: TxStatus, + ) -> anyhow::Result; + async fn chill(&self, status: TxStatus) -> anyhow::Result; + async fn bond_extra_stake( + &self, + extra_stake: Balance, + status: TxStatus, + ) -> anyhow::Result; +} + +#[async_trait::async_trait] +pub trait StakingApiExt { + async fn batch_bond( + &self, + accounts: &[(AccountId, AccountId)], + stake: Balance, + status: TxStatus, + ) -> anyhow::Result; + async fn batch_nominate( + &self, + nominator_nominee_pairs: &[(AccountId, AccountId)], + status: TxStatus, + ) -> anyhow::Result; +} + +#[async_trait::async_trait] +pub trait StakingSudoApi { + async fn force_new_era(&self, status: TxStatus) -> anyhow::Result; + async fn set_staking_config( + &self, + minimal_nominator_bond: u128, + minimal_validator_bond: u128, + max_nominators_count: Option, + max_validators_count: Option, + status: TxStatus, + ) -> anyhow::Result; +} + +#[async_trait::async_trait] +pub trait StakingRawApi { + async fn get_stakers_storage_keys(&self, era: EraIndex, at: Option) -> Vec; + async fn get_stakers_storage_keys_from_accounts( + &self, + era: EraIndex, + accounts: &[AccountId], + at: Option, + ) -> Vec; +} + +#[async_trait::async_trait] +impl StakingApi for Connection { + async fn get_active_era(&self, at: Option) -> EraIndex { + let addrs = api::storage().staking().active_era(); + + self.get_storage_entry(&addrs, at).await.index + } + + async fn get_current_era(&self, at: Option) -> EraIndex { + let addrs = api::storage().staking().current_era(); + + self.get_storage_entry(&addrs, at).await + } + + async fn get_bonded(&self, stash: AccountId, at: Option) -> Option { + let addrs = api::storage().staking().bonded(stash); + + self.get_storage_entry_maybe(&addrs, at).await + } + + async fn get_ledger(&self, controller: AccountId, at: Option) -> StakingLedger { + let addrs = api::storage().staking().ledger(controller); + + self.get_storage_entry(&addrs, at).await + } + + async fn get_payout_for_era(&self, era: EraIndex, at: Option) -> u128 { + let addrs = api::storage().staking().eras_validator_reward(era); + + self.get_storage_entry(&addrs, at).await + } + + async fn get_exposure( + &self, + era: EraIndex, + account_id: &AccountId, + at: Option, + ) -> Exposure { + let addrs = api::storage().staking().eras_stakers(era, account_id); + + self.get_storage_entry(&addrs, at).await + } + + async fn get_era_reward_points( + &self, + era: EraIndex, + at: Option, + ) -> Option> { + let addrs = api::storage().staking().eras_reward_points(era); + + self.get_storage_entry_maybe(&addrs, at).await + } + + async fn get_minimum_validator_count(&self, at: Option) -> u32 { + let addrs = api::storage().staking().minimum_validator_count(); + + self.get_storage_entry(&addrs, at).await + } + + async fn get_session_per_era(&self) -> u32 { + let addrs = api::constants().staking().sessions_per_era(); + + self.client.constants().at(&addrs).unwrap() + } +} + +#[async_trait::async_trait] +impl StakingUserApi for SignedConnection { + async fn bond( + &self, + initial_stake: Balance, + controller_id: AccountId, + status: TxStatus, + ) -> anyhow::Result { + let tx = api::tx().staking().bond( + MultiAddress::::Id(controller_id), + initial_stake, + RewardDestination::Staked, + ); + + self.send_tx(tx, status).await + } + + async fn validate( + &self, + validator_commission_percentage: u8, + status: TxStatus, + ) -> anyhow::Result { + let tx = api::tx().staking().validate(ValidatorPrefs { + commission: Perbill( + SPerbill::from_percent(validator_commission_percentage as u32).deconstruct(), + ), + blocked: false, + }); + + self.send_tx(tx, status).await + } + + async fn payout_stakers( + &self, + stash_account: AccountId, + era: EraIndex, + status: TxStatus, + ) -> anyhow::Result { + let tx = api::tx().staking().payout_stakers(stash_account, era); + + self.send_tx(tx, status).await + } + + async fn nominate( + &self, + nominee_account_id: AccountId, + status: TxStatus, + ) -> anyhow::Result { + let tx = api::tx() + .staking() + .nominate(vec![MultiAddress::Id(nominee_account_id)]); + + self.send_tx(tx, status).await + } + + async fn chill(&self, status: TxStatus) -> anyhow::Result { + let tx = api::tx().staking().chill(); + + self.send_tx(tx, status).await + } + + async fn bond_extra_stake( + &self, + extra_stake: Balance, + status: TxStatus, + ) -> anyhow::Result { + let tx = api::tx().staking().bond_extra(extra_stake); + + self.send_tx(tx, status).await + } +} + +#[async_trait::async_trait] +impl StakingSudoApi for RootConnection { + async fn force_new_era(&self, status: TxStatus) -> anyhow::Result { + let call = Staking(force_new_era); + + self.sudo_unchecked(call, status).await + } + + async fn set_staking_config( + &self, + min_nominator_bond: u128, + min_validator_bond: u128, + max_nominator_count: Option, + max_validator_count: Option, + status: TxStatus, + ) -> anyhow::Result { + let call = Staking(set_staking_configs { + min_nominator_bond: Set(min_nominator_bond), + min_validator_bond: Set(min_validator_bond), + max_nominator_count: match max_nominator_count { + None => ConfigOp::Noop, + Some(m) => Set(m), + }, + max_validator_count: match max_validator_count { + None => ConfigOp::Noop, + Some(m) => Set(m), + }, + chill_threshold: ConfigOp::Noop, + min_commission: ConfigOp::Noop, + }); + self.sudo_unchecked(call, status).await + } +} + +#[async_trait::async_trait] +impl StakingRawApi for Connection { + async fn get_stakers_storage_keys(&self, era: EraIndex, at: Option) -> Vec { + let key_addrs = api::storage().staking().eras_stakers_root(); + let mut key = key_addrs.to_root_bytes(); + StorageMapKey::new(&era, StorageHasher::Twox64Concat).to_bytes(&mut key); + self.client + .storage() + .fetch_keys(&key, 10, None, at) + .await + .unwrap() + } + + async fn get_stakers_storage_keys_from_accounts( + &self, + era: EraIndex, + accounts: &[AccountId], + _: Option, + ) -> Vec { + let key_addrs = api::storage().staking().eras_stakers_root(); + let mut key = key_addrs.to_root_bytes(); + StorageMapKey::new(&era, StorageHasher::Twox64Concat).to_bytes(&mut key); + accounts + .iter() + .map(|account| { + let mut key = key.clone(); + StorageMapKey::new(account, StorageHasher::Twox64Concat).to_bytes(&mut key); + + StorageKey(key) + }) + .collect() + } +} + +#[async_trait::async_trait] +impl StakingApiExt for RootConnection { + async fn batch_bond( + &self, + accounts: &[(AccountId, AccountId)], + stake: Balance, + status: TxStatus, + ) -> anyhow::Result { + let calls = accounts + .iter() + .map(|(c, s)| { + let b = Staking(bond { + controller: MultiAddress::Id(c.clone()), + value: stake, + payee: RewardDestination::Staked, + }); + + Sudo(sudo_as { + who: MultiAddress::Id(s.clone()), + call: Box::new(b), + }) + }) + .collect(); + + self.as_signed().batch_call(calls, status).await + } + + async fn batch_nominate( + &self, + nominator_nominee_pairs: &[(AccountId, AccountId)], + status: TxStatus, + ) -> anyhow::Result { + let calls = nominator_nominee_pairs + .iter() + .map(|(nominator, nominee)| { + let call = Staking(nominate { + targets: vec![MultiAddress::Id(nominee.clone())], + }); + Sudo(sudo_as { + who: MultiAddress::Id(nominator.clone()), + call: Box::new(call), + }) + }) + .collect(); + + self.as_signed().batch_call(calls, status).await + } +} diff --git a/aleph-client/src/pallets/system.rs b/aleph-client/src/pallets/system.rs new file mode 100644 index 0000000000..3fe06640e6 --- /dev/null +++ b/aleph-client/src/pallets/system.rs @@ -0,0 +1,52 @@ +use primitives::Balance; +use sp_core::H256; +use subxt::ext::sp_runtime::Perbill as SPerbill; + +use crate::{ + api, + frame_system::pallet::Call::{fill_block, set_code}, + sp_arithmetic::per_things::Perbill, + AccountId, + Call::System, + Connection, RootConnection, SudoCall, TxStatus, +}; + +#[async_trait::async_trait] +pub trait SystemApi { + async fn get_free_balance(&self, account: AccountId, at: Option) -> Balance; +} + +#[async_trait::async_trait] +pub trait SystemSudoApi { + async fn set_code(&self, code: Vec, status: TxStatus) -> anyhow::Result; + async fn fill_block(&self, target_ratio_percent: u8, status: TxStatus) -> anyhow::Result; +} + +#[async_trait::async_trait] +impl SystemSudoApi for RootConnection { + async fn set_code(&self, code: Vec, status: TxStatus) -> anyhow::Result { + let call = System(set_code { code }); + + self.sudo_unchecked(call, status).await + } + + async fn fill_block(&self, target_ratio_percent: u8, status: TxStatus) -> anyhow::Result { + let call = System(fill_block { + ratio: Perbill(SPerbill::from_percent(target_ratio_percent as u32).deconstruct()), + }); + + self.sudo_unchecked(call, status).await + } +} + +#[async_trait::async_trait] +impl SystemApi for Connection { + async fn get_free_balance(&self, account: AccountId, at: Option) -> Balance { + let addrs = api::storage().system().account(&account); + + match self.get_storage_entry_maybe(&addrs, at).await { + None => 0, + Some(account) => account.data.free, + } + } +} diff --git a/aleph-client/src/pallets/treasury.rs b/aleph-client/src/pallets/treasury.rs new file mode 100644 index 0000000000..4bed8c80ce --- /dev/null +++ b/aleph-client/src/pallets/treasury.rs @@ -0,0 +1,118 @@ +use frame_support::PalletId; +use primitives::{Balance, MILLISECS_PER_BLOCK}; +use sp_core::H256; +use sp_runtime::traits::AccountIdConversion; +use subxt::ext::sp_runtime::MultiAddress; + +use crate::{ + api, + pallet_treasury::pallet::Call::{approve_proposal, reject_proposal}, + pallets::{elections::ElectionsApi, staking::StakingApi}, + AccountId, + Call::Treasury, + Connection, RootConnection, SignedConnection, SudoCall, TxStatus, +}; + +#[async_trait::async_trait] +pub trait TreasuryApi { + async fn treasury_account(&self) -> AccountId; + async fn proposals_count(&self, at: Option) -> Option; + async fn approvals(&self, at: Option) -> Vec; +} + +#[async_trait::async_trait] +pub trait TreasuryUserApi { + async fn propose_spend( + &self, + amount: Balance, + beneficiary: AccountId, + status: TxStatus, + ) -> anyhow::Result; + async fn approve(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result; + async fn reject(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result; +} + +#[async_trait::async_trait] +pub trait TreasureApiExt { + async fn possible_treasury_payout(&self) -> Balance; +} + +#[async_trait::async_trait] +pub trait TreasurySudoApi { + async fn approve(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result; + async fn reject(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result; +} + +#[async_trait::async_trait] +impl TreasuryApi for Connection { + async fn treasury_account(&self) -> AccountId { + PalletId(*b"a0/trsry").into_account_truncating() + } + + async fn proposals_count(&self, at: Option) -> Option { + let addrs = api::storage().treasury().proposal_count(); + + self.get_storage_entry_maybe(&addrs, at).await + } + + async fn approvals(&self, at: Option) -> Vec { + let addrs = api::storage().treasury().approvals(); + + self.get_storage_entry(&addrs, at).await.0 + } +} + +#[async_trait::async_trait] +impl TreasuryUserApi for SignedConnection { + async fn propose_spend( + &self, + amount: Balance, + beneficiary: AccountId, + status: TxStatus, + ) -> anyhow::Result { + let tx = api::tx() + .treasury() + .propose_spend(amount, MultiAddress::Id(beneficiary)); + + self.send_tx(tx, status).await + } + + async fn approve(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result { + let tx = api::tx().treasury().approve_proposal(proposal_id); + + self.send_tx(tx, status).await + } + + async fn reject(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result { + let tx = api::tx().treasury().reject_proposal(proposal_id); + + self.send_tx(tx, status).await + } +} + +#[async_trait::async_trait] +impl TreasurySudoApi for RootConnection { + async fn approve(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result { + let call = Treasury(approve_proposal { proposal_id }); + + self.sudo_unchecked(call, status).await + } + + async fn reject(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result { + let call = Treasury(reject_proposal { proposal_id }); + + self.sudo_unchecked(call, status).await + } +} + +#[async_trait::async_trait] +impl TreasureApiExt for Connection { + async fn possible_treasury_payout(&self) -> Balance { + let session_period = self.get_session_period().await; + let sessions_per_era = self.get_session_per_era().await; + + let millisecs_per_era = + MILLISECS_PER_BLOCK * session_period as u64 * sessions_per_era as u64; + primitives::staking::era_payout(millisecs_per_era).1 + } +} diff --git a/aleph-client/src/pallets/utility.rs b/aleph-client/src/pallets/utility.rs new file mode 100644 index 0000000000..9c61a632a9 --- /dev/null +++ b/aleph-client/src/pallets/utility.rs @@ -0,0 +1,17 @@ +use subxt::ext::sp_core::H256; + +use crate::{api, Call, SignedConnection, TxStatus}; + +#[async_trait::async_trait] +pub trait UtilityApi { + async fn batch_call(&self, calls: Vec, status: TxStatus) -> anyhow::Result; +} + +#[async_trait::async_trait] +impl UtilityApi for SignedConnection { + async fn batch_call(&self, calls: Vec, status: TxStatus) -> anyhow::Result { + let tx = api::tx().utility().batch(calls); + + self.send_tx(tx, status).await + } +} diff --git a/aleph-client/src/pallets/vesting.rs b/aleph-client/src/pallets/vesting.rs new file mode 100644 index 0000000000..f8a0fd13f9 --- /dev/null +++ b/aleph-client/src/pallets/vesting.rs @@ -0,0 +1,73 @@ +use subxt::ext::{sp_core::H256, sp_runtime::MultiAddress}; + +use crate::{ + api, pallet_vesting::vesting_info::VestingInfo, AccountId, Connection, SignedConnection, + TxStatus, +}; + +#[async_trait::async_trait] +pub trait VestingApi { + async fn get_vesting(&self, who: AccountId, at: Option) -> Vec>; +} + +#[async_trait::async_trait] +pub trait VestingUserApi { + async fn vest(&self, status: TxStatus) -> anyhow::Result; + async fn vest_other(&self, status: TxStatus, other: AccountId) -> anyhow::Result; + async fn vested_transfer( + &self, + receiver: AccountId, + schedule: VestingInfo, + status: TxStatus, + ) -> anyhow::Result; + async fn merge_schedules(&self, idx1: u32, idx2: u32, status: TxStatus) + -> anyhow::Result; +} + +#[async_trait::async_trait] +impl VestingApi for Connection { + async fn get_vesting(&self, who: AccountId, at: Option) -> Vec> { + let addrs = api::storage().vesting().vesting(who); + + self.get_storage_entry(&addrs, at).await.0 + } +} + +#[async_trait::async_trait] +impl VestingUserApi for SignedConnection { + async fn vest(&self, status: TxStatus) -> anyhow::Result { + let tx = api::tx().vesting().vest(); + + self.send_tx(tx, status).await + } + + async fn vest_other(&self, status: TxStatus, other: AccountId) -> anyhow::Result { + let tx = api::tx().vesting().vest_other(MultiAddress::Id(other)); + + self.send_tx(tx, status).await + } + + async fn vested_transfer( + &self, + receiver: AccountId, + schedule: VestingInfo, + status: TxStatus, + ) -> anyhow::Result { + let tx = api::tx() + .vesting() + .vested_transfer(MultiAddress::Id(receiver), schedule); + + self.send_tx(tx, status).await + } + + async fn merge_schedules( + &self, + idx1: u32, + idx2: u32, + status: TxStatus, + ) -> anyhow::Result { + let tx = api::tx().vesting().merge_schedules(idx1, idx2); + + self.send_tx(tx, status).await + } +} diff --git a/aleph-client/src/rpc.rs b/aleph-client/src/rpc.rs deleted file mode 100644 index f6eab8007a..0000000000 --- a/aleph-client/src/rpc.rs +++ /dev/null @@ -1,216 +0,0 @@ -use codec::Encode; -use serde_json::{json, Value}; -use sp_core::{ - ed25519, - storage::{StorageChangeSet, StorageData}, - Pair, H256, -}; -use substrate_api_client::StorageKey; - -use crate::{AnyConnection, BlockHash, BlockNumber, SessionKeys}; - -fn json_req(method: &str, params: Value, id: u32) -> Value { - json!({ - "method": method, - "params": params, - "jsonrpc": "2.0", - "id": id.to_string(), - }) -} - -pub fn author_rotate_keys_json() -> Value { - json_req("author_rotateKeys", Value::Null, 1) -} - -/// Produces a JSON encoding of an emergency finalization RPC. -fn emergency_finalize_json(signature: Vec, hash: BlockHash, number: BlockNumber) -> Value { - json_req( - "alephNode_emergencyFinalize", - json!([signature, hash, number]), - 1, - ) -} - -fn state_query_storage_at_json(storage_keys: &[StorageKey]) -> Value { - json_req( - "state_queryStorageAt", - Value::Array(vec![ - Value::Array( - storage_keys - .iter() - .map(|storage_key| Value::String(hex::encode(storage_key))) - .collect::>(), - ), - Value::Null, - ]), - 1, - ) -} - -fn parse_query_storage_at_result( - maybe_json_result: Option, - expected_storage_key_size: usize, -) -> Result>, String> { - match maybe_json_result { - None => Err(String::from("Returned result was null!")), - Some(result) => { - let mut storage_change_set_vec: Vec> = - serde_json::from_str(&result[..]).map_err(|_| { - String::from(&format!("Failed to parse result {:?} into JSON", result)) - })?; - if storage_change_set_vec.is_empty() { - return Err(String::from("Expected result to be non-empty!")); - } - // we're interested only in first element, since queryStorageAt returns history of - // changes of given storage key starting from requested block, in our case from - // best known block - let storage_change_set = storage_change_set_vec.remove(0); - if storage_change_set.changes.len() != expected_storage_key_size { - return Err(format!( - "Expected result to have exactly {} entries, got {}!", - expected_storage_key_size, - storage_change_set.changes.len() - )); - } - Ok(storage_change_set - .changes - .into_iter() - .map(|(_, entries)| entries) - .collect()) - } - } -} - -pub fn state_query_storage_at( - connection: &C, - storage_keys: Vec, -) -> Result>, String> { - match connection - .as_connection() - .get_request(state_query_storage_at_json(&storage_keys)) - { - Ok(maybe_json_result) => { - parse_query_storage_at_result(maybe_json_result, storage_keys.len()) - } - Err(_) => Err(format!( - "Failed to obtain results from storage keys {:?}", - &storage_keys - )), - } -} - -pub fn rotate_keys_base( - connection: &C, - rpc_result_mapper: F, -) -> Result -where - F: Fn(String) -> Option, -{ - match connection - .as_connection() - .get_request(author_rotate_keys_json()) - { - Ok(maybe_keys) => match maybe_keys { - Some(keys) => match rpc_result_mapper(keys) { - Some(keys) => Ok(keys), - None => Err("Failed to parse keys from string result"), - }, - None => Err("Failed to retrieve keys from chain"), - }, - Err(_) => Err("Connection does not work"), - } -} - -pub fn rotate_keys(connection: &C) -> Result { - rotate_keys_base(connection, |keys| match SessionKeys::try_from(keys) { - Ok(keys) => Some(keys), - Err(_) => None, - }) -} - -pub fn rotate_keys_raw_result(connection: &C) -> Result { - // we need to escape two characters from RPC result which is escaped quote - rotate_keys_base(connection, |keys| Some(keys.trim_matches('\"').to_string())) -} - -/// Sends an emergency justification to the node, using the provided key to sign the hash. -pub fn emergency_finalize( - connection: &C, - number: BlockNumber, - hash: BlockHash, - key: ed25519::Pair, -) -> Result<(), String> { - let signature = key.sign(&hash.encode()); - let raw_signature: &[u8] = signature.as_ref(); - match connection - .as_connection() - .get_request(emergency_finalize_json( - raw_signature.to_vec(), - hash, - number, - )) { - Ok(_) => Ok(()), - Err(e) => Err(format!("Emergency finalize failed: {}", e)), - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn given_some_input_when_state_query_storage_at_json_then_json_is_as_expected() { - let storage_keys = vec![ - StorageKey(vec![0, 1, 2, 3, 4, 5]), - StorageKey(vec![9, 8, 7, 6, 5]), - ]; - let expected_json_string = r#" -{ - "id": "1", - "jsonrpc": "2.0", - "method":"state_queryStorageAt", - "params": [["000102030405", "0908070605"], null] -}"#; - - let expected_json: Value = serde_json::from_str(expected_json_string).unwrap(); - assert_eq!(expected_json, state_query_storage_at_json(&storage_keys)); - } - - #[test] - fn given_expected_input_when_parse_query_storage_at_result_then_json_is_as_expected() { - let expected_json_string = r#" - [ - { - "block": "0x07825c4cae90d07a322ea434ed82186091e0aae8d465274d07ab1e1dea545d0d", - "changes": [ - [ - "0xc2261276cc9d1f8598ea4b6a74b15c2f218f26c73add634897550b4003b26bc61b614bd4a126f2d5d294e9a8af9da25248d7e931307afb4b68d8d565d4c66e00d856c6d65f5fed6bb82dcfb60e936c67", - "0x047374616b696e672000407a10f35a0000000000000000000002" - ], - [ - "0xc2261276cc9d1f8598ea4b6a74b15c2f218f26c73add634897550b4003b26bc6e2c1dc507e2035edbbd8776c440d870460c57f0008067cc01c5ff9eb2e2f9b3a94299a915a91198bd1021a6c55596f57", - "0x047374616b696e672000407a10f35a0000000000000000000002" - ], - [ - "0xc2261276cc9d1f8598ea4b6a74b15c2f218f26c73add634897550b4003b26bc6e2c1dc507e2035edbbd8776c440d870460c57f0008067cc01c5ff9eb2e2f9b3a94299a915a91198bd1021a6c55596f59", - null - ] - ] - } - ]"#; - assert_eq!( - vec![ - Some(StorageData(vec![ - 4, 115, 116, 97, 107, 105, 110, 103, 32, 0, 64, 122, 16, 243, 90, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2 - ])), - Some(StorageData(vec![ - 4, 115, 116, 97, 107, 105, 110, 103, 32, 0, 64, 122, 16, 243, 90, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 2 - ])), - None - ], - parse_query_storage_at_result(Some(String::from(expected_json_string)), 3).unwrap() - ); - } -} diff --git a/aleph-client/src/rpc/mod.rs b/aleph-client/src/rpc/mod.rs new file mode 100644 index 0000000000..1b8756db16 --- /dev/null +++ b/aleph-client/src/rpc/mod.rs @@ -0,0 +1,17 @@ +use codec::Decode; + +use crate::{aleph_runtime::SessionKeys, SignedConnection}; + +#[async_trait::async_trait] +pub trait Rpc { + async fn author_rotate_keys(&self) -> SessionKeys; +} + +#[async_trait::async_trait] +impl Rpc for SignedConnection { + async fn author_rotate_keys(&self) -> SessionKeys { + let bytes = self.connection.client.rpc().rotate_keys().await.unwrap(); + + SessionKeys::decode(&mut bytes.0.as_slice()).unwrap() + } +} diff --git a/aleph-client/src/runtime_types.rs b/aleph-client/src/runtime_types.rs new file mode 100644 index 0000000000..88e7144b81 --- /dev/null +++ b/aleph-client/src/runtime_types.rs @@ -0,0 +1,42 @@ +pub use crate::aleph_zero::api::runtime_types::*; +use crate::{ + aleph_runtime::SessionKeys, + api::runtime_types::{ + primitives::app::Public as AlephPublic, + sp_consensus_aura::sr25519::app_sr25519::Public as AuraPublic, + sp_core::{ed25519::Public as EdPublic, sr25519::Public as SrPublic}, + }, + pallet_staking::EraRewardPoints, +}; + +impl Default for EraRewardPoints { + fn default() -> Self { + Self { + total: 0, + individual: vec![], + } + } +} + +// Manually implementing decoding +impl From> for SessionKeys { + fn from(bytes: Vec) -> Self { + assert_eq!(bytes.len(), 64); + Self { + aura: AuraPublic(SrPublic(bytes[..32].try_into().unwrap())), + aleph: AlephPublic(EdPublic(bytes[32..64].try_into().unwrap())), + } + } +} + +impl TryFrom for SessionKeys { + type Error = (); + + fn try_from(keys: String) -> Result { + let bytes: Vec = match hex::FromHex::from_hex(keys) { + Ok(bytes) => bytes, + Err(_) => return Err(()), + }; + Ok(SessionKeys::from(bytes)) + } +} diff --git a/aleph-client/src/session.rs b/aleph-client/src/session.rs deleted file mode 100644 index aeb4fe8c1d..0000000000 --- a/aleph-client/src/session.rs +++ /dev/null @@ -1,167 +0,0 @@ -use codec::{Decode, Encode}; -use log::info; -use primitives::{BlockHash, CommitteeSeats, SessionIndex}; -use sp_core::H256; -use substrate_api_client::{compose_call, compose_extrinsic, AccountId, FromHexString, XtStatus}; - -use crate::{ - get_block_hash, send_xt, waiting::wait_for_event, AnyConnection, BlockNumber, ReadStorage, - RootConnection, SignedConnection, -}; - -const PALLET: &str = "Session"; - -// Using custom struct and rely on default Encode trait from Parity's codec -// it works since byte arrays are encoded in a straight forward way, it as-is -#[derive(Clone, Eq, PartialEq, Hash, Debug, Decode, Encode)] -pub struct Keys { - pub aura: [u8; 32], - pub aleph: [u8; 32], -} - -// Manually implementing decoding -impl From> for Keys { - fn from(bytes: Vec) -> Self { - assert_eq!(bytes.len(), 64); - Self { - aura: bytes[0..32].try_into().unwrap(), - aleph: bytes[32..64].try_into().unwrap(), - } - } -} - -impl TryFrom for Keys { - type Error = (); - - fn try_from(keys: String) -> Result { - let bytes: Vec = match FromHexString::from_hex(keys) { - Ok(bytes) => bytes, - Err(_) => return Err(()), - }; - Ok(Keys::from(bytes)) - } -} - -pub fn get_next_session_keys( - connection: &C, - account_id: AccountId, -) -> Option { - connection.read_storage_map(PALLET, "NextKeys", account_id, None) -} - -pub fn change_validators( - sudo_connection: &RootConnection, - new_reserved_validators: Option>, - new_non_reserved_validators: Option>, - committee_size: Option, - status: XtStatus, -) { - info!(target: "aleph-client", "New validators: reserved: {:#?}, non_reserved: {:#?}, validators_per_session: {:?}", new_reserved_validators, new_non_reserved_validators, committee_size); - let call = compose_call!( - sudo_connection.as_connection().metadata, - "Elections", - "change_validators", - new_reserved_validators, - new_non_reserved_validators, - committee_size - ); - let xt = compose_extrinsic!( - sudo_connection.as_connection(), - "Sudo", - "sudo_unchecked_weight", - call, - 0_u64 - ); - send_xt(sudo_connection, xt, Some("change_validators"), status); -} - -pub fn change_next_era_reserved_validators( - sudo_connection: &RootConnection, - new_validators: Vec, - status: XtStatus, -) { - change_validators(sudo_connection, Some(new_validators), None, None, status) -} - -pub fn set_keys(connection: &SignedConnection, new_keys: Keys, status: XtStatus) { - let xt = compose_extrinsic!( - connection.as_connection(), - PALLET, - "set_keys", - new_keys, - 0u8 - ); - send_xt(connection, xt, Some("set_keys"), status); -} - -pub fn get_current_session(connection: &C) -> SessionIndex { - get_session(connection, None) -} - -pub fn get_session(connection: &C, block_hash: Option) -> SessionIndex { - connection - .as_connection() - .get_storage_value(PALLET, "CurrentIndex", block_hash) - .unwrap() - .unwrap_or(0) -} - -pub fn wait_for_predicate bool>( - connection: &C, - session_predicate: P, -) -> anyhow::Result { - info!(target: "aleph-client", "Waiting for session"); - - #[derive(Debug, Decode, Clone)] - struct NewSessionEvent { - session_index: SessionIndex, - } - let result = wait_for_event(connection, (PALLET, "NewSession"), |e: NewSessionEvent| { - info!(target: "aleph-client", "New session {}", e.session_index); - - session_predicate(e.session_index) - })?; - Ok(result.session_index) -} - -pub fn wait_for( - connection: &C, - session_index: SessionIndex, -) -> anyhow::Result { - wait_for_predicate(connection, |session_ix| session_ix == session_index) -} - -pub fn wait_for_at_least( - connection: &C, - session_index: SessionIndex, -) -> anyhow::Result { - wait_for_predicate(connection, |session_ix| session_ix >= session_index) -} - -pub fn get_session_period(connection: &C) -> u32 { - connection.read_constant("Elections", "SessionPeriod") -} - -pub fn get_validators_for_session( - connection: &C, - session: SessionIndex, -) -> Vec { - let session_period = get_session_period(connection); - let first_block = session_period * session; - let block = get_block_hash(connection, first_block); - - connection.read_storage_value_at_block(PALLET, "Validators", Some(block)) -} - -pub fn get_current_validators(connection: &C) -> Vec { - connection.read_storage_value(PALLET, "Validators") -} - -pub fn get_current_validator_count(connection: &C) -> u32 { - get_current_validators(connection).len() as u32 -} - -pub fn get_session_first_block(connection: &C, session: SessionIndex) -> BlockHash { - let block_number = session * get_session_period(connection); - get_block_hash(connection, block_number) -} diff --git a/aleph-client/src/staking.rs b/aleph-client/src/staking.rs deleted file mode 100644 index f5b5f443a6..0000000000 --- a/aleph-client/src/staking.rs +++ /dev/null @@ -1,469 +0,0 @@ -use std::collections::{BTreeMap, BTreeSet}; - -use codec::{Compact, Decode, Encode}; -use frame_support::BoundedVec; -use log::{debug, info}; -use pallet_staking::{ - Exposure, MaxUnlockingChunks, RewardDestination, UnlockChunk, ValidatorPrefs, -}; -use primitives::EraIndex; -use rayon::prelude::*; -use sp_core::{storage::StorageKey, Pair, H256}; -use sp_runtime::Perbill; -use substrate_api_client::{ - compose_call, compose_extrinsic, AccountId, Balance, GenericAddress, XtStatus, -}; - -use crate::{ - account_from_keypair, create_connection, locks, send_xt, session::wait_for_predicate, - wait_for_session, AnyConnection, BlockNumber, KeyPair, ReadStorage, RootConnection, - SignedConnection, -}; - -const PALLET: &str = "Staking"; - -pub fn bond( - connection: &SignedConnection, - initial_stake: Balance, - controller_account_id: &AccountId, - status: XtStatus, -) { - let controller_account_id = GenericAddress::Id(controller_account_id.clone()); - - let xt = connection.as_connection().staking_bond( - controller_account_id, - initial_stake, - RewardDestination::Staked, - ); - send_xt(connection, xt, Some("bond"), status); -} - -pub fn multi_bond(node: &str, bonders: &[KeyPair], stake: Balance) { - bonders.par_iter().for_each(|bonder| { - let connection = create_connection(node) - .set_signer(bonder.clone()) - .try_into() - .expect("Signer has been set"); - - let controller_account = account_from_keypair(bonder); - bond(&connection, stake, &controller_account, XtStatus::InBlock); - }); -} - -pub fn validate( - connection: &SignedConnection, - validator_commission_percentage: u8, - status: XtStatus, -) { - let prefs = ValidatorPrefs { - blocked: false, - commission: Perbill::from_percent(validator_commission_percentage as u32), - }; - let xt = compose_extrinsic!(connection.as_connection(), PALLET, "validate", prefs); - send_xt(connection, xt, Some("validate"), status); -} - -pub fn set_staking_limits( - connection: &RootConnection, - minimal_nominator_stake: u128, - minimal_validator_stake: u128, - max_nominators_count: Option, - max_validators_count: Option, - status: XtStatus, -) { - let set_staking_limits_call = compose_call!( - connection.as_connection().metadata, - PALLET, - "set_staking_limits", - minimal_nominator_stake, - minimal_validator_stake, - max_nominators_count, - max_validators_count, - 0_u8 - ); - let xt = compose_extrinsic!( - connection.as_connection(), - "Sudo", - "sudo", - set_staking_limits_call - ); - send_xt(connection, xt, Some("set_staking_limits"), status); -} - -pub fn force_new_era(connection: &RootConnection, status: XtStatus) { - let force_new_era_call = - compose_call!(connection.as_connection().metadata, PALLET, "force_new_era"); - let xt = compose_extrinsic!( - connection.as_connection(), - "Sudo", - "sudo", - force_new_era_call - ); - send_xt(connection, xt, Some("force_new_era"), status); -} - -pub fn wait_for_full_era_completion(connection: &C) -> anyhow::Result { - // staking works in such a way, that when we request a controller to be a validator in era N, - // then the changes are applied in the era N+1 (so the new validator is receiving points in N+1), - // so that we need N+1 to finish in order to claim the reward in era N+2 for the N+1 era - wait_for_era_completion(connection, get_active_era(connection) + 2) -} - -pub fn wait_for_next_era(connection: &C) -> anyhow::Result { - wait_for_era_completion(connection, get_active_era(connection) + 1) -} - -pub fn wait_for_at_least_era( - connection: &C, - era: EraIndex, -) -> anyhow::Result { - let current_era = get_era(connection, None); - if current_era >= era { - return Ok(current_era); - } - let sessions_per_era: u32 = connection.read_constant(PALLET, "SessionsPerEra"); - let first_session_in_era = era * sessions_per_era; - wait_for_predicate(connection, |session| session >= first_session_in_era)?; - Ok(get_era(connection, None)) -} - -pub fn wait_for_era_completion( - connection: &C, - next_era_index: EraIndex, -) -> anyhow::Result { - debug!("waiting for era {}", next_era_index); - let sessions_per_era: u32 = connection.read_constant(PALLET, "SessionsPerEra"); - let first_session_in_next_era = next_era_index * sessions_per_era; - debug!( - "waiting for session first_session_in_next_era={}", - first_session_in_next_era - ); - wait_for_session(connection, first_session_in_next_era)?; - Ok(next_era_index) -} - -pub fn get_sessions_per_era(connection: &C) -> u32 { - connection.read_constant(PALLET, "SessionsPerEra") -} - -pub fn get_era(connection: &C, block: Option) -> EraIndex { - connection - .as_connection() - .get_storage_value(PALLET, "ActiveEra", block) - .expect("Failed to obtain ActiveEra extrinsic!") - .expect("ActiveEra is empty in the storage!") -} - -pub fn get_active_era(connection: &C) -> EraIndex { - get_era(connection, None) -} - -pub fn get_current_era(connection: &C) -> EraIndex { - connection - .as_connection() - .get_storage_value(PALLET, "CurrentEra", None) - .expect("Failed to obtain CurrentEra extrinsic!") - .expect("CurrentEra is empty in the storage!") -} - -pub fn payout_stakers( - stash_connection: &SignedConnection, - stash_account: &AccountId, - era_number: BlockNumber, -) { - let xt = compose_extrinsic!( - stash_connection.as_connection(), - PALLET, - "payout_stakers", - stash_account, - era_number - ); - - send_xt( - stash_connection, - xt, - Some("payout stakers"), - XtStatus::InBlock, - ); -} - -pub fn payout_stakers_and_assert_locked_balance( - stash_connection: &SignedConnection, - accounts_to_check_balance: &[AccountId], - stash_account: &AccountId, - era: BlockNumber, -) { - let locked_stash_balances_before_payout = locks(stash_connection, accounts_to_check_balance); - payout_stakers(stash_connection, stash_account, era - 1); - let locked_stash_balances_after_payout = locks(stash_connection, accounts_to_check_balance); - locked_stash_balances_before_payout.iter() - .zip(locked_stash_balances_after_payout.iter()) - .zip(accounts_to_check_balance.iter()) - .for_each(|((balances_before, balances_after), account_id)| { - assert!(balances_after[0].amount > balances_before[0].amount, - "Expected payout to be positive in locked balance for account {}. Balance before: {}, balance after: {}", - account_id, balances_before[0].amount, balances_after[0].amount); - }); -} - -pub fn batch_bond( - connection: &RootConnection, - stash_controller_accounts: &[(&AccountId, &AccountId)], - bond_value: u128, - reward_destination: RewardDestination, -) { - let metadata = &connection.as_connection().metadata; - - let batch_bond_calls = stash_controller_accounts - .iter() - .cloned() - .map(|(stash_account, controller_account)| { - let bond_call = compose_call!( - metadata, - PALLET, - "bond", - GenericAddress::Id(controller_account.clone()), - Compact(bond_value), - reward_destination.clone() - ); - compose_call!( - metadata, - "Sudo", - "sudo_as", - GenericAddress::Id(stash_account.clone()), - bond_call - ) - }) - .collect::>(); - - let xt = compose_extrinsic!( - connection.as_connection(), - "Utility", - "batch", - batch_bond_calls - ); - send_xt( - connection, - xt, - Some("batch of bond calls"), - XtStatus::InBlock, - ); -} - -pub fn nominate(connection: &SignedConnection, nominee_account_id: &AccountId) { - let xt = connection - .as_connection() - .staking_nominate(vec![GenericAddress::Id(nominee_account_id.clone())]); - send_xt(connection, xt, Some("nominate"), XtStatus::InBlock); -} - -pub fn batch_nominate( - connection: &RootConnection, - nominator_nominee_pairs: &[(&AccountId, &AccountId)], -) { - let metadata = &connection.as_connection().metadata; - - let batch_nominate_calls = nominator_nominee_pairs - .iter() - .cloned() - .map(|(nominator, nominee)| { - let nominate_call = compose_call!( - metadata, - PALLET, - "nominate", - vec![GenericAddress::Id(nominee.clone())] - ); - compose_call!( - metadata, - "Sudo", - "sudo_as", - GenericAddress::Id(nominator.clone()), - nominate_call - ) - }) - .collect::>(); - - let xt = compose_extrinsic!( - connection.as_connection(), - "Utility", - "batch", - batch_nominate_calls - ); - send_xt( - connection, - xt, - Some("batch of nominate calls"), - XtStatus::InBlock, - ); -} - -pub fn bonded(connection: &C, stash: &KeyPair) -> Option { - let account_id = AccountId::from(stash.public()); - connection - .as_connection() - .get_storage_map(PALLET, "Bonded", &account_id, None) - .unwrap_or_else(|_| panic!("Failed to obtain Bonded for account id {}", account_id)) -} - -/// Since PR #10982 changed `pallet_staking::StakingLedger` to be generic over -/// `T: pallet_staking::Config` (somehow breaking consistency with similar structures in other -/// pallets) we have no easy way of retrieving ledgers from storage. Thus, we chose cloning -/// (relevant part of) this struct instead of implementing `Config` trait. -#[derive(Clone, Eq, PartialEq, Debug, Encode, Decode)] -pub struct StakingLedger { - pub stash: AccountId, - #[codec(compact)] - pub total: Balance, - #[codec(compact)] - pub active: Balance, - pub unlocking: BoundedVec, MaxUnlockingChunks>, -} - -pub fn ledger(connection: &C, controller: &KeyPair) -> Option { - let account_id = AccountId::from(controller.public()); - connection - .as_connection() - .get_storage_map(PALLET, "Ledger", &account_id, None) - .unwrap_or_else(|_| panic!("Failed to obtain Ledger for account id {}", account_id)) -} - -pub fn get_payout_for_era(connection: &C, era: EraIndex) -> u128 { - connection - .as_connection() - .get_storage_map(PALLET, "ErasValidatorReward", era, None) - .expect("Failed to obtain ErasValidatorReward") - .expect("ErasValidatoReward is empty in storage") -} - -pub fn get_exposure( - connection: &C, - era: EraIndex, - account_id: &AccountId, - block_hash: Option, -) -> Exposure { - connection - .as_connection() - .get_storage_double_map(PALLET, "ErasStakers", era, account_id, block_hash) - .expect("Failed to obtain ErasStakers extrinsic!") - .unwrap_or_else(|| panic!("Failed to decode ErasStakers for era {}.", era)) -} - -pub type RewardPoint = u32; - -/// Helper to decode reward points for an era without the need to fill in a generic parameter. -/// Reward points of an era. Used to split era total payout between validators. -/// -/// This points will be used to reward validators and their respective nominators. -#[derive(Clone, Decode, Default)] -pub struct EraRewardPoints { - /// Total number of points. Equals the sum of reward points for each validator. - pub total: RewardPoint, - /// The reward points earned by a given validator. - pub individual: BTreeMap, -} - -pub fn get_era_reward_points( - connection: &C, - era: EraIndex, - block_hash: Option, -) -> Option { - connection - .as_connection() - .get_storage_map(PALLET, "ErasRewardPoints", era, block_hash) - .unwrap_or_else(|e| { - panic!( - "Failed to obtain ErasRewardPoints for era {} at block {:?}: {}", - era, block_hash, e - ) - }) -} - -/// Get `ErasStakers` as `StorageKey`s from `pallet_staking` -pub fn get_stakers_as_storage_keys( - connection: &C, - accounts: &[AccountId], - era: EraIndex, -) -> BTreeSet { - accounts - .iter() - .map(|acc| { - connection - .as_connection() - .metadata - .storage_double_map_key(PALLET, "ErasStakers", era, acc) - .unwrap() - }) - .collect() -} - -/// Produce storage key to `ErasStakers::era`. -/// -/// Since in `substrate-api-client` it seems impossible to get prefix for the first key in double -/// map, we have to do it by hand. -pub fn get_eras_stakers_storage_key(era: EraIndex) -> StorageKey { - let mut bytes = sp_core::twox_128(PALLET.as_bytes()).to_vec(); - bytes.extend(&sp_core::twox_128("ErasStakers".as_bytes())[..]); - - let era_encoded = codec::Encode::encode(&era); - // `pallet_staking::ErasStakers`'s keys are `Twox64Concat`-encoded. - let era_key: Vec = sp_core::twox_64(&era_encoded) - .iter() - .chain(&era_encoded) - .cloned() - .collect(); - bytes.extend(era_key); - - StorageKey(bytes) -} - -/// Get `ErasStakers` as `StorageKey`s based on the manually produced first `StorageKey` in the double map. -pub fn get_stakers_as_storage_keys_from_storage_key( - connection: &C, - current_era: EraIndex, - storage_key: StorageKey, -) -> BTreeSet { - let stakers = connection - .as_connection() - .get_keys(storage_key, None) - .unwrap_or_else(|_| panic!("Couldn't read storage keys")) - .unwrap_or_else(|| panic!("Couldn't read `ErasStakers` for era {}", current_era)) - .into_iter() - .map(|key| { - let mut bytes = [0u8; 84]; - hex::decode_to_slice(&key[2..], &mut bytes as &mut [u8]).expect("Should decode key"); - StorageKey(bytes.to_vec()) - }); - BTreeSet::from_iter(stakers) -} - -/// Chill validator. -pub fn chill_validator(connection: &SignedConnection) { - let xt = compose_extrinsic!(connection.as_connection(), PALLET, "chill"); - send_xt( - connection, - xt, - Some("chilling validator"), - XtStatus::InBlock, - ); -} - -/// Chill all validators in `chilling`. -pub fn chill_validators(node: &str, chilling: Vec) { - for validator in chilling.into_iter() { - info!("Chilling validator {:?}", validator.public()); - let connection = SignedConnection::new(node, validator); - chill_validator(&connection); - } -} - -/// Given a `SignedConnection`, bond an extra stake equal to `additional_stake`. -pub fn bond_extra_stake(connection: &SignedConnection, additional_stake: Balance) { - let xt = connection - .as_connection() - .staking_bond_extra(additional_stake); - send_xt(connection, xt, Some("bond_extra"), XtStatus::Finalized); -} - -pub fn get_minimum_validator_count(connection: &C) -> u32 { - connection.read_storage_value(PALLET, "MinimumValidatorCount") -} diff --git a/aleph-client/src/system.rs b/aleph-client/src/system.rs deleted file mode 100644 index 5db1368e9e..0000000000 --- a/aleph-client/src/system.rs +++ /dev/null @@ -1,38 +0,0 @@ -use sp_runtime::Perbill; -use substrate_api_client::{compose_call, compose_extrinsic, XtStatus}; - -use crate::{send_xt, try_send_xt, AnyConnection, CallSystem, RootConnection}; - -pub fn set_code(connection: &RootConnection, runtime: Vec, status: XtStatus) { - let call = compose_call!( - connection.as_connection().metadata, - "System", - "set_code", - runtime - ); - let xt = compose_extrinsic!( - connection.as_connection(), - "Sudo", - "sudo_unchecked_weight", - call, - 0_u64 - ); - send_xt(connection, xt, Some("set_code"), status); -} - -impl CallSystem for RootConnection { - type Error = substrate_api_client::std::error::Error; - - fn fill_block(&self, target_ratio_percent: u32, status: XtStatus) -> Result<(), Self::Error> { - let connection = self.as_connection(); - let target_ratio_perbill = Perbill::from_percent(target_ratio_percent); - let call = compose_call!( - connection.metadata, - "System", - "fill_block", - target_ratio_perbill.deconstruct() - ); - let xt = compose_extrinsic!(connection, "Sudo", "sudo", call); - try_send_xt(&connection, xt, Some("fill block"), status).map(|_| ()) - } -} diff --git a/aleph-client/src/transfer.rs b/aleph-client/src/transfer.rs deleted file mode 100644 index bfaa80912e..0000000000 --- a/aleph-client/src/transfer.rs +++ /dev/null @@ -1,111 +0,0 @@ -use codec::Compact; -use primitives::Balance; -use sp_core::H256; -use sp_runtime::MultiAddress; -use substrate_api_client::{ - compose_call, compose_extrinsic, compose_extrinsic_offline, std::error::Error as SacError, - AccountId, GenericAddress, XtStatus, -}; - -use crate::{ - send_xt, try_send_xt, AnyConnection, BalanceTransfer, BatchTransactions, Extrinsic, - SignedConnection, -}; - -pub type TransferCall = ([u8; 2], MultiAddress, Compact); -pub type TransferTransaction = Extrinsic; - -pub fn transfer( - connection: &SignedConnection, - target: &AccountId, - value: u128, - status: XtStatus, -) -> TransferTransaction { - let xt = connection - .as_connection() - .balance_transfer(GenericAddress::Id(target.clone()), value); - send_xt(connection, xt.clone(), Some("transfer"), status); - xt -} - -pub fn batch_transfer( - connection: &SignedConnection, - account_keys: Vec, - endowment: u128, -) { - let batch_endow = account_keys - .into_iter() - .map(|account_id| { - compose_call!( - connection.as_connection().metadata, - "Balances", - "transfer", - GenericAddress::Id(account_id), - Compact(endowment) - ) - }) - .collect::>(); - - let xt = compose_extrinsic!(connection.as_connection(), "Utility", "batch", batch_endow); - send_xt( - connection, - xt, - Some("batch of endow balances"), - XtStatus::InBlock, - ); -} - -impl SignedConnection { - pub fn create_transfer_extrinsic( - &self, - tx: ::TransferTx, - ) -> TransferTransaction { - let nonce = self.as_connection().get_nonce().unwrap(); - compose_extrinsic_offline!( - self.as_connection().signer.unwrap(), - tx, - self.as_connection().extrinsic_params(nonce) - ) - } -} - -impl BalanceTransfer for SignedConnection { - type TransferTx = TransferCall; - type Error = SacError; - - fn create_transfer_tx(&self, account: AccountId, amount: Balance) -> Self::TransferTx { - compose_call!( - self.as_connection().metadata, - "Balances", - "transfer", - GenericAddress::Id(account), - amount.into() - ) - } - - fn transfer( - &self, - tx: Self::TransferTx, - status: XtStatus, - ) -> Result, Self::Error> { - let xt = self.create_transfer_extrinsic(tx); - try_send_xt(self, xt, Some("transfer"), status) - } -} - -impl BatchTransactions<::TransferTx> for SignedConnection { - type Error = SacError; - - fn batch_and_send_transactions<'a>( - &self, - transactions: impl IntoIterator::TransferTx>, - status: XtStatus, - ) -> Result, Self::Error> - where - ::TransferTx: 'a, - { - let txs = Vec::from_iter(transactions); - let xt = compose_extrinsic!(self.as_connection(), "Utility", "batch", txs); - try_send_xt(self, xt, Some("batch/transfer"), status) - } -} diff --git a/aleph-client/src/treasury.rs b/aleph-client/src/treasury.rs deleted file mode 100644 index 4629d39aa0..0000000000 --- a/aleph-client/src/treasury.rs +++ /dev/null @@ -1,134 +0,0 @@ -use std::{thread, thread::sleep, time::Duration}; - -use codec::Decode; -use frame_support::PalletId; -use primitives::{Balance, MILLISECS_PER_BLOCK}; -use sp_core::H256; -use sp_runtime::{traits::AccountIdConversion, AccountId32}; -use substrate_api_client::{compose_extrinsic, ApiResult, GenericAddress, XtStatus}; - -use crate::{ - try_send_xt, wait_for_event, AnyConnection, ReadStorage, RootConnection, SignedConnection, -}; - -const PALLET: &str = "Treasury"; - -type AnyResult = anyhow::Result; - -/// Returns the account of the treasury. -pub fn treasury_account() -> AccountId32 { - PalletId(*b"a0/trsry").into_account_truncating() -} - -/// Returns how many treasury proposals have ever been created. -pub fn proposals_counter(connection: &C) -> u32 { - connection.read_storage_value_or_default(PALLET, "ProposalCount") -} - -/// Calculates how much balance will be paid out to the treasury after each era. -pub fn staking_treasury_payout(connection: &C) -> Balance { - let sessions_per_era: u32 = connection.read_constant("Staking", "SessionsPerEra"); - let session_period: u32 = connection.read_constant("Elections", "SessionPeriod"); - let millisecs_per_era = MILLISECS_PER_BLOCK * session_period as u64 * sessions_per_era as u64; - primitives::staking::era_payout(millisecs_per_era).1 -} - -/// Creates a proposal of spending treasury's funds. -/// -/// The intention is to transfer `value` balance to `beneficiary`. The signer of `connection` is the -/// proposer. -pub fn propose( - connection: &SignedConnection, - value: Balance, - beneficiary: &AccountId32, -) -> ApiResult> { - let xt = compose_extrinsic!( - connection.as_connection(), - PALLET, - "propose_spend", - Compact(value), - GenericAddress::Id(beneficiary.clone()) - ); - try_send_xt(connection, xt, Some("treasury spend"), XtStatus::Finalized) -} - -/// Approves proposal with id `proposal_id` and waits (in a loop) until pallet storage is updated. -/// -/// Unfortunately, pallet treasury does not emit any event (like while rejecting), so we have to -/// keep reading storage to be sure. Hence, it may be an expensive call. -/// -/// Be careful, since execution might never end. -pub fn approve(connection: &RootConnection, proposal_id: u32) -> AnyResult<()> { - send_approval(connection, proposal_id)?; - wait_for_approval(connection, proposal_id) -} - -/// Rejects proposal with id `proposal_id` and waits for the corresponding event. -/// -/// Be careful, since execution might never end (we may stuck on waiting for the event forever). -pub fn reject(connection: &RootConnection, proposal_id: u32) -> AnyResult<()> { - let listener = { - let (c, p) = (connection.clone(), proposal_id); - thread::spawn(move || wait_for_rejection(&c, p)) - }; - send_rejection(connection, proposal_id)?; - listener - .join() - .expect("Corresponding event should have been emitted") -} - -#[derive(Debug, Decode, Copy, Clone)] -struct ProposalRejectedEvent { - proposal_id: u32, - _slashed: Balance, -} - -fn wait_for_rejection(connection: &C, proposal_id: u32) -> AnyResult<()> { - wait_for_event( - connection, - (PALLET, "Rejected"), - |e: ProposalRejectedEvent| proposal_id.eq(&e.proposal_id), - ) - .map(|_| ()) -} - -fn send_rejection(connection: &RootConnection, proposal_id: u32) -> ApiResult> { - let xt = compose_extrinsic!( - connection.as_connection(), - PALLET, - "reject_proposal", - Compact(proposal_id) - ); - try_send_xt( - connection, - xt, - Some("treasury rejection"), - XtStatus::Finalized, - ) -} - -fn send_approval(connection: &RootConnection, proposal_id: u32) -> ApiResult> { - let xt = compose_extrinsic!( - connection.as_connection(), - PALLET, - "approve_proposal", - Compact(proposal_id) - ); - try_send_xt( - connection, - xt, - Some("treasury approval"), - XtStatus::Finalized, - ) -} - -fn wait_for_approval(connection: &C, proposal_id: u32) -> AnyResult<()> { - loop { - let approvals: Vec = connection.read_storage_value(PALLET, "Approvals"); - if approvals.contains(&proposal_id) { - return Ok(()); - } else { - sleep(Duration::from_millis(500)) - } - } -} diff --git a/aleph-client/src/utility.rs b/aleph-client/src/utility.rs new file mode 100644 index 0000000000..eceae643d7 --- /dev/null +++ b/aleph-client/src/utility.rs @@ -0,0 +1,57 @@ +use log::info; +use primitives::{BlockNumber, EraIndex, SessionIndex}; +use subxt::ext::sp_core::H256; + +use crate::{ + pallets::{elections::ElectionsApi, staking::StakingApi}, + Connection, +}; + +#[async_trait::async_trait] +pub trait BlocksApi { + async fn first_block_of_session(&self, session: SessionIndex) -> Option; + async fn get_block_hash(&self, block: BlockNumber) -> Option; + async fn get_best_block(&self) -> BlockNumber; +} + +#[async_trait::async_trait] +pub trait SessionEraApi { + async fn get_era_for_session(&self, session: SessionIndex) -> EraIndex; +} + +#[async_trait::async_trait] +impl BlocksApi for Connection { + async fn first_block_of_session(&self, session: SessionIndex) -> Option { + let period = self.get_session_period().await; + let block_num = period * session; + + self.get_block_hash(block_num).await + } + + async fn get_block_hash(&self, block: BlockNumber) -> Option { + info!(target: "aleph-client", "querying block hash for number #{}", block); + self.client + .rpc() + .block_hash(Some(block.into())) + .await + .unwrap() + } + + async fn get_best_block(&self) -> BlockNumber { + self.client + .rpc() + .header(None) + .await + .unwrap() + .unwrap() + .number + } +} + +#[async_trait::async_trait] +impl SessionEraApi for Connection { + async fn get_era_for_session(&self, session: SessionIndex) -> EraIndex { + let block = self.first_block_of_session(session).await; + self.get_active_era(block).await + } +} diff --git a/aleph-client/src/version_upgrade.rs b/aleph-client/src/version_upgrade.rs deleted file mode 100644 index 5265aaf6d3..0000000000 --- a/aleph-client/src/version_upgrade.rs +++ /dev/null @@ -1,36 +0,0 @@ -use anyhow::Result; -use primitives::SessionIndex; -use substrate_api_client::{compose_call, compose_extrinsic, ApiClientError, XtStatus}; - -use crate::{try_send_xt, AnyConnection, RootConnection}; - -pub type Version = u32; - -pub fn schedule_upgrade( - connection: &RootConnection, - version: Version, - session: SessionIndex, -) -> Result<(), ApiClientError> { - let connection = connection.as_connection(); - let upgrade_call = compose_call!( - connection.metadata, - "Aleph", - "schedule_finality_version_change", - version, - session - ); - let xt = compose_extrinsic!( - connection, - "Sudo", - "sudo_unchecked_weight", - upgrade_call, - 0_u64 - ); - try_send_xt( - &connection, - xt, - Some("schedule finality version change"), - XtStatus::Finalized, - ) - .map(|_| ()) -} diff --git a/aleph-client/src/vesting.rs b/aleph-client/src/vesting.rs deleted file mode 100644 index 16b76d89f1..0000000000 --- a/aleph-client/src/vesting.rs +++ /dev/null @@ -1,121 +0,0 @@ -use anyhow::Result; -use log::info; -pub use pallet_vesting::VestingInfo; -use primitives::Balance; -use substrate_api_client::{compose_extrinsic, GenericAddress, XtStatus::Finalized}; -use thiserror::Error; - -use crate::{ - account_from_keypair, try_send_xt, AccountId, AnyConnection, BlockNumber, SignedConnection, -}; - -const PALLET: &str = "Vesting"; - -/// Gathers errors from this module. -#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Error)] -pub enum VestingError { - #[error("🦺❌ The connection should be signed.")] - UnsignedConnection, -} - -pub type VestingSchedule = VestingInfo; - -/// Calls `pallet_vesting::vest` for the signer of `connection`, i.e. makes all unlocked balances -/// transferable. -/// -/// Fails if transaction could not have been sent. -/// -/// *Note*: This function returns `Ok(_)` even if the account has no active vesting schedules -/// and thus the extrinsic was not successful. However, semantically it is still correct. -pub fn vest(connection: SignedConnection) -> Result<()> { - let vester = connection.signer(); - let xt = compose_extrinsic!(connection.as_connection(), PALLET, "vest"); - let block_hash = try_send_xt(&connection, xt, Some("Vesting"), Finalized)? - .expect("For `Finalized` status a block hash should be returned"); - info!( - target: "aleph-client", "Vesting for the account {:?}. Finalized in block {:?}", - account_from_keypair(&vester), block_hash - ); - Ok(()) -} - -/// Calls `pallet_vesting::vest_other` by the signer of `connection` on behalf of `vest_account`, -/// i.e. makes all unlocked balances of `vest_account` transferable. -/// -/// Fails if transaction could not have been sent. -/// -/// *Note*: This function returns `Ok(_)` even if the account has no active vesting schedules -/// and thus the extrinsic was not successful. However, semantically it is still correct. -pub fn vest_other(connection: SignedConnection, vest_account: AccountId) -> Result<()> { - let xt = compose_extrinsic!( - connection.as_connection(), - PALLET, - "vest_other", - GenericAddress::Id(vest_account.clone()) - ); - let block_hash = try_send_xt(&connection, xt, Some("Vesting on behalf"), Finalized)? - .expect("For `Finalized` status a block hash should be returned"); - info!(target: "aleph-client", "Vesting on behalf of the account {:?}. Finalized in block {:?}", vest_account, block_hash); - Ok(()) -} - -/// Performs a vested transfer from the signer of `connection` to `receiver` according to -/// `schedule`. -/// -/// Fails if transaction could not have been sent. -pub fn vested_transfer( - connection: SignedConnection, - receiver: AccountId, - schedule: VestingSchedule, -) -> Result<()> { - let xt = compose_extrinsic!( - connection.as_connection(), - PALLET, - "vested_transfer", - GenericAddress::Id(receiver.clone()), - schedule - ); - let block_hash = try_send_xt(&connection, xt, Some("Vested transfer"), Finalized)? - .expect("For `Finalized` status a block hash should be returned"); - info!(target: "aleph-client", "Vested transfer to the account {:?}. Finalized in block {:?}", receiver, block_hash); - Ok(()) -} - -/// Returns all active schedules of `who`. If `who` does not have any active vesting schedules, -/// an empty container is returned. -/// -/// Fails if storage could have not been read. -pub fn get_schedules( - connection: &C, - who: AccountId, -) -> Result> { - connection - .as_connection() - .get_storage_map::>(PALLET, "Vesting", who, None)? - .map_or_else(|| Ok(vec![]), Ok) -} - -/// Merges two vesting schedules (at indices `idx1` and `idx2`) of the signer of `connection`. -/// -/// Fails if transaction could not have been sent. -/// -/// *Note*: This function returns `Ok(_)` even if the account has no active vesting schedules, or -/// it has fewer schedules than `max(idx1, idx2) - 1` and thus the extrinsic was not successful. -pub fn merge_schedules(connection: SignedConnection, idx1: u32, idx2: u32) -> Result<()> { - let who = connection.signer(); - let xt = compose_extrinsic!( - connection.as_connection(), - PALLET, - "merge_schedules", - idx1, - idx2 - ); - - let block_hash = try_send_xt(&connection, xt, Some("Merge vesting schedules"), Finalized)? - .expect("For `Finalized` status a block hash should be returned"); - - info!(target: "aleph-client", - "Merging vesting schedules (indices: {} and {}) for the account {:?}. Finalized in block {:?}", - idx1, idx2, account_from_keypair(&who), block_hash); - Ok(()) -} diff --git a/aleph-client/src/waiting.rs b/aleph-client/src/waiting.rs index a6ee4a9032..cb5fe3c92c 100644 --- a/aleph-client/src/waiting.rs +++ b/aleph-client/src/waiting.rs @@ -1,56 +1,120 @@ -use std::sync::mpsc::channel; - -use anyhow::{anyhow, Result as AnyResult}; -use codec::Decode; -use log::{error, info}; -use substrate_api_client::ApiResult; - -use crate::{AnyConnection, BlockNumber, Header}; - -pub fn wait_for_event bool>( - connection: &C, - event: (&str, &str), - predicate: P, -) -> AnyResult { - let (module, variant) = event; - info!(target: "aleph-client", "Creating event subscription {}/{}", module, variant); - - let (events_in, events_out) = channel(); - connection.as_connection().subscribe_events(events_in)?; - - loop { - let args: ApiResult = - connection - .as_connection() - .wait_for_event(module, variant, None, &events_out); - - match args { - Ok(event) if predicate(event.clone()) => return Ok(event), - Ok(_) => (), - Err(why) => error!(target: "aleph-client", "Error {:?}", why), +use futures::StreamExt; +use log::info; +use primitives::{EraIndex, SessionIndex}; +use subxt::events::StaticEvent; + +use crate::{ + aleph_zero, + api::session::events::NewSession, + pallets::{session::SessionApi, staking::StakingApi}, + Connection, +}; + +pub enum BlockStatus { + Best, + Finalized, +} + +#[async_trait::async_trait] +pub trait AlephWaiting { + async fn wait_for_block bool + Send>(&self, predicate: P, status: BlockStatus); + async fn wait_for_event bool + Send>( + &self, + predicate: P, + status: BlockStatus, + ) -> T; + async fn wait_for_era(&self, era: EraIndex, status: BlockStatus); + async fn wait_for_session(&self, session: SessionIndex, status: BlockStatus); +} + +#[async_trait::async_trait] +pub trait WaitingExt { + async fn wait_for_n_sessions(&self, n: SessionIndex, status: BlockStatus); + async fn wait_for_n_eras(&self, n: EraIndex, status: BlockStatus); +} + +#[async_trait::async_trait] +impl AlephWaiting for Connection { + async fn wait_for_block bool + Send>(&self, predicate: P, status: BlockStatus) { + let mut block_sub = match status { + BlockStatus::Best => self.client.rpc().subscribe_blocks().await.unwrap(), + BlockStatus::Finalized => self + .client + .rpc() + .subscribe_finalized_blocks() + .await + .unwrap(), + }; + + while let Some(Ok(block)) = block_sub.next().await { + if predicate(block.number) { + return; + } } } -} -pub fn wait_for_finalized_block( - connection: &C, - block_number: BlockNumber, -) -> AnyResult { - let (sender, receiver) = channel(); - connection - .as_connection() - .subscribe_finalized_heads(sender)?; - - while let Ok(header) = receiver - .recv() - .map(|h| serde_json::from_str::
(&h).expect("Should deserialize header")) - { - info!(target: "aleph-client", "Received header for a block number {:?}", header.number); - - if header.number.ge(&block_number) { - return Ok(block_number); + async fn wait_for_event bool + Send>( + &self, + predicate: P, + status: BlockStatus, + ) -> T { + let mut event_sub = match status { + BlockStatus::Best => self.client.events().subscribe().await.unwrap().boxed(), + BlockStatus::Finalized => self + .client + .events() + .subscribe_finalized() + .await + .unwrap() + .boxed(), + }; + + info!(target: "aleph-client", "waiting for event {}.{}", T::PALLET, T::EVENT); + + loop { + let events = match event_sub.next().await { + Some(Ok(events)) => events, + _ => continue, + }; + for event in events.iter() { + let event = event.unwrap(); + if let Ok(Some(ev)) = event.as_event::() { + if predicate(&ev) { + return ev; + } + } + } } } - Err(anyhow!("Waiting for finalization is no longer possible")) + async fn wait_for_era(&self, era: EraIndex, status: BlockStatus) { + let addrs = aleph_zero::api::constants().staking().sessions_per_era(); + let sessions_per_era = self.client.constants().at(&addrs).unwrap(); + let first_session_in_era = era * sessions_per_era; + + self.wait_for_session(first_session_in_era, status).await; + } + + async fn wait_for_session(&self, session: SessionIndex, status: BlockStatus) { + self.wait_for_event(|event: &NewSession| { + info!(target: "aleph-client", "waiting for session {:?}, current session {:?}", session, event.session_index); + event.session_index >= session + }, status) + .await; + } +} + +#[async_trait::async_trait] +impl WaitingExt for Connection { + async fn wait_for_n_sessions(&self, n: SessionIndex, status: BlockStatus) { + let current_session = self.get_session(None).await; + + self.wait_for_session(current_session + n, status).await; + } + + async fn wait_for_n_eras(&self, n: EraIndex, status: BlockStatus) { + let current_era = self.get_current_era(None).await; + + self.wait_for_era(current_era + n, status).await; + } } diff --git a/benches/payout-stakers/Cargo.lock b/benches/payout-stakers/Cargo.lock index 8d216c22b4..4290536749 100644 --- a/benches/payout-stakers/Cargo.lock +++ b/benches/payout-stakers/Cargo.lock @@ -12,55 +12,6 @@ dependencies = [ "regex", ] -[[package]] -name = "ac-compose-macros" -version = "0.1.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate-api-client.git?branch=aleph-v0.9.28#92bc66b75428213e4bcdb2484616cf458455813a" -dependencies = [ - "ac-primitives", - "log", - "parity-scale-codec", - "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "ac-node-api" -version = "0.1.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate-api-client.git?branch=aleph-v0.9.28#92bc66b75428213e4bcdb2484616cf458455813a" -dependencies = [ - "ac-primitives", - "derive_more", - "frame-metadata 15.0.0 (git+https://github.com/integritee-network/frame-metadata)", - "frame-support", - "frame-system", - "hex", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "serde_json", - "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "ac-primitives" -version = "0.1.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate-api-client.git?branch=aleph-v0.9.28#92bc66b75428213e4bcdb2484616cf458455813a" -dependencies = [ - "hex", - "parity-scale-codec", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "addr2line" version = "0.17.0" @@ -98,31 +49,25 @@ dependencies = [ [[package]] name = "aleph_client" -version = "1.11.0" +version = "2.0.0" dependencies = [ - "ac-node-api", - "ac-primitives", "anyhow", + "async-trait", "contract-metadata 1.5.0", "contract-transcode", "frame-support", + "futures", "hex", "ink_metadata", "log", - "pallet-aleph", - "pallet-balances", - "pallet-elections", - "pallet-multisig", - "pallet-staking", - "pallet-treasury", - "pallet-vesting", "parity-scale-codec", "primitives", "rayon", + "serde", "serde_json", "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "substrate-api-client", + "subxt", "thiserror", ] @@ -141,7 +86,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -150,15 +95,6 @@ version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" -[[package]] -name = "approx" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" -dependencies = [ - "num-traits", -] - [[package]] name = "arrayref" version = "0.3.6" @@ -186,6 +122,16 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +[[package]] +name = "async-lock" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" +dependencies = [ + "event-listener", + "futures-lite", +] + [[package]] name = "async-trait" version = "0.1.58" @@ -205,7 +151,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -222,7 +168,7 @@ checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -247,6 +193,15 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +dependencies = [ + "serde", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -356,16 +311,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -dependencies = [ - "byteorder", - "iovec", -] - [[package]] name = "bytes" version = "1.2.1" @@ -378,12 +323,6 @@ version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -399,7 +338,7 @@ dependencies = [ "iana-time-zone", "num-integer", "num-traits", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -516,10 +455,14 @@ dependencies = [ ] [[package]] -name = "convert_case" -version = "0.4.0" +name = "core-foundation" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] [[package]] name = "core-foundation-sys" @@ -542,7 +485,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -552,7 +495,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] @@ -564,7 +507,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", "memoffset", "scopeguard", @@ -576,7 +519,7 @@ version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -697,6 +640,41 @@ dependencies = [ "syn", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "der" version = "0.5.1" @@ -706,16 +684,25 @@ dependencies = [ "const-oid", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "convert_case", "proc-macro2", "quote", - "rustc_version", "syn", ] @@ -881,12 +868,27 @@ dependencies = [ "rustversion", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + [[package]] name = "fake-simd" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + [[package]] name = "ff" version = "0.11.1" @@ -910,19 +912,10 @@ dependencies = [ ] [[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" @@ -933,73 +926,13 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "frame-benchmarking" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "linregress", - "log", - "parity-scale-codec", - "paste", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-storage 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "frame-election-provider-solution-type" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "frame-election-provider-support" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-election-provider-solution-type", - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-arithmetic 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-npos-elections", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "frame-metadata" version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df6bb8542ef006ef0de09a5c4420787d79823c0ed7924225822362fd2bf2ff2d" dependencies = [ - "cfg-if 1.0.0", - "parity-scale-codec", - "scale-info", - "serde", -] - -[[package]] -name = "frame-metadata" -version = "15.0.0" -source = "git+https://github.com/integritee-network/frame-metadata#3b43da9821238681f9431276d55b92a079142083" -dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "parity-scale-codec", "scale-info", "serde", @@ -1011,7 +944,7 @@ version = "4.0.0-dev" source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" dependencies = [ "bitflags", - "frame-metadata 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", "k256", @@ -1070,39 +1003,6 @@ dependencies = [ "syn", ] -[[package]] -name = "frame-system" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-version", -] - -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "funty" version = "2.0.0" @@ -1158,6 +1058,21 @@ version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + [[package]] name = "futures-macro" version = "0.3.25" @@ -1230,7 +1145,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi 0.9.0+wasi-snapshot-preview1", @@ -1243,7 +1158,7 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] @@ -1341,6 +1256,17 @@ dependencies = [ "hmac 0.8.1", ] +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "httparse" version = "1.8.0" @@ -1364,7 +1290,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1377,6 +1303,12 @@ dependencies = [ "cxx-build", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.3.0" @@ -1438,7 +1370,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c9588a59a0e8997c0b2153cd11b5aaa77c06a0537a6b18f3811d1f1aa098b12" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1464,7 +1396,7 @@ checksum = "a891d34301a3dbb1c7b7424c49ae184282b163491c54f9acd17fcbe14a80447b" dependencies = [ "arrayref", "blake2", - "cfg-if 1.0.0", + "cfg-if", "derive_more", "ink_allocator", "ink_engine", @@ -1503,7 +1435,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f031e6b8495594a7288b089bf4122e76c26b994959d1b2b693bdfe846b14c0e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1512,28 +1444,28 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e12cf42dce81d060401c7cec95a392ad6d3c2f18661fa3083f619ce135133c33" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ink_prelude", "parity-scale-codec", "scale-info", ] [[package]] -name = "integer-sqrt" -version = "0.1.5" +name = "instant" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "num-traits", + "cfg-if", ] [[package]] -name = "iovec" -version = "0.1.4" +name = "integer-sqrt" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" dependencies = [ - "libc", + "num-traits", ] [[package]] @@ -1567,56 +1499,103 @@ dependencies = [ ] [[package]] -name = "k256" -version = "0.10.4" +name = "jsonrpsee" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" +checksum = "8bd0d559d5e679b1ab2f869b486a11182923863b1b3ee8b421763cdd707b783a" dependencies = [ - "cfg-if 1.0.0", - "ecdsa", - "elliptic-curve", - "sec1", + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", ] [[package]] -name = "keccak" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" - -[[package]] -name = "kernel32-sys" -version = "0.2.2" +name = "jsonrpsee-client-transport" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +checksum = "8752740ecd374bcbf8b69f3e80b0327942df76f793f8d4e60d3355650c31fb74" dependencies = [ - "winapi 0.2.8", - "winapi-build", + "futures-util", + "http", + "jsonrpsee-core", + "jsonrpsee-types", + "pin-project", + "rustls-native-certs", + "soketto", + "thiserror", + "tokio", + "tokio-rustls", + "tokio-util", + "tracing", + "webpki-roots", ] [[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.3.0" +name = "jsonrpsee-core" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - -[[package]] -name = "libc" -version = "0.2.135" +checksum = "f3dc3e9cf2ba50b7b1d7d76a667619f82846caa39e8e8daa8a4962d74acaddca" +dependencies = [ + "anyhow", + "async-lock", + "async-trait", + "beef", + "futures-channel", + "futures-timer", + "futures-util", + "jsonrpsee-types", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" +checksum = "e290bba767401b646812f608c099b922d8142603c9e73a50fb192d3ac86f4a0d" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] [[package]] -name = "libm" -version = "0.2.5" +name = "k256" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "292a948cd991e376cf75541fe5b97a1081d713c618b4f1b9500f8844e49eb565" +checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sec1", +] + +[[package]] +name = "keccak" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.135" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" [[package]] name = "libsecp256k1" @@ -1675,16 +1654,6 @@ dependencies = [ "cc", ] -[[package]] -name = "linregress" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c601a85f5ecd1aba625247bca0031585fb1c446461b142878a16f8245ddeb8" -dependencies = [ - "nalgebra", - "statrs", -] - [[package]] name = "lock_api" version = "0.4.9" @@ -1701,7 +1670,7 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1713,15 +1682,6 @@ dependencies = [ "regex-automata", ] -[[package]] -name = "matrixmultiply" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add85d4dd35074e6fedc608f8c8f513a3548619a9024b751949ef0e8e45a4d84" -dependencies = [ - "rawpointer", -] - [[package]] name = "memchr" version = "2.5.0" @@ -1783,85 +1743,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.6.23" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", "libc", "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - -[[package]] -name = "nalgebra" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "462fffe4002f4f2e1f6a9dcf12cc1a6fc0e15989014efc02a941d3e0f5dc2120" -dependencies = [ - "approx", - "matrixmultiply", - "nalgebra-macros", - "num-complex", - "num-rational 0.4.1", - "num-traits", - "rand 0.8.5", - "rand_distr", - "simba", - "typenum", -] - -[[package]] -name = "nalgebra-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01fcc0b8149b4632adc89ac3b7b31a12fb6099a0317a4eb2ebff574ef7de7218" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "net2" -version = "0.2.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.42.0", ] [[package]] @@ -1904,15 +1793,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-complex" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" -dependencies = [ - "num-traits", -] - [[package]] name = "num-format" version = "0.4.3" @@ -1945,17 +1825,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.15" @@ -1963,7 +1832,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -2004,43 +1872,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] -name = "openssl" -version = "0.10.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" -dependencies = [ - "bitflags", - "cfg-if 1.0.0", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-sys" -version = "0.9.77" +name = "openssl-probe" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" -dependencies = [ - "autocfg", - "cc", - "libc", - "pkg-config", - "vcpkg", -] +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "os_str_bytes" @@ -2048,201 +1883,6 @@ version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" -[[package]] -name = "pallet-aleph" -version = "0.5.0" -dependencies = [ - "frame-support", - "frame-system", - "pallet-balances", - "pallet-session", - "pallets-support", - "parity-scale-codec", - "primitives", - "scale-info", - "serde", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-authorship" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "sp-authorship", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-balances" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-elections" -version = "0.5.0" -dependencies = [ - "frame-election-provider-support", - "frame-support", - "frame-system", - "pallet-authorship", - "pallet-balances", - "pallet-session", - "pallet-staking", - "pallets-support", - "parity-scale-codec", - "primitives", - "scale-info", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-staking", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-multisig" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-session" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "pallet-timestamp", - "parity-scale-codec", - "scale-info", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-session", - "sp-staking", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-trie 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-staking" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-election-provider-support", - "frame-support", - "frame-system", - "log", - "pallet-authorship", - "pallet-session", - "parity-scale-codec", - "scale-info", - "serde", - "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-staking", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-inherents", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-timestamp", -] - -[[package]] -name = "pallet-transaction-payment" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-treasury" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "pallet-balances", - "parity-scale-codec", - "scale-info", - "serde", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-vesting" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallets-support" -version = "0.1.0" -dependencies = [ - "frame-support", -] - [[package]] name = "parity-scale-codec" version = "3.2.1" @@ -2252,7 +1892,7 @@ dependencies = [ "arrayvec 0.7.2", "bitvec", "byte-slice-cast", - "bytes 1.2.1", + "bytes", "impl-trait-for-tuples", "parity-scale-codec-derive", "serde", @@ -2276,13 +1916,13 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "hashbrown", "impl-trait-for-tuples", "parity-util-mem-derive", "parking_lot", "primitive-types", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2302,6 +1942,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + [[package]] name = "parking_lot" version = "0.12.1" @@ -2318,11 +1964,11 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2339,15 +1985,16 @@ dependencies = [ "anyhow", "clap", "env_logger 0.8.4", + "futures", "hex", "log", "parity-scale-codec", "primitives", "rand 0.8.5", - "rayon", "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", "sp-keyring", - "substrate-api-client", + "subxt", + "tokio", ] [[package]] @@ -2374,6 +2021,26 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" version = "0.2.9" @@ -2386,12 +2053,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" - [[package]] name = "ppv-lite86" version = "0.2.16" @@ -2548,16 +2209,6 @@ dependencies = [ "getrandom 0.2.8", ] -[[package]] -name = "rand_distr" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" -dependencies = [ - "num-traits", - "rand 0.8.5", -] - [[package]] name = "rand_hc" version = "0.2.0" @@ -2576,12 +2227,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - [[package]] name = "rayon" version = "1.5.3" @@ -2672,6 +2317,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + [[package]] name = "rlibc" version = "1.0.0" @@ -2697,12 +2357,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] -name = "rustc_version" -version = "0.4.0" +name = "rustls" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" dependencies = [ - "semver", + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +dependencies = [ + "base64", ] [[package]] @@ -2717,6 +2401,29 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +[[package]] +name = "scale-bits" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd7aca73785181cc41f0bbe017263e682b585ca660540ba569133901d013ecf" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "scale-decode" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d823d4be477fc33321f93d08fb6c2698273d044f01362dc27573a750deb7c233" +dependencies = [ + "parity-scale-codec", + "scale-bits", + "scale-info", + "thiserror", +] + [[package]] name = "scale-info" version = "2.2.0" @@ -2724,7 +2431,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "333af15b02563b8182cd863f925bd31ef8fa86a0e095d30c091956057d436153" dependencies = [ "bitvec", - "cfg-if 1.0.0", + "cfg-if", "derive_more", "parity-scale-codec", "scale-info-derive", @@ -2743,6 +2450,33 @@ dependencies = [ "syn", ] +[[package]] +name = "scale-value" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16a5e7810815bd295da73e4216d1dfbced3c7c7c7054d70fa5f6e4c58123fff4" +dependencies = [ + "either", + "frame-metadata", + "parity-scale-codec", + "scale-bits", + "scale-decode", + "scale-info", + "serde", + "thiserror", + "yap", +] + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys 0.36.1", +] + [[package]] name = "schnorrkel" version = "0.9.1" @@ -2773,6 +2507,16 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "sec1" version = "0.2.1" @@ -2830,6 +2574,29 @@ dependencies = [ "zeroize", ] +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "1.0.14" @@ -2872,14 +2639,15 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.8.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", ] [[package]] @@ -2901,7 +2669,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", @@ -2913,7 +2681,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.5", ] @@ -2938,25 +2706,22 @@ dependencies = [ ] [[package]] -name = "signature" +name = "signal-hook-registry" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" dependencies = [ - "digest 0.9.0", - "rand_core 0.6.4", + "libc", ] [[package]] -name = "simba" -version = "0.5.1" +name = "signature" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e82063457853d00243beda9952e910b82593e4b07ae9f721b9278a99a0d3d5c" +checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" dependencies = [ - "approx", - "num-complex", - "num-traits", - "paste", + "digest 0.9.0", + "rand_core 0.6.4", ] [[package]] @@ -2974,6 +2739,31 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64", + "bytes", + "futures", + "httparse", + "log", + "rand 0.8.5", + "sha-1", +] + [[package]] name = "sp-api" version = "4.0.0-dev" @@ -3053,24 +2843,12 @@ source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=alep dependencies = [ "integer-sqrt", "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-debug-derive 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "static_assertions", -] - -[[package]] -name = "sp-authorship" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "async-trait", - "parity-scale-codec", - "sp-inherents", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "parity-scale-codec", + "scale-info", + "serde", + "sp-debug-derive 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "static_assertions", ] [[package]] @@ -3294,7 +3072,7 @@ name = "sp-io" version = "6.0.0" source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" dependencies = [ - "bytes 1.2.1", + "bytes", "futures", "hash-db", "libsecp256k1", @@ -3359,20 +3137,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "sp-npos-elections" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-arithmetic 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "sp-panic-handler" version = "4.0.0" @@ -3394,16 +3158,6 @@ dependencies = [ "regex", ] -[[package]] -name = "sp-rpc" -version = "6.0.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "rustc-hash", - "serde", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "sp-runtime" version = "6.0.0" @@ -3472,7 +3226,7 @@ name = "sp-runtime-interface" version = "6.0.0" source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" dependencies = [ - "bytes 1.2.1", + "bytes", "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", @@ -3510,20 +3264,6 @@ dependencies = [ "syn", ] -[[package]] -name = "sp-session" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-staking", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "sp-staking" version = "4.0.0-dev" @@ -3619,22 +3359,6 @@ dependencies = [ "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", ] -[[package]] -name = "sp-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "async-trait", - "futures-timer", - "log", - "parity-scale-codec", - "sp-api", - "sp-inherents", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "thiserror", -] - [[package]] name = "sp-tracing" version = "5.0.0" @@ -3745,6 +3469,12 @@ dependencies = [ "wasmi", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "ss58-registry" version = "1.33.0" @@ -3766,19 +3496,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "statrs" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05bdbb8e4e78216a85785a85d3ec3183144f98d0097b9281802c019bb07a6f05" -dependencies = [ - "approx", - "lazy_static", - "nalgebra", - "num-traits", - "rand 0.8.5", -] - [[package]] name = "strsim" version = "0.10.0" @@ -3807,36 +3524,6 @@ dependencies = [ "syn", ] -[[package]] -name = "substrate-api-client" -version = "0.6.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate-api-client.git?branch=aleph-v0.9.28#92bc66b75428213e4bcdb2484616cf458455813a" -dependencies = [ - "ac-compose-macros", - "ac-node-api", - "ac-primitives", - "frame-metadata 15.0.0 (git+https://github.com/integritee-network/frame-metadata)", - "frame-support", - "frame-system", - "hex", - "log", - "pallet-balances", - "pallet-staking", - "pallet-transaction-payment", - "parity-scale-codec", - "primitive-types", - "serde", - "serde_json", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-rpc", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-version", - "thiserror", - "ws", -] - [[package]] name = "substrate-bip39" version = "0.4.4" @@ -3856,6 +3543,75 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +[[package]] +name = "subxt" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a8757ee0e19f87e722577282ab1386c86592a4b13ff963b9c6ec4176348104c" +dependencies = [ + "bitvec", + "derivative", + "frame-metadata", + "futures", + "hex", + "jsonrpsee", + "parity-scale-codec", + "parking_lot", + "scale-decode", + "scale-info", + "scale-value", + "serde", + "serde_json", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "subxt-macro", + "subxt-metadata", + "thiserror", + "tracing", +] + +[[package]] +name = "subxt-codegen" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb77f93e11e6ff3ff95fe33e3d24c27c342e16feca8ef47759993614ebe90d2c" +dependencies = [ + "darling", + "frame-metadata", + "heck", + "parity-scale-codec", + "proc-macro-error", + "proc-macro2", + "quote", + "scale-info", + "subxt-metadata", + "syn", +] + +[[package]] +name = "subxt-macro" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051cc21d77a54ae944b872eafdf9edfe1d9134fdfcfc3477dc10f763c76564a9" +dependencies = [ + "darling", + "proc-macro-error", + "subxt-codegen", + "syn", +] + +[[package]] +name = "subxt-metadata" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ed78d80db3a97d55e8b1cfecc1f6f9e21793a589d4e2e5f4fe2d6d5850c2e54" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "syn" version = "1.0.103" @@ -3972,6 +3728,62 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +[[package]] +name = "tokio" +version = "1.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite", + "tokio", +] + [[package]] name = "toml" version = "0.5.9" @@ -3987,7 +3799,7 @@ version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -4014,6 +3826,16 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + [[package]] name = "tracing-log" version = "0.1.3" @@ -4091,7 +3913,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "digest 0.10.5", "rand 0.8.5", "static_assertions", @@ -4148,6 +3970,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "url" version = "2.3.1" @@ -4166,18 +3994,18 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -4196,7 +4024,7 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -4253,7 +4081,7 @@ dependencies = [ "downcast-rs", "libc", "memory_units", - "num-rational 0.2.4", + "num-rational", "num-traits", "parity-wasm", "wasmi-validation", @@ -4269,10 +4097,33 @@ dependencies = [ ] [[package]] -name = "winapi" -version = "0.2.8" +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" +dependencies = [ + "webpki", +] [[package]] name = "winapi" @@ -4284,12 +4135,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -4302,7 +4147,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -4311,6 +4156,19 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + [[package]] name = "windows-sys" version = "0.42.0" @@ -4318,12 +4176,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_x86_64_msvc 0.42.0", ] [[package]] @@ -4332,24 +4190,48 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + [[package]] name = "windows_aarch64_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + [[package]] name = "windows_i686_gnu" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + [[package]] name = "windows_i686_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + [[package]] name = "windows_x86_64_gnu" version = "0.42.0" @@ -4364,38 +4246,15 @@ checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" [[package]] name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" - -[[package]] -name = "ws" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fe90c75f236a0a00247d5900226aea4f2d7b05ccc34da9e7a8880ff59b5848" -dependencies = [ - "byteorder", - "bytes 0.4.12", - "httparse", - "log", - "mio", - "mio-extras", - "openssl", - "rand 0.7.3", - "sha-1", - "slab", - "url", -] +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] -name = "ws2_32-sys" -version = "0.2.1" +name = "windows_x86_64_msvc" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" [[package]] name = "wyz" @@ -4406,6 +4265,12 @@ dependencies = [ "tap", ] +[[package]] +name = "yap" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc77f52dc9e9b10d55d3f4462c3b7fc393c4f17975d641542833ab2d3bc26ef" + [[package]] name = "zeroize" version = "1.5.7" diff --git a/benches/payout-stakers/Cargo.toml b/benches/payout-stakers/Cargo.toml index 428e441eb6..35267af561 100644 --- a/benches/payout-stakers/Cargo.toml +++ b/benches/payout-stakers/Cargo.toml @@ -11,13 +11,14 @@ codec = { package = 'parity-scale-codec', version = "3.0.0", features = ['derive env_logger = "0.8" hex = { version = "0.4.3", default-features = false, features = ["alloc"] } log = "0.4" -rayon = "1.5" +futures = "0.3.25" rand = "0.8.5" sp-core = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28", features = ["full_crypto"] } sp-keyring = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } -substrate-api-client = { git = "https://github.com/Cardinal-Cryptography/substrate-api-client.git", branch = "aleph-v0.9.28" } +subxt = "0.24.0" +tokio = { version = "1.21.2", features = ["full"] } aleph_client = { path = "../../aleph-client" } primitives = { path = "../../primitives" } diff --git a/benches/payout-stakers/src/main.rs b/benches/payout-stakers/src/main.rs index 3eac534cef..4842056455 100644 --- a/benches/payout-stakers/src/main.rs +++ b/benches/payout-stakers/src/main.rs @@ -1,21 +1,23 @@ use std::{iter, time::Instant}; use aleph_client::{ - balances_batch_transfer, keypair_from_string, payout_stakers_and_assert_locked_balance, - staking_batch_bond, staking_batch_nominate, staking_bond, staking_validate, wait_for_next_era, - AnyConnection, RootConnection, SignedConnection, + keypair_from_string, + pallets::{ + balances::{BalanceApi, BalanceUserBatchExtApi}, + staking::{StakingApi, StakingApiExt, StakingUserApi}, + }, + waiting::{BlockStatus, WaitingExt}, + AccountId, Connection, KeyPair, RootConnection, SignedConnection, TxStatus, }; use clap::{ArgGroup, Parser}; +use futures::future::join_all; use log::{info, trace, warn}; use primitives::{ staking::{MAX_NOMINATORS_REWARDED_PER_VALIDATOR, MIN_NOMINATOR_BOND, MIN_VALIDATOR_BOND}, - TOKEN, + EraIndex, TOKEN, }; use rand::{thread_rng, Rng}; -use rayon::prelude::*; -use sp_core::{crypto::AccountId32, sr25519::Pair as KeyPair, Pair}; use sp_keyring::AccountKeyring; -use substrate_api_client::{extrinsic::staking::RewardDestination, AccountId, XtStatus}; // testcase parameters const NOMINATOR_COUNT: u32 = MAX_NOMINATORS_REWARDED_PER_VALIDATOR; @@ -31,7 +33,7 @@ const TRANSFER_CALL_BATCH_LIMIT: usize = 1024; #[clap(group(ArgGroup::new("valid").required(true)))] struct Config { /// WS endpoint address of the node to connect to. Use IP:port syntax, e.g. 127.0.0.1:9944 - #[clap(long, default_value = "127.0.0.1:9944")] + #[clap(long, default_value = "ws://127.0.0.1:9944")] pub address: String, /// A path to a file that contains the root account seed. @@ -51,7 +53,8 @@ struct Config { pub validator_count: Option, } -fn main() -> anyhow::Result<()> { +#[tokio::main] +async fn main() -> anyhow::Result<()> { env_logger::init(); info!("Running payout_stakers bench."); @@ -66,7 +69,7 @@ fn main() -> anyhow::Result<()> { let sudoer = get_sudoer_keypair(root_seed_file); - let connection = RootConnection::new(&address, sudoer); + let connection = RootConnection::new(address.clone(), sudoer).await.unwrap(); let validators = match validators_seed_file { Some(validators_seed_file) => { @@ -87,18 +90,30 @@ fn main() -> anyhow::Result<()> { let controllers = generate_controllers_for_validators(validator_count); - bond_validators_funds_and_choose_controllers(&address, controllers.clone(), validators.clone()); - send_validate_txs(&address, controllers); + bond_validators_funds_and_choose_controllers( + &address, + controllers + .iter() + .map(|k| KeyPair::new(k.signer().clone())) + .collect(), + validators + .iter() + .map(|k| KeyPair::new(k.signer().clone())) + .collect(), + ) + .await; + send_validate_txs(&address, controllers).await; let validators_and_nominator_stashes = - setup_test_validators_and_nominator_stashes(&connection, validators); + setup_test_validators_and_nominator_stashes(&connection, validators).await; wait_for_successive_eras( &address, - &connection, + &connection.connection, validators_and_nominator_stashes, ERAS_TO_WAIT, - )?; + ) + .await?; let elapsed = Instant::now().duration_since(start); println!("Ok! Elapsed time {}ms", elapsed.as_millis()); @@ -114,7 +129,7 @@ fn get_sudoer_keypair(root_seed_file: Option) -> KeyPair { .unwrap_or_else(|_| panic!("Failed to read file {}", root_seed_file)); keypair_from_string(root_seed.trim()) } - None => AccountKeyring::Alice.pair(), + None => keypair_from_string(&AccountKeyring::Alice.to_seed()), } } @@ -127,31 +142,36 @@ fn generate_controllers_for_validators(validator_count: u32) -> Vec { /// For a given set of validators, generates nominator accounts (controllers and stashes). /// Bonds nominator controllers to the corresponding nominator stashes. -fn setup_test_validators_and_nominator_stashes( +async fn setup_test_validators_and_nominator_stashes( connection: &RootConnection, validators: Vec, -) -> Vec<(KeyPair, Vec)> { - validators - .iter() - .enumerate() - .map(|(validator_index, validator)| { - let (nominator_controller_accounts, nominator_stash_accounts) = - generate_nominator_accounts_with_minimal_bond( - &connection.as_signed(), - validator_index as u32, - validators.len() as u32, - ); - let nominee_account = AccountId::from(validator.public()); - info!("Nominating validator {}", nominee_account); - nominate_validator( - connection, - nominator_controller_accounts, - nominator_stash_accounts.clone(), - nominee_account, - ); - (validator.clone(), nominator_stash_accounts) - }) - .collect() +) -> Vec<(KeyPair, Vec)> { + let mut validators_stashes = vec![]; + let validators_len = validators.len(); + for (validator_index, validator) in validators.into_iter().enumerate() { + let (nominator_controller_accounts, nominator_stash_accounts) = + generate_nominator_accounts_with_minimal_bond( + &connection.as_signed(), + validator_index as u32, + validators_len as u32, + ) + .await; + let nominee_account = validator.account_id().clone(); + info!("Nominating validator {}", nominee_account); + nominate_validator( + connection, + nominator_controller_accounts, + nominator_stash_accounts.clone(), + nominee_account, + ) + .await; + validators_stashes.push(( + KeyPair::new(validator.signer().clone()), + nominator_stash_accounts, + )); + } + + validators_stashes } pub fn derive_user_account_from_numeric_seed(seed: u32) -> KeyPair { @@ -160,44 +180,47 @@ pub fn derive_user_account_from_numeric_seed(seed: u32) -> KeyPair { } /// For a given number of eras, in each era check whether stash balances of a validator are locked. -fn wait_for_successive_eras( +async fn wait_for_successive_eras( address: &str, - connection: &C, + connection: &Connection, validators_and_nominator_stashes: Vec<(KeyPair, Vec)>, eras_to_wait: u32, ) -> anyhow::Result<()> { // in order to have over 8k nominators we need to wait around 60 seconds all calls to be processed // that means not all 8k nominators we'll make i to era 1st, hence we need to wait to 2nd era - wait_for_next_era(connection)?; - wait_for_next_era(connection)?; // then we wait another full era to test rewards - let mut current_era = wait_for_next_era(connection)?; + connection.wait_for_n_eras(3, BlockStatus::Finalized).await; + let mut current_era = connection.get_current_era(None).await; for _ in 0..eras_to_wait { info!( "Era {} started, claiming rewards for era {}", current_era, current_era - 1 ); - validators_and_nominator_stashes - .iter() - .for_each(|(validator, nominators_stashes)| { - let validator_connection = SignedConnection::new(address, validator.clone()); - let validator_account = AccountId::from(validator.public()); - info!("Doing payout_stakers for validator {}", validator_account); - payout_stakers_and_assert_locked_balance( - &validator_connection, - &[&nominators_stashes[..], &[validator_account.clone()]].concat(), - &validator_account, - current_era, - ); - }); - current_era = wait_for_next_era(connection)?; + for (validator, nominators_stashes) in validators_and_nominator_stashes.iter() { + let validator_connection = SignedConnection::new( + address.to_string(), + KeyPair::new(validator.signer().clone()), + ) + .await; + let validator_account = validator.account_id().clone(); + info!("Doing payout_stakers for validator {}", validator_account); + payout_stakers_and_assert_locked_balance( + &validator_connection, + &[&nominators_stashes[..], &[validator_account.clone()]].concat(), + &validator_account, + current_era, + ) + .await; + } + connection.wait_for_n_eras(1, BlockStatus::Finalized).await; + current_era = connection.get_current_era(None).await; } Ok(()) } /// Nominates a specific validator based on the nominator controller and stash accounts. -fn nominate_validator( +async fn nominate_validator( connection: &RootConnection, nominator_controller_accounts: Vec, nominator_stash_accounts: Vec, @@ -205,64 +228,90 @@ fn nominate_validator( ) { let stash_controller_accounts = nominator_stash_accounts .iter() - .zip(nominator_controller_accounts.iter()) + .cloned() + .zip(nominator_controller_accounts.iter().cloned()) .collect::>(); - stash_controller_accounts + + let mut handles = vec![]; + for chunk in stash_controller_accounts .chunks(BOND_CALL_BATCH_LIMIT) - .for_each(|chunk| { - let mut rng = thread_rng(); - staking_batch_bond( - connection, - chunk, - (rng.gen::() % 100) * TOKEN + MIN_NOMINATOR_BOND, - RewardDestination::Staked, - ) - }); + .map(|c| c.to_vec()) + { + let root = RootConnection::try_from_connection( + connection.connection.clone(), + KeyPair::new(connection.root.signer().clone()), + ) + .await + .unwrap(); + + let mut rng = thread_rng(); + let stake = (rng.gen::() % 100) * TOKEN + MIN_NOMINATOR_BOND; + handles.push(tokio::spawn(async move { + root.batch_bond(&chunk, stake, TxStatus::InBlock) + .await + .unwrap(); + })); + } + + join_all(handles).await; let nominator_nominee_accounts = nominator_controller_accounts .iter() - .zip(iter::repeat(&nominee_account)) + .cloned() + .zip(iter::repeat(&nominee_account).cloned()) .collect::>(); - nominator_nominee_accounts - .chunks(NOMINATE_CALL_BATCH_LIMIT) - .for_each(|chunk| staking_batch_nominate(connection, chunk)); + for chunks in nominator_nominee_accounts.chunks(NOMINATE_CALL_BATCH_LIMIT) { + connection + .batch_nominate(chunks, TxStatus::InBlock) + .await + .unwrap(); + } } /// Bonds the funds of the validators. /// Chooses controller accounts for the corresponding validators. /// We assume stash == validator != controller. -fn bond_validators_funds_and_choose_controllers( +async fn bond_validators_funds_and_choose_controllers( address: &str, controllers: Vec, validators: Vec, ) { - controllers - .into_par_iter() - .zip(validators.into_par_iter()) - .for_each(|(controller, validator)| { - let connection = SignedConnection::new(address, validator); - let controller_account_id = AccountId::from(controller.public()); - staking_bond( - &connection, - MIN_VALIDATOR_BOND, - &controller_account_id, - XtStatus::InBlock, - ); - }); + let mut handles = vec![]; + for (controller, validator) in controllers.into_iter().zip(validators) { + let validator_address = address.to_string(); + handles.push(tokio::spawn(async move { + let connection = SignedConnection::new(validator_address, validator).await; + let controller_account_id = controller.account_id().clone(); + connection + .bond(MIN_VALIDATOR_BOND, controller_account_id, TxStatus::InBlock) + .await + .unwrap(); + })); + } + join_all(handles).await; } /// Submits candidate validators via controller accounts. /// We assume stash == validator != controller. -fn send_validate_txs(address: &str, controllers: Vec) { - controllers.par_iter().for_each(|controller| { +async fn send_validate_txs(address: &str, controllers: Vec) { + let mut handles = vec![]; + for controller in controllers { + let node_address = address.to_string(); let mut rng = thread_rng(); - let connection = SignedConnection::new(address, controller.clone()); - staking_validate(&connection, rng.gen::() % 100, XtStatus::InBlock); - }); + let prc = rng.gen::() % 100; + handles.push(tokio::spawn(async move { + let connection = + SignedConnection::new(node_address, KeyPair::new(controller.signer().clone())) + .await; + connection.validate(prc, TxStatus::InBlock).await.unwrap(); + })); + } + + join_all(handles).await; } /// For a specific validator given by index, generates a predetermined number of nominator accounts. /// Nominator accounts are produced as (controller, stash) tuples with initial endowments. -fn generate_nominator_accounts_with_minimal_bond( +async fn generate_nominator_accounts_with_minimal_bond( connection: &SignedConnection, validator_number: u32, validators_count: u32, @@ -277,20 +326,50 @@ fn generate_nominator_accounts_with_minimal_bond( let idx = validators_count + nominator_number + NOMINATOR_COUNT * validator_number; let controller = keypair_from_string(&format!("//{}//Controller", idx)); let stash = keypair_from_string(&format!("//{}//Stash", idx)); - controller_accounts.push(AccountId::from(controller.public())); - stash_accounts.push(AccountId::from(stash.public())); + controller_accounts.push(controller.account_id().clone()); + stash_accounts.push(stash.account_id().clone()); }); - controller_accounts - .chunks(TRANSFER_CALL_BATCH_LIMIT) - .for_each(|chunk| { - balances_batch_transfer(connection, chunk.to_vec(), TOKEN); - }); - stash_accounts - .chunks(TRANSFER_CALL_BATCH_LIMIT) - .for_each(|chunk| { - balances_batch_transfer(connection, chunk.to_vec(), MIN_NOMINATOR_BOND * 10); - // potentially change to + 1 - }); + for chunk in controller_accounts.chunks(TRANSFER_CALL_BATCH_LIMIT) { + connection + .batch_transfer(chunk, TOKEN, TxStatus::InBlock) + .await + .unwrap(); + } + for chunk in stash_accounts.chunks(TRANSFER_CALL_BATCH_LIMIT) { + // potentially change to + 1 + connection + .batch_transfer(chunk, MIN_NOMINATOR_BOND * 10, TxStatus::InBlock) + .await + .unwrap(); + } (controller_accounts, stash_accounts) } + +async fn payout_stakers_and_assert_locked_balance( + stash_connection: &SignedConnection, + accounts_to_check_balance: &[AccountId], + stash_account: &AccountId, + era: EraIndex, +) { + let locked_stash_balances_before_payout = stash_connection + .connection + .locks(accounts_to_check_balance, None) + .await; + stash_connection + .payout_stakers(stash_account.clone(), era - 1, TxStatus::Finalized) + .await + .unwrap(); + let locked_stash_balances_after_payout = stash_connection + .connection + .locks(accounts_to_check_balance, None) + .await; + locked_stash_balances_before_payout.iter() + .zip(locked_stash_balances_after_payout.iter()) + .zip(accounts_to_check_balance.iter()) + .for_each(|((balances_before, balances_after), account_id)| { + assert!(balances_after[0].amount > balances_before[0].amount, + "Expected payout to be positive in locked balance for account {}. Balance before: {}, balance after: {}", + account_id, balances_before[0].amount, balances_after[0].amount); + }); +} diff --git a/bin/cliain/Cargo.lock b/bin/cliain/Cargo.lock index a32dca162d..d0fb3ca315 100644 --- a/bin/cliain/Cargo.lock +++ b/bin/cliain/Cargo.lock @@ -12,55 +12,6 @@ dependencies = [ "regex", ] -[[package]] -name = "ac-compose-macros" -version = "0.1.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate-api-client.git?branch=aleph-v0.9.28#92bc66b75428213e4bcdb2484616cf458455813a" -dependencies = [ - "ac-primitives", - "log", - "parity-scale-codec", - "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "ac-node-api" -version = "0.1.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate-api-client.git?branch=aleph-v0.9.28#92bc66b75428213e4bcdb2484616cf458455813a" -dependencies = [ - "ac-primitives", - "derive_more", - "frame-metadata 15.0.0 (git+https://github.com/integritee-network/frame-metadata)", - "frame-support", - "frame-system", - "hex", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "serde_json", - "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "ac-primitives" -version = "0.1.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate-api-client.git?branch=aleph-v0.9.28#92bc66b75428213e4bcdb2484616cf458455813a" -dependencies = [ - "hex", - "parity-scale-codec", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "addr2line" version = "0.17.0" @@ -98,31 +49,25 @@ dependencies = [ [[package]] name = "aleph_client" -version = "1.11.0" +version = "2.0.0" dependencies = [ - "ac-node-api", - "ac-primitives", "anyhow", + "async-trait", "contract-metadata 1.5.0", "contract-transcode", "frame-support", + "futures", "hex", "ink_metadata", "log", - "pallet-aleph", - "pallet-balances", - "pallet-elections", - "pallet-multisig", - "pallet-staking", - "pallet-treasury", - "pallet-vesting", "parity-scale-codec", "primitives", "rayon", + "serde", "serde_json", "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "substrate-api-client", + "subxt", "thiserror", ] @@ -141,7 +86,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -186,6 +131,16 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +[[package]] +name = "async-lock" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" +dependencies = [ + "event-listener", + "futures-lite", +] + [[package]] name = "async-trait" version = "0.1.58" @@ -205,7 +160,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -222,7 +177,7 @@ checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -247,6 +202,15 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +dependencies = [ + "serde", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -356,16 +320,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -dependencies = [ - "byteorder", - "iovec", -] - [[package]] name = "bytes" version = "1.2.1" @@ -378,12 +332,6 @@ version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -399,7 +347,7 @@ dependencies = [ "iana-time-zone", "num-integer", "num-traits", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -461,7 +409,8 @@ dependencies = [ "serde", "serde_json", "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "substrate-api-client", + "subxt", + "tokio", ] [[package]] @@ -485,7 +434,7 @@ dependencies = [ "libc", "terminal_size", "unicode-width", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -565,10 +514,14 @@ dependencies = [ ] [[package]] -name = "convert_case" -version = "0.4.0" +name = "core-foundation" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] [[package]] name = "core-foundation-sys" @@ -591,7 +544,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -601,7 +554,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] @@ -613,7 +566,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", "memoffset", "scopeguard", @@ -625,7 +578,7 @@ version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -746,6 +699,41 @@ dependencies = [ "syn", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "der" version = "0.5.1" @@ -755,16 +743,25 @@ dependencies = [ "const-oid", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "convert_case", "proc-macro2", "quote", - "rustc_version", "syn", ] @@ -947,6 +944,12 @@ dependencies = [ "rustversion", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + [[package]] name = "fake-simd" version = "0.1.2" @@ -985,19 +988,10 @@ dependencies = [ ] [[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" @@ -1063,18 +1057,7 @@ version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df6bb8542ef006ef0de09a5c4420787d79823c0ed7924225822362fd2bf2ff2d" dependencies = [ - "cfg-if 1.0.0", - "parity-scale-codec", - "scale-info", - "serde", -] - -[[package]] -name = "frame-metadata" -version = "15.0.0" -source = "git+https://github.com/integritee-network/frame-metadata#3b43da9821238681f9431276d55b92a079142083" -dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "parity-scale-codec", "scale-info", "serde", @@ -1086,7 +1069,7 @@ version = "4.0.0-dev" source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" dependencies = [ "bitflags", - "frame-metadata 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", "k256", @@ -1162,22 +1145,6 @@ dependencies = [ "sp-version", ] -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "funty" version = "2.0.0" @@ -1233,6 +1200,21 @@ version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + [[package]] name = "futures-macro" version = "0.3.25" @@ -1305,7 +1287,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi 0.9.0+wasi-snapshot-preview1", @@ -1318,7 +1300,7 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] @@ -1416,6 +1398,17 @@ dependencies = [ "hmac 0.8.1", ] +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "httparse" version = "1.8.0" @@ -1439,7 +1432,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1452,6 +1445,12 @@ dependencies = [ "cxx-build", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.3.0" @@ -1513,7 +1512,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c9588a59a0e8997c0b2153cd11b5aaa77c06a0537a6b18f3811d1f1aa098b12" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1539,7 +1538,7 @@ checksum = "a891d34301a3dbb1c7b7424c49ae184282b163491c54f9acd17fcbe14a80447b" dependencies = [ "arrayref", "blake2", - "cfg-if 1.0.0", + "cfg-if", "derive_more", "ink_allocator", "ink_engine", @@ -1578,7 +1577,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f031e6b8495594a7288b089bf4122e76c26b994959d1b2b693bdfe846b14c0e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1587,7 +1586,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e12cf42dce81d060401c7cec95a392ad6d3c2f18661fa3083f619ce135133c33" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ink_prelude", "parity-scale-codec", "scale-info", @@ -1599,7 +1598,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1611,15 +1610,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - [[package]] name = "itertools" version = "0.10.5" @@ -1650,13 +1640,82 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonrpsee" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bd0d559d5e679b1ab2f869b486a11182923863b1b3ee8b421763cdd707b783a" +dependencies = [ + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8752740ecd374bcbf8b69f3e80b0327942df76f793f8d4e60d3355650c31fb74" +dependencies = [ + "futures-util", + "http", + "jsonrpsee-core", + "jsonrpsee-types", + "pin-project", + "rustls-native-certs", + "soketto", + "thiserror", + "tokio", + "tokio-rustls", + "tokio-util", + "tracing", + "webpki-roots", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3dc3e9cf2ba50b7b1d7d76a667619f82846caa39e8e8daa8a4962d74acaddca" +dependencies = [ + "anyhow", + "async-lock", + "async-trait", + "beef", + "futures-channel", + "futures-timer", + "futures-util", + "jsonrpsee-types", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e290bba767401b646812f608c099b922d8142603c9e73a50fb192d3ac86f4a0d" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + [[package]] name = "k256" version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ecdsa", "elliptic-curve", "sec1", @@ -1668,28 +1727,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" version = "0.2.135" @@ -1785,7 +1828,7 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1867,45 +1910,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.6.23" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", "libc", "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.42.0", ] [[package]] @@ -1937,17 +1949,6 @@ dependencies = [ "syn", ] -[[package]] -name = "net2" -version = "0.2.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", -] - [[package]] name = "nodrop" version = "0.1.14" @@ -2088,43 +2089,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] -name = "openssl" -version = "0.10.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" -dependencies = [ - "bitflags", - "cfg-if 1.0.0", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-sys" -version = "0.9.77" +name = "openssl-probe" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" -dependencies = [ - "autocfg", - "cc", - "libc", - "pkg-config", - "vcpkg", -] +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "os_str_bytes" @@ -2132,23 +2100,6 @@ version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" -[[package]] -name = "pallet-aleph" -version = "0.5.0" -dependencies = [ - "frame-support", - "frame-system", - "pallet-balances", - "pallet-session", - "pallets-support", - "parity-scale-codec", - "primitives", - "scale-info", - "serde", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "pallet-authorship" version = "4.0.0-dev" @@ -2164,57 +2115,6 @@ dependencies = [ "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", ] -[[package]] -name = "pallet-balances" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-elections" -version = "0.5.0" -dependencies = [ - "frame-election-provider-support", - "frame-support", - "frame-system", - "pallet-authorship", - "pallet-balances", - "pallet-session", - "pallet-staking", - "pallets-support", - "parity-scale-codec", - "primitives", - "scale-info", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-staking", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-multisig" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "pallet-session" version = "4.0.0-dev" @@ -2274,59 +2174,6 @@ dependencies = [ "sp-timestamp", ] -[[package]] -name = "pallet-transaction-payment" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-treasury" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "pallet-balances", - "parity-scale-codec", - "scale-info", - "serde", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-vesting" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallets-support" -version = "0.1.0" -dependencies = [ - "frame-support", -] - [[package]] name = "parity-scale-codec" version = "3.2.1" @@ -2336,7 +2183,7 @@ dependencies = [ "arrayvec 0.7.2", "bitvec", "byte-slice-cast", - "bytes 1.2.1", + "bytes", "impl-trait-for-tuples", "parity-scale-codec-derive", "serde", @@ -2360,13 +2207,13 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "hashbrown", "impl-trait-for-tuples", "parity-util-mem-derive", "parking_lot", "primitive-types", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2386,6 +2233,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + [[package]] name = "parking_lot" version = "0.12.1" @@ -2402,11 +2255,11 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2439,6 +2292,26 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" version = "0.2.9" @@ -2451,12 +2324,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" - [[package]] name = "ppv-lite86" version = "0.2.16" @@ -2732,7 +2599,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2746,6 +2613,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + [[package]] name = "rlibc" version = "1.0.0" @@ -2771,12 +2653,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] -name = "rustc_version" -version = "0.4.0" +name = "rustls" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" dependencies = [ - "semver", + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +dependencies = [ + "base64", ] [[package]] @@ -2791,6 +2697,29 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +[[package]] +name = "scale-bits" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd7aca73785181cc41f0bbe017263e682b585ca660540ba569133901d013ecf" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "scale-decode" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d823d4be477fc33321f93d08fb6c2698273d044f01362dc27573a750deb7c233" +dependencies = [ + "parity-scale-codec", + "scale-bits", + "scale-info", + "thiserror", +] + [[package]] name = "scale-info" version = "2.2.0" @@ -2798,7 +2727,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "333af15b02563b8182cd863f925bd31ef8fa86a0e095d30c091956057d436153" dependencies = [ "bitvec", - "cfg-if 1.0.0", + "cfg-if", "derive_more", "parity-scale-codec", "scale-info-derive", @@ -2817,6 +2746,33 @@ dependencies = [ "syn", ] +[[package]] +name = "scale-value" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16a5e7810815bd295da73e4216d1dfbced3c7c7c7054d70fa5f6e4c58123fff4" +dependencies = [ + "either", + "frame-metadata", + "parity-scale-codec", + "scale-bits", + "scale-decode", + "scale-info", + "serde", + "thiserror", + "yap", +] + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys 0.36.1", +] + [[package]] name = "schnorrkel" version = "0.9.1" @@ -2847,6 +2803,16 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "sec1" version = "0.2.1" @@ -2904,6 +2870,29 @@ dependencies = [ "zeroize", ] +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "1.0.14" @@ -2946,14 +2935,15 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.8.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", ] [[package]] @@ -2975,7 +2965,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", @@ -2987,7 +2977,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.5", ] @@ -3011,6 +3001,15 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + [[package]] name = "signature" version = "1.4.0" @@ -3048,6 +3047,31 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64", + "bytes", + "futures", + "httparse", + "log", + "rand 0.8.5", + "sha-1", +] + [[package]] name = "sp-api" version = "4.0.0-dev" @@ -3368,7 +3392,7 @@ name = "sp-io" version = "6.0.0" source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" dependencies = [ - "bytes 1.2.1", + "bytes", "futures", "hash-db", "libsecp256k1", @@ -3457,16 +3481,6 @@ dependencies = [ "regex", ] -[[package]] -name = "sp-rpc" -version = "6.0.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "rustc-hash", - "serde", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "sp-runtime" version = "6.0.0" @@ -3535,7 +3549,7 @@ name = "sp-runtime-interface" version = "6.0.0" source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" dependencies = [ - "bytes 1.2.1", + "bytes", "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", @@ -3808,6 +3822,12 @@ dependencies = [ "wasmi", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "ss58-registry" version = "1.33.0" @@ -3848,36 +3868,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" -[[package]] -name = "substrate-api-client" -version = "0.6.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate-api-client.git?branch=aleph-v0.9.28#92bc66b75428213e4bcdb2484616cf458455813a" -dependencies = [ - "ac-compose-macros", - "ac-node-api", - "ac-primitives", - "frame-metadata 15.0.0 (git+https://github.com/integritee-network/frame-metadata)", - "frame-support", - "frame-system", - "hex", - "log", - "pallet-balances", - "pallet-staking", - "pallet-transaction-payment", - "parity-scale-codec", - "primitive-types", - "serde", - "serde_json", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-rpc", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-version", - "thiserror", - "ws", -] - [[package]] name = "substrate-bip39" version = "0.4.4" @@ -3897,6 +3887,75 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +[[package]] +name = "subxt" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a8757ee0e19f87e722577282ab1386c86592a4b13ff963b9c6ec4176348104c" +dependencies = [ + "bitvec", + "derivative", + "frame-metadata", + "futures", + "hex", + "jsonrpsee", + "parity-scale-codec", + "parking_lot", + "scale-decode", + "scale-info", + "scale-value", + "serde", + "serde_json", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "subxt-macro", + "subxt-metadata", + "thiserror", + "tracing", +] + +[[package]] +name = "subxt-codegen" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb77f93e11e6ff3ff95fe33e3d24c27c342e16feca8ef47759993614ebe90d2c" +dependencies = [ + "darling", + "frame-metadata", + "heck", + "parity-scale-codec", + "proc-macro-error", + "proc-macro2", + "quote", + "scale-info", + "subxt-metadata", + "syn", +] + +[[package]] +name = "subxt-macro" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051cc21d77a54ae944b872eafdf9edfe1d9134fdfcfc3477dc10f763c76564a9" +dependencies = [ + "darling", + "proc-macro-error", + "subxt-codegen", + "syn", +] + +[[package]] +name = "subxt-metadata" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ed78d80db3a97d55e8b1cfecc1f6f9e21793a589d4e2e5f4fe2d6d5850c2e54" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "syn" version = "1.0.103" @@ -3932,12 +3991,12 @@ version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", "libc", "redox_syscall", "remove_dir_all", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3956,7 +4015,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -4037,6 +4096,62 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +[[package]] +name = "tokio" +version = "1.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite", + "tokio", +] + [[package]] name = "toml" version = "0.5.9" @@ -4052,7 +4167,7 @@ version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -4079,6 +4194,16 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + [[package]] name = "tracing-log" version = "0.1.3" @@ -4156,7 +4281,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "digest 0.10.5", "rand 0.8.5", "static_assertions", @@ -4213,6 +4338,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "url" version = "2.3.1" @@ -4231,18 +4362,18 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -4261,7 +4392,7 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -4334,10 +4465,33 @@ dependencies = [ ] [[package]] -name = "winapi" -version = "0.2.8" +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" +dependencies = [ + "webpki", +] [[package]] name = "winapi" @@ -4349,12 +4503,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -4367,7 +4515,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -4376,6 +4524,19 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + [[package]] name = "windows-sys" version = "0.42.0" @@ -4383,12 +4544,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_x86_64_msvc 0.42.0", ] [[package]] @@ -4397,24 +4558,48 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + [[package]] name = "windows_aarch64_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + [[package]] name = "windows_i686_gnu" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + [[package]] name = "windows_i686_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + [[package]] name = "windows_x86_64_gnu" version = "0.42.0" @@ -4429,38 +4614,15 @@ checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" [[package]] name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] -name = "ws" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fe90c75f236a0a00247d5900226aea4f2d7b05ccc34da9e7a8880ff59b5848" -dependencies = [ - "byteorder", - "bytes 0.4.12", - "httparse", - "log", - "mio", - "mio-extras", - "openssl", - "rand 0.7.3", - "sha-1", - "slab", - "url", -] - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" +name = "windows_x86_64_msvc" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" [[package]] name = "wyz" @@ -4471,6 +4633,12 @@ dependencies = [ "tap", ] +[[package]] +name = "yap" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc77f52dc9e9b10d55d3f4462c3b7fc393c4f17975d641542833ab2d3bc26ef" + [[package]] name = "zeroize" version = "1.5.7" diff --git a/bin/cliain/Cargo.toml b/bin/cliain/Cargo.toml index 35f5d78ffc..799f9bc02e 100644 --- a/bin/cliain/Cargo.toml +++ b/bin/cliain/Cargo.toml @@ -21,7 +21,8 @@ primitives = { path = "../../primitives" } serde = { version = "1.0.137", features = ["derive"] } serde_json = "1.0.81" sp-core = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28", features = ["full_crypto"] } -substrate-api-client = { git = "https://github.com/Cardinal-Cryptography/substrate-api-client.git", branch = "aleph-v0.9.28", features = ["staking-xt"] } +tokio = { version = "1.21.2", features = ["full"] } +subxt = "0.24.0" [features] default = ["std"] diff --git a/bin/cliain/src/commands.rs b/bin/cliain/src/commands.rs index adeea04533..538ba6c184 100644 --- a/bin/cliain/src/commands.rs +++ b/bin/cliain/src/commands.rs @@ -3,12 +3,11 @@ use std::{ path::{Path, PathBuf}, }; -use aleph_client::BlockNumber; +use aleph_client::AccountId; use clap::{Args, Subcommand}; -use primitives::{Balance, CommitteeSeats}; +use primitives::{Balance, BlockNumber, CommitteeSeats}; use serde::{Deserialize, Serialize}; use sp_core::H256; -use substrate_api_client::AccountId; #[derive(Debug, Clone, Args)] pub struct ContractOptions { @@ -304,9 +303,6 @@ pub enum Command { starting_block: BlockNumber, }, - /// Print debug info of storage - DebugStorage, - /// Deploys a new contract, returns its code hash and the AccountId of the instance. /// /// Contract cannot already exist on-chain diff --git a/bin/cliain/src/contracts.rs b/bin/cliain/src/contracts.rs index cd2332989d..c7b130074e 100644 --- a/bin/cliain/src/contracts.rs +++ b/bin/cliain/src/contracts.rs @@ -3,51 +3,26 @@ use std::{ path::Path, }; -use aleph_client::{send_xt, wait_for_event, AnyConnection, Balance, Connection, SignedConnection}; +use aleph_client::{ + api::contracts::events::{CodeRemoved, CodeStored, Instantiated}, + pallet_contracts::wasm::OwnerInfo, + pallets::contract::{ContractsApi, ContractsUserApi}, + waiting::{AlephWaiting, BlockStatus}, + AccountId, Connection, SignedConnection, TxStatus, +}; use anyhow::anyhow; -use codec::{Compact, Decode, Encode}; +use codec::{Compact, Decode}; use contract_metadata::ContractMetadata; use contract_transcode::ContractMessageTranscoder; use log::{debug, info}; use serde::{Deserialize, Serialize}; -use sp_core::{Pair, H256}; -use substrate_api_client::{ - compose_extrinsic, utils::storage_key, AccountId, GenericAddress, StorageKey, XtStatus, -}; +use subxt::ext::sp_core::H256; use crate::commands::{ ContractCall, ContractInstantiate, ContractInstantiateWithCode, ContractOptions, ContractOwnerInfo, ContractRemoveCode, ContractUploadCode, }; -#[derive(Debug, Decode, Encode, Clone)] -pub struct OwnerInfo { - /// The account that has deployed the contract and hence is allowed to remove it. - pub owner: AccountId, - /// The amount of balance that was deposited by the owner in order to deploy the contract. - #[codec(compact)] - pub deposit: Balance, - /// The number of contracts that share (use) this code. - #[codec(compact)] - pub refcount: u64, -} - -#[derive(Debug, Decode, Clone)] -pub struct ContractCodeRemovedEvent { - code_hash: H256, -} - -#[derive(Debug, Decode, Clone)] -pub struct ContractInstantiatedEvent { - deployer: AccountId, - contract: AccountId, -} - -#[derive(Debug, Decode, Clone)] -pub struct ContractCodeStoredEvent { - code_hash: H256, -} - #[derive(Debug, Decode, Clone, Serialize, Deserialize)] pub struct InstantiateWithCodeReturnValue { pub contract: AccountId, @@ -58,48 +33,43 @@ fn storage_deposit(storage_deposit_limit: Option) -> Option> storage_deposit_limit.map(Compact) } -pub fn upload_code( +pub async fn upload_code( signed_connection: SignedConnection, command: ContractUploadCode, -) -> anyhow::Result { +) -> anyhow::Result { let ContractUploadCode { wasm_path, storage_deposit_limit, } = command; - let connection = signed_connection.as_connection(); - let wasm = fs::read(wasm_path).expect("WASM artifact not found"); debug!(target: "contracts", "Found WASM contract code {:?}", wasm); - let xt = compose_extrinsic!( - connection, - "Contracts", - "upload_code", - wasm, // code - storage_deposit(storage_deposit_limit) - ); - - debug!(target: "contracts", "Prepared `upload_code` extrinsic {:?}", xt); - - let _block_hash = send_xt(&connection, xt, Some("upload_code"), XtStatus::InBlock); - - let code_stored_event: ContractCodeStoredEvent = wait_for_event( - &connection, - ("Contracts", "CodeStored"), - |e: ContractCodeStoredEvent| { - info!(target : "contracts", "Received CodeStored event {:?}", e); - true - }, - )?; + let _block_hash = signed_connection + .upload_code( + wasm, + storage_deposit(storage_deposit_limit), + TxStatus::InBlock, + ) + .await?; + let code_stored_event = signed_connection + .connection + .wait_for_event( + |e: &CodeStored| { + info!(target : "contracts", "Received CodeStored event {:?}", e); + true + }, + BlockStatus::Finalized, + ) + .await; Ok(code_stored_event) } -pub fn instantiate( +pub async fn instantiate( signed_connection: SignedConnection, command: ContractInstantiate, -) -> anyhow::Result { +) -> anyhow::Result { let ContractInstantiate { code_hash, metadata_path, @@ -114,46 +84,40 @@ pub fn instantiate( storage_deposit_limit, } = options; - let connection = signed_connection.as_connection(); - let metadata = load_metadata(&metadata_path)?; let transcoder = ContractMessageTranscoder::new(&metadata); let data = transcoder.encode(&constructor, &args.unwrap_or_default())?; debug!("Encoded constructor data {:?}", data); - let xt = compose_extrinsic!( - connection, - "Contracts", - "instantiate", - Compact(balance), - Compact(gas_limit), - storage_deposit(storage_deposit_limit), - code_hash, - data, // The input data to pass to the contract constructor - Vec::::new() // salt used for the address derivation - ); - - debug!(target: "contracts", "Prepared `instantiate` extrinsic {:?}", xt); - - let _block_hash = send_xt(&connection, xt, Some("instantiate"), XtStatus::InBlock); - - let contract_instantiated_event: ContractInstantiatedEvent = wait_for_event( - &connection, - ("Contracts", "Instantiated"), - |e: ContractInstantiatedEvent| { - info!(target : "contracts", "Received ContractInstantiated event {:?}", e); - match &connection.signer { - Some(signer) => AccountId::from(signer.public()).eq(&e.deployer), - None => panic!("Should never get here"), - } - }, - )?; + let _block_hash = signed_connection + .instantiate( + code_hash, + balance, + gas_limit, + storage_deposit(storage_deposit_limit), + data, + vec![], + TxStatus::InBlock, + ) + .await?; + + let signer_id = signed_connection.signer.account_id().clone(); + let contract_instantiated_event = signed_connection + .connection + .wait_for_event( + |e: &Instantiated| { + info!(target : "contracts", "Received ContractInstantiated event {:?}", e); + signer_id.eq(&e.deployer) + }, + BlockStatus::Finalized, + ) + .await; Ok(contract_instantiated_event) } -pub fn instantiate_with_code( +pub async fn instantiate_with_code( signed_connection: SignedConnection, command: ContractInstantiateWithCode, ) -> anyhow::Result { @@ -171,8 +135,6 @@ pub fn instantiate_with_code( storage_deposit_limit, } = options; - let connection = signed_connection.as_connection(); - let wasm = fs::read(wasm_path).expect("WASM artifact not found"); debug!(target: "contracts", "Found WASM contract code {:?}", wasm); @@ -182,48 +144,42 @@ pub fn instantiate_with_code( debug!("Encoded constructor data {:?}", data); - let xt = compose_extrinsic!( - connection, - "Contracts", - "instantiate_with_code", - Compact(balance), - Compact(gas_limit), - storage_deposit(storage_deposit_limit), - wasm, // code - data, // The input data to pass to the contract constructor - Vec::::new() // salt used for the address derivation - ); - - debug!(target: "contracts", "Prepared `instantiate_with_code` extrinsic {:?}", xt); - - let _block_hash = send_xt( - &connection, - xt, - Some("instantiate_with_code"), - XtStatus::InBlock, - ); - - let code_stored_event: ContractCodeStoredEvent = wait_for_event( - &connection, - ("Contracts", "CodeStored"), - |e: ContractCodeStoredEvent| { - info!(target : "contracts", "Received CodeStored event {:?}", e); - // TODO : can we pre-calculate what the code hash will be? - true - }, - )?; - - let contract_instantiated_event: ContractInstantiatedEvent = wait_for_event( - &connection, - ("Contracts", "Instantiated"), - |e: ContractInstantiatedEvent| { - info!(target : "contracts", "Received ContractInstantiated event {:?}", e); - match &connection.signer { - Some(signer) => AccountId::from(signer.public()).eq(&e.deployer), - None => panic!("Should never get here"), - } - }, - )?; + let _block_hash = signed_connection + .instantiate_with_code( + wasm, + balance, + gas_limit, + storage_deposit(storage_deposit_limit), + data, + vec![], + TxStatus::InBlock, + ) + .await?; + + let code_stored_event = signed_connection + .connection + .wait_for_event( + |e: &CodeStored| { + info!(target : "contracts", "Received CodeStored event {:?}", e); + // TODO : can we pre-calculate what the code hash will be? + true + }, + BlockStatus::Finalized, + ) + .await; + + let signer_id = signed_connection.signer.account_id().clone(); + + let contract_instantiated_event = signed_connection + .connection + .wait_for_event( + |e: &Instantiated| { + info!(target : "contracts", "Received ContractInstantiated event {:?}", e); + signer_id.eq(&e.deployer) + }, + BlockStatus::Finalized, + ) + .await; Ok(InstantiateWithCodeReturnValue { contract: contract_instantiated_event.contract, @@ -231,7 +187,10 @@ pub fn instantiate_with_code( }) } -pub fn call(signed_connection: SignedConnection, command: ContractCall) -> anyhow::Result<()> { +pub async fn call( + signed_connection: SignedConnection, + command: ContractCall, +) -> anyhow::Result<()> { let ContractCall { destination, message, @@ -246,64 +205,52 @@ pub fn call(signed_connection: SignedConnection, command: ContractCall) -> anyho storage_deposit_limit, } = options; - let connection = signed_connection.as_connection(); - let metadata = load_metadata(&metadata_path)?; let transcoder = ContractMessageTranscoder::new(&metadata); let data = transcoder.encode(&message, &args.unwrap_or_default())?; debug!("Encoded call data {:?}", data); - let xt = compose_extrinsic!( - connection, - "Contracts", - "call", - GenericAddress::Id(destination), - Compact(balance), - Compact(gas_limit), - storage_deposit(storage_deposit_limit), - data // The input data to pass to the contract message - ); - - debug!(target: "contracts", "Prepared `call` extrinsic {:?}", xt); + let _block_hash = signed_connection + .call( + destination, + balance, + gas_limit, + storage_deposit(storage_deposit_limit), + data, + TxStatus::InBlock, + ) + .await?; - let _block_hash = send_xt(&connection, xt, Some("call"), XtStatus::Finalized); Ok(()) } -pub fn owner_info(connection: Connection, command: ContractOwnerInfo) -> Option { +pub async fn owner_info(connection: Connection, command: ContractOwnerInfo) -> Option { let ContractOwnerInfo { code_hash } = command; - let mut code_hash_bytes: Vec = Vec::from(code_hash.0); - let mut bytes = storage_key("Contracts", "OwnerInfoOf").0; - bytes.append(&mut code_hash_bytes); - let storage_key = StorageKey(bytes); - - connection - .get_storage_by_key_hash::(storage_key, None) - .ok()? + + connection.get_owner_info(code_hash, None).await } -pub fn remove_code( +pub async fn remove_code( signed_connection: SignedConnection, command: ContractRemoveCode, -) -> anyhow::Result { +) -> anyhow::Result { let ContractRemoveCode { code_hash } = command; - let connection = signed_connection.as_connection(); - - let xt = compose_extrinsic!(connection, "Contracts", "remove_code", code_hash); - - debug!(target: "contracts", "Prepared `remove_code` extrinsic {:?}", xt); - - let _block_hash = send_xt(&connection, xt, Some("remove_code"), XtStatus::InBlock); - let contract_removed_event: ContractCodeRemovedEvent = wait_for_event( - &connection, - ("Contracts", "CodeRemoved"), - |e: ContractCodeRemovedEvent| { - info!(target : "contracts", "Received ContractCodeRemoved event {:?}", e); - e.code_hash.eq(&code_hash) - }, - )?; + let _block_hash = signed_connection + .remove_code(code_hash, TxStatus::InBlock) + .await?; + + let contract_removed_event = signed_connection + .connection + .wait_for_event( + |e: &CodeRemoved| { + info!(target : "contracts", "Received ContractCodeRemoved event {:?}", e); + e.code_hash.eq(&code_hash) + }, + BlockStatus::Finalized, + ) + .await; Ok(contract_removed_event) } diff --git a/bin/cliain/src/finalization.rs b/bin/cliain/src/finalization.rs index 278f007858..e536c0fe2e 100644 --- a/bin/cliain/src/finalization.rs +++ b/bin/cliain/src/finalization.rs @@ -1,25 +1,32 @@ use std::str::FromStr; use aleph_client::{ - emergency_finalize, finalization_set_emergency_finalizer, AlephKeyPair, BlockHash, BlockNumber, - SignedConnection, + pallets::aleph::{AlephRpc, AlephSudoApi}, + AccountId, AlephKeyPair, SignedConnection, TxStatus, }; -use substrate_api_client::{AccountId, XtStatus}; +use primitives::{BlockHash, BlockNumber}; use crate::RootConnection; /// Sets the emergency finalized, the provided string should be the seed phrase of the desired finalizer. -pub fn set_emergency_finalizer(connection: RootConnection, finalizer: AccountId) { - finalization_set_emergency_finalizer(&connection, finalizer, XtStatus::Finalized) +pub async fn set_emergency_finalizer(connection: RootConnection, finalizer: AccountId) { + connection + .set_emergency_finalizer(finalizer, TxStatus::Finalized) + .await + .unwrap(); } /// Finalizes the given block using the key pair from provided seed as emergency finalizer. -pub fn finalize( +pub async fn finalize( connection: SignedConnection, number: BlockNumber, hash: String, key_pair: AlephKeyPair, ) { let hash = BlockHash::from_str(&hash).expect("Hash is properly hex encoded"); - emergency_finalize(&connection, number, hash, key_pair).unwrap(); + connection + .connection + .emergency_finalize(number, hash, key_pair) + .await + .unwrap(); } diff --git a/bin/cliain/src/keys.rs b/bin/cliain/src/keys.rs index 9bfdad0f19..b615d70e76 100644 --- a/bin/cliain/src/keys.rs +++ b/bin/cliain/src/keys.rs @@ -1,45 +1,56 @@ use aleph_client::{ - get_next_session_keys, rotate_keys as rotate, rotate_keys_raw_result, set_keys as set, - staking_bond, Connection, RootConnection, SessionKeys, SignedConnection, + aleph_runtime::SessionKeys, + pallets::{ + session::{SessionApi, SessionUserApi}, + staking::StakingUserApi, + }, + rpc::Rpc, + AccountId, Connection, RootConnection, SignedConnection, TxStatus, }; use hex::ToHex; use log::{error, info}; use primitives::staking::MIN_VALIDATOR_BOND; use serde_json::json; -use sp_core::crypto::Ss58Codec; -use substrate_api_client::{AccountId, XtStatus}; +use subxt::ext::sp_core::crypto::Ss58Codec; -pub fn prepare_keys(connection: RootConnection, controller_account_id: AccountId) { - staking_bond( - &connection.as_signed(), - MIN_VALIDATOR_BOND, - &controller_account_id, - XtStatus::Finalized, - ); - let new_keys = rotate(&connection).expect("Failed to retrieve keys"); - set(&connection.as_signed(), new_keys, XtStatus::Finalized); +pub async fn prepare_keys(connection: RootConnection, controller_account_id: AccountId) { + connection + .as_signed() + .bond( + MIN_VALIDATOR_BOND, + controller_account_id, + TxStatus::Finalized, + ) + .await + .unwrap(); + let new_keys = connection.as_signed().author_rotate_keys().await; + connection + .as_signed() + .set_keys(new_keys, TxStatus::Finalized) + .await + .unwrap(); } -pub fn set_keys(connection: SignedConnection, new_keys: String) { - set( - &connection, - SessionKeys::try_from(new_keys).expect("Failed to parse keys"), - XtStatus::InBlock, - ); +pub async fn set_keys(connection: SignedConnection, new_keys: String) { + connection + .set_keys(SessionKeys::try_from(new_keys).unwrap(), TxStatus::InBlock) + .await + .unwrap(); } -pub fn rotate_keys(connection: Connection) { - let new_keys = rotate_keys_raw_result(&connection).expect("Failed to retrieve keys"); +pub async fn rotate_keys(connection: SignedConnection) { + let new_keys = connection.author_rotate_keys().await; + info!("Rotated keys: {:?}", new_keys); } -pub fn next_session_keys(connection: &Connection, account_id: String) { +pub async fn next_session_keys(connection: Connection, account_id: String) { let account_id = AccountId::from_ss58check(&account_id).expect("Address is valid"); - match get_next_session_keys(connection, account_id) { + match connection.get_next_session_keys(account_id, None).await { Some(keys) => { let keys_json = json!({ - "aura": "0x".to_owned() + keys.aura.encode_hex::().as_str(), - "aleph": "0x".to_owned() + keys.aleph.encode_hex::().as_str(), + "aura": "0x".to_owned() + keys.aura.0.0.encode_hex::().as_str(), + "aleph": "0x".to_owned() + keys.aleph.0.0.encode_hex::().as_str(), }); println!("{}", serde_json::to_string_pretty(&keys_json).unwrap()); } diff --git a/bin/cliain/src/lib.rs b/bin/cliain/src/lib.rs index b69fea25fd..e6d5124431 100644 --- a/bin/cliain/src/lib.rs +++ b/bin/cliain/src/lib.rs @@ -1,3 +1,5 @@ +extern crate core; + mod commands; mod contracts; mod finalization; @@ -10,9 +12,7 @@ mod treasury; mod validators; mod vesting; -use aleph_client::{ - create_connection, keypair_from_string, Connection, RootConnection, SignedConnection, -}; +use aleph_client::{keypair_from_string, Connection, RootConnection, SignedConnection}; pub use commands::Command; pub use contracts::{ call, instantiate, instantiate_with_code, owner_info, remove_code, upload_code, @@ -41,23 +41,25 @@ impl ConnectionConfig { signer_seed, } } -} -impl From for Connection { - fn from(cfg: ConnectionConfig) -> Self { - create_connection(cfg.node_endpoint.as_str()) + pub async fn get_connection(&self) -> Connection { + Connection::new(self.node_endpoint.clone()).await } -} -impl From for SignedConnection { - fn from(cfg: ConnectionConfig) -> Self { - let key = keypair_from_string(&cfg.signer_seed); - SignedConnection::new(cfg.node_endpoint.as_str(), key) + pub async fn get_singed_connection(&self) -> SignedConnection { + SignedConnection::new( + self.node_endpoint.clone(), + keypair_from_string(&self.signer_seed), + ) + .await } -} -impl From for RootConnection { - fn from(cfg: ConnectionConfig) -> Self { - RootConnection::from(Into::::into(cfg)) + pub async fn get_root_connection(&self) -> RootConnection { + RootConnection::new( + self.node_endpoint.clone(), + keypair_from_string(&self.signer_seed), + ) + .await + .expect("signer should be root") } } diff --git a/bin/cliain/src/main.rs b/bin/cliain/src/main.rs index 74338c9384..06514204ea 100644 --- a/bin/cliain/src/main.rs +++ b/bin/cliain/src/main.rs @@ -1,9 +1,6 @@ use std::env; -use aleph_client::{ - account_from_keypair, aleph_keypair_from_string, keypair_from_string, print_storages, - Connection, -}; +use aleph_client::{account_from_keypair, aleph_keypair_from_string, keypair_from_string, Pair}; use clap::Parser; use cliain::{ bond, call, change_validators, finalize, force_new_era, instantiate, instantiate_with_code, @@ -13,7 +10,6 @@ use cliain::{ vested_transfer, Command, ConnectionConfig, }; use log::{error, info}; -use sp_core::Pair; #[derive(Debug, Parser, Clone)] #[clap(version = "1.0")] @@ -42,7 +38,6 @@ fn read_seed(command: &Command, seed: Option) -> String { } | Command::NextSessionKeys { account_id: _ } | Command::RotateKeys - | Command::DebugStorage | Command::SeedToSS58 { input: _ } | Command::ContractOwnerInfo { .. } => String::new(), _ => read_secret(seed, "Provide seed for the signer account:"), @@ -62,7 +57,8 @@ fn read_secret(secret: Option, message: &str) -> String { } } -fn main() { +#[tokio::main] +async fn main() { init_env(); let Config { @@ -76,16 +72,23 @@ fn main() { match command { Command::ChangeValidators { change_validators_args, - } => change_validators(cfg.into(), change_validators_args), + } => change_validators(cfg.get_root_connection().await, change_validators_args).await, Command::PrepareKeys => { let key = keypair_from_string(&seed); - let controller_account_id = account_from_keypair(&key); - prepare_keys(cfg.into(), controller_account_id); + let controller_account_id = account_from_keypair(key.signer()); + prepare_keys(cfg.get_root_connection().await, controller_account_id).await; } Command::Bond { controller_account, initial_stake_tokens, - } => bond(cfg.into(), initial_stake_tokens, controller_account), + } => { + bond( + cfg.get_singed_connection().await, + initial_stake_tokens, + controller_account, + ) + .await + } Command::Finalize { block, hash, @@ -93,71 +96,102 @@ fn main() { } => { let finalizer_seed = read_secret(finalizer_seed, "Provide finalizer seed:"); let finalizer = aleph_keypair_from_string(&finalizer_seed); - finalize(cfg.into(), block, hash, finalizer); + finalize(cfg.get_singed_connection().await, block, hash, finalizer).await; } Command::SetEmergencyFinalizer { finalizer_seed } => { let finalizer_seed = read_secret(finalizer_seed, "Provide finalizer seed:"); let finalizer = aleph_keypair_from_string(&finalizer_seed); let finalizer = account_from_keypair(&finalizer); - set_emergency_finalizer(cfg.into(), finalizer); + set_emergency_finalizer(cfg.get_root_connection().await, finalizer).await; + } + Command::SetKeys { new_keys } => { + set_keys(cfg.get_singed_connection().await, new_keys).await } - Command::SetKeys { new_keys } => set_keys(cfg.into(), new_keys), Command::Validate { commission_percentage, - } => validate(cfg.into(), commission_percentage), + } => validate(cfg.get_singed_connection().await, commission_percentage).await, Command::Transfer { amount_in_tokens, to_account, - } => transfer(cfg.into(), amount_in_tokens, to_account), + } => { + transfer( + cfg.get_singed_connection().await, + amount_in_tokens, + to_account, + ) + .await + } Command::TreasuryPropose { amount_in_tokens, beneficiary, - } => treasury_propose(cfg.into(), amount_in_tokens, beneficiary), - Command::TreasuryApprove { proposal_id } => treasury_approve(cfg.into(), proposal_id), - Command::TreasuryReject { proposal_id } => treasury_reject(cfg.into(), proposal_id), - Command::RotateKeys => rotate_keys(cfg.into()), - Command::NextSessionKeys { account_id } => next_session_keys(&cfg.into(), account_id), + } => { + treasury_propose( + cfg.get_singed_connection().await, + amount_in_tokens, + beneficiary, + ) + .await + } + Command::TreasuryApprove { proposal_id } => { + treasury_approve(cfg.get_root_connection().await, proposal_id).await + } + Command::TreasuryReject { proposal_id } => { + treasury_reject(cfg.get_root_connection().await, proposal_id).await + } + Command::RotateKeys => rotate_keys(cfg.get_singed_connection().await).await, + Command::NextSessionKeys { account_id } => { + next_session_keys(cfg.get_connection().await, account_id).await + } Command::SetStakingLimits { minimal_nominator_stake, minimal_validator_stake, max_nominators_count, max_validators_count, - } => set_staking_limits( - cfg.into(), - minimal_nominator_stake, - minimal_validator_stake, - max_nominators_count, - max_validators_count, - ), + } => { + set_staking_limits( + cfg.get_root_connection().await, + minimal_nominator_stake, + minimal_validator_stake, + max_nominators_count, + max_validators_count, + ) + .await + } Command::ForceNewEra => { - force_new_era(cfg.into()); + force_new_era(cfg.get_root_connection().await).await; } Command::SeedToSS58 { input } => { let input = read_secret(input, "Provide seed:"); info!( "SS58 Address: {}", - keypair_from_string(&input).public().to_string() + keypair_from_string(&input).signer().public().to_string() ) } - Command::DebugStorage => print_storages::(&cfg.into()), - Command::UpdateRuntime { runtime } => update_runtime(cfg.into(), runtime), - Command::Vest => vest(cfg.into()), - Command::VestOther { vesting_account } => vest_other(cfg.into(), vesting_account), + Command::UpdateRuntime { runtime } => { + update_runtime(cfg.get_root_connection().await, runtime).await + } + Command::Vest => vest(cfg.get_singed_connection().await).await, + Command::VestOther { vesting_account } => { + vest_other(cfg.get_singed_connection().await, vesting_account).await + } Command::VestedTransfer { to_account, amount_in_tokens, per_block, starting_block, - } => vested_transfer( - cfg.into(), - to_account, - amount_in_tokens, - per_block, - starting_block, - ), - Command::Nominate { nominee } => nominate(cfg.into(), nominee), + } => { + vested_transfer( + cfg.get_singed_connection().await, + to_account, + amount_in_tokens, + per_block, + starting_block, + ) + .await + } + Command::Nominate { nominee } => nominate(cfg.get_singed_connection().await, nominee).await, Command::ContractInstantiateWithCode(command) => { - match instantiate_with_code(cfg.into(), command) { + match instantiate_with_code(cfg.get_singed_connection().await, command).await { Ok(result) => println!( "{}", serde_json::to_string(&result).expect("Can't encode the result as JSON") @@ -165,23 +199,36 @@ fn main() { Err(why) => error!("Contract deployment failed {:?}", why), }; } - Command::ContractUploadCode(command) => match upload_code(cfg.into(), command) { - Ok(result) => println!("{:?}", result), - Err(why) => error!("Contract upload failed {:?}", why), - }, - Command::ContractCall(command) => match call(cfg.into(), command) { - Ok(result) => println!("{:?}", result), - Err(why) => error!("Contract call failed {:?}", why), - }, - Command::ContractInstantiate(command) => match instantiate(cfg.into(), command) { - Ok(result) => println!("{:?}", result), - Err(why) => error!("Contract instantiate failed {:?}", why), - }, - Command::ContractOwnerInfo(command) => println!("{:#?}", owner_info(cfg.into(), command)), - Command::ContractRemoveCode(command) => match remove_code(cfg.into(), command) { - Ok(result) => println!("{:?}", result), - Err(why) => error!("Contract remove code failed {:?}", why), - }, + Command::ContractUploadCode(command) => { + match upload_code(cfg.get_singed_connection().await, command).await { + Ok(result) => println!("{:?}", result), + Err(why) => error!("Contract upload failed {:?}", why), + } + } + Command::ContractCall(command) => { + match call(cfg.get_singed_connection().await, command).await { + Ok(result) => println!("{:?}", result), + Err(why) => error!("Contract call failed {:?}", why), + } + } + Command::ContractInstantiate(command) => { + match instantiate(cfg.get_singed_connection().await, command).await { + Ok(result) => println!("{:?}", result), + Err(why) => error!("Contract instantiate failed {:?}", why), + } + } + Command::ContractOwnerInfo(command) => { + println!( + "{:#?}", + owner_info(cfg.get_connection().await, command).await + ) + } + Command::ContractRemoveCode(command) => { + match remove_code(cfg.get_singed_connection().await, command).await { + Ok(result) => println!("{:?}", result), + Err(why) => error!("Contract remove code failed {:?}", why), + } + } } } diff --git a/bin/cliain/src/runtime.rs b/bin/cliain/src/runtime.rs index b1628ae715..5ce32a3727 100644 --- a/bin/cliain/src/runtime.rs +++ b/bin/cliain/src/runtime.rs @@ -1,9 +1,11 @@ use std::fs; -use aleph_client::{set_code, RootConnection}; -use substrate_api_client::XtStatus; +use aleph_client::{pallets::system::SystemSudoApi, RootConnection, TxStatus}; -pub fn update_runtime(connection: RootConnection, runtime: String) { +pub async fn update_runtime(connection: RootConnection, runtime: String) { let runtime = fs::read(runtime).expect("Runtime file not found"); - set_code(&connection, runtime, XtStatus::InBlock); + connection + .set_code(runtime, TxStatus::InBlock) + .await + .unwrap(); } diff --git a/bin/cliain/src/staking.rs b/bin/cliain/src/staking.rs index f1daa139e4..185c505fa8 100644 --- a/bin/cliain/src/staking.rs +++ b/bin/cliain/src/staking.rs @@ -1,12 +1,11 @@ use aleph_client::{ - staking_bond, staking_force_new_era, staking_nominate, staking_set_staking_limits, - staking_validate, RootConnection, SignedConnection, + pallets::staking::{StakingSudoApi, StakingUserApi}, + AccountId, RootConnection, SignedConnection, TxStatus, }; use primitives::TOKEN; -use sp_core::crypto::Ss58Codec; -use substrate_api_client::{AccountId, XtStatus}; +use subxt::ext::sp_core::crypto::Ss58Codec; -pub fn bond( +pub async fn bond( stash_connection: SignedConnection, initial_stake_in_tokens: u32, controller_account: String, @@ -15,40 +14,49 @@ pub fn bond( AccountId::from_ss58check(&controller_account).expect("Address is valid"); let initial_stake = initial_stake_in_tokens as u128 * TOKEN; - staking_bond( - &stash_connection, - initial_stake, - &controller_account, - XtStatus::Finalized, - ); + stash_connection + .bond(initial_stake, controller_account, TxStatus::Finalized) + .await + .unwrap(); } -pub fn validate(connection: SignedConnection, commission_percentage: u8) { - staking_validate(&connection, commission_percentage, XtStatus::Finalized); +pub async fn validate(connection: SignedConnection, commission_percentage: u8) { + connection + .validate(commission_percentage, TxStatus::Finalized) + .await + .unwrap(); } -pub fn nominate(connection: SignedConnection, nominee: String) { +pub async fn nominate(connection: SignedConnection, nominee: String) { let nominee_account = AccountId::from_ss58check(&nominee).expect("Address is valid"); - staking_nominate(&connection, &nominee_account); + connection + .nominate(nominee_account, TxStatus::InBlock) + .await + .unwrap(); } -pub fn set_staking_limits( +pub async fn set_staking_limits( root_connection: RootConnection, minimal_nominator_stake_tokens: u64, minimal_validator_stake_tokens: u64, max_nominators_count: Option, max_validators_count: Option, ) { - staking_set_staking_limits( - &root_connection, - minimal_nominator_stake_tokens as u128 * TOKEN, - minimal_validator_stake_tokens as u128 * TOKEN, - max_nominators_count, - max_validators_count, - XtStatus::Finalized, - ); + root_connection + .set_staking_config( + minimal_nominator_stake_tokens as u128 * TOKEN, + minimal_validator_stake_tokens as u128 * TOKEN, + max_nominators_count, + max_validators_count, + TxStatus::Finalized, + ) + .await + .unwrap(); } -pub fn force_new_era(root_connection: RootConnection) { - staking_force_new_era(&root_connection, XtStatus::Finalized); +pub async fn force_new_era(root_connection: RootConnection) { + root_connection + .force_new_era(TxStatus::Finalized) + .await + .unwrap(); } diff --git a/bin/cliain/src/transfer.rs b/bin/cliain/src/transfer.rs index 565fab1940..8ca1c92adf 100644 --- a/bin/cliain/src/transfer.rs +++ b/bin/cliain/src/transfer.rs @@ -1,14 +1,15 @@ -use aleph_client::{balances_transfer, SignedConnection}; +use aleph_client::{pallets::balances::BalanceUserApi, AccountId, SignedConnection, TxStatus}; use primitives::TOKEN; -use sp_core::crypto::Ss58Codec; -use substrate_api_client::{AccountId, XtStatus}; +use subxt::ext::sp_core::crypto::Ss58Codec; -pub fn transfer(connection: SignedConnection, amount_in_tokens: u64, to_account: String) { +pub async fn transfer(connection: SignedConnection, amount_in_tokens: u64, to_account: String) { let to_account = AccountId::from_ss58check(&to_account).expect("Address is valid"); - balances_transfer( - &connection, - &to_account, - amount_in_tokens as u128 * TOKEN, - XtStatus::Finalized, - ); + connection + .transfer( + to_account, + amount_in_tokens as u128 * TOKEN, + TxStatus::Finalized, + ) + .await + .unwrap(); } diff --git a/bin/cliain/src/treasury.rs b/bin/cliain/src/treasury.rs index 51b1948d9c..4843b1b10b 100644 --- a/bin/cliain/src/treasury.rs +++ b/bin/cliain/src/treasury.rs @@ -1,28 +1,33 @@ use aleph_client::{ - approve_treasury_proposal, make_treasury_proposal, reject_treasury_proposal, RootConnection, - SignedConnection, + pallets::treasury::{TreasurySudoApi, TreasuryUserApi}, + AccountId, RootConnection, SignedConnection, TxStatus, }; use primitives::{Balance, TOKEN}; -use sp_core::crypto::Ss58Codec; -use substrate_api_client::AccountId; +use subxt::ext::sp_core::crypto::Ss58Codec; /// Delegates to `aleph_client::make_treasury_proposal`. -pub fn propose(connection: SignedConnection, amount_in_tokens: u64, beneficiary: String) { +pub async fn propose(connection: SignedConnection, amount_in_tokens: u64, beneficiary: String) { let beneficiary = AccountId::from_ss58check(&beneficiary).expect("Address should be valid"); let endowment = amount_in_tokens as Balance * TOKEN; - make_treasury_proposal(&connection, endowment, &beneficiary) - .expect("Should successfully make a proposal"); + connection + .propose_spend(endowment, beneficiary, TxStatus::Finalized) + .await + .unwrap(); } /// Delegates to `aleph_client::approve_treasury_proposal`. -pub fn approve(connection: RootConnection, proposal_id: u32) { - approve_treasury_proposal(&connection, proposal_id) - .expect("Should successfully approve the proposal") +pub async fn approve(connection: RootConnection, proposal_id: u32) { + connection + .approve(proposal_id, TxStatus::Finalized) + .await + .unwrap(); } /// Delegates to `aleph_client::reject_treasury_proposal`. -pub fn reject(connection: RootConnection, proposal_id: u32) { - reject_treasury_proposal(&connection, proposal_id) - .expect("Should successfully reject the proposal") +pub async fn reject(connection: RootConnection, proposal_id: u32) { + connection + .reject(proposal_id, TxStatus::Finalized) + .await + .unwrap(); } diff --git a/bin/cliain/src/validators.rs b/bin/cliain/src/validators.rs index 0f735ff4f8..966df1c245 100644 --- a/bin/cliain/src/validators.rs +++ b/bin/cliain/src/validators.rs @@ -1,20 +1,28 @@ -use aleph_client::RootConnection; -use substrate_api_client::XtStatus; +use aleph_client::{ + pallets::elections::ElectionsSudoApi, primitives::CommitteeSeats, RootConnection, TxStatus, +}; use crate::commands::ChangeValidatorArgs; /// Change validators to the provided list by calling the provided node. -pub fn change_validators( +pub async fn change_validators( root_connection: RootConnection, change_validator_args: ChangeValidatorArgs, ) { - aleph_client::change_validators( - &root_connection, - change_validator_args.reserved_validators, - change_validator_args.non_reserved_validators, - change_validator_args.committee_size, - XtStatus::Finalized, - ); + root_connection + .change_validators( + change_validator_args.reserved_validators, + change_validator_args.non_reserved_validators, + change_validator_args + .committee_size + .map(|s| CommitteeSeats { + reserved_seats: s.reserved_seats, + non_reserved_seats: s.non_reserved_seats, + }), + TxStatus::Finalized, + ) + .await + .unwrap(); // TODO we need to check state here whether change members actually succeed // not only here, but for all cliain commands // see https://cardinal-cryptography.atlassian.net/browse/AZ-699 diff --git a/bin/cliain/src/vesting.rs b/bin/cliain/src/vesting.rs index 2c8a73967f..648e72be82 100644 --- a/bin/cliain/src/vesting.rs +++ b/bin/cliain/src/vesting.rs @@ -1,14 +1,15 @@ use aleph_client::{ - account_from_keypair, keypair_from_string, BlockNumber, SignedConnection, VestingSchedule, + account_from_keypair, keypair_from_string, pallet_vesting::vesting_info::VestingInfo, + pallets::vesting::VestingUserApi, SignedConnection, TxStatus, }; use log::{error, info}; -use primitives::{Balance, TOKEN}; +use primitives::{Balance, BlockNumber, TOKEN}; /// Delegates to `aleph_client::vest`. /// /// Vesting is performed for the signer of `connection`. -pub fn vest(connection: SignedConnection) { - match aleph_client::vest(connection) { +pub async fn vest(connection: SignedConnection) { + match connection.vest(TxStatus::Finalized).await { Ok(_) => info!("Vesting has succeeded"), Err(e) => error!("Vesting has failed with:\n {:?}", e), } @@ -17,9 +18,9 @@ pub fn vest(connection: SignedConnection) { /// Delegates to `aleph_client::vest_other`. /// /// Vesting is performed by the signer of `connection` for `vesting_account_seed`. -pub fn vest_other(connection: SignedConnection, vesting_account_seed: String) { - let vester = account_from_keypair(&keypair_from_string(vesting_account_seed.as_str())); - match aleph_client::vest_other(connection, vester) { +pub async fn vest_other(connection: SignedConnection, vesting_account_seed: String) { + let vester = account_from_keypair(keypair_from_string(vesting_account_seed.as_str()).signer()); + match connection.vest_other(TxStatus::Finalized, vester).await { Ok(_) => info!("Vesting on behalf has succeeded"), Err(e) => error!("Vesting on behalf has failed with:\n {:?}", e), } @@ -30,17 +31,23 @@ pub fn vest_other(connection: SignedConnection, vesting_account_seed: String) { /// The transfer is performed from the signer of `connection` to `target_seed`. /// `amount_in_tokens`, `per_block` and `starting_block` corresponds to the fields of /// `aleph_client::VestingSchedule` struct. -pub fn vested_transfer( +pub async fn vested_transfer( connection: SignedConnection, target_seed: String, amount_in_tokens: u64, per_block: Balance, starting_block: BlockNumber, ) { - let receiver = account_from_keypair(&keypair_from_string(target_seed.as_str())); - let schedule = - VestingSchedule::new(amount_in_tokens as u128 * TOKEN, per_block, starting_block); - match aleph_client::vested_transfer(connection, receiver, schedule) { + let receiver = account_from_keypair(keypair_from_string(target_seed.as_str()).signer()); + let schedule = VestingInfo { + locked: amount_in_tokens as u128 * TOKEN, + per_block, + starting_block, + }; + match connection + .vested_transfer(receiver, schedule, TxStatus::Finalized) + .await + { Ok(_) => info!("Vested transfer has succeeded"), Err(e) => error!("Vested transfer has failed with:\n {:?}", e), } diff --git a/e2e-tests/Cargo.lock b/e2e-tests/Cargo.lock index b7d7d8d828..f9f5040aa9 100644 --- a/e2e-tests/Cargo.lock +++ b/e2e-tests/Cargo.lock @@ -12,55 +12,6 @@ dependencies = [ "regex", ] -[[package]] -name = "ac-compose-macros" -version = "0.1.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate-api-client.git?branch=aleph-v0.9.28#92bc66b75428213e4bcdb2484616cf458455813a" -dependencies = [ - "ac-primitives", - "log", - "parity-scale-codec", - "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "ac-node-api" -version = "0.1.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate-api-client.git?branch=aleph-v0.9.28#92bc66b75428213e4bcdb2484616cf458455813a" -dependencies = [ - "ac-primitives", - "derive_more", - "frame-metadata 15.0.0 (git+https://github.com/integritee-network/frame-metadata)", - "frame-support", - "frame-system", - "hex", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "serde_json", - "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "ac-primitives" -version = "0.1.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate-api-client.git?branch=aleph-v0.9.28#92bc66b75428213e4bcdb2484616cf458455813a" -dependencies = [ - "hex", - "parity-scale-codec", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "addr2line" version = "0.17.0" @@ -98,7 +49,7 @@ dependencies = [ [[package]] name = "aleph-e2e-client" -version = "0.6.0" +version = "0.7.0" dependencies = [ "aleph_client", "anyhow", @@ -117,35 +68,30 @@ dependencies = [ "serde_json", "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "tokio", ] [[package]] name = "aleph_client" -version = "1.11.0" +version = "2.0.0" dependencies = [ - "ac-node-api", - "ac-primitives", "anyhow", + "async-trait", "contract-metadata 1.5.0", "contract-transcode", "frame-support", + "futures", "hex", "ink_metadata", "log", - "pallet-aleph", - "pallet-balances", - "pallet-elections", - "pallet-multisig", - "pallet-staking", - "pallet-treasury", - "pallet-vesting", "parity-scale-codec", "primitives", "rayon", + "serde", "serde_json", "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "substrate-api-client", + "subxt", "thiserror", ] @@ -164,7 +110,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -209,6 +155,16 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +[[package]] +name = "async-lock" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" +dependencies = [ + "event-listener", + "futures-lite", +] + [[package]] name = "async-trait" version = "0.1.58" @@ -228,7 +184,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -245,7 +201,7 @@ checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -270,6 +226,15 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +dependencies = [ + "serde", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -379,16 +344,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -dependencies = [ - "byteorder", - "iovec", -] - [[package]] name = "bytes" version = "1.2.1" @@ -401,12 +356,6 @@ version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -422,7 +371,7 @@ dependencies = [ "iana-time-zone", "num-integer", "num-traits", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -539,10 +488,14 @@ dependencies = [ ] [[package]] -name = "convert_case" -version = "0.4.0" +name = "core-foundation" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] [[package]] name = "core-foundation-sys" @@ -565,7 +518,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -575,7 +528,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] @@ -587,7 +540,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", "memoffset", "scopeguard", @@ -599,7 +552,7 @@ version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -720,6 +673,41 @@ dependencies = [ "syn", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "der" version = "0.5.1" @@ -729,16 +717,25 @@ dependencies = [ "const-oid", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "convert_case", "proc-macro2", "quote", - "rustc_version", "syn", ] @@ -904,12 +901,27 @@ dependencies = [ "rustversion", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + [[package]] name = "fake-simd" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + [[package]] name = "ff" version = "0.11.1" @@ -933,19 +945,10 @@ dependencies = [ ] [[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" @@ -1011,18 +1014,7 @@ version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df6bb8542ef006ef0de09a5c4420787d79823c0ed7924225822362fd2bf2ff2d" dependencies = [ - "cfg-if 1.0.0", - "parity-scale-codec", - "scale-info", - "serde", -] - -[[package]] -name = "frame-metadata" -version = "15.0.0" -source = "git+https://github.com/integritee-network/frame-metadata#3b43da9821238681f9431276d55b92a079142083" -dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "parity-scale-codec", "scale-info", "serde", @@ -1034,7 +1026,7 @@ version = "4.0.0-dev" source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" dependencies = [ "bitflags", - "frame-metadata 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", "k256", @@ -1110,22 +1102,6 @@ dependencies = [ "sp-version", ] -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "funty" version = "2.0.0" @@ -1181,6 +1157,21 @@ version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + [[package]] name = "futures-macro" version = "0.3.25" @@ -1253,7 +1244,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi 0.9.0+wasi-snapshot-preview1", @@ -1266,7 +1257,7 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] @@ -1364,6 +1355,17 @@ dependencies = [ "hmac 0.8.1", ] +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "httparse" version = "1.8.0" @@ -1387,7 +1389,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1400,6 +1402,12 @@ dependencies = [ "cxx-build", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.3.0" @@ -1461,7 +1469,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c9588a59a0e8997c0b2153cd11b5aaa77c06a0537a6b18f3811d1f1aa098b12" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1487,7 +1495,7 @@ checksum = "a891d34301a3dbb1c7b7424c49ae184282b163491c54f9acd17fcbe14a80447b" dependencies = [ "arrayref", "blake2", - "cfg-if 1.0.0", + "cfg-if", "derive_more", "ink_allocator", "ink_engine", @@ -1526,7 +1534,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f031e6b8495594a7288b089bf4122e76c26b994959d1b2b693bdfe846b14c0e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1535,28 +1543,28 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e12cf42dce81d060401c7cec95a392ad6d3c2f18661fa3083f619ce135133c33" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ink_prelude", "parity-scale-codec", "scale-info", ] [[package]] -name = "integer-sqrt" -version = "0.1.5" +name = "instant" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "num-traits", + "cfg-if", ] [[package]] -name = "iovec" -version = "0.1.4" +name = "integer-sqrt" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" dependencies = [ - "libc", + "num-traits", ] [[package]] @@ -1589,13 +1597,82 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonrpsee" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bd0d559d5e679b1ab2f869b486a11182923863b1b3ee8b421763cdd707b783a" +dependencies = [ + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8752740ecd374bcbf8b69f3e80b0327942df76f793f8d4e60d3355650c31fb74" +dependencies = [ + "futures-util", + "http", + "jsonrpsee-core", + "jsonrpsee-types", + "pin-project", + "rustls-native-certs", + "soketto", + "thiserror", + "tokio", + "tokio-rustls", + "tokio-util", + "tracing", + "webpki-roots", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3dc3e9cf2ba50b7b1d7d76a667619f82846caa39e8e8daa8a4962d74acaddca" +dependencies = [ + "anyhow", + "async-lock", + "async-trait", + "beef", + "futures-channel", + "futures-timer", + "futures-util", + "jsonrpsee-types", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e290bba767401b646812f608c099b922d8142603c9e73a50fb192d3ac86f4a0d" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + [[package]] name = "k256" version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ecdsa", "elliptic-curve", "sec1", @@ -1607,28 +1684,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" version = "0.2.137" @@ -1724,7 +1785,7 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1806,45 +1867,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.6.23" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", "libc", "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.42.0", ] [[package]] @@ -1876,17 +1906,6 @@ dependencies = [ "syn", ] -[[package]] -name = "net2" -version = "0.2.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", -] - [[package]] name = "nodrop" version = "0.1.14" @@ -2027,67 +2046,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] -name = "openssl" -version = "0.10.42" +name = "openssl-probe" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" -dependencies = [ - "bitflags", - "cfg-if 1.0.0", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] -name = "openssl-macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "openssl-sys" -version = "0.9.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" -dependencies = [ - "autocfg", - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "os_str_bytes" -version = "6.3.0" +name = "os_str_bytes" +version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" -[[package]] -name = "pallet-aleph" -version = "0.5.0" -dependencies = [ - "frame-support", - "frame-system", - "pallet-balances", - "pallet-session", - "pallets-support", - "parity-scale-codec", - "primitives", - "scale-info", - "serde", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "pallet-authorship" version = "4.0.0-dev" @@ -2140,20 +2109,6 @@ dependencies = [ "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", ] -[[package]] -name = "pallet-multisig" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "pallet-session" version = "4.0.0-dev" @@ -2213,52 +2168,6 @@ dependencies = [ "sp-timestamp", ] -[[package]] -name = "pallet-transaction-payment" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-treasury" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "pallet-balances", - "parity-scale-codec", - "scale-info", - "serde", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-vesting" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "pallets-support" version = "0.1.0" @@ -2275,7 +2184,7 @@ dependencies = [ "arrayvec 0.7.2", "bitvec", "byte-slice-cast", - "bytes 1.2.1", + "bytes", "impl-trait-for-tuples", "parity-scale-codec-derive", "serde", @@ -2299,13 +2208,13 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "hashbrown", "impl-trait-for-tuples", "parity-util-mem-derive", "parking_lot", "primitive-types", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2325,6 +2234,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + [[package]] name = "parking_lot" version = "0.12.1" @@ -2341,11 +2256,11 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2378,6 +2293,26 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" version = "0.2.9" @@ -2390,12 +2325,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "pkg-config" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" - [[package]] name = "ppv-lite86" version = "0.2.16" @@ -2676,6 +2605,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + [[package]] name = "rlibc" version = "1.0.0" @@ -2701,12 +2645,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] -name = "rustc_version" -version = "0.4.0" +name = "rustls" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" dependencies = [ - "semver", + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +dependencies = [ + "base64", ] [[package]] @@ -2721,6 +2689,29 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +[[package]] +name = "scale-bits" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd7aca73785181cc41f0bbe017263e682b585ca660540ba569133901d013ecf" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "scale-decode" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d823d4be477fc33321f93d08fb6c2698273d044f01362dc27573a750deb7c233" +dependencies = [ + "parity-scale-codec", + "scale-bits", + "scale-info", + "thiserror", +] + [[package]] name = "scale-info" version = "2.2.0" @@ -2728,7 +2719,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "333af15b02563b8182cd863f925bd31ef8fa86a0e095d30c091956057d436153" dependencies = [ "bitvec", - "cfg-if 1.0.0", + "cfg-if", "derive_more", "parity-scale-codec", "scale-info-derive", @@ -2747,6 +2738,33 @@ dependencies = [ "syn", ] +[[package]] +name = "scale-value" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16a5e7810815bd295da73e4216d1dfbced3c7c7c7054d70fa5f6e4c58123fff4" +dependencies = [ + "either", + "frame-metadata", + "parity-scale-codec", + "scale-bits", + "scale-decode", + "scale-info", + "serde", + "thiserror", + "yap", +] + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys 0.36.1", +] + [[package]] name = "schnorrkel" version = "0.9.1" @@ -2777,6 +2795,16 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "sec1" version = "0.2.1" @@ -2834,6 +2862,29 @@ dependencies = [ "zeroize", ] +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "1.0.14" @@ -2876,14 +2927,15 @@ dependencies = [ [[package]] name = "sha-1" -version = "0.8.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", ] [[package]] @@ -2905,7 +2957,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug 0.3.0", @@ -2917,7 +2969,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.5", ] @@ -2941,6 +2993,15 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + [[package]] name = "signature" version = "1.4.0" @@ -2978,6 +3039,31 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64", + "bytes", + "futures", + "httparse", + "log", + "rand 0.8.5", + "sha-1", +] + [[package]] name = "sp-api" version = "4.0.0-dev" @@ -3298,7 +3384,7 @@ name = "sp-io" version = "6.0.0" source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" dependencies = [ - "bytes 1.2.1", + "bytes", "futures", "hash-db", "libsecp256k1", @@ -3387,16 +3473,6 @@ dependencies = [ "regex", ] -[[package]] -name = "sp-rpc" -version = "6.0.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "rustc-hash", - "serde", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "sp-runtime" version = "6.0.0" @@ -3465,7 +3541,7 @@ name = "sp-runtime-interface" version = "6.0.0" source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" dependencies = [ - "bytes 1.2.1", + "bytes", "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", @@ -3738,6 +3814,12 @@ dependencies = [ "wasmi", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "ss58-registry" version = "1.33.0" @@ -3778,36 +3860,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" -[[package]] -name = "substrate-api-client" -version = "0.6.0" -source = "git+https://github.com/Cardinal-Cryptography/substrate-api-client.git?branch=aleph-v0.9.28#92bc66b75428213e4bcdb2484616cf458455813a" -dependencies = [ - "ac-compose-macros", - "ac-node-api", - "ac-primitives", - "frame-metadata 15.0.0 (git+https://github.com/integritee-network/frame-metadata)", - "frame-support", - "frame-system", - "hex", - "log", - "pallet-balances", - "pallet-staking", - "pallet-transaction-payment", - "parity-scale-codec", - "primitive-types", - "serde", - "serde_json", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-rpc", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-version", - "thiserror", - "ws", -] - [[package]] name = "substrate-bip39" version = "0.4.4" @@ -3827,6 +3879,75 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +[[package]] +name = "subxt" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a8757ee0e19f87e722577282ab1386c86592a4b13ff963b9c6ec4176348104c" +dependencies = [ + "bitvec", + "derivative", + "frame-metadata", + "futures", + "hex", + "jsonrpsee", + "parity-scale-codec", + "parking_lot", + "scale-decode", + "scale-info", + "scale-value", + "serde", + "serde_json", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "subxt-macro", + "subxt-metadata", + "thiserror", + "tracing", +] + +[[package]] +name = "subxt-codegen" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb77f93e11e6ff3ff95fe33e3d24c27c342e16feca8ef47759993614ebe90d2c" +dependencies = [ + "darling", + "frame-metadata", + "heck", + "parity-scale-codec", + "proc-macro-error", + "proc-macro2", + "quote", + "scale-info", + "subxt-metadata", + "syn", +] + +[[package]] +name = "subxt-macro" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051cc21d77a54ae944b872eafdf9edfe1d9134fdfcfc3477dc10f763c76564a9" +dependencies = [ + "darling", + "proc-macro-error", + "subxt-codegen", + "syn", +] + +[[package]] +name = "subxt-metadata" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ed78d80db3a97d55e8b1cfecc1f6f9e21793a589d4e2e5f4fe2d6d5850c2e54" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "syn" version = "1.0.103" @@ -3943,6 +4064,62 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +[[package]] +name = "tokio" +version = "1.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite", + "tokio", +] + [[package]] name = "toml" version = "0.5.9" @@ -3958,7 +4135,7 @@ version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -3985,6 +4162,16 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + [[package]] name = "tracing-log" version = "0.1.3" @@ -4062,7 +4249,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "digest 0.10.5", "rand 0.8.5", "static_assertions", @@ -4119,6 +4306,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "url" version = "2.3.1" @@ -4137,18 +4330,18 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -4167,7 +4360,7 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -4240,10 +4433,33 @@ dependencies = [ ] [[package]] -name = "winapi" -version = "0.2.8" +name = "web-sys" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" +dependencies = [ + "webpki", +] [[package]] name = "winapi" @@ -4255,12 +4471,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -4273,7 +4483,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -4282,6 +4492,19 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + [[package]] name = "windows-sys" version = "0.42.0" @@ -4289,12 +4512,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_x86_64_msvc 0.42.0", ] [[package]] @@ -4303,24 +4526,48 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + [[package]] name = "windows_aarch64_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + [[package]] name = "windows_i686_gnu" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + [[package]] name = "windows_i686_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + [[package]] name = "windows_x86_64_gnu" version = "0.42.0" @@ -4335,38 +4582,15 @@ checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" [[package]] name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" - -[[package]] -name = "ws" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fe90c75f236a0a00247d5900226aea4f2d7b05ccc34da9e7a8880ff59b5848" -dependencies = [ - "byteorder", - "bytes 0.4.12", - "httparse", - "log", - "mio", - "mio-extras", - "openssl", - "rand 0.7.3", - "sha-1", - "slab", - "url", -] +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] -name = "ws2_32-sys" -version = "0.2.1" +name = "windows_x86_64_msvc" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" [[package]] name = "wyz" @@ -4377,6 +4601,12 @@ dependencies = [ "tap", ] +[[package]] +name = "yap" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc77f52dc9e9b10d55d3f4462c3b7fc393c4f17975d641542833ab2d3bc26ef" + [[package]] name = "zeroize" version = "1.5.7" diff --git a/e2e-tests/Cargo.toml b/e2e-tests/Cargo.toml index 32429f8f96..9466585028 100644 --- a/e2e-tests/Cargo.toml +++ b/e2e-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aleph-e2e-client" -version = "0.6.0" +version = "0.7.0" edition = "2021" license = "Apache 2.0" @@ -13,6 +13,7 @@ log = "0.4" serde_json = "1.0" codec = { package = 'parity-scale-codec', version = "3.0", default-features = false, features = ['derive'] } rayon = "1.5" +tokio = { version = "1.21.2", features = ["full"] } sp-core = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28", default-features = false, features = ["full_crypto"] } sp-runtime = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28", default-features = false } diff --git a/e2e-tests/src/accounts.rs b/e2e-tests/src/accounts.rs index 0292319366..31c8a6fa7e 100644 --- a/e2e-tests/src/accounts.rs +++ b/e2e-tests/src/accounts.rs @@ -1,5 +1,6 @@ -use aleph_client::{keypair_from_string, AccountId, KeyPair}; -use sp_core::Pair; +use aleph_client::{ + keypair_from_string, raw_keypair_from_string, AccountId, KeyPair, Pair, RawKeyPair, +}; use crate::config::Config; @@ -20,6 +21,9 @@ pub fn get_validators_seeds(config: &Config) -> Vec { pub fn get_validators_keys(config: &Config) -> Vec { accounts_seeds_to_keys(&get_validators_seeds(config)) } +pub fn get_validators_raw_keys(config: &Config) -> Vec { + accounts_seeds_to_raw_keys(&get_validators_seeds(config)) +} pub fn accounts_seeds_to_keys(seeds: &[String]) -> Vec { seeds @@ -28,6 +32,13 @@ pub fn accounts_seeds_to_keys(seeds: &[String]) -> Vec { .map(keypair_from_string) .collect() } +pub fn accounts_seeds_to_raw_keys(seeds: &[String]) -> Vec { + seeds + .iter() + .map(String::as_str) + .map(raw_keypair_from_string) + .collect() +} pub fn get_sudo_key(config: &Config) -> KeyPair { keypair_from_string(&config.sudo_seed) @@ -53,6 +64,6 @@ fn get_validators_controller_seed(seed: &str) -> String { pub fn account_ids_from_keys(keys: &[KeyPair]) -> Vec { keys.iter() - .map(|pair| AccountId::from(pair.public())) + .map(|pair| AccountId::from(pair.signer().public())) .collect() } diff --git a/e2e-tests/src/ban.rs b/e2e-tests/src/ban.rs index c087b322e1..29dfb887c3 100644 --- a/e2e-tests/src/ban.rs +++ b/e2e-tests/src/ban.rs @@ -1,19 +1,21 @@ use aleph_client::{ - change_validators, get_ban_config, get_ban_reason_for_validator, - get_underperformed_validator_session_count, wait_for_event, wait_for_full_era_completion, - AccountId, AnyConnection, RootConnection, XtStatus, + api::elections::events::BanValidators, + pallets::elections::{ElectionsApi, ElectionsSudoApi}, + primitives::{BanConfig, BanInfo, CommitteeSeats, EraValidators}, + waiting::{AlephWaiting, BlockStatus, WaitingExt}, + AccountId, Connection, RootConnection, TxStatus, }; -use codec::Decode; +use codec::Encode; use log::info; -use primitives::{BanConfig, BanInfo, CommitteeSeats, EraValidators, SessionCount}; +use primitives::SessionCount; use sp_runtime::Perbill; use crate::{accounts::account_ids_from_keys, validators::get_test_validators, Config}; -pub fn setup_test( +pub async fn setup_test( config: &Config, ) -> anyhow::Result<(RootConnection, Vec, Vec)> { - let root_connection = config.create_root_connection(); + let root_connection = config.create_root_connection().await; let validator_keys = get_test_validators(config); let reserved_validators = account_ids_from_keys(&validator_keys.reserved); @@ -24,15 +26,19 @@ pub fn setup_test( non_reserved_seats: 2, }; - change_validators( - &root_connection, - Some(reserved_validators.clone()), - Some(non_reserved_validators.clone()), - Some(seats), - XtStatus::InBlock, - ); + root_connection + .change_validators( + Some(reserved_validators.clone()), + Some(non_reserved_validators.clone()), + Some(seats), + TxStatus::InBlock, + ) + .await?; - wait_for_full_era_completion(&root_connection)?; + root_connection + .connection + .wait_for_n_eras(2, BlockStatus::Best) + .await; Ok(( root_connection, @@ -41,31 +47,28 @@ pub fn setup_test( )) } -pub fn check_validators( - connection: &C, +pub fn check_validators( expected_reserved: &[AccountId], expected_non_reserved: &[AccountId], - actual_validators_source: fn(&C) -> EraValidators, + era_validators: EraValidators, ) -> EraValidators { - let era_validators = actual_validators_source(connection); - assert_eq!(era_validators.reserved, expected_reserved); assert_eq!(era_validators.non_reserved, expected_non_reserved); era_validators } -pub fn check_ban_config( - connection: &RootConnection, +pub async fn check_ban_config( + connection: &Connection, expected_minimal_expected_performance: Perbill, expected_session_count_threshold: SessionCount, expected_clean_session_counter_delay: SessionCount, ) -> BanConfig { - let ban_config = get_ban_config(connection); + let ban_config = connection.get_ban_config(None).await; assert_eq!( - ban_config.minimal_expected_performance, - expected_minimal_expected_performance + ban_config.minimal_expected_performance.0, + expected_minimal_expected_performance.deconstruct() ); assert_eq!( ban_config.underperformed_session_count_threshold, @@ -79,48 +82,63 @@ pub fn check_ban_config( ban_config } -pub fn check_underperformed_validator_session_count( - connection: &C, +pub async fn check_underperformed_validator_session_count( + connection: &Connection, validator: &AccountId, - expected_session_count: &SessionCount, + expected_session_count: SessionCount, ) -> SessionCount { - let underperformed_validator_session_count = - get_underperformed_validator_session_count(connection, validator); + let underperformed_validator_session_count = connection + .get_underperformed_validator_session_count(validator.clone(), None) + .await + .unwrap_or_default(); assert_eq!( - &underperformed_validator_session_count, + underperformed_validator_session_count, expected_session_count ); underperformed_validator_session_count } -pub fn check_underperformed_validator_reason( - connection: &C, +pub async fn check_underperformed_validator_reason( + connection: &Connection, validator: &AccountId, expected_info: Option<&BanInfo>, ) -> Option { - let validator_ban_info = get_ban_reason_for_validator(connection, validator); - - assert_eq!(validator_ban_info.as_ref(), expected_info); - - validator_ban_info -} - -#[derive(Debug, Decode, Clone)] -pub struct BanEvent { - banned_validators: Vec<(AccountId, BanInfo)>, + let validator_ban_info = connection + .get_ban_info_for_validator(validator.clone(), None) + .await; + + match (validator_ban_info.as_ref(), expected_info) { + (Some(info), Some(expected_info)) => { + // terrible hack for now :( + assert_eq!(info.reason.encode(), expected_info.reason.encode()); + assert_eq!(info.start, expected_info.start); + + validator_ban_info + } + (None, None) => None, + _ => panic!( + "expected infos to be equal: expected {:?}, got {:?}", + expected_info, validator_ban_info + ), + } } -pub fn check_ban_event( - connection: &C, +pub async fn check_ban_event( + connection: &Connection, expected_banned_validators: &[(AccountId, BanInfo)], -) -> anyhow::Result { - let event = wait_for_event(connection, ("Elections", "BanValidators"), |e: BanEvent| { - info!("Received BanValidators event: {:?}", e.banned_validators); - assert_eq!(e.banned_validators, expected_banned_validators); - true - })?; +) -> anyhow::Result { + let event = connection + .wait_for_event( + |event: &BanValidators| { + info!("Received BanValidators event: {:?}", event.0); + true + }, + BlockStatus::Best, + ) + .await; + assert_eq!(event.0.encode(), expected_banned_validators.encode()); Ok(event) } diff --git a/e2e-tests/src/cases.rs b/e2e-tests/src/cases.rs index 31848ca8ab..635a94fcd5 100644 --- a/e2e-tests/src/cases.rs +++ b/e2e-tests/src/cases.rs @@ -18,50 +18,64 @@ use crate::{ }, }; -pub type TestCase = fn(&Config) -> anyhow::Result<()>; +pub async fn run_testcase(id: &str, config: &Config) -> anyhow::Result<()> { + match id { + "finalization" => test_finalization(config).await, + "version_upgrade" => test_schedule_version_change(config).await, + "rewards_disable_node" => test_disable_node(config).await, + "token_transfer" => test_token_transfer(config).await, + "channeling_fee_and_tip" => test_channeling_fee_and_tip(config).await, + "treasury_access" => test_treasury_access(config).await, + "batch_transactions" => test_batch_transactions(config).await, + "staking_era_payouts" => test_staking_era_payouts(config).await, + "validators_rotate" => test_validators_rotate(config).await, + "staking_new_validator" => test_staking_new_validator(config).await, + "change_validators" => test_change_validators(config).await, + "fee_calculation" => test_fee_calculation(config).await, + "era_payout" => test_era_payout(config).await, + "era_validators" => test_era_validators(config).await, + "rewards_change_stake_and_force_new_era" => { + test_change_stake_and_force_new_era(config).await + } + "points_basic" => test_points_basic(config).await, + "rewards_force_new_era" => test_force_new_era(config).await, + "rewards_stake_change" => test_points_stake_change(config).await, + "authorities_are_staking" => test_authorities_are_staking(config).await, -pub type PossibleTestCases = Vec<(&'static str, TestCase)>; + "clearing_session_count" => test_clearing_session_count(config).await, + "ban_automatic" => test_ban_automatic(config).await, + _ => panic!("unknown testcase"), + } +} + +pub async fn run_all_testcases(config: &Config) -> anyhow::Result<()> { + let all = vec![ + "finalization", + "version_upgrade", + "rewards_disable_node", + "token_transfer", + "channeling_fee_and_tip", + "treasury_access", + "batch_transactions", + "staking_era_payouts", + "validators_rotate", + "staking_new_validator", + "change_validators", + "fee_calculation", + "era_payout", + "era_validators", + "rewards_change_stake_and_force_new_era", + "points_basic", + "rewards_force_new_era", + "rewards_stake_change", + "authorities_are_staking", + "clearing_session_count", + "ban_automatic", + ]; + + for testcase in all { + run_testcase(testcase, config).await?; + } -/// Get a Vec with test cases that the e2e suite is able to handle. -/// The order of items is important for tests when more than one case is handled in order. -/// This comes up in local tests. -pub fn possible_test_cases() -> PossibleTestCases { - vec![ - ("finalization", test_finalization as TestCase), - ("version_upgrade", test_schedule_version_change), - ("rewards_disable_node", test_disable_node as TestCase), - ("token_transfer", test_token_transfer as TestCase), - ( - "channeling_fee_and_tip", - test_channeling_fee_and_tip as TestCase, - ), - ("treasury_access", test_treasury_access as TestCase), - ("batch_transactions", test_batch_transactions as TestCase), - ("staking_era_payouts", test_staking_era_payouts as TestCase), - ("validators_rotate", test_validators_rotate as TestCase), - ( - "staking_new_validator", - test_staking_new_validator as TestCase, - ), - ("change_validators", test_change_validators as TestCase), - ("fee_calculation", test_fee_calculation as TestCase), - ("era_payout", test_era_payout as TestCase), - ("era_validators", test_era_validators as TestCase), - ( - "rewards_change_stake_and_force_new_era", - test_change_stake_and_force_new_era as TestCase, - ), - ("points_basic", test_points_basic as TestCase), - ("rewards_force_new_era", test_force_new_era as TestCase), - ("rewards_stake_change", test_points_stake_change as TestCase), - ( - "authorities_are_staking", - test_authorities_are_staking as TestCase, - ), - ( - "clearing_session_count", - test_clearing_session_count as TestCase, - ), - ("ban_automatic", test_ban_automatic as TestCase), - ] + Ok(()) } diff --git a/e2e-tests/src/config.rs b/e2e-tests/src/config.rs index 55777282a9..a69be41e6c 100644 --- a/e2e-tests/src/config.rs +++ b/e2e-tests/src/config.rs @@ -44,17 +44,19 @@ impl Config { NodeKeys::from(validator_seed) } - pub fn create_root_connection(&self) -> RootConnection { + pub async fn create_root_connection(&self) -> RootConnection { let sudo_keypair = get_sudo_key(self); - RootConnection::new(&self.node, sudo_keypair) + RootConnection::new(self.node.clone(), sudo_keypair) + .await + .unwrap() } /// Get a `SignedConnection` where the signer is the first validator. - pub fn get_first_signed_connection(&self) -> SignedConnection { + pub async fn get_first_signed_connection(&self) -> SignedConnection { let node = &self.node; - let accounts = get_validators_keys(self); - let sender = accounts.first().expect("Using default accounts").to_owned(); - SignedConnection::new(node, sender) + let mut accounts = get_validators_keys(self); + let sender = accounts.remove(0); + SignedConnection::new(node.clone(), sender).await } } diff --git a/e2e-tests/src/elections.rs b/e2e-tests/src/elections.rs index 0d60c3f2f7..fcc9f19edf 100644 --- a/e2e-tests/src/elections.rs +++ b/e2e-tests/src/elections.rs @@ -1,11 +1,16 @@ use std::{collections::HashSet, iter::empty}; -use aleph_client::{get_validators_for_session, AccountId, ReadStorage}; +use aleph_client::{ + pallets::session::SessionApi, + primitives::{CommitteeSeats, EraValidators}, + utility::BlocksApi, + AccountId, Connection, +}; use log::debug; -use primitives::{CommitteeSeats, EraValidators, SessionIndex}; +use primitives::SessionIndex; -pub fn get_and_test_members_for_session( - connection: &C, +pub async fn get_and_test_members_for_session( + connection: &Connection, seats: CommitteeSeats, era_validators: &EraValidators, session: SessionIndex, @@ -35,9 +40,8 @@ pub fn get_and_test_members_for_session( .collect(); let members_active_set: HashSet<_> = members_active.iter().cloned().collect(); - let network_members: HashSet<_> = get_validators_for_session(connection, session) - .into_iter() - .collect(); + let block = connection.first_block_of_session(session).await; + let network_members: HashSet<_> = connection.get_validators(block).await.into_iter().collect(); debug!( "expected era validators for session {}: reserved - {:?}, non-reserved - {:?}", diff --git a/e2e-tests/src/lib.rs b/e2e-tests/src/lib.rs index b5f65039a1..f37546f64a 100644 --- a/e2e-tests/src/lib.rs +++ b/e2e-tests/src/lib.rs @@ -1,4 +1,4 @@ -pub use cases::{possible_test_cases, PossibleTestCases}; +pub use cases::{run_all_testcases, run_testcase}; pub use config::Config; mod accounts; diff --git a/e2e-tests/src/main.rs b/e2e-tests/src/main.rs index acba54a517..c1067bebf3 100644 --- a/e2e-tests/src/main.rs +++ b/e2e-tests/src/main.rs @@ -1,26 +1,25 @@ use std::{env, time::Instant}; -use aleph_e2e_client::{possible_test_cases, Config, PossibleTestCases}; +use aleph_e2e_client::{run_all_testcases, run_testcase, Config}; use clap::Parser; use log::info; -fn main() -> anyhow::Result<()> { +#[tokio::main(flavor = "multi_thread")] +async fn main() -> anyhow::Result<()> { init_env(); let config: Config = Config::parse(); let test_cases = config.test_cases.clone(); - - let possible_test_cases = possible_test_cases(); // Possibility to handle specified vs. default test cases // is helpful to parallelize e2e tests. match test_cases { Some(cases) => { info!("Running specified test cases."); - run_specified_test_cases(cases, possible_test_cases, &config)?; + run_specified_test_cases(cases, &config).await?; } None => { info!("Running all handled test cases."); - run_all_test_cases(possible_test_cases, &config)?; + run_all_testcases(&config).await?; } }; Ok(()) @@ -33,50 +32,20 @@ fn init_env() { env_logger::init(); } -/// Runs all handled test cases in sequence. -fn run_all_test_cases( - possible_test_cases: PossibleTestCases, - config: &Config, -) -> anyhow::Result<()> { - for (test_name, test_case) in possible_test_cases { - run(test_case, test_name, config)?; - } - Ok(()) -} - /// Runs specified test cases in sequence. /// Checks whether each provided test case is valid. -fn run_specified_test_cases( - test_names: Vec, - possible_test_cases: PossibleTestCases, - config: &Config, -) -> anyhow::Result<()> { +async fn run_specified_test_cases(test_names: Vec, config: &Config) -> anyhow::Result<()> { for test_name in test_names { - if let Some(idx) = possible_test_cases - .iter() - .position(|&(name, _)| name == test_name) - { - let (_, case) = possible_test_cases[idx]; - run(case, test_name.as_str(), config)?; - } else { - return Err(anyhow::anyhow!(format!( - "Provided test case '{}' is not handled.", - test_name - ))); - } + run(&test_name, config).await?; } Ok(()) } /// Runs single test case. Allows for a generic return type. -fn run( - testcase: fn(&Config) -> anyhow::Result, - name: &str, - config: &Config, -) -> anyhow::Result<()> { +async fn run(name: &str, config: &Config) -> anyhow::Result<()> { info!("Running test: {}", name); let start = Instant::now(); - testcase(config).map(|_| { + run_testcase(name, config).await.map(|_| { let elapsed = Instant::now().duration_since(start); println!("Ok! Elapsed time {}ms", elapsed.as_millis()); }) diff --git a/e2e-tests/src/rewards.rs b/e2e-tests/src/rewards.rs index 132175b169..14b190743e 100644 --- a/e2e-tests/src/rewards.rs +++ b/e2e-tests/src/rewards.rs @@ -1,19 +1,24 @@ use std::collections::{HashMap, HashSet}; use aleph_client::{ - account_from_keypair, balances_batch_transfer, balances_transfer, bond_extra_stake, - change_validators, get_block_hash, get_committee_seats, get_current_session, get_era, - get_era_reward_points, get_era_validators, get_exposure, get_session_first_block, - get_session_period, get_validator_block_count, rotate_keys, set_keys, wait_for_at_least_era, - wait_for_at_least_session, wait_for_finalized_block, wait_for_next_era, AccountId, ReadStorage, - RewardPoint, SessionKeys, SignedConnection, XtStatus, + account_from_keypair, + aleph_runtime::SessionKeys, + api::runtime_types, + pallets::{ + balances::{BalanceUserApi, BalanceUserBatchExtApi}, + elections::{ElectionsApi, ElectionsSudoApi}, + session::{SessionApi, SessionUserApi}, + staking::{StakingApi, StakingUserApi}, + }, + primitives::{CommitteeSeats, EraValidators}, + rpc::Rpc, + utility::BlocksApi, + waiting::{AlephWaiting, BlockStatus, WaitingExt}, + AccountId, SignedConnection, TxStatus, }; use log::{debug, info}; use pallet_elections::LENIENT_THRESHOLD; -use pallet_staking::Exposure; -use primitives::{ - Balance, BlockHash, CommitteeSeats, EraIndex, EraValidators, SessionIndex, TOKEN, -}; +use primitives::{Balance, BlockHash, EraIndex, SessionIndex, TOKEN}; use sp_runtime::Perquintill; use crate::{ @@ -25,50 +30,63 @@ const COMMITTEE_SEATS: CommitteeSeats = CommitteeSeats { reserved_seats: 2, non_reserved_seats: 2, }; +type RewardPoint = u32; /// Changes session_keys used by a given `controller` to some `zero`/invalid value, /// making it impossible to create new legal blocks. -pub fn set_invalid_keys_for_validator( +pub async fn set_invalid_keys_for_validator( controller_connection: &SignedConnection, ) -> anyhow::Result<()> { const ZERO_SESSION_KEYS: SessionKeys = SessionKeys { - aura: [0; 32], - aleph: [0; 32], + // todo: clean this + aura: runtime_types::sp_consensus_aura::sr25519::app_sr25519::Public( + runtime_types::sp_core::sr25519::Public([0; 32]), + ), + aleph: runtime_types::primitives::app::Public(runtime_types::sp_core::ed25519::Public( + [0; 32], + )), }; - set_keys(controller_connection, ZERO_SESSION_KEYS, XtStatus::InBlock); // wait until our node is forced to use new keys, i.e. current session + 2 - let current_session = get_current_session(controller_connection); - wait_for_at_least_session(controller_connection, current_session + 2)?; + controller_connection + .set_keys(ZERO_SESSION_KEYS, TxStatus::InBlock) + .await + .unwrap(); + controller_connection + .connection + .wait_for_n_sessions(2, BlockStatus::Best) + .await; Ok(()) } /// Rotates session_keys of a given `controller`, making it able to rejoin the `consensus`. -pub fn reset_validator_keys(controller_connection: &SignedConnection) -> anyhow::Result<()> { - let validator_keys = - rotate_keys(controller_connection).expect("Failed to retrieve keys from chain"); - set_keys(controller_connection, validator_keys, XtStatus::InBlock); +pub async fn reset_validator_keys(controller_connection: &SignedConnection) -> anyhow::Result<()> { + let validator_keys = controller_connection.author_rotate_keys().await; + controller_connection + .set_keys(validator_keys, TxStatus::InBlock) + .await + .unwrap(); // wait until our node is forced to use new keys, i.e. current session + 2 - let current_session = get_current_session(controller_connection); - wait_for_at_least_session(controller_connection, current_session + 2)?; + controller_connection + .connection + .wait_for_n_sessions(2, BlockStatus::Best) + .await; Ok(()) } -pub fn download_exposure( +pub async fn download_exposure( connection: &SignedConnection, era: EraIndex, account_id: &AccountId, beginning_of_session_block_hash: BlockHash, ) -> Balance { - let exposure: Exposure = get_exposure( - connection, - era, - account_id, - Some(beginning_of_session_block_hash), - ); + let exposure = connection + .connection + .get_exposure(era, account_id, Some(beginning_of_session_block_hash)) + .await; info!( "Validator {} has own exposure of {} and total of {}.", account_id, exposure.own, exposure.total @@ -96,11 +114,12 @@ fn check_rewards( .map(|(_, reward)| reward) .sum(); - for (account, reward) in validator_reward_points { - let retrieved_reward = *retrieved_reward_points.get(&account).unwrap_or_else(|| { + for (account, reward) in &validator_reward_points { + let reward = *reward; + let retrieved_reward = *retrieved_reward_points.get(account).unwrap_or_else(|| { panic!( - "missing account={} in retrieved collection of reward points", - account + "missing account={} in retrieved collection of reward points {:?}", + account, validator_reward_points ) }); @@ -121,18 +140,18 @@ fn check_rewards( Ok(()) } -fn get_node_performance( +async fn get_node_performance( connection: &SignedConnection, account_id: &AccountId, before_end_of_session_block_hash: BlockHash, blocks_to_produce_per_session: u32, ) -> f64 { - let block_count = get_validator_block_count( - connection, - account_id, - Some(before_end_of_session_block_hash), - ) - .unwrap_or(0); + let block_count = connection + .connection + .get_validator_block_count(account_id.clone(), Some(before_end_of_session_block_hash)) + .await + .unwrap_or_default(); + info!( "Block count for validator {} is {:?}, block hash is {}.", account_id, block_count, before_end_of_session_block_hash @@ -150,7 +169,7 @@ fn get_node_performance( lenient_performance } -pub fn check_points( +pub async fn check_points( connection: &SignedConnection, session: SessionIndex, era: EraIndex, @@ -159,19 +178,34 @@ pub fn check_points( members_per_session: u32, max_relative_difference: f64, ) -> anyhow::Result<()> { - let session_period = get_session_period(connection); + let session_period = connection.connection.get_session_period().await; info!("Era: {} | session: {}.", era, session); let beggining_of_session_block = session * session_period; let end_of_session_block = beggining_of_session_block + session_period; info!("Waiting for block: {}.", end_of_session_block); - wait_for_finalized_block(connection, end_of_session_block)?; - - let beggining_of_session_block_hash = get_block_hash(connection, beggining_of_session_block); - let end_of_session_block_hash = get_block_hash(connection, end_of_session_block); - let before_end_of_session_block_hash = get_block_hash(connection, end_of_session_block - 1); - info!("End-of-session block hash: {}.", end_of_session_block_hash); + connection + .connection + .wait_for_block(|n| n >= end_of_session_block, BlockStatus::Finalized) + .await; + + let beggining_of_session_block_hash = connection + .connection + .get_block_hash(beggining_of_session_block) + .await; + let end_of_session_block_hash = connection + .connection + .get_block_hash(end_of_session_block) + .await; + let before_end_of_session_block_hash = connection + .connection + .get_block_hash(end_of_session_block - 1) + .await; + info!( + "End-of-session block hash: {:?}.", + end_of_session_block_hash + ); info!("Members per session: {}.", members_per_session); @@ -182,15 +216,21 @@ pub fn check_points( ); // get points stored by the Staking pallet - let validator_reward_points_current_era = - get_era_reward_points(connection, era, Some(end_of_session_block_hash)) + let validator_reward_points_current_era = connection + .connection + .get_era_reward_points(era, end_of_session_block_hash) + .await + .unwrap_or_default() + .individual; + + let validator_reward_points_previous_session = HashMap::::from_iter( + connection + .connection + .get_era_reward_points(era, beggining_of_session_block_hash) + .await .unwrap_or_default() - .individual; - - let validator_reward_points_previous_session = - get_era_reward_points(connection, era, Some(beggining_of_session_block_hash)) - .unwrap_or_default() - .individual; + .individual, + ); let validator_reward_points_current_session: HashMap = validator_reward_points_current_era @@ -209,27 +249,38 @@ pub fn check_points( }) .collect(); - let members_uptime = members.into_iter().map(|account_id| { - ( + let mut members_uptime = vec![]; + for account_id in members.into_iter() { + members_uptime.push(( account_id.clone(), get_node_performance( connection, &account_id, - before_end_of_session_block_hash, + before_end_of_session_block_hash.unwrap(), blocks_to_produce_per_session, - ), - ) - }); + ) + .await, + )); + } let members_bench_uptime = members_bench .into_iter() .map(|account_id| (account_id, 1.0)); - let mut reward_points: HashMap<_, _> = members_uptime.chain(members_bench_uptime).collect(); + let mut reward_points: HashMap<_, _> = members_uptime + .into_iter() + .chain(members_bench_uptime) + .collect(); + let members_count = reward_points.len() as f64; for (account_id, reward_points) in reward_points.iter_mut() { - let exposure = - download_exposure(connection, era, account_id, beggining_of_session_block_hash); + let exposure = download_exposure( + connection, + era, + account_id, + beggining_of_session_block_hash.unwrap(), + ) + .await; *reward_points *= exposure as f64 / members_count; } @@ -240,24 +291,22 @@ pub fn check_points( ) } -pub fn get_era_for_session(connection: &C, session: SessionIndex) -> EraIndex { - let session_first_block = get_session_first_block(connection, session); - get_era(connection, Some(session_first_block)) -} - -pub fn setup_validators( +pub async fn setup_validators( config: &Config, ) -> anyhow::Result<(EraValidators, CommitteeSeats, SessionIndex)> { - let root_connection = config.create_root_connection(); + let root_connection = config.create_root_connection().await; // we need to wait for at least era 1 since some of the storage items are not available at era 0 - wait_for_at_least_era(&root_connection, 1)?; + root_connection + .connection + .wait_for_n_eras(1, BlockStatus::Best) + .await; let seats = COMMITTEE_SEATS; let members_seats = seats.reserved_seats + seats.non_reserved_seats; let members_seats = members_seats.try_into().unwrap(); let members: Vec<_> = get_validators_keys(config) .iter() - .map(account_from_keypair) + .map(|kp| account_from_keypair(kp.signer())) .collect(); let members_size = members.len(); @@ -270,10 +319,20 @@ pub fn setup_validators( let reserved_members = &members[0..reserved_size]; let non_reserved_members = &members[reserved_size..]; - let session = get_current_session(&root_connection); - let network_validators = get_era_validators(&root_connection, session); - let first_block_in_session = get_session_first_block(&root_connection, session); - let network_seats = get_committee_seats(&root_connection, Some(first_block_in_session)); + let session = root_connection.connection.get_session(None).await; + let network_validators = root_connection + .connection + .get_current_era_validators(None) + .await; + let first_block_in_session = root_connection + .connection + .first_block_of_session(session) + .await + .unwrap(); + let network_seats = root_connection + .connection + .get_committee_seats(Some(first_block_in_session)) + .await; let era_validators = EraValidators { reserved: reserved_members.to_vec(), @@ -285,24 +344,38 @@ pub fn setup_validators( return Ok((era_validators, seats, session)); } - change_validators( - &root_connection, - Some(reserved_members.into()), - Some(non_reserved_members.into()), - Some(seats), - XtStatus::Finalized, - ); - - wait_for_next_era(&root_connection)?; - let session = get_current_session(&root_connection); - - let network_validators = get_era_validators(&root_connection, session); + info!("changing validators to {:?}", era_validators); + root_connection + .change_validators( + Some(reserved_members.into()), + Some(non_reserved_members.into()), + Some(seats.clone()), + TxStatus::Finalized, + ) + .await?; + + root_connection + .connection + .wait_for_n_eras(1, BlockStatus::Best) + .await; + let session = root_connection.connection.get_session(None).await; + + let first_block_in_session = root_connection + .connection + .first_block_of_session(session) + .await; + let network_validators = root_connection + .connection + .get_current_era_validators(first_block_in_session) + .await; let reserved: HashSet<_> = era_validators.reserved.iter().cloned().collect(); let network_reserved: HashSet<_> = network_validators.reserved.into_iter().collect(); let non_reserved: HashSet<_> = era_validators.non_reserved.iter().cloned().collect(); let network_non_reserved: HashSet<_> = network_validators.non_reserved.into_iter().collect(); - let first_block_in_session = get_session_first_block(&root_connection, session); - let network_seats = get_committee_seats(&root_connection, Some(first_block_in_session)); + let network_seats = root_connection + .connection + .get_committee_seats(first_block_in_session) + .await; assert_eq!(reserved, network_reserved); assert_eq!(non_reserved, network_non_reserved); @@ -311,9 +384,9 @@ pub fn setup_validators( Ok((era_validators, seats, session)) } -pub fn validators_bond_extra_stakes(config: &Config, additional_stakes: &[Balance]) { +pub async fn validators_bond_extra_stakes(config: &Config, additional_stakes: &[Balance]) { let node = &config.node; - let root_connection = config.create_root_connection(); + let root_connection = config.create_root_connection().await; let accounts_keys: Vec = get_validators_seeds(config) .into_iter() @@ -322,25 +395,30 @@ pub fn validators_bond_extra_stakes(config: &Config, additional_stakes: &[Balanc let controller_accounts: Vec = accounts_keys .iter() - .map(|account_keys| account_from_keypair(&account_keys.controller)) + .map(|account_keys| account_from_keypair(account_keys.controller.signer())) .collect(); // funds to cover fees - balances_batch_transfer(&root_connection.as_signed(), controller_accounts, TOKEN); - - accounts_keys.iter().zip(additional_stakes.iter()).for_each( - |(account_keys, additional_stake)| { - let validator_id = account_from_keypair(&account_keys.validator); - - // Additional TOKEN to cover fees - balances_transfer( - &root_connection.as_signed(), - &validator_id, - *additional_stake + TOKEN, - XtStatus::Finalized, - ); - let stash_connection = SignedConnection::new(node, account_keys.validator.clone()); - bond_extra_stake(&stash_connection, *additional_stake); - }, - ); + root_connection + .as_signed() + .batch_transfer(&controller_accounts, TOKEN, TxStatus::Finalized) + .await + .unwrap(); + + for (account_keys, additional_stake) in accounts_keys.into_iter().zip(additional_stakes.iter()) + { + let validator_id = account_from_keypair(account_keys.validator.signer()); + + // Additional TOKEN to cover fees + root_connection + .as_signed() + .transfer(validator_id, *additional_stake + TOKEN, TxStatus::Finalized) + .await + .unwrap(); + let stash_connection = SignedConnection::new(node.clone(), account_keys.validator).await; + stash_connection + .bond_extra_stake(*additional_stake, TxStatus::Finalized) + .await + .unwrap(); + } } diff --git a/e2e-tests/src/test/ban.rs b/e2e-tests/src/test/ban.rs index 698ed08d20..24a7e0fb56 100644 --- a/e2e-tests/src/test/ban.rs +++ b/e2e-tests/src/test/ban.rs @@ -1,13 +1,16 @@ use aleph_client::{ - change_ban_config, get_current_era, get_current_era_validators, get_current_session, - get_next_era_non_reserved_validators, get_next_era_reserved_validators, - get_underperformed_validator_session_count, wait_for_at_least_session, SignedConnection, - XtStatus, + pallets::{ + elections::{ElectionsApi, ElectionsSudoApi}, + staking::StakingApi, + }, + primitives::{BanInfo, BanReason}, + waiting::{BlockStatus, WaitingExt}, + SignedConnection, TxStatus, }; use log::info; use primitives::{ - BanInfo, BanReason, SessionCount, DEFAULT_BAN_MINIMAL_EXPECTED_PERFORMANCE, - DEFAULT_BAN_SESSION_COUNT_THRESHOLD, DEFAULT_CLEAN_SESSION_COUNTER_DELAY, + SessionCount, DEFAULT_BAN_MINIMAL_EXPECTED_PERFORMANCE, DEFAULT_BAN_SESSION_COUNT_THRESHOLD, + DEFAULT_CLEAN_SESSION_COUNTER_DELAY, }; use crate::{ @@ -23,85 +26,102 @@ use crate::{ const VALIDATOR_TO_DISABLE_NON_RESERVED_INDEX: u32 = 0; const VALIDATOR_TO_DISABLE_OVERALL_INDEX: u32 = 2; // Address for //2 (Node2). Depends on the infrastructure setup. -const NODE_TO_DISABLE_ADDRESS: &str = "127.0.0.1:9945"; +const NODE_TO_DISABLE_ADDRESS: &str = "ws://127.0.0.1:9945"; const SESSIONS_TO_MEET_BAN_THRESHOLD: SessionCount = 4; -fn disable_validator(validator_address: &str, validator_seed: u32) -> anyhow::Result<()> { +async fn disable_validator(validator_address: &str, validator_seed: u32) -> anyhow::Result<()> { let validator_seed = get_validator_seed(validator_seed); let stash_controller = NodeKeys::from(validator_seed); let controller_key_to_disable = stash_controller.controller; // This connection has to be set up with the controller key. - let connection_to_disable = SignedConnection::new(validator_address, controller_key_to_disable); + let connection_to_disable = + SignedConnection::new(validator_address.to_string(), controller_key_to_disable).await; - set_invalid_keys_for_validator(&connection_to_disable) + set_invalid_keys_for_validator(&connection_to_disable).await } /// Runs a chain, sets up a committee and validators. Sets an incorrect key for one of the /// validators. Waits for the offending validator to hit the ban threshold of sessions without /// producing blocks. Verifies that the offending validator has in fact been banned out for the /// appropriate reason. -pub fn ban_automatic(config: &Config) -> anyhow::Result<()> { - let (root_connection, reserved_validators, non_reserved_validators) = setup_test(config)?; +pub async fn ban_automatic(config: &Config) -> anyhow::Result<()> { + let (root_connection, reserved_validators, non_reserved_validators) = + setup_test(config).await?; // Check current era validators. check_validators( - &root_connection, &reserved_validators, &non_reserved_validators, - get_current_era_validators, + root_connection + .connection + .get_current_era_validators(None) + .await, ); check_ban_config( - &root_connection, + &root_connection.connection, DEFAULT_BAN_MINIMAL_EXPECTED_PERFORMANCE, DEFAULT_BAN_SESSION_COUNT_THRESHOLD, DEFAULT_CLEAN_SESSION_COUNTER_DELAY, - ); + ) + .await; let validator_to_disable = &non_reserved_validators[VALIDATOR_TO_DISABLE_NON_RESERVED_INDEX as usize]; info!(target: "aleph-client", "Validator to disable: {}", validator_to_disable); - check_underperformed_validator_session_count(&root_connection, validator_to_disable, &0); - check_underperformed_validator_reason(&root_connection, validator_to_disable, None); - - disable_validator(NODE_TO_DISABLE_ADDRESS, VALIDATOR_TO_DISABLE_OVERALL_INDEX)?; + check_underperformed_validator_session_count( + &root_connection.connection, + validator_to_disable, + 0, + ) + .await; + check_underperformed_validator_reason(&root_connection.connection, validator_to_disable, None) + .await; - let current_session = get_current_session(&root_connection); + disable_validator(NODE_TO_DISABLE_ADDRESS, VALIDATOR_TO_DISABLE_OVERALL_INDEX).await?; - wait_for_at_least_session( - &root_connection, - current_session + SESSIONS_TO_MEET_BAN_THRESHOLD, - )?; + root_connection + .connection + .wait_for_n_sessions(SESSIONS_TO_MEET_BAN_THRESHOLD, BlockStatus::Best) + .await; // The session count for underperforming validators is reset to 0 immediately on reaching the // threshold. - check_underperformed_validator_session_count(&root_connection, validator_to_disable, &0); + check_underperformed_validator_session_count( + &root_connection.connection, + validator_to_disable, + 0, + ) + .await; let reason = BanReason::InsufficientUptime(DEFAULT_BAN_SESSION_COUNT_THRESHOLD); - let start = get_current_era(&root_connection) + 1; + let start = root_connection.connection.get_current_era(None).await + 1; let expected_ban_info = BanInfo { reason, start }; check_underperformed_validator_reason( - &root_connection, + &root_connection.connection, validator_to_disable, Some(&expected_ban_info), - ); + ) + .await; let expected_non_reserved = &non_reserved_validators[(VALIDATOR_TO_DISABLE_NON_RESERVED_INDEX + 1) as usize..]; let expected_banned_validators = vec![(validator_to_disable.clone(), expected_ban_info)]; - check_ban_event(&root_connection, &expected_banned_validators)?; + check_ban_event(&root_connection.connection, &expected_banned_validators).await?; // Check current validators. check_validators( - &root_connection, &reserved_validators, expected_non_reserved, - get_current_era_validators, + root_connection + .connection + .get_current_era_validators(None) + .await, ); Ok(()) @@ -111,36 +131,43 @@ pub fn ban_automatic(config: &Config) -> anyhow::Result<()> { /// underperformed_session_count_threshold to 3. /// Disable one non_reserved validator. Check if the disabled validator is still in the committee /// and his underperformed session count is less or equal to 2. -pub fn clearing_session_count(config: &Config) -> anyhow::Result<()> { - let (root_connection, reserved_validators, non_reserved_validators) = setup_test(config)?; +pub async fn clearing_session_count(config: &Config) -> anyhow::Result<()> { + let (root_connection, reserved_validators, non_reserved_validators) = + setup_test(config).await?; info!(target: "aleph-client", "changing ban config"); - change_ban_config( - &root_connection, - None, - Some(3), - Some(2), - None, - XtStatus::InBlock, - ); + + root_connection + .change_ban_config(None, Some(3), Some(2), None, TxStatus::InBlock) + .await?; let validator_to_disable = &non_reserved_validators[VALIDATOR_TO_DISABLE_NON_RESERVED_INDEX as usize]; - disable_validator(NODE_TO_DISABLE_ADDRESS, VALIDATOR_TO_DISABLE_OVERALL_INDEX)?; - info!(target: "aleph-client", "Disabling validator {}", validator_to_disable); - let current_session = get_current_session(&root_connection); + disable_validator(NODE_TO_DISABLE_ADDRESS, VALIDATOR_TO_DISABLE_OVERALL_INDEX).await?; - wait_for_at_least_session(&root_connection, current_session + 5)?; + root_connection + .connection + .wait_for_n_sessions(5, BlockStatus::Best) + .await; - let underperformed_validator_session_count = - get_underperformed_validator_session_count(&root_connection, validator_to_disable); + let underperformed_validator_session_count = root_connection + .connection + .get_underperformed_validator_session_count(validator_to_disable.clone(), None) + .await + .unwrap_or_default(); // it only has to be ge than 0 and should be cleared before reaching values larger than 3. assert!(underperformed_validator_session_count <= 2); - let next_era_reserved_validators = get_next_era_reserved_validators(&root_connection); - let next_era_non_reserved_validators = get_next_era_non_reserved_validators(&root_connection); + let next_era_reserved_validators = root_connection + .connection + .get_next_era_reserved_validators(None) + .await; + let next_era_non_reserved_validators = root_connection + .connection + .get_next_era_non_reserved_validators(None) + .await; // checks no one was kicked out assert_eq!(next_era_reserved_validators, reserved_validators); diff --git a/e2e-tests/src/test/electing_validators.rs b/e2e-tests/src/test/electing_validators.rs index fa5f27164d..6d82940ebd 100644 --- a/e2e-tests/src/test/electing_validators.rs +++ b/e2e-tests/src/test/electing_validators.rs @@ -1,18 +1,19 @@ use std::collections::BTreeSet; use aleph_client::{ - change_validators, get_current_session, get_current_validator_count, get_current_validators, - get_eras_stakers_storage_key, get_minimum_validator_count, get_stakers_as_storage_keys, - get_stakers_as_storage_keys_from_storage_key, staking_chill_validators, - wait_for_full_era_completion, wait_for_session, AccountId, AnyConnection, RootConnection, - SignedConnection, XtStatus, + pallets::{ + elections::ElectionsSudoApi, + session::SessionApi, + staking::{StakingApi, StakingRawApi, StakingUserApi}, + }, + primitives::CommitteeSeats, + waiting::{BlockStatus, WaitingExt}, + AccountId, Connection, KeyPair, Pair, SignedConnection, TxStatus, }; use log::info; -use primitives::{CommitteeSeats, EraIndex}; -use sp_core::storage::StorageKey; +use primitives::EraIndex; use crate::{ - accounts::get_sudo_key, validators::{prepare_validators, setup_accounts}, Config, }; @@ -20,19 +21,23 @@ use crate::{ /// Verify that `pallet_staking::ErasStakers` contains all target validators. /// /// We have to do it by comparing keys in storage trie. -fn assert_validators_are_elected_stakers( - connection: &C, +async fn assert_validators_are_elected_stakers( + connection: &Connection, current_era: EraIndex, - expected_validators_as_keys: &BTreeSet, + expected_validators_as_keys: Vec>, ) { - let storage_key = get_eras_stakers_storage_key(current_era); - let stakers = - get_stakers_as_storage_keys_from_storage_key(connection, current_era, storage_key); + let stakers = connection + .get_stakers_storage_keys(current_era, None) + .await + .into_iter() + .map(|key| key.0); + let stakers_tree = BTreeSet::from_iter(stakers); + let expected_validators_as_keys = BTreeSet::from_iter(expected_validators_as_keys); assert_eq!( - *expected_validators_as_keys, stakers, + expected_validators_as_keys, stakers_tree, "Expected another set of staking validators.\n\tExpected: {:?}\n\tActual: {:?}", - expected_validators_as_keys, stakers + expected_validators_as_keys, stakers_tree ); } @@ -54,23 +59,23 @@ fn min_num_sessions_to_see_all_non_reserved_validators( /// Verify that all target validators are included `pallet_session::Validators` across a few /// consecutive sessions. -fn assert_validators_are_used_as_authorities( - connection: &C, +async fn assert_validators_are_used_as_authorities( + connection: &Connection, expected_authorities: &BTreeSet, min_num_sessions: u32, ) { let mut authorities = BTreeSet::new(); for _ in 0..min_num_sessions { - let current_session = get_current_session(connection); + let current_session = connection.get_session(None).await; info!("Reading authorities in session {}", current_session); - let current_authorities = get_current_validators(connection); + let current_authorities = connection.get_validators(None).await; for ca in current_authorities.into_iter() { authorities.insert(ca); } - wait_for_session(connection, current_session + 1).expect("Couldn't wait for next session"); + connection.wait_for_n_sessions(1, BlockStatus::Best).await; } assert_eq!( @@ -80,8 +85,8 @@ fn assert_validators_are_used_as_authorities( ); } -fn assert_enough_validators(connection: &C, min_validator_count: u32) { - let current_validator_count = get_current_validator_count(connection); +async fn assert_enough_validators(connection: &Connection, min_validator_count: u32) { + let current_validator_count = connection.get_validators(None).await.len() as u32; assert!( current_validator_count >= min_validator_count, "{} validators present. Staking enforces a minimum of {} validators.", @@ -117,6 +122,14 @@ fn assert_enough_validators_left_after_chilling( ); } +async fn chill_validators(node: &str, chilling: Vec) { + for validator in chilling.into_iter() { + info!("Chilling validator {:?}", validator.signer().public()); + let connection = SignedConnection::new(node.to_string(), validator).await; + connection.chill(TxStatus::InBlock).await.unwrap(); + } +} + /// 1. Setup `v` brand new validators (e.g. `v=6`) - `r` reserved (e.g. `r=3`) and `n` (e.g. `n=3`) /// non reserved. /// 2. Wait until they are in force. @@ -134,16 +147,18 @@ fn assert_enough_validators_left_after_chilling( /// parameter to set `MinimumValidatorCount` in the chain spec as the chain is set up. /// For this specific test case, we use `node-count = 6` and `min-validator-count = 4`, which /// satisfies the outlined conditions. -pub fn authorities_are_staking(config: &Config) -> anyhow::Result<()> { +pub async fn authorities_are_staking(config: &Config) -> anyhow::Result<()> { let node = &config.node; - let sudo = get_sudo_key(config); - let root_connection = RootConnection::new(node, sudo); + let root_connection = config.create_root_connection().await; const RESERVED_SEATS_DEFAULT: u32 = 3; const NON_RESERVED_SEATS_DEFAULT: u32 = 3; // `MinimumValidatorCount` from `pallet_staking`, set in chain spec. - let min_validator_count = get_minimum_validator_count(&root_connection); + let min_validator_count = root_connection + .connection + .get_minimum_validator_count(None) + .await; let reserved_seats = match config.test_case_params.reserved_seats { Some(seats) => seats, @@ -158,17 +173,18 @@ pub fn authorities_are_staking(config: &Config) -> anyhow::Result<()> { const RESERVED_TO_CHILL_COUNT: u32 = 1; const NON_RESERVED_TO_CHILL_COUNT: u32 = 1; - assert_enough_validators(&root_connection, min_validator_count); + assert_enough_validators(&root_connection.connection, min_validator_count).await; let desired_validator_count = reserved_seats + non_reserved_seats; let accounts = setup_accounts(desired_validator_count); - prepare_validators(&root_connection.as_signed(), node, &accounts); + prepare_validators(&root_connection.as_signed(), node, &accounts).await; info!("New validators are set up"); let reserved_validators = accounts.get_stash_accounts()[..reserved_seats as usize].to_vec(); - let chilling_reserved = accounts.get_controller_keys()[0].clone(); // first reserved validator + let chilling_reserved = KeyPair::new(accounts.get_controller_raw_keys()[0].clone()); // first reserved validator let non_reserved_validators = accounts.get_stash_accounts()[reserved_seats as usize..].to_vec(); - let chilling_non_reserved = accounts.get_controller_keys()[reserved_seats as usize].clone(); // first non-reserved validator + let chilling_non_reserved = + KeyPair::new(accounts.get_controller_raw_keys()[reserved_seats as usize].clone()); // first non-reserved validator let reserved_count = reserved_validators.len() as u32; let non_reserved_count = non_reserved_validators.len() as u32; @@ -192,42 +208,63 @@ pub fn authorities_are_staking(config: &Config) -> anyhow::Result<()> { min_validator_count, ); - change_validators( - &root_connection, - Some(reserved_validators), - Some(non_reserved_validators), - Some(CommitteeSeats { - reserved_seats, - non_reserved_seats, - }), - XtStatus::Finalized, - ); + root_connection + .change_validators( + Some(reserved_validators), + Some(non_reserved_validators), + Some(CommitteeSeats { + reserved_seats, + non_reserved_seats, + }), + TxStatus::Finalized, + ) + .await?; + info!("Changed validators to a new set"); // We need any signed connection. - let connection = SignedConnection::new(node, accounts.get_stash_keys()[0].clone()); - - let current_era = wait_for_full_era_completion(&connection)?; + let connection = root_connection.as_signed(); + connection + .connection + .wait_for_n_eras(1, BlockStatus::Best) + .await; + let current_era = connection.connection.get_current_era(None).await; info!("New validators are in force (era: {})", current_era); assert_validators_are_elected_stakers( - &connection, + &connection.connection, current_era, - &get_stakers_as_storage_keys(&connection, accounts.get_stash_accounts(), current_era), - ); + connection + .connection + .get_stakers_storage_keys_from_accounts( + current_era, + &accounts.get_stash_accounts(), + None, + ) + .await + .into_iter() + .map(|k| k.0) + .collect(), + ) + .await; let min_num_sessions = min_num_sessions_to_see_all_non_reserved_validators(non_reserved_count, non_reserved_seats); assert_validators_are_used_as_authorities( - &connection, + &connection.connection, &BTreeSet::from_iter(accounts.get_stash_accounts().clone().into_iter()), min_num_sessions, - ); + ) + .await; - staking_chill_validators(node, vec![chilling_reserved, chilling_non_reserved]); + chill_validators(node, vec![chilling_reserved, chilling_non_reserved]).await; - let current_era = wait_for_full_era_completion(&connection)?; + connection + .connection + .wait_for_n_eras(1, BlockStatus::Best) + .await; + let current_era = connection.connection.get_current_era(None).await; info!( "Subset of validators should be in force (era: {})", current_era @@ -238,15 +275,23 @@ pub fn authorities_are_staking(config: &Config) -> anyhow::Result<()> { left_stashes.remove(0); assert_validators_are_elected_stakers( - &connection, + &connection.connection, current_era, - &get_stakers_as_storage_keys(&connection, &left_stashes, current_era), - ); + connection + .connection + .get_stakers_storage_keys_from_accounts(current_era, &left_stashes, None) + .await + .into_iter() + .map(|k| k.0) + .collect(), + ) + .await; assert_validators_are_used_as_authorities( - &connection, + &connection.connection, &BTreeSet::from_iter(left_stashes.into_iter()), min_num_sessions, - ); + ) + .await; Ok(()) } diff --git a/e2e-tests/src/test/era_payout.rs b/e2e-tests/src/test/era_payout.rs index 11c3a191b4..9124fd403d 100644 --- a/e2e-tests/src/test/era_payout.rs +++ b/e2e-tests/src/test/era_payout.rs @@ -1,6 +1,7 @@ use aleph_client::{ - create_connection, get_active_era, get_payout_for_era, staking_force_new_era, - wait_for_next_era, wait_for_session, ReadStorage, XtStatus, + pallets::staking::{StakingApi, StakingSudoApi}, + waiting::{AlephWaiting, BlockStatus, WaitingExt}, + Connection, TxStatus, }; use primitives::{ staking::era_payout, Balance, EraIndex, DEFAULT_SESSIONS_PER_ERA, DEFAULT_SESSION_PERIOD, @@ -9,9 +10,9 @@ use primitives::{ use crate::Config; -pub fn era_payouts_calculated_correctly(config: &Config) -> anyhow::Result<()> { - normal_era_payout(config)?; - force_era_payout(config)?; +pub async fn era_payouts_calculated_correctly(config: &Config) -> anyhow::Result<()> { + normal_era_payout(config).await?; + force_era_payout(config).await?; Ok(()) } @@ -29,29 +30,40 @@ fn payout_within_two_block_delta(expected_payout: Balance, payout: Balance) { ); } -fn wait_to_second_era(connection: &C) -> EraIndex { - let active_era = get_active_era(connection); +async fn wait_to_second_era(connection: &Connection) -> EraIndex { + let active_era = connection.get_active_era(None).await; if active_era < 2 { - wait_for_next_era(connection).expect("Era is active"); - wait_for_next_era(connection).expect("Era is active"); + connection.wait_for_n_eras(2, BlockStatus::Best).await; } - get_active_era(connection) + connection.get_active_era(None).await } -fn force_era_payout(config: &Config) -> anyhow::Result<()> { - let root_connection = config.create_root_connection(); - let active_era = wait_to_second_era(&root_connection); - wait_for_next_era(&root_connection)?; +async fn force_era_payout(config: &Config) -> anyhow::Result<()> { + let root_connection = config.create_root_connection().await; + let active_era = wait_to_second_era(&root_connection.connection).await; + root_connection + .connection + .wait_for_n_eras(1, BlockStatus::Best) + .await; let active_era = active_era + 1; let starting_session = active_era * DEFAULT_SESSIONS_PER_ERA; - wait_for_session(&root_connection, starting_session + 1)?; + root_connection + .connection + .wait_for_session(starting_session + 1, BlockStatus::Best) + .await; // new era will start in the session `starting_session + 3` - staking_force_new_era(&root_connection, XtStatus::InBlock); - wait_for_session(&root_connection, starting_session + 3)?; - - let payout = get_payout_for_era(&root_connection, active_era); + root_connection.force_new_era(TxStatus::InBlock).await?; + root_connection + .connection + .wait_for_session(starting_session + 3, BlockStatus::Best) + .await; + + let payout = root_connection + .connection + .get_payout_for_era(active_era, None) + .await; let expected_payout = era_payout((3 * DEFAULT_SESSION_PERIOD) as u64 * MILLISECS_PER_BLOCK).0; payout_within_two_block_delta(expected_payout, payout); @@ -59,11 +71,14 @@ fn force_era_payout(config: &Config) -> anyhow::Result<()> { Ok(()) } -fn normal_era_payout(config: &Config) -> anyhow::Result<()> { - let connection = create_connection(&config.node); +async fn normal_era_payout(config: &Config) -> anyhow::Result<()> { + let root_connection = config.create_root_connection().await; - let active_era = wait_to_second_era(&connection); - let payout = get_payout_for_era(&connection, active_era - 1); + let active_era = wait_to_second_era(&root_connection.connection).await; + let payout = root_connection + .connection + .get_payout_for_era(active_era - 1, None) + .await; let expected_payout = era_payout( (DEFAULT_SESSIONS_PER_ERA * DEFAULT_SESSION_PERIOD) as u64 * MILLISECS_PER_BLOCK, ) diff --git a/e2e-tests/src/test/era_validators.rs b/e2e-tests/src/test/era_validators.rs index d5707f67fc..8be1c52db9 100644 --- a/e2e-tests/src/test/era_validators.rs +++ b/e2e-tests/src/test/era_validators.rs @@ -1,51 +1,66 @@ use aleph_client::{ - change_validators, get_current_block_number, get_current_era_non_reserved_validators, - get_current_era_reserved_validators, get_current_session, get_next_era_non_reserved_validators, - get_next_era_reserved_validators, wait_for_finalized_block, wait_for_full_era_completion, - wait_for_next_era, wait_for_session, AccountId, KeyPair, SignedConnection, XtStatus, + pallets::elections::{ElectionsApi, ElectionsSudoApi}, + primitives::CommitteeSeats, + utility::BlocksApi, + waiting::{AlephWaiting, BlockStatus, WaitingExt}, + AccountId, Connection, KeyPair, TxStatus, }; -use primitives::CommitteeSeats; use crate::{ - accounts::{account_ids_from_keys, get_validators_keys}, + accounts::{account_ids_from_keys, get_validators_raw_keys}, Config, }; fn get_initial_reserved_validators(config: &Config) -> Vec { - get_validators_keys(config)[..2].to_vec() + get_validators_raw_keys(config)[..2] + .iter() + .map(|k| KeyPair::new(k.clone())) + .collect() } fn get_initial_non_reserved_validators(config: &Config) -> Vec { - get_validators_keys(config)[2..].to_vec() + get_validators_raw_keys(config)[2..] + .iter() + .map(|k| KeyPair::new(k.clone())) + .collect() } fn get_new_reserved_validators(config: &Config) -> Vec { - get_validators_keys(config)[3..].to_vec() + get_validators_raw_keys(config)[3..] + .iter() + .map(|k| KeyPair::new(k.clone())) + .collect() } fn get_new_non_reserved_validators(config: &Config) -> Vec { - get_validators_keys(config)[..3].to_vec() + get_validators_raw_keys(config)[..3] + .iter() + .map(|k| KeyPair::new(k.clone())) + .collect() } -fn get_current_and_next_era_reserved_validators( - connection: &SignedConnection, +async fn get_current_and_next_era_reserved_validators( + connection: &Connection, ) -> (Vec, Vec) { - let stored_reserved = get_next_era_reserved_validators(connection); - let current_reserved = get_current_era_reserved_validators(connection); + let stored_reserved = connection.get_next_era_reserved_validators(None).await; + let current_reserved = connection.get_current_era_validators(None).await.reserved; (current_reserved, stored_reserved) } -fn get_current_and_next_era_non_reserved_validators( - connection: &SignedConnection, +async fn get_current_and_next_era_non_reserved_validators( + connection: &Connection, ) -> (Vec, Vec) { - let stored_non_reserved = get_next_era_non_reserved_validators(connection); - let current_non_reserved = get_current_era_non_reserved_validators(connection); + let stored_non_reserved = connection.get_next_era_non_reserved_validators(None).await; + let current_non_reserved = connection + .get_current_era_validators(None) + .await + .non_reserved; (current_non_reserved, stored_non_reserved) } -pub fn era_validators(config: &Config) -> anyhow::Result<()> { - let connection = config.get_first_signed_connection(); - let root_connection = config.create_root_connection(); +pub async fn era_validators(config: &Config) -> anyhow::Result<()> { + let connection = config.get_first_signed_connection().await; + let root_connection = config.create_root_connection().await; let initial_reserved_validators_keys = get_initial_reserved_validators(config); let initial_reserved_validators = account_ids_from_keys(&initial_reserved_validators_keys); @@ -60,36 +75,42 @@ pub fn era_validators(config: &Config) -> anyhow::Result<()> { let new_non_reserved_validators_keys = get_new_non_reserved_validators(config); let new_non_reserved_validators = account_ids_from_keys(&new_non_reserved_validators_keys); - change_validators( - &root_connection, - Some(initial_reserved_validators.clone()), - Some(initial_non_reserved_validators.clone()), - Some(CommitteeSeats { - reserved_seats: 2, - non_reserved_seats: 2, - }), - XtStatus::InBlock, - ); - wait_for_full_era_completion(&connection)?; - - change_validators( - &root_connection, - Some(new_reserved_validators.clone()), - Some(new_non_reserved_validators.clone()), - Some(CommitteeSeats { - reserved_seats: 2, - non_reserved_seats: 2, - }), - XtStatus::InBlock, - ); - - let current_session = get_current_session(&connection); - wait_for_session(&connection, current_session + 1)?; - + root_connection + .change_validators( + Some(initial_reserved_validators.clone()), + Some(initial_non_reserved_validators.clone()), + Some(CommitteeSeats { + reserved_seats: 2, + non_reserved_seats: 2, + }), + TxStatus::InBlock, + ) + .await?; + root_connection + .connection + .wait_for_n_eras(1, BlockStatus::Finalized) + .await; + + root_connection + .change_validators( + Some(new_reserved_validators.clone()), + Some(new_non_reserved_validators.clone()), + Some(CommitteeSeats { + reserved_seats: 2, + non_reserved_seats: 2, + }), + TxStatus::InBlock, + ) + .await?; + + root_connection + .connection + .wait_for_session(1, BlockStatus::Finalized) + .await; let (eras_reserved, stored_reserved) = - get_current_and_next_era_reserved_validators(&connection); + get_current_and_next_era_reserved_validators(&connection.connection).await; let (eras_non_reserved, stored_non_reserved) = - get_current_and_next_era_non_reserved_validators(&connection); + get_current_and_next_era_non_reserved_validators(&connection.connection).await; assert_eq!( stored_reserved, new_reserved_validators, @@ -109,12 +130,15 @@ pub fn era_validators(config: &Config) -> anyhow::Result<()> { "Non-reserved validators set has been updated too early." ); - wait_for_next_era(&connection)?; + connection + .connection + .wait_for_n_eras(1, BlockStatus::Finalized) + .await; let (eras_reserved, stored_reserved) = - get_current_and_next_era_reserved_validators(&connection); + get_current_and_next_era_reserved_validators(&connection.connection).await; let (eras_non_reserved, stored_non_reserved) = - get_current_and_next_era_non_reserved_validators(&connection); + get_current_and_next_era_non_reserved_validators(&connection.connection).await; assert_eq!( stored_reserved, new_reserved_validators, @@ -134,8 +158,11 @@ pub fn era_validators(config: &Config) -> anyhow::Result<()> { "Non-reserved validators set is not properly updated in the next era." ); - let block_number = get_current_block_number(&connection); - wait_for_finalized_block(&connection, block_number)?; + let block_number = connection.connection.get_best_block().await; + connection + .connection + .wait_for_block(|n| n >= block_number, BlockStatus::Finalized) + .await; Ok(()) } diff --git a/e2e-tests/src/test/fee.rs b/e2e-tests/src/test/fee.rs index 2375ef3efa..41b4b62259 100644 --- a/e2e-tests/src/test/fee.rs +++ b/e2e-tests/src/test/fee.rs @@ -1,125 +1,138 @@ use aleph_client::{ - balances_transfer, get_next_fee_multiplier, AccountId, BalanceTransfer, CallSystem, FeeInfo, - GetTxInfo, ReadStorage, RootConnection, XtStatus, + api::transaction_payment::events::TransactionFeePaid, + pallets::{balances::BalanceUserApi, fee::TransactionPaymentApi, system::SystemSudoApi}, + waiting::{AlephWaiting, BlockStatus}, + AccountId, RootConnection, SignedConnection, TxStatus, }; -use sp_runtime::{traits::One, FixedPointNumber, FixedU128}; +use log::info; +use primitives::Balance; +use sp_runtime::{FixedPointNumber, FixedU128}; use crate::{config::Config, transfer::setup_for_transfer}; -pub fn fee_calculation(config: &Config) -> anyhow::Result<()> { +pub async fn fee_calculation(config: &Config) -> anyhow::Result<()> { // An initial transfer is needed to establish the fee multiplier. - let (connection, to) = setup_for_transfer(config); - let root_connection = config.create_root_connection(); + let (connection, to) = setup_for_transfer(config).await; + let root_connection = config.create_root_connection().await; let transfer_value = 1000u128; - balances_transfer(&connection, &to, transfer_value, XtStatus::Finalized); - // An example transaction for which we will query fee details at different traffic level. - let tx = prepare_transaction(&connection); - - let (actual_multiplier, fee_info) = check_current_fees(&connection, &tx); - assert_no_scaling( + let minimum_multiplier = FixedU128::saturating_from_integer(1); + let (old_fee, actual_multiplier) = + current_fees(&connection, to.clone(), None, transfer_value).await; + assert_eq!( actual_multiplier, - fee_info, + minimum_multiplier.into_inner(), "In the beginning the fee multiplier should be equal to the minimum value", - "In the beginning fees should not be scaled", ); // The target saturation level is set to 25%, so unless we cross this limit, // the fees should not increase. Note that effectively it is 18.75% of the whole block. - fill_blocks(15, 5, &root_connection); - let (actual_multiplier, fee_info) = check_current_fees(&connection, &tx); - assert_no_scaling( + fill_blocks(15, 5, &root_connection).await; + let (new_fee, actual_multiplier) = + current_fees(&connection, to.clone(), None, transfer_value).await; + assert_eq!( actual_multiplier, - fee_info, - "When the traffic is low the fee multiplier should not increase", - "When the traffic is low fees should not be scaled", + minimum_multiplier.into_inner(), + "In the beginning the fee multiplier should be equal to the minimum value", + ); + + assert_eq!( + new_fee, old_fee, + "In the beginning the fee should not be adjusted", ); // At 60% of occupancy the fees should increase by ~2.4% per block. However, the // intermediate blocks will be empty, so in order to have reliable reads we have to // simulate high traffic for a longer time. - fill_blocks(60, 4, &root_connection); - let (actual_multiplier, fee_info) = check_current_fees(&connection, &tx); + fill_blocks(60, 4, &root_connection).await; + let (new_fee, actual_multiplier) = + current_fees(&connection, to.clone(), None, transfer_value).await; assert!( - actual_multiplier.gt(&FixedU128::one()), - "When the traffic is high the fee multiplier should increase", + actual_multiplier > 1, + "When the traffic is high the fee multiplier should increase, {:?}", + actual_multiplier, ); assert!( - fee_info.unadjusted_weight < fee_info.adjusted_weight, - "When the traffic is high fees should be scaled up", + new_fee > old_fee, + "When the traffic is high fees should be scaled up: {:?} !> {:?}", + new_fee, + old_fee ); - let (prev_multiplier, prev_fee_info) = (actual_multiplier, fee_info); - fill_blocks(60, 4, &root_connection); - let (actual_multiplier, fee_info) = check_current_fees(&connection, &tx); + let (prev_multiplier, prev_fee) = (actual_multiplier, new_fee); + fill_blocks(60, 4, &root_connection).await; + let (new_fee, actual_multiplier) = + current_fees(&connection, to.clone(), None, transfer_value).await; assert!( actual_multiplier.gt(&prev_multiplier), "When the traffic is still high the fee multiplier should still increase", ); assert!( - prev_fee_info.adjusted_weight < fee_info.adjusted_weight, + prev_fee < new_fee, "When the traffic is still high fees should be scaled up even more", ); - let (prev_multiplier, prev_fee_info) = (actual_multiplier, fee_info); - fill_blocks(0, 8, &root_connection); - let (actual_multiplier, fee_info) = check_current_fees(&connection, &tx); + let (prev_multiplier, prev_fee) = (actual_multiplier, new_fee); + fill_blocks(0, 8, &root_connection).await; + let (new_fee, actual_multiplier) = current_fees(&connection, to, None, transfer_value).await; // This is rather an ethical version of sleep. assert!( prev_multiplier.gt(&actual_multiplier), "When the traffic is low again the fee multiplier should decrease", ); assert!( - fee_info.adjusted_weight < prev_fee_info.adjusted_weight, + new_fee < prev_fee, "When the traffic is low again fees should be scaled down", ); Ok(()) } -fn check_current_fees>( - connection: &C, - tx: &C::TransferTx, -) -> (FixedU128, FeeInfo) { - // The storage query will return an u128 value which is the 'inner' representation - // i.e. scaled up by 10^18 (see `implement_fixed!` for `FixedU128). - let actual_multiplier = FixedU128::from_inner(get_next_fee_multiplier(connection)); - let fee_info = connection.get_tx_info(tx); - (actual_multiplier, fee_info) +async fn fill_blocks(target_ratio: u8, blocks: u32, connection: &RootConnection) { + for _ in 0..blocks { + connection + .fill_block(target_ratio, TxStatus::InBlock) + .await + .unwrap_or_else(|err| panic!("Error while sending a fill_block transation: {:?}", err)); + } } -fn assert_no_scaling( - actual_multiplier: FixedU128, - fee_info: FeeInfo, - error_multiplier_msg: &str, - error_fee_msg: &str, -) { - // We should never drop below 1, in particular when there is no traffic. - let minimum_multiplier = FixedU128::saturating_from_integer(1); - - assert_eq!( - minimum_multiplier, actual_multiplier, - "{} (actual multiplier: {})", - error_multiplier_msg, actual_multiplier - ); - assert_eq!( - fee_info.unadjusted_weight, fee_info.adjusted_weight, - "{} ({} was scaled to {})", - error_fee_msg, fee_info.unadjusted_weight, fee_info.adjusted_weight, - ); -} +pub async fn current_fees( + connection: &SignedConnection, + to: AccountId, + tip: Option, + transfer_value: Balance, +) -> (Balance, u128) { + let actual_multiplier = connection.connection.get_next_fee_multiplier(None).await; -fn prepare_transaction(connection: &C) -> C::TransferTx { - let bytes = [0u8; 32]; - let account = AccountId::from(bytes); + let waiting_connection = connection.connection.clone(); + let signer = connection.signer.account_id().clone(); + let event_handle = tokio::spawn(async move { + waiting_connection + .wait_for_event( + |e: &TransactionFeePaid| e.who == signer, + BlockStatus::Finalized, + ) + .await + }); + match tip { + None => { + connection + .transfer(to, transfer_value, TxStatus::Finalized) + .await + .unwrap(); + } + Some(tip) => { + connection + .transfer_with_tip(to, transfer_value, tip, TxStatus::Finalized) + .await + .unwrap(); + } + } + let event = event_handle.await.unwrap(); + let fee = event.actual_fee; - connection.create_transfer_tx(account, 0u128) -} + info!("fee payed: {}", fee); -fn fill_blocks(target_ratio: u32, blocks: u32, connection: &RootConnection) { - for _ in 0..blocks { - connection - .fill_block(target_ratio, XtStatus::InBlock) - .unwrap_or_else(|err| panic!("Error while sending a fill_block transation: {:?}", err)); - } + (fee, actual_multiplier) } diff --git a/e2e-tests/src/test/finalization.rs b/e2e-tests/src/test/finalization.rs index bbc9882829..fa827267e5 100644 --- a/e2e-tests/src/test/finalization.rs +++ b/e2e-tests/src/test/finalization.rs @@ -1,9 +1,12 @@ -use aleph_client::{create_connection, wait_for_finalized_block}; +use aleph_client::waiting::{AlephWaiting, BlockStatus}; use crate::config::Config; -pub fn finalization(config: &Config) -> anyhow::Result<()> { - let connection = create_connection(&config.node); - wait_for_finalized_block(&connection, 1)?; +pub async fn finalization(config: &Config) -> anyhow::Result<()> { + let connection = config.create_root_connection().await; + connection + .connection + .wait_for_block(|n| n >= 1, BlockStatus::Finalized) + .await; Ok(()) } diff --git a/e2e-tests/src/test/rewards.rs b/e2e-tests/src/test/rewards.rs index 4e749e8fd6..4ab255c71b 100644 --- a/e2e-tests/src/test/rewards.rs +++ b/e2e-tests/src/test/rewards.rs @@ -1,17 +1,21 @@ use aleph_client::{ - get_active_era, get_current_session, staking_force_new_era, wait_for_full_era_completion, - wait_for_next_era, wait_for_session, AccountId, SignedConnection, XtStatus, + pallets::{ + session::SessionApi, + staking::{StakingApi, StakingSudoApi}, + }, + primitives::{CommitteeSeats, EraValidators}, + utility::SessionEraApi, + waiting::{AlephWaiting, BlockStatus, WaitingExt}, + AccountId, SignedConnection, TxStatus, }; use log::info; -use primitives::{ - staking::MIN_VALIDATOR_BOND, CommitteeSeats, EraIndex, EraValidators, SessionIndex, -}; +use primitives::{staking::MIN_VALIDATOR_BOND, EraIndex, SessionIndex}; use crate::{ elections::get_and_test_members_for_session, rewards::{ - check_points, get_era_for_session, reset_validator_keys, set_invalid_keys_for_validator, - setup_validators, validators_bond_extra_stakes, + check_points, reset_validator_keys, set_invalid_keys_for_validator, setup_validators, + validators_bond_extra_stakes, }, Config, }; @@ -21,13 +25,16 @@ use crate::{ // retrieved from pallet Staking. const MAX_DIFFERENCE: f64 = 0.07; -pub fn points_basic(config: &Config) -> anyhow::Result<()> { - let (era_validators, committee_size, start_session) = setup_validators(config)?; +pub async fn points_basic(config: &Config) -> anyhow::Result<()> { + let (era_validators, committee_size, start_session) = setup_validators(config).await?; - let connection = config.get_first_signed_connection(); + let connection = config.get_first_signed_connection().await; - wait_for_next_era(&connection)?; - let end_session = get_current_session(&connection); + connection + .connection + .wait_for_n_eras(1, BlockStatus::Best) + .await; + let end_session = connection.connection.get_session(None).await; let members_per_session = committee_size.reserved_seats + committee_size.non_reserved_seats; info!( @@ -36,9 +43,14 @@ pub fn points_basic(config: &Config) -> anyhow::Result<()> { ); for session in start_session..end_session { - let era = get_era_for_session(&connection, session); - let (members_active, members_bench) = - get_and_test_members_for_session(&connection, committee_size, &era_validators, session); + let era = connection.connection.get_era_for_session(session).await; + let (members_active, members_bench) = get_and_test_members_for_session( + &connection.connection, + committee_size.clone(), + &era_validators, + session, + ) + .await; check_points( &connection, @@ -48,7 +60,8 @@ pub fn points_basic(config: &Config) -> anyhow::Result<()> { members_bench, members_per_session, MAX_DIFFERENCE, - )? + ) + .await? } Ok(()) @@ -56,8 +69,8 @@ pub fn points_basic(config: &Config) -> anyhow::Result<()> { /// Runs a chain, bonds extra stakes to validator accounts and checks that reward points /// are calculated correctly afterward. -pub fn points_stake_change(config: &Config) -> anyhow::Result<()> { - let (era_validators, committee_size, _) = setup_validators(config)?; +pub async fn points_stake_change(config: &Config) -> anyhow::Result<()> { + let (era_validators, committee_size, _) = setup_validators(config).await?; validators_bond_extra_stakes( config, @@ -68,12 +81,16 @@ pub fn points_stake_change(config: &Config) -> anyhow::Result<()> { 2 * MIN_VALIDATOR_BOND, 0, ], - ); - - let connection = config.get_first_signed_connection(); - let start_session = get_current_session(&connection); - wait_for_next_era(&connection)?; - let end_session = get_current_session(&connection); + ) + .await; + + let connection = config.get_first_signed_connection().await; + let start_session = connection.connection.get_session(None).await; + connection + .connection + .wait_for_n_eras(1, BlockStatus::Best) + .await; + let end_session = connection.connection.get_session(None).await; let members_per_session = committee_size.reserved_seats + committee_size.non_reserved_seats; info!( @@ -82,9 +99,14 @@ pub fn points_stake_change(config: &Config) -> anyhow::Result<()> { ); for session in start_session..end_session { - let era = get_era_for_session(&connection, session); - let (members_active, members_bench) = - get_and_test_members_for_session(&connection, committee_size, &era_validators, session); + let era = connection.connection.get_era_for_session(session).await; + let (members_active, members_bench) = get_and_test_members_for_session( + &connection.connection, + committee_size.clone(), + &era_validators, + session, + ) + .await; check_points( &connection, @@ -94,7 +116,8 @@ pub fn points_stake_change(config: &Config) -> anyhow::Result<()> { members_bench, members_per_session, MAX_DIFFERENCE, - )? + ) + .await? } Ok(()) @@ -102,19 +125,23 @@ pub fn points_stake_change(config: &Config) -> anyhow::Result<()> { /// Runs a chain, sets invalid session keys for one validator, re-sets the keys to valid ones /// and checks that reward points are calculated correctly afterward. -pub fn disable_node(config: &Config) -> anyhow::Result<()> { - let (era_validators, committee_size, start_session) = setup_validators(config)?; +pub async fn disable_node(config: &Config) -> anyhow::Result<()> { + let (era_validators, committee_size, start_session) = setup_validators(config).await?; - let root_connection = config.create_root_connection(); - let controller_connection = SignedConnection::new(&config.node, config.node_keys().controller); + let root_connection = config.create_root_connection().await; + let controller_connection = + SignedConnection::new(config.node.clone(), config.node_keys().controller).await; // this should `disable` this node by setting invalid session_keys - set_invalid_keys_for_validator(&controller_connection)?; + set_invalid_keys_for_validator(&controller_connection).await?; // this should `re-enable` this node, i.e. by means of the `rotate keys` procedure - reset_validator_keys(&controller_connection)?; + reset_validator_keys(&controller_connection).await?; - wait_for_full_era_completion(&root_connection)?; - let end_session = get_current_session(&root_connection); + root_connection + .connection + .wait_for_n_eras(1, BlockStatus::Best) + .await; + let end_session = root_connection.connection.get_session(None).await; let members_per_session = committee_size.reserved_seats + committee_size.non_reserved_seats; info!( @@ -123,13 +150,17 @@ pub fn disable_node(config: &Config) -> anyhow::Result<()> { ); for session in start_session..end_session { - let era = get_era_for_session(&controller_connection, session); + let era = root_connection + .connection + .get_era_for_session(session) + .await; let (members_active, members_bench) = get_and_test_members_for_session( - &controller_connection, - committee_size, + &controller_connection.connection, + committee_size.clone(), &era_validators, session, - ); + ) + .await; check_points( &controller_connection, @@ -139,7 +170,8 @@ pub fn disable_node(config: &Config) -> anyhow::Result<()> { members_bench, members_per_session, MAX_DIFFERENCE, - )?; + ) + .await?; } Ok(()) @@ -149,20 +181,25 @@ pub fn disable_node(config: &Config) -> anyhow::Result<()> { /// for 3 sessions: 1) immediately following the forcing call, 2) in the subsequent, interim /// session, when the new era has not yet started, 3) in the next session, second one after /// the call, when the new era has already begun. -pub fn force_new_era(config: &Config) -> anyhow::Result<()> { - let (era_validators, committee_size, start_session) = setup_validators(config)?; +pub async fn force_new_era(config: &Config) -> anyhow::Result<()> { + let (era_validators, committee_size, start_session) = setup_validators(config).await?; - let connection = config.get_first_signed_connection(); - let root_connection = config.create_root_connection(); - let start_era = get_era_for_session(&connection, start_session); + let connection = config.get_first_signed_connection().await; + let root_connection = config.create_root_connection().await; + let start_era = connection + .connection + .get_era_for_session(start_session) + .await; info!("Start | era: {}, session: {}", start_era, start_session); - staking_force_new_era(&root_connection, XtStatus::Finalized); - - wait_for_session(&connection, start_session + 2)?; - let active_era = get_active_era(&connection); - let current_session = get_current_session(&connection); + root_connection.force_new_era(TxStatus::Finalized).await?; + connection + .connection + .wait_for_session(start_session + 2, BlockStatus::Finalized) + .await; + let active_era = connection.connection.get_active_era(None).await; + let current_session = connection.connection.get_session(None).await; info!( "After ForceNewEra | era: {}, session: {}", active_era, current_session @@ -175,7 +212,8 @@ pub fn force_new_era(config: &Config) -> anyhow::Result<()> { &era_validators, committee_size, MAX_DIFFERENCE, - )?; + ) + .await?; Ok(()) } @@ -185,13 +223,16 @@ pub fn force_new_era(config: &Config) -> anyhow::Result<()> { /// Expected behaviour: until the next (forced) era, rewards are calculated using old stakes, /// and after two sessions (required for a new era to be forced) they are adjusted to the new /// stakes. -pub fn change_stake_and_force_new_era(config: &Config) -> anyhow::Result<()> { - let (era_validators, committee_size, start_session) = setup_validators(config)?; +pub async fn change_stake_and_force_new_era(config: &Config) -> anyhow::Result<()> { + let (era_validators, committee_size, start_session) = setup_validators(config).await?; - let connection = config.get_first_signed_connection(); - let root_connection = config.create_root_connection(); + let connection = config.get_first_signed_connection().await; + let root_connection = config.create_root_connection().await; - let start_era = get_era_for_session(&connection, start_session); + let start_era = connection + .connection + .get_era_for_session(start_session) + .await; info!("Start | era: {}, session: {}", start_era, start_session); validators_bond_extra_stakes( @@ -203,13 +244,17 @@ pub fn change_stake_and_force_new_era(config: &Config) -> anyhow::Result<()> { 0, 4 * MIN_VALIDATOR_BOND, ], - ); - - staking_force_new_era(&root_connection, XtStatus::Finalized); - - wait_for_session(&connection, start_session + 2)?; - let active_era = get_active_era(&connection); - let current_session = get_current_session(&connection); + ) + .await; + + root_connection.force_new_era(TxStatus::Finalized).await?; + let start_session = root_connection.connection.get_session(None).await; + connection + .connection + .wait_for_session(start_session + 2, BlockStatus::Finalized) + .await; + let active_era = connection.connection.get_active_era(None).await; + let current_session = connection.connection.get_session(None).await; info!( "After ForceNewEra | era: {}, session: {}", active_era, current_session @@ -222,11 +267,12 @@ pub fn change_stake_and_force_new_era(config: &Config) -> anyhow::Result<()> { &era_validators, committee_size, MAX_DIFFERENCE, - )?; + ) + .await?; Ok(()) } -fn check_points_after_force_new_era( +async fn check_points_after_force_new_era( connection: &SignedConnection, start_session: SessionIndex, start_era: EraIndex, @@ -248,8 +294,13 @@ fn check_points_after_force_new_era( era_to_check, session_to_check ); - let (members_active, members_bench) = - get_and_test_members_for_session(connection, seats, era_validators, session_to_check); + let (members_active, members_bench) = get_and_test_members_for_session( + &connection.connection, + seats.clone(), + era_validators, + session_to_check, + ) + .await; check_points( connection, @@ -259,7 +310,8 @@ fn check_points_after_force_new_era( members_bench, seats.reserved_seats + seats.non_reserved_seats, max_relative_difference, - )?; + ) + .await?; } Ok(()) } diff --git a/e2e-tests/src/test/staking.rs b/e2e-tests/src/test/staking.rs index 3ed7419fe1..f533f0ed8d 100644 --- a/e2e-tests/src/test/staking.rs +++ b/e2e-tests/src/test/staking.rs @@ -1,20 +1,23 @@ use aleph_client::{ - balances_batch_transfer, change_validators, get_current_session, keypair_from_string, - payout_stakers_and_assert_locked_balance, rotate_keys, set_keys, staking_bond, staking_bonded, - staking_ledger, staking_multi_bond, staking_nominate, staking_validate, - wait_for_full_era_completion, wait_for_session, AccountId, KeyPair, SignedConnection, - StakingLedger, XtStatus, + account_from_keypair, keypair_from_string, + pallet_staking::StakingLedger, + pallets::{ + balances::{BalanceApi, BalanceUserApi, BalanceUserBatchExtApi}, + elections::ElectionsSudoApi, + session::SessionUserApi, + staking::{StakingApi, StakingUserApi}, + }, + primitives::CommitteeSeats, + rpc::Rpc, + sp_runtime::bounded::bounded_vec::BoundedVec, + waiting::{BlockStatus, WaitingExt}, + AccountId, KeyPair, Pair, SignedConnection, TxStatus, }; -use frame_support::BoundedVec; use log::info; use primitives::{ staking::{MIN_NOMINATOR_BOND, MIN_VALIDATOR_BOND}, - CommitteeSeats, TOKEN, + Balance, BlockNumber, TOKEN, }; -use rayon::iter::{ - IndexedParallelIterator, IntoParallelIterator, IntoParallelRefIterator, ParallelIterator, -}; -use sp_core::Pair; use crate::{ accounts::{account_ids_from_keys, accounts_seeds_to_keys, get_validators_seeds}, @@ -38,44 +41,58 @@ fn get_validator_stashes_key_pairs(config: &Config) -> (Vec, Vec anyhow::Result<()> { +pub async fn staking_era_payouts(config: &Config) -> anyhow::Result<()> { let (stashes_accounts_key_pairs, validator_accounts) = get_validator_stashes_key_pairs(config); let node = &config.node; - let connection = config.get_first_signed_connection(); + let connection = config.get_first_signed_connection().await; let stashes_accounts = account_ids_from_keys(&stashes_accounts_key_pairs); - balances_batch_transfer(&connection, stashes_accounts, MIN_NOMINATOR_BOND + TOKEN); - staking_multi_bond(node, &stashes_accounts_key_pairs, MIN_NOMINATOR_BOND); + connection + .batch_transfer( + &stashes_accounts, + MIN_NOMINATOR_BOND + TOKEN, + TxStatus::InBlock, + ) + .await?; + multi_bond(node, &stashes_accounts_key_pairs, MIN_NOMINATOR_BOND).await; - stashes_accounts_key_pairs - .par_iter() - .zip(validator_accounts.par_iter()) - .for_each(|(nominator, nominee)| { - let connection = SignedConnection::new(node, nominator.clone()); - let nominee_account_id = AccountId::from(nominee.public()); - staking_nominate(&connection, &nominee_account_id) - }); + for (nominator, nominee) in stashes_accounts_key_pairs + .into_iter() + .zip(validator_accounts) + { + let connection = SignedConnection::new(node.clone(), nominator).await; + let nominee_account_id = AccountId::from(nominee.signer().public()); + connection + .nominate(nominee_account_id, TxStatus::InBlock) + .await?; + } // All the above calls influence the next era, so we need to wait that it passes. // this test can be speeded up by forcing new era twice, and waiting 4 sessions in total instead of almost 10 sessions - let current_era = wait_for_full_era_completion(&connection)?; + connection + .connection + .wait_for_n_eras(2, BlockStatus::Finalized) + .await; + let current_era = connection.connection.get_current_era(None).await; info!( "Era {} started, claiming rewards for era {}", current_era, current_era - 1 ); - validator_accounts.into_par_iter().for_each(|key_pair| { - let stash_connection = SignedConnection::new(node, key_pair.clone()); - let stash_account = AccountId::from(key_pair.public()); + let (_, validator_accounts) = get_validator_stashes_key_pairs(config); + for key_pair in validator_accounts { + let stash_account = AccountId::from(key_pair.signer().public()); + let stash_connection = SignedConnection::new(node.to_string(), key_pair).await; payout_stakers_and_assert_locked_balance( &stash_connection, &[stash_account.clone()], &stash_account, current_era, ) - }); + .await; + } Ok(()) } @@ -89,107 +106,119 @@ pub fn staking_era_payouts(config: &Config) -> anyhow::Result<()> { // 7. add 4th validator which is the new stash account // 8. wait for next era // 9. claim rewards for the stash account -pub fn staking_new_validator(config: &Config) -> anyhow::Result<()> { +pub async fn staking_new_validator(config: &Config) -> anyhow::Result<()> { let controller_seed = "//Controller"; let controller = keypair_from_string(controller_seed); - let controller_account = AccountId::from(controller.public()); + let controller_account = AccountId::from(controller.signer().public()); let stash_seed = "//Stash"; let stash = keypair_from_string(stash_seed); - let stash_account = AccountId::from(stash.public()); + let stash_account = AccountId::from(stash.signer().public()); let (_, mut validator_accounts) = get_validator_stashes_key_pairs(config); let node = &config.node; let _ = validator_accounts.remove(0); // signer of this connection is sudo, the same node which in this test is used as the new one // it's essential since keys from rotate_keys() needs to be run against that node - let root_connection = config.create_root_connection(); - - change_validators( - &root_connection, - Some(account_ids_from_keys(&validator_accounts)), - Some(vec![]), - Some(CommitteeSeats { - reserved_seats: 4, - non_reserved_seats: 0, - }), - XtStatus::InBlock, - ); + let root_connection = config.create_root_connection().await; - let current_session = get_current_session(&root_connection); + root_connection + .change_validators( + Some(account_ids_from_keys(&validator_accounts)), + Some(vec![]), + Some(CommitteeSeats { + reserved_seats: 4, + non_reserved_seats: 0, + }), + TxStatus::InBlock, + ) + .await?; - let _ = wait_for_session(&root_connection, current_session + 2)?; + root_connection + .connection + .wait_for_n_sessions(2, BlockStatus::Best) + .await; // to cover tx fees as we need a bit more than VALIDATOR_STAKE - balances_batch_transfer( - &root_connection.as_signed(), - vec![stash_account.clone()], - MIN_VALIDATOR_BOND + TOKEN, - ); + root_connection + .as_signed() + .transfer( + stash_account.clone(), + MIN_VALIDATOR_BOND + TOKEN, + TxStatus::InBlock, + ) + .await?; // to cover txs fees - balances_batch_transfer( - &root_connection.as_signed(), - vec![controller_account.clone()], - TOKEN, - ); + root_connection + .as_signed() + .transfer(controller_account.clone(), TOKEN, TxStatus::InBlock) + .await?; - let stash_connection = SignedConnection::new(node, stash.clone()); + let stash_connection = + SignedConnection::new(node.to_string(), KeyPair::new(stash.signer().clone())).await; - staking_bond( - &stash_connection, - MIN_VALIDATOR_BOND, - &controller_account, - XtStatus::InBlock, - ); - let bonded_controller_account = staking_bonded(&root_connection, &stash).unwrap_or_else(|| { - panic!( - "Expected that stash account {} is bonded to some controller!", - &stash_account + stash_connection + .bond( + MIN_VALIDATOR_BOND, + controller_account.clone(), + TxStatus::InBlock, ) - }); + .await?; + + let bonded_controller_account = root_connection + .connection + .get_bonded(stash_account.clone(), None) + .await + .expect("should be bonded to smth"); assert_eq!( bonded_controller_account, controller_account, "Expected that stash account {} is bonded to the controller account {}, got {} instead!", &stash_account, &controller_account, &bonded_controller_account ); - let validator_keys = rotate_keys(&root_connection).expect("Failed to retrieve keys from chain"); - let controller_connection = SignedConnection::new(node, controller.clone()); - set_keys(&controller_connection, validator_keys, XtStatus::InBlock); - - // to be elected in next era instead of expected validator_account_id - staking_validate(&controller_connection, 10, XtStatus::InBlock); - - let ledger = staking_ledger(&root_connection, &controller); - assert!( - ledger.is_some(), - "Expected controller {} configuration to be non empty", - controller_account - ); - let ledger = ledger.unwrap(); + let validator_keys = root_connection.as_signed().author_rotate_keys().await; + let controller_connection = + SignedConnection::new(node.to_string(), KeyPair::new(controller.signer().clone())).await; + controller_connection + .set_keys(validator_keys, TxStatus::InBlock) + .await?; + controller_connection + .validate(10, TxStatus::InBlock) + .await?; + let ledger = controller_connection + .connection + .get_ledger(controller_account, None) + .await; assert_eq!( ledger, StakingLedger { stash: stash_account.clone(), total: MIN_VALIDATOR_BOND, active: MIN_VALIDATOR_BOND, - unlocking: BoundedVec::try_from(vec![]).unwrap(), + unlocking: BoundedVec(vec![]), + claimed_rewards: vec![], } ); validator_accounts.push(stash); - change_validators( - &root_connection, - Some(account_ids_from_keys(&validator_accounts)), - Some(vec![]), - Some(CommitteeSeats { - reserved_seats: 5, - non_reserved_seats: 0, - }), - XtStatus::InBlock, - ); - let current_session = get_current_session(&root_connection); - let _ = wait_for_session(&root_connection, current_session + 2)?; - - let current_era = wait_for_full_era_completion(&root_connection)?; + root_connection + .change_validators( + Some(account_ids_from_keys(&validator_accounts)), + Some(vec![]), + Some(CommitteeSeats { + reserved_seats: 5, + non_reserved_seats: 0, + }), + TxStatus::InBlock, + ) + .await?; + root_connection + .connection + .wait_for_n_sessions(2, BlockStatus::Best) + .await; + root_connection + .connection + .wait_for_n_eras(2, BlockStatus::Best) + .await; + let current_era = root_connection.connection.get_current_era(None).await; info!( "Era {} started, claiming rewards for era {}", current_era, @@ -201,7 +230,48 @@ pub fn staking_new_validator(config: &Config) -> anyhow::Result<()> { &[stash_account.clone()], &stash_account, current_era, - ); + ) + .await; Ok(()) } + +pub async fn multi_bond(node: &str, bonders: &[KeyPair], stake: Balance) { + for bonder in bonders { + let controller_account = account_from_keypair(bonder.signer()); + let connection = + SignedConnection::new(node.to_string(), KeyPair::new(bonder.signer().clone())).await; + connection + .bond(stake, controller_account, TxStatus::InBlock) + .await + .unwrap(); + } +} + +async fn payout_stakers_and_assert_locked_balance( + stash_connection: &SignedConnection, + accounts_to_check_balance: &[AccountId], + stash_account: &AccountId, + era: BlockNumber, +) { + let locked_stash_balances_before_payout = stash_connection + .connection + .locks(accounts_to_check_balance, None) + .await; + stash_connection + .payout_stakers(stash_account.clone(), era - 1, TxStatus::Finalized) + .await + .unwrap(); + let locked_stash_balances_after_payout = stash_connection + .connection + .locks(accounts_to_check_balance, None) + .await; + locked_stash_balances_before_payout.iter() + .zip(locked_stash_balances_after_payout.iter()) + .zip(accounts_to_check_balance.iter()) + .for_each(|((balances_before, balances_after), account_id)| { + assert!(balances_after[0].amount > balances_before[0].amount, + "Expected payout to be positive in locked balance for account {}. Balance before: {}, balance after: {}", + account_id, balances_before[0].amount, balances_after[0].amount); + }); +} diff --git a/e2e-tests/src/test/transfer.rs b/e2e-tests/src/test/transfer.rs index 9cb53ab0d9..52eb1792d7 100644 --- a/e2e-tests/src/test/transfer.rs +++ b/e2e-tests/src/test/transfer.rs @@ -1,18 +1,29 @@ -use aleph_client::{balances_transfer, get_free_balance, XtStatus}; +use aleph_client::{ + pallets::{balances::BalanceUserApi, system::SystemApi}, + TxStatus, +}; use log::info; use crate::{config::Config, transfer::setup_for_transfer}; -pub fn token_transfer(config: &Config) -> anyhow::Result<()> { - let (connection, to) = setup_for_transfer(config); +pub async fn token_transfer(config: &Config) -> anyhow::Result<()> { + let (connection, to) = setup_for_transfer(config).await; - let balance_before = get_free_balance(&connection, &to); + let balance_before = connection + .connection + .get_free_balance(to.clone(), None) + .await; info!("[+] Account {} balance before tx: {}", to, balance_before); - let transfer_value = 1000u128; - balances_transfer(&connection, &to, transfer_value, XtStatus::Finalized); + let transfer_value = 1000; + connection + .transfer(to.clone(), transfer_value, TxStatus::Finalized) + .await?; - let balance_after = get_free_balance(&connection, &to); + let balance_after = connection + .connection + .get_free_balance(to.clone(), None) + .await; info!("[+] Account {} balance after tx: {}", to, balance_after); assert_eq!( diff --git a/e2e-tests/src/test/treasury.rs b/e2e-tests/src/test/treasury.rs index b60e2b512f..58348c5798 100644 --- a/e2e-tests/src/test/treasury.rs +++ b/e2e-tests/src/test/treasury.rs @@ -1,23 +1,30 @@ use aleph_client::{ - account_from_keypair, approve_treasury_proposal, get_free_balance, make_treasury_proposal, - reject_treasury_proposal, staking_treasury_payout, total_issuance, treasury_account, - treasury_proposals_counter, Balance, BalanceTransfer, GetTxInfo, ReadStorage, RootConnection, - SignedConnection, XtStatus, + account_from_keypair, + api::treasury::events::Rejected, + pallets::{ + balances::BalanceApi, + system::SystemApi, + treasury::{TreasureApiExt, TreasuryApi, TreasuryUserApi}, + }, + waiting::{AlephWaiting, BlockStatus}, + Connection, KeyPair, RootConnection, SignedConnection, TxStatus, }; use log::info; +use primitives::Balance; use crate::{ - accounts::{get_sudo_key, get_validators_keys}, - config::Config, - transfer::setup_for_tipped_transfer, + accounts::get_validators_raw_keys, config::Config, test::fee::current_fees, + transfer::setup_for_transfer, }; /// Returns current treasury free funds and total issuance. /// /// Takes two storage reads. -fn balance_info(connection: &C) -> (Balance, Balance) { - let treasury_balance = get_free_balance(connection, &treasury_account()); - let issuance = total_issuance(connection); +async fn balance_info(connection: &Connection) -> (Balance, Balance) { + let treasury_balance = connection + .get_free_balance(connection.treasury_account().await, None) + .await; + let issuance = connection.total_issuance(None).await; info!( "[+] Treasury balance: {}. Total issuance: {}.", treasury_balance, issuance @@ -26,31 +33,26 @@ fn balance_info(connection: &C) -> (Balance, Balance) { (treasury_balance, issuance) } -pub fn channeling_fee_and_tip(config: &Config) -> anyhow::Result<()> { +pub async fn channeling_fee_and_tip(config: &Config) -> anyhow::Result<()> { let (transfer_amount, tip) = (1_000u128, 10_000u128); - let (connection, to) = setup_for_tipped_transfer(config, tip); + let (connection, to) = setup_for_transfer(config).await; - let (treasury_balance_before, issuance_before) = balance_info(&connection); - let tx = connection.create_transfer_tx(to, transfer_amount); - connection.transfer(tx.clone(), XtStatus::Finalized)?; - let (treasury_balance_after, issuance_after) = balance_info(&connection); - - let possible_treasury_gain_from_staking = staking_treasury_payout(&connection); + let (treasury_balance_before, issuance_before) = balance_info(&connection.connection).await; + let possible_treasury_gain_from_staking = + connection.connection.possible_treasury_payout().await; + let (fee, _) = current_fees(&connection, to, Some(tip), transfer_amount).await; + let (treasury_balance_after, issuance_after) = balance_info(&connection.connection).await; check_issuance( possible_treasury_gain_from_staking, issuance_before, issuance_after, ); - - let fee_info = connection.get_tx_info(&tx); - let fee = fee_info.fee_without_weight + fee_info.adjusted_weight; check_treasury_balance( possible_treasury_gain_from_staking, treasury_balance_before, treasury_balance_after, fee, - tip, ); Ok(()) @@ -82,33 +84,43 @@ fn check_treasury_balance( treasury_balance_before: Balance, treasury_balance_after: Balance, fee: Balance, - tip: Balance, ) { - let treasury_balance_diff = treasury_balance_after - (treasury_balance_before + fee + tip); + let treasury_balance_diff = treasury_balance_after - (treasury_balance_before + fee); assert_eq!( treasury_balance_diff % possibly_treasury_gain_from_staking, 0, - "Incorrect amount was channeled to the treasury: before = {}, after = {}, fee = {}, tip = \ - {}. We can be different only as multiples of staking treasury reward {}, but the remainder \ + "Incorrect amount was channeled to the treasury: before = {}, after = {}, fee = {}. \ + We can be different only as multiples of staking treasury reward {}, but the remainder \ is {}", treasury_balance_before, treasury_balance_after, fee, - tip, possibly_treasury_gain_from_staking, treasury_balance_diff % possibly_treasury_gain_from_staking, ); } -pub fn treasury_access(config: &Config) -> anyhow::Result<()> { - let proposer = get_validators_keys(config)[0].clone(); - let beneficiary = account_from_keypair(&proposer); - let connection = SignedConnection::new(&config.node, proposer); - - let proposals_counter_before = treasury_proposals_counter(&connection); - make_treasury_proposal(&connection, 10u128, &beneficiary)?; - make_treasury_proposal(&connection, 100u128, &beneficiary)?; - let proposals_counter_after = treasury_proposals_counter(&connection); +pub async fn treasury_access(config: &Config) -> anyhow::Result<()> { + let proposer = KeyPair::new(get_validators_raw_keys(config)[0].clone()); + let beneficiary = account_from_keypair(proposer.signer()); + let connection = SignedConnection::new(config.node.clone(), proposer).await; + + let proposals_counter_before = connection + .connection + .proposals_count(None) + .await + .unwrap_or_default(); + connection + .propose_spend(10, beneficiary.clone(), TxStatus::InBlock) + .await?; + connection + .propose_spend(100, beneficiary.clone(), TxStatus::InBlock) + .await?; + let proposals_counter_after = connection + .connection + .proposals_count(None) + .await + .unwrap_or_default(); assert_eq!( proposals_counter_before + 2, @@ -116,11 +128,40 @@ pub fn treasury_access(config: &Config) -> anyhow::Result<()> { "Proposal has not been created" ); - let sudo = get_sudo_key(config); - let connection = RootConnection::new(&config.node, sudo); + let root_connection = config.create_root_connection().await; + + approve_treasury_proposal(&root_connection, proposals_counter_after - 2).await?; + reject_treasury_proposal(&root_connection, proposals_counter_after - 1).await?; + + Ok(()) +} + +async fn approve_treasury_proposal(connection: &RootConnection, id: u32) -> anyhow::Result<()> { + connection + .as_signed() + .approve(id, TxStatus::Finalized) + .await?; + let approvals = connection.connection.approvals(None).await; + assert!(approvals.contains(&id)); + + Ok(()) +} - approve_treasury_proposal(&connection, proposals_counter_after - 2)?; - reject_treasury_proposal(&connection, proposals_counter_after - 1)?; +async fn reject_treasury_proposal(connection: &RootConnection, id: u32) -> anyhow::Result<()> { + let handle_connection = connection.connection.clone(); + let handle = tokio::spawn(async move { + handle_connection + .wait_for_event( + |e: &Rejected| e.proposal_index == id, + BlockStatus::Finalized, + ) + .await; + }); + connection + .as_signed() + .reject(id, TxStatus::Finalized) + .await?; + handle.await?; Ok(()) } diff --git a/e2e-tests/src/test/utility.rs b/e2e-tests/src/test/utility.rs index 0a38c2a710..aef3d384be 100644 --- a/e2e-tests/src/test/utility.rs +++ b/e2e-tests/src/test/utility.rs @@ -1,26 +1,18 @@ use std::iter::repeat; -use aleph_client::{BalanceTransfer, BatchTransactions, XtStatus}; -use log::info; +use aleph_client::{pallets::balances::BalanceUserBatchExtApi, TxStatus}; use crate::{config::Config, transfer::setup_for_transfer}; -pub fn batch_transactions(config: &Config) -> anyhow::Result<()> { +pub async fn batch_transactions(config: &Config) -> anyhow::Result<()> { const NUMBER_OF_TRANSACTIONS: usize = 100; - let (connection, to) = setup_for_transfer(config); + let (connection, to) = setup_for_transfer(config).await; - let call = connection.create_transfer_tx(to, 1000u128); - let transactions = repeat(&call).take(NUMBER_OF_TRANSACTIONS); - - let finalized_block_hash = connection - .batch_and_send_transactions(transactions, XtStatus::Finalized) - .unwrap_or_else(|err| panic!("error while sending a batch of txs: {:?}", err)) - .expect("Could not get tx hash"); - info!( - "[+] A batch of {} transactions was included in finalized {} block.", - NUMBER_OF_TRANSACTIONS, finalized_block_hash - ); + let accounts: Vec<_> = repeat(to.clone()).take(NUMBER_OF_TRANSACTIONS).collect(); + connection + .batch_transfer(&accounts, 1000, TxStatus::Finalized) + .await?; Ok(()) } diff --git a/e2e-tests/src/test/validators_change.rs b/e2e-tests/src/test/validators_change.rs index 824931d4ff..ec1905f17c 100644 --- a/e2e-tests/src/test/validators_change.rs +++ b/e2e-tests/src/test/validators_change.rs @@ -1,65 +1,77 @@ use aleph_client::{ - get_current_block_number, get_next_era_committee_seats, get_next_era_non_reserved_validators, - get_next_era_reserved_validators, wait_for_event, wait_for_finalized_block, AccountId, - XtStatus, + api::elections::events::ChangeValidators, + pallets::elections::{ElectionsApi, ElectionsSudoApi}, + primitives::CommitteeSeats, + utility::BlocksApi, + waiting::{AlephWaiting, BlockStatus}, + AccountId, Pair, TxStatus, }; -use codec::Decode; use log::info; -use primitives::CommitteeSeats; -use sp_core::Pair; use crate::{accounts::get_validators_keys, config::Config}; -pub fn change_validators(config: &Config) -> anyhow::Result<()> { +pub async fn change_validators(config: &Config) -> anyhow::Result<()> { let accounts = get_validators_keys(config); - let connection = config.create_root_connection(); + let connection = config.create_root_connection().await; - let reserved_before = get_next_era_reserved_validators(&connection); - let non_reserved_before = get_next_era_non_reserved_validators(&connection); - let committee_size_before = get_next_era_committee_seats(&connection); + let reserved_before = connection + .connection + .get_next_era_reserved_validators(None) + .await; + let non_reserved_before = connection + .connection + .get_next_era_non_reserved_validators(None) + .await; + let committee_size_before = connection + .connection + .get_next_era_committee_seats(None) + .await; info!( "[+] state before tx: reserved: {:#?}, non_reserved: {:#?}, committee_size: {:#?}", reserved_before, non_reserved_before, committee_size_before ); - let new_validators: Vec = accounts.iter().map(|pair| pair.public().into()).collect(); - aleph_client::change_validators( - &connection, - Some(new_validators[0..2].to_vec()), - Some(new_validators[2..].to_vec()), - Some(CommitteeSeats { - reserved_seats: 2, - non_reserved_seats: 2, - }), - XtStatus::InBlock, - ); + let new_validators: Vec = accounts + .iter() + .map(|pair| pair.signer().public().into()) + .collect(); + connection + .change_validators( + Some(new_validators[0..2].to_vec()), + Some(new_validators[2..].to_vec()), + Some(CommitteeSeats { + reserved_seats: 2, + non_reserved_seats: 2, + }), + TxStatus::InBlock, + ) + .await?; - #[derive(Debug, Decode, Clone)] - struct NewValidatorsEvent { - reserved: Vec, - non_reserved: Vec, - committee_size: CommitteeSeats, - } - wait_for_event( - &connection, - ("Elections", "ChangeValidators"), - |e: NewValidatorsEvent| { - info!("[+] NewValidatorsEvent: reserved: {:#?}, non_reserved: {:#?}, committee_size: {:#?}", e.reserved, e.non_reserved, e.non_reserved); + connection.connection.wait_for_event(|e: &ChangeValidators| { + info!("[+] NewValidatorsEvent: reserved: {:#?}, non_reserved: {:#?}, committee_size: {:#?}", e.0, e.1, e.2); - e.reserved == new_validators[0..2] - && e.non_reserved == new_validators[2..] - && e.committee_size - == CommitteeSeats { - reserved_seats: 2, - non_reserved_seats: 2, - } - }, - )?; + e.0 == new_validators[0..2] + && e.1 == new_validators[2..] + && e.2 + == CommitteeSeats { + reserved_seats: 2, + non_reserved_seats: 2, + } + }, BlockStatus::Best).await; - let reserved_after = get_next_era_reserved_validators(&connection); - let non_reserved_after = get_next_era_non_reserved_validators(&connection); - let committee_size_after = get_next_era_committee_seats(&connection); + let reserved_after = connection + .connection + .get_next_era_reserved_validators(None) + .await; + let non_reserved_after = connection + .connection + .get_next_era_non_reserved_validators(None) + .await; + let committee_size_after = connection + .connection + .get_next_era_committee_seats(None) + .await; info!( "[+] state before tx: reserved: {:#?}, non_reserved: {:#?}, committee_size: {:#?}", @@ -75,9 +87,11 @@ pub fn change_validators(config: &Config) -> anyhow::Result<()> { }, committee_size_after ); - - let block_number = get_current_block_number(&connection); - wait_for_finalized_block(&connection, block_number)?; + let block_number = connection.connection.get_best_block().await; + connection + .connection + .wait_for_block(|n| n >= block_number, BlockStatus::Finalized) + .await; Ok(()) } diff --git a/e2e-tests/src/test/validators_rotate.rs b/e2e-tests/src/test/validators_rotate.rs index e8d3f5a555..aadeb510ce 100644 --- a/e2e-tests/src/test/validators_rotate.rs +++ b/e2e-tests/src/test/validators_rotate.rs @@ -1,10 +1,12 @@ use std::collections::HashMap; use aleph_client::{ - change_validators, get_current_block_number, get_current_session, get_validators_for_session, - wait_for_finalized_block, wait_for_full_era_completion, wait_for_session, XtStatus, + pallets::{elections::ElectionsSudoApi, session::SessionApi}, + primitives::CommitteeSeats, + utility::BlocksApi, + waiting::{AlephWaiting, BlockStatus, WaitingExt}, + TxStatus, }; -use primitives::CommitteeSeats; use crate::{ accounts::account_ids_from_keys, elections::get_members_subset_for_session, @@ -13,9 +15,9 @@ use crate::{ const TEST_LENGTH: u32 = 5; -pub fn validators_rotate(config: &Config) -> anyhow::Result<()> { - let connection = config.get_first_signed_connection(); - let root_connection = config.create_root_connection(); +pub async fn validators_rotate(config: &Config) -> anyhow::Result<()> { + let connection = config.get_first_signed_connection().await; + let root_connection = config.create_root_connection().await; let era_validators = get_test_validators(config); let reserved_validators = account_ids_from_keys(&era_validators.reserved); @@ -27,25 +29,34 @@ pub fn validators_rotate(config: &Config) -> anyhow::Result<()> { non_reserved_seats: 2, }; - change_validators( - &root_connection, - Some(reserved_validators.clone()), - Some(non_reserved_validators.clone()), - Some(seats), - XtStatus::InBlock, - ); - wait_for_full_era_completion(&connection)?; - - let current_session = get_current_session(&connection); - wait_for_session(&connection, current_session + TEST_LENGTH)?; + root_connection + .change_validators( + Some(reserved_validators.clone()), + Some(non_reserved_validators.clone()), + Some(seats.clone()), + TxStatus::InBlock, + ) + .await?; + root_connection + .connection + .wait_for_n_eras(2, BlockStatus::Finalized) + .await; + let current_session = root_connection.connection.get_session(None).await; + root_connection + .connection + .wait_for_n_sessions(TEST_LENGTH, BlockStatus::Finalized) + .await; let mut non_reserved_count = HashMap::new(); for session in current_session..current_session + TEST_LENGTH { - let elected = get_validators_for_session(&connection, session); + let elected = connection + .connection + .get_validators(connection.connection.first_block_of_session(session).await) + .await; let non_reserved = get_members_subset_for_session( - seats.non_reserved_seats, + seats.non_reserved_seats.clone(), &non_reserved_validators, session, ); @@ -88,8 +99,11 @@ pub fn validators_rotate(config: &Config) -> anyhow::Result<()> { let min_elected = non_reserved_count.values().min().unwrap(); assert!(max_elected - min_elected <= 1); - let block_number = get_current_block_number(&connection); - wait_for_finalized_block(&connection, block_number)?; + let block_number = connection.connection.get_best_block().await; + connection + .connection + .wait_for_block(|n| n >= block_number, BlockStatus::Finalized) + .await; Ok(()) } diff --git a/e2e-tests/src/test/version_upgrade.rs b/e2e-tests/src/test/version_upgrade.rs index cb5af611f8..bfb82743f4 100644 --- a/e2e-tests/src/test/version_upgrade.rs +++ b/e2e-tests/src/test/version_upgrade.rs @@ -1,6 +1,8 @@ use aleph_client::{ - get_current_session, get_session_period, schedule_upgrade, wait_for_at_least_session, - wait_for_finalized_block, + pallets::{aleph::AlephSudoApi, session::SessionApi}, + utility::BlocksApi, + waiting::{AlephWaiting, BlockStatus}, + TxStatus, }; use primitives::SessionIndex; @@ -13,11 +15,11 @@ const UPGRADE_SESSION: SessionIndex = 3; const UPGRADE_FINALIZATION_WAIT_SESSIONS: u32 = 3; // Simple test that schedules a version upgrade, awaits it, and checks if node is still finalizing after planned upgrade session. -pub fn schedule_version_change(config: &Config) -> anyhow::Result<()> { - let connection = config.create_root_connection(); +pub async fn schedule_version_change(config: &Config) -> anyhow::Result<()> { + let connection = config.create_root_connection().await; let test_case_params = config.test_case_params.clone(); - let current_session = get_current_session(&connection); + let current_session = connection.connection.get_session(None).await; let version_for_upgrade = test_case_params .upgrade_to_version .unwrap_or(UPGRADE_TO_VERSION); @@ -28,11 +30,23 @@ pub fn schedule_version_change(config: &Config) -> anyhow::Result<()> { .unwrap_or(UPGRADE_FINALIZATION_WAIT_SESSIONS); let session_after_upgrade = session_for_upgrade + wait_sessions_after_upgrade; - schedule_upgrade(&connection, version_for_upgrade, session_for_upgrade)?; - - wait_for_at_least_session(&connection, session_after_upgrade)?; - let block_number = session_after_upgrade * get_session_period(&connection); - wait_for_finalized_block(&connection, block_number)?; + connection + .schedule_finality_version_change( + version_for_upgrade, + session_for_upgrade, + TxStatus::Finalized, + ) + .await?; + connection + .connection + .wait_for_session(session_after_upgrade + 1, BlockStatus::Finalized) + .await; + + let block_number = connection.connection.get_best_block().await; + connection + .connection + .wait_for_block(|n| n >= block_number, BlockStatus::Finalized) + .await; Ok(()) } diff --git a/e2e-tests/src/transfer.rs b/e2e-tests/src/transfer.rs index 7bb13d37cc..e9d19ee18c 100644 --- a/e2e-tests/src/transfer.rs +++ b/e2e-tests/src/transfer.rs @@ -1,24 +1,18 @@ -use aleph_client::{ - create_connection, AccountId, Balance, Connection, KeyPair, ManageParams, SignedConnection, -}; -use sp_core::Pair; +use aleph_client::{AccountId, Connection, KeyPair, Pair, SignedConnection}; -use crate::{accounts::get_validators_keys, config::Config}; +use crate::{accounts::get_validators_raw_keys, config::Config}; -fn setup(config: &Config) -> (Connection, KeyPair, AccountId) { - let accounts = get_validators_keys(config); - let (from, to) = (accounts[0].clone(), accounts[1].clone()); - let to = AccountId::from(to.public()); - (create_connection(&config.node), from, to) +async fn setup(config: &Config) -> (Connection, KeyPair, AccountId) { + let accounts = get_validators_raw_keys(config); + let (from, to) = ( + KeyPair::new(accounts[0].clone()), + KeyPair::new(accounts[1].clone()), + ); + let to = AccountId::from(to.signer().public()); + (Connection::new(config.node.clone()).await, from, to) } -pub fn setup_for_transfer(config: &Config) -> (SignedConnection, AccountId) { - let (connection, from, to) = setup(config); - (SignedConnection::from_any_connection(&connection, from), to) -} - -pub fn setup_for_tipped_transfer(config: &Config, tip: Balance) -> (SignedConnection, AccountId) { - let (connection, from, to) = setup(config); - let connection = SignedConnection::from_any_connection(&connection, from).set_tip(tip); - (connection, to) +pub async fn setup_for_transfer(config: &Config) -> (SignedConnection, AccountId) { + let (connection, from, to) = setup(config).await; + (SignedConnection::from_connection(connection, from), to) } diff --git a/e2e-tests/src/validators.rs b/e2e-tests/src/validators.rs index fe1676033c..5b3420f411 100644 --- a/e2e-tests/src/validators.rs +++ b/e2e-tests/src/validators.rs @@ -1,16 +1,26 @@ use aleph_client::{ - account_from_keypair, balances_batch_transfer, keypair_from_string, rotate_keys, set_keys, - staking_bond, staking_validate, AccountId, KeyPair, SignedConnection, XtStatus, + account_from_keypair, keypair_from_string, + pallets::{balances::BalanceUserBatchExtApi, session::SessionUserApi, staking::StakingUserApi}, + primitives::EraValidators, + raw_keypair_from_string, + rpc::Rpc, + AccountId, KeyPair, RawKeyPair, SignedConnection, TxStatus, }; -use primitives::{staking::MIN_VALIDATOR_BOND, EraValidators, TOKEN}; +use primitives::{staking::MIN_VALIDATOR_BOND, TOKEN}; -use crate::{accounts::get_validators_keys, Config}; +use crate::{accounts::get_validators_raw_keys, Config}; /// Get all validators assumed for test pub fn get_test_validators(config: &Config) -> EraValidators { - let all_validators = get_validators_keys(config); - let reserved = all_validators[0..2].to_vec(); - let non_reserved = all_validators[2..].to_vec(); + let all_validators = get_validators_raw_keys(config); + let reserved = all_validators[0..2] + .iter() + .map(|k| KeyPair::new(k.clone())) + .collect(); + let non_reserved = all_validators[2..] + .iter() + .map(|k| KeyPair::new(k.clone())) + .collect(); EraValidators { reserved, @@ -22,21 +32,29 @@ pub fn get_test_validators(config: &Config) -> EraValidators { pub struct Accounts { stash_keys: Vec, stash_accounts: Vec, - + stash_raw_keys: Vec, controller_keys: Vec, controller_accounts: Vec, + controller_raw_keys: Vec, } +#[allow(dead_code)] impl Accounts { pub fn get_stash_keys(&self) -> &Vec { &self.stash_keys } + pub fn get_stash_raw_keys(&self) -> &Vec { + &self.stash_raw_keys + } pub fn get_stash_accounts(&self) -> &Vec { &self.stash_accounts } pub fn get_controller_keys(&self) -> &Vec { &self.controller_keys } + pub fn get_controller_raw_keys(&self) -> &Vec { + &self.controller_raw_keys + } pub fn get_controller_accounts(&self) -> &Vec { &self.controller_accounts } @@ -47,54 +65,76 @@ pub fn setup_accounts(desired_validator_count: u32) -> Accounts { let seeds = (0..desired_validator_count).map(|idx| format!("//Validator//{}", idx)); let stash_seeds = seeds.clone().map(|seed| format!("{}//Stash", seed)); - let stash_keys = stash_seeds.map(|s| keypair_from_string(&s)); - let stash_accounts = stash_keys.clone().map(|k| account_from_keypair(&k)); + let stash_keys: Vec<_> = stash_seeds + .clone() + .map(|s| keypair_from_string(&s)) + .collect(); + let stash_raw_keys = stash_seeds.map(|s| raw_keypair_from_string(&s)).collect(); + let stash_accounts = stash_keys + .iter() + .map(|k| account_from_keypair(k.signer())) + .collect(); let controller_seeds = seeds.map(|seed| format!("{}//Controller", seed)); - let controller_keys = controller_seeds.map(|s| keypair_from_string(&s)); - let controller_accounts = controller_keys.clone().map(|k| account_from_keypair(&k)); + let controller_keys: Vec<_> = controller_seeds + .clone() + .map(|s| keypair_from_string(&s)) + .collect(); + let controller_raw_keys = controller_seeds + .map(|s| raw_keypair_from_string(&s)) + .collect(); + let controller_accounts = controller_keys + .iter() + .map(|k| account_from_keypair(k.signer())) + .collect(); Accounts { - stash_keys: stash_keys.collect(), - stash_accounts: stash_accounts.collect(), - controller_keys: controller_keys.collect(), - controller_accounts: controller_accounts.collect(), + stash_keys, + stash_accounts, + controller_keys, + controller_accounts, + stash_raw_keys, + controller_raw_keys, } } /// Endow validators (stashes and controllers), bond and rotate keys. /// /// Signer of `connection` should have enough balance to endow new accounts. -pub fn prepare_validators(connection: &SignedConnection, node: &str, accounts: &Accounts) { - balances_batch_transfer( - connection, - accounts.stash_accounts.clone(), - MIN_VALIDATOR_BOND + TOKEN, - ); - balances_batch_transfer( - connection, - accounts.get_controller_accounts().to_vec(), - TOKEN, - ); +pub async fn prepare_validators(connection: &SignedConnection, node: &str, accounts: &Accounts) { + connection + .batch_transfer( + &accounts.stash_accounts, + MIN_VALIDATOR_BOND + TOKEN, + TxStatus::Finalized, + ) + .await + .unwrap(); + connection + .batch_transfer(&accounts.controller_accounts, TOKEN, TxStatus::Finalized) + .await + .unwrap(); for (stash, controller) in accounts - .stash_keys + .stash_raw_keys .iter() .zip(accounts.get_controller_accounts().iter()) { - let connection = SignedConnection::new(node, stash.clone()); - staking_bond( - &connection, - MIN_VALIDATOR_BOND, - controller, - XtStatus::Finalized, - ); + let connection = SignedConnection::new(node.to_string(), KeyPair::new(stash.clone())).await; + connection + .bond(MIN_VALIDATOR_BOND, controller.clone(), TxStatus::Finalized) + .await + .unwrap(); } - for controller in accounts.controller_keys.iter() { - let keys = rotate_keys(connection).expect("Failed to generate new keys"); - let connection = SignedConnection::new(node, controller.clone()); - set_keys(&connection, keys, XtStatus::Finalized); - staking_validate(&connection, 10, XtStatus::Finalized); + for controller in accounts.controller_raw_keys.iter() { + let keys = connection.author_rotate_keys().await; + let connection = + SignedConnection::new(node.to_string(), KeyPair::new(controller.clone())).await; + connection + .set_keys(keys, TxStatus::Finalized) + .await + .unwrap(); + connection.validate(10, TxStatus::Finalized).await.unwrap(); } } diff --git a/flooder/Cargo.lock b/flooder/Cargo.lock index 39ec0dda25..c8ee43de7a 100644 --- a/flooder/Cargo.lock +++ b/flooder/Cargo.lock @@ -98,31 +98,25 @@ dependencies = [ [[package]] name = "aleph_client" -version = "1.11.0" +version = "2.0.0" dependencies = [ - "ac-node-api", - "ac-primitives", "anyhow", + "async-trait", "contract-metadata 1.5.0", "contract-transcode", "frame-support", + "futures", "hex", "ink_metadata", "log", - "pallet-aleph", - "pallet-balances", - "pallet-elections", - "pallet-multisig", - "pallet-staking", - "pallet-treasury", - "pallet-vesting", "parity-scale-codec", "primitives", "rayon", + "serde", "serde_json", "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "substrate-api-client", + "subxt", "thiserror", ] @@ -186,6 +180,16 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +[[package]] +name = "async-lock" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" +dependencies = [ + "event-listener", + "futures-lite", +] + [[package]] name = "async-trait" version = "0.1.58" @@ -247,6 +251,15 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +dependencies = [ + "serde", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -542,6 +555,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.3" @@ -727,6 +750,41 @@ dependencies = [ "syn", ] +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "der" version = "0.5.1" @@ -736,6 +794,17 @@ dependencies = [ "const-oid", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -911,12 +980,27 @@ dependencies = [ "rustversion", ] +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + [[package]] name = "fake-simd" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + [[package]] name = "ff" version = "0.11.1" @@ -960,7 +1044,7 @@ dependencies = [ "futures", "hdrhistogram", "log", - "mio", + "mio 0.6.23", "parity-scale-codec", "rayon", "serde_json", @@ -971,6 +1055,12 @@ dependencies = [ "zip", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "foreign-types" version = "0.3.2" @@ -1017,33 +1107,6 @@ dependencies = [ "sp-storage 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", ] -[[package]] -name = "frame-election-provider-solution-type" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "frame-election-provider-support" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-election-provider-solution-type", - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-arithmetic 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-npos-elections", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "frame-metadata" version = "15.0.0" @@ -1220,6 +1283,21 @@ version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + [[package]] name = "futures-macro" version = "0.3.25" @@ -1417,6 +1495,17 @@ dependencies = [ "hmac 0.8.1", ] +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes 1.2.1", + "fnv", + "itoa", +] + [[package]] name = "httparse" version = "1.8.0" @@ -1453,6 +1542,12 @@ dependencies = [ "cxx-build", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.3.0" @@ -1594,6 +1689,15 @@ dependencies = [ "scale-info", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", +] + [[package]] name = "integer-sqrt" version = "0.1.5" @@ -1642,6 +1746,75 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonrpsee" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bd0d559d5e679b1ab2f869b486a11182923863b1b3ee8b421763cdd707b783a" +dependencies = [ + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8752740ecd374bcbf8b69f3e80b0327942df76f793f8d4e60d3355650c31fb74" +dependencies = [ + "futures-util", + "http", + "jsonrpsee-core", + "jsonrpsee-types", + "pin-project", + "rustls-native-certs", + "soketto", + "thiserror", + "tokio", + "tokio-rustls", + "tokio-util", + "tracing", + "webpki-roots", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3dc3e9cf2ba50b7b1d7d76a667619f82846caa39e8e8daa8a4962d74acaddca" +dependencies = [ + "anyhow", + "async-lock", + "async-trait", + "beef", + "futures-channel", + "futures-timer", + "futures-util", + "jsonrpsee-types", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e290bba767401b646812f608c099b922d8142603c9e73a50fb192d3ac86f4a0d" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + [[package]] name = "k256" version = "0.10.4" @@ -1876,6 +2049,18 @@ dependencies = [ "winapi 0.2.8", ] +[[package]] +name = "mio" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.42.0", +] + [[package]] name = "mio-extras" version = "2.0.6" @@ -1884,7 +2069,7 @@ checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" dependencies = [ "lazycell", "log", - "mio", + "mio 0.6.23", "slab", ] @@ -2105,6 +2290,12 @@ dependencies = [ "syn", ] +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + [[package]] name = "openssl-sys" version = "0.9.77" @@ -2124,38 +2315,6 @@ version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" -[[package]] -name = "pallet-aleph" -version = "0.5.0" -dependencies = [ - "frame-support", - "frame-system", - "pallet-balances", - "pallet-session", - "pallets-support", - "parity-scale-codec", - "primitives", - "scale-info", - "serde", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-authorship" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "sp-authorship", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "pallet-balances" version = "4.0.0-dev" @@ -2172,185 +2331,53 @@ dependencies = [ ] [[package]] -name = "pallet-elections" -version = "0.5.0" +name = "pallet-transaction-payment" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" dependencies = [ - "frame-election-provider-support", "frame-support", "frame-system", - "pallet-authorship", - "pallet-balances", - "pallet-session", - "pallet-staking", - "pallets-support", "parity-scale-codec", - "primitives", "scale-info", + "serde", "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-staking", "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", ] [[package]] -name = "pallet-multisig" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +name = "parity-scale-codec" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a" dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "arrayvec 0.7.2", + "bitvec", + "byte-slice-cast", + "bytes 1.2.1", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", ] [[package]] -name = "pallet-session" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +name = "parity-scale-codec-derive" +version = "3.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "log", - "pallet-timestamp", - "parity-scale-codec", - "scale-info", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-session", - "sp-staking", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-trie 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "pallet-staking" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-election-provider-support", - "frame-support", - "frame-system", - "log", - "pallet-authorship", - "pallet-session", - "parity-scale-codec", - "scale-info", - "serde", - "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-staking", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-inherents", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-timestamp", -] - -[[package]] -name = "pallet-transaction-payment" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-treasury" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", - "pallet-balances", - "parity-scale-codec", - "scale-info", - "serde", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallet-vesting" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - -[[package]] -name = "pallets-support" -version = "0.1.0" -dependencies = [ - "frame-support", -] - -[[package]] -name = "parity-scale-codec" -version = "3.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a" -dependencies = [ - "arrayvec 0.7.2", - "bitvec", - "byte-slice-cast", - "bytes 1.2.1", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "3.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "parity-util-mem" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" +name = "parity-util-mem" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" dependencies = [ "cfg-if 1.0.0", "hashbrown", @@ -2378,6 +2405,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + [[package]] name = "parking_lot" version = "0.12.1" @@ -2398,7 +2431,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2431,6 +2464,26 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" version = "0.2.9" @@ -2729,6 +2782,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi 0.3.9", +] + [[package]] name = "rlibc" version = "1.0.0" @@ -2762,6 +2830,39 @@ dependencies = [ "semver", ] +[[package]] +name = "rustls" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" +dependencies = [ + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +dependencies = [ + "base64", +] + [[package]] name = "rustversion" version = "1.0.9" @@ -2774,6 +2875,29 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +[[package]] +name = "scale-bits" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd7aca73785181cc41f0bbe017263e682b585ca660540ba569133901d013ecf" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "scale-decode" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d823d4be477fc33321f93d08fb6c2698273d044f01362dc27573a750deb7c233" +dependencies = [ + "parity-scale-codec", + "scale-bits", + "scale-info", + "thiserror", +] + [[package]] name = "scale-info" version = "2.2.0" @@ -2800,6 +2924,33 @@ dependencies = [ "syn", ] +[[package]] +name = "scale-value" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16a5e7810815bd295da73e4216d1dfbced3c7c7c7054d70fa5f6e4c58123fff4" +dependencies = [ + "either", + "frame-metadata 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec", + "scale-bits", + "scale-decode", + "scale-info", + "serde", + "thiserror", + "yap", +] + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys 0.36.1", +] + [[package]] name = "schnorrkel" version = "0.9.1" @@ -2830,6 +2981,16 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "sec1" version = "0.2.1" @@ -2887,6 +3048,29 @@ dependencies = [ "zeroize", ] +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "1.0.14" @@ -2939,6 +3123,19 @@ dependencies = [ "opaque-debug 0.2.3", ] +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + [[package]] name = "sha2" version = "0.8.2" @@ -3031,6 +3228,31 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64", + "bytes 1.2.1", + "futures", + "httparse", + "log", + "rand 0.8.5", + "sha-1 0.9.8", +] + [[package]] name = "sp-api" version = "4.0.0-dev" @@ -3118,18 +3340,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "sp-authorship" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "async-trait", - "parity-scale-codec", - "sp-inherents", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "sp-core" version = "6.0.0" @@ -3405,20 +3615,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "sp-npos-elections" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-arithmetic 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "sp-panic-handler" version = "4.0.0" @@ -3556,20 +3752,6 @@ dependencies = [ "syn", ] -[[package]] -name = "sp-session" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-staking", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", -] - [[package]] name = "sp-staking" version = "4.0.0-dev" @@ -3665,22 +3847,6 @@ dependencies = [ "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", ] -[[package]] -name = "sp-timestamp" -version = "4.0.0-dev" -source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" -dependencies = [ - "async-trait", - "futures-timer", - "log", - "parity-scale-codec", - "sp-api", - "sp-inherents", - "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", - "thiserror", -] - [[package]] name = "sp-tracing" version = "5.0.0" @@ -3791,6 +3957,12 @@ dependencies = [ "wasmi", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "ss58-registry" version = "1.33.0" @@ -3845,7 +4017,6 @@ dependencies = [ "hex", "log", "pallet-balances", - "pallet-staking", "pallet-transaction-payment", "parity-scale-codec", "primitive-types", @@ -3880,6 +4051,75 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +[[package]] +name = "subxt" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a8757ee0e19f87e722577282ab1386c86592a4b13ff963b9c6ec4176348104c" +dependencies = [ + "bitvec", + "derivative", + "frame-metadata 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures", + "hex", + "jsonrpsee", + "parity-scale-codec", + "parking_lot", + "scale-decode", + "scale-info", + "scale-value", + "serde", + "serde_json", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "subxt-macro", + "subxt-metadata", + "thiserror", + "tracing", +] + +[[package]] +name = "subxt-codegen" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb77f93e11e6ff3ff95fe33e3d24c27c342e16feca8ef47759993614ebe90d2c" +dependencies = [ + "darling", + "frame-metadata 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "heck", + "parity-scale-codec", + "proc-macro-error", + "proc-macro2", + "quote", + "scale-info", + "subxt-metadata", + "syn", +] + +[[package]] +name = "subxt-macro" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051cc21d77a54ae944b872eafdf9edfe1d9134fdfcfc3477dc10f763c76564a9" +dependencies = [ + "darling", + "proc-macro-error", + "subxt-codegen", + "syn", +] + +[[package]] +name = "subxt-metadata" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ed78d80db3a97d55e8b1cfecc1f6f9e21793a589d4e2e5f4fe2d6d5850c2e54" +dependencies = [ + "frame-metadata 15.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec", + "scale-info", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "syn" version = "1.0.103" @@ -4007,6 +4247,57 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +[[package]] +name = "tokio" +version = "1.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +dependencies = [ + "autocfg", + "libc", + "mio 0.8.5", + "pin-project-lite", + "socket2", + "tokio-macros", + "winapi 0.3.9", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes 1.2.1", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite", + "tokio", +] + [[package]] name = "toml" version = "0.5.9" @@ -4049,6 +4340,16 @@ dependencies = [ "valuable", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + [[package]] name = "tracing-log" version = "0.1.3" @@ -4126,7 +4427,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "digest 0.10.5", "rand 0.8.5", "static_assertions", @@ -4183,6 +4484,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "url" version = "2.3.1" @@ -4213,6 +4520,12 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" @@ -4309,6 +4622,35 @@ dependencies = [ "parity-wasm", ] +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" +dependencies = [ + "webpki", +] + [[package]] name = "winapi" version = "0.2.8" @@ -4352,6 +4694,19 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + [[package]] name = "windows-sys" version = "0.42.0" @@ -4359,12 +4714,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_x86_64_msvc 0.42.0", ] [[package]] @@ -4373,24 +4728,48 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + [[package]] name = "windows_aarch64_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + [[package]] name = "windows_i686_gnu" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + [[package]] name = "windows_i686_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + [[package]] name = "windows_x86_64_gnu" version = "0.42.0" @@ -4403,6 +4782,12 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + [[package]] name = "windows_x86_64_msvc" version = "0.42.0" @@ -4419,11 +4804,11 @@ dependencies = [ "bytes 0.4.12", "httparse", "log", - "mio", + "mio 0.6.23", "mio-extras", "openssl", "rand 0.7.3", - "sha-1", + "sha-1 0.8.2", "slab", "url", ] @@ -4447,6 +4832,12 @@ dependencies = [ "tap", ] +[[package]] +name = "yap" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc77f52dc9e9b10d55d3f4462c3b7fc393c4f17975d641542833ab2d3bc26ef" + [[package]] name = "zeroize" version = "1.5.7" diff --git a/scripts/run_e2e.sh b/scripts/run_e2e.sh index bf73c7d8a3..0515ff0b25 100755 --- a/scripts/run_e2e.sh +++ b/scripts/run_e2e.sh @@ -4,6 +4,6 @@ set -e cd e2e-tests/ -RUST_LOG=aleph_e2e_client=info,aleph-client=info cargo run -- --node 127.0.0.1:9943 +RUST_LOG=aleph_e2e_client=info,aleph-client=info cargo run -- --node ws://127.0.0.1:9944 --test-cases rewards_stake_change exit $? From a32b83a366a2940a0c69499d75412b5cd3f6096d Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Tue, 15 Nov 2022 14:36:06 +0100 Subject: [PATCH 02/24] fix --- scripts/run_e2e.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run_e2e.sh b/scripts/run_e2e.sh index 0515ff0b25..d717f9b398 100755 --- a/scripts/run_e2e.sh +++ b/scripts/run_e2e.sh @@ -4,6 +4,6 @@ set -e cd e2e-tests/ -RUST_LOG=aleph_e2e_client=info,aleph-client=info cargo run -- --node ws://127.0.0.1:9944 --test-cases rewards_stake_change +RUST_LOG=aleph_e2e_client=info,aleph-client=info cargo run -- --node ws://127.0.0.1:9944 exit $? From 2de3ccfda9a285c2693c0f15a66d2e0889a756ba Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Tue, 15 Nov 2022 15:43:02 +0100 Subject: [PATCH 03/24] fix --- .github/scripts/run_e2e_test.sh | 2 +- bin/cliain/src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/run_e2e_test.sh b/.github/scripts/run_e2e_test.sh index a1a2fcbbe7..bbe31c5d98 100755 --- a/.github/scripts/run_e2e_test.sh +++ b/.github/scripts/run_e2e_test.sh @@ -59,7 +59,7 @@ function set_randomized_test_params { ARGS=( --network "container:Node0" - -e NODE_URL="127.0.0.1:9943" + -e NODE_URL="ws://127.0.0.1:9943" -e RUST_LOG=info ) diff --git a/bin/cliain/src/main.rs b/bin/cliain/src/main.rs index acf923505e..2b231c6dc1 100644 --- a/bin/cliain/src/main.rs +++ b/bin/cliain/src/main.rs @@ -15,7 +15,7 @@ use log::{error, info}; #[clap(version = "1.0")] struct Config { /// WS endpoint address of the node to connect to - #[clap(long, default_value = "127.0.0.1:9944")] + #[clap(long, default_value = "ws://127.0.0.1:9944")] pub node: String, /// The seed of the key to use for signing calls. From d8752f4f1bffcd5b0c766514309679ca3f6093f7 Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Wed, 16 Nov 2022 09:59:54 +0100 Subject: [PATCH 04/24] fix --- e2e-tests/Cargo.lock | 1 + e2e-tests/Cargo.toml | 1 + e2e-tests/src/ban.rs | 4 ++-- e2e-tests/src/test/version_upgrade.rs | 2 +- e2e-tests/src/validators.rs | 27 ++++++++++++++++++--------- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/e2e-tests/Cargo.lock b/e2e-tests/Cargo.lock index 9a5d6b1db5..a70e1b0718 100644 --- a/e2e-tests/Cargo.lock +++ b/e2e-tests/Cargo.lock @@ -57,6 +57,7 @@ dependencies = [ "env_logger 0.8.4", "frame-support", "frame-system", + "futures", "hex", "log", "pallet-balances", diff --git a/e2e-tests/Cargo.toml b/e2e-tests/Cargo.toml index 9466585028..96477a5b5f 100644 --- a/e2e-tests/Cargo.toml +++ b/e2e-tests/Cargo.toml @@ -14,6 +14,7 @@ serde_json = "1.0" codec = { package = 'parity-scale-codec', version = "3.0", default-features = false, features = ['derive'] } rayon = "1.5" tokio = { version = "1.21.2", features = ["full"] } +futures = "0.3.25" sp-core = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28", default-features = false, features = ["full_crypto"] } sp-runtime = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28", default-features = false } diff --git a/e2e-tests/src/ban.rs b/e2e-tests/src/ban.rs index d87af6d08d..9a48ba165d 100644 --- a/e2e-tests/src/ban.rs +++ b/e2e-tests/src/ban.rs @@ -224,14 +224,14 @@ pub async fn check_underperformed_count_for_sessions( let session_underperformed_count = connection .get_underperformed_validator_session_count(val.clone(), session_end_block_hash) .await - .unwrap(); + .unwrap_or_default(); let previous_session_underperformed_count = connection .get_underperformed_validator_session_count( val.clone(), previous_session_end_block_hash, ) .await - .unwrap(); + .unwrap_or_default(); let underperformed_diff = session_underperformed_count.abs_diff(previous_session_underperformed_count); diff --git a/e2e-tests/src/test/version_upgrade.rs b/e2e-tests/src/test/version_upgrade.rs index 788443aca8..1f8fb03617 100644 --- a/e2e-tests/src/test/version_upgrade.rs +++ b/e2e-tests/src/test/version_upgrade.rs @@ -79,7 +79,7 @@ pub async fn schedule_doomed_version_change_and_verify_finalization_stopped( .await?; connection .connection - .wait_for_session(session_after_upgrade + 1, BlockStatus::Finalized) + .wait_for_session(session_after_upgrade + 1, BlockStatus::Best) .await; let last_finalized_block = diff --git a/e2e-tests/src/validators.rs b/e2e-tests/src/validators.rs index 5b3420f411..29b27c176a 100644 --- a/e2e-tests/src/validators.rs +++ b/e2e-tests/src/validators.rs @@ -6,6 +6,7 @@ use aleph_client::{ rpc::Rpc, AccountId, KeyPair, RawKeyPair, SignedConnection, TxStatus, }; +use futures::future::join_all; use primitives::{staking::MIN_VALIDATOR_BOND, TOKEN}; use crate::{accounts::get_validators_raw_keys, Config}; @@ -115,26 +116,34 @@ pub async fn prepare_validators(connection: &SignedConnection, node: &str, accou .await .unwrap(); + let mut handles = vec![]; for (stash, controller) in accounts .stash_raw_keys .iter() .zip(accounts.get_controller_accounts().iter()) { let connection = SignedConnection::new(node.to_string(), KeyPair::new(stash.clone())).await; - connection - .bond(MIN_VALIDATOR_BOND, controller.clone(), TxStatus::Finalized) - .await - .unwrap(); + let contr = controller.clone(); + handles.push(tokio::spawn(async move { + connection + .bond(MIN_VALIDATOR_BOND, contr, TxStatus::Finalized) + .await + .unwrap(); + })); } for controller in accounts.controller_raw_keys.iter() { let keys = connection.author_rotate_keys().await; let connection = SignedConnection::new(node.to_string(), KeyPair::new(controller.clone())).await; - connection - .set_keys(keys, TxStatus::Finalized) - .await - .unwrap(); - connection.validate(10, TxStatus::Finalized).await.unwrap(); + handles.push(tokio::spawn(async move { + connection + .set_keys(keys, TxStatus::Finalized) + .await + .unwrap(); + connection.validate(10, TxStatus::Finalized).await.unwrap(); + })); } + + join_all(handles).await; } From c550c39cd6f9297f3435f38eb9d9147f9b8d0056 Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Wed, 16 Nov 2022 10:40:05 +0100 Subject: [PATCH 05/24] fix --- scripts/catchup_version_upgrade_test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/catchup_version_upgrade_test.sh b/scripts/catchup_version_upgrade_test.sh index baeb1a3c5b..e62e57ef6b 100755 --- a/scripts/catchup_version_upgrade_test.sh +++ b/scripts/catchup_version_upgrade_test.sh @@ -163,6 +163,7 @@ ALL_NODES_PORTS=(${result[@]}) log "initializing nodes..." DOCKER_COMPOSE=./docker/docker-compose.bridged.yml ./.github/scripts/run_consensus.sh 1>&2 +sleep 10 log "awaiting finalization of $INIT_BLOCK blocks..." initialize $INIT_BLOCK "Node0" 9933 log "nodes initialized" From de9f7ecb375f681e470e93e781e1e72a70629809 Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Wed, 16 Nov 2022 10:52:34 +0100 Subject: [PATCH 06/24] fix --- aleph-client/src/connections.rs | 20 ++++++++------------ aleph-client/src/pallets/system.rs | 2 +- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/aleph-client/src/connections.rs b/aleph-client/src/connections.rs index 2fe9601d93..e82610a1e2 100644 --- a/aleph-client/src/connections.rs +++ b/aleph-client/src/connections.rs @@ -29,27 +29,23 @@ pub struct RootConnection { #[async_trait::async_trait] pub trait SudoCall { async fn sudo_unchecked(&self, call: Call, status: TxStatus) -> anyhow::Result; + async fn sudo(&self, call: Call, status: TxStatus) -> anyhow::Result; } #[async_trait::async_trait] impl SudoCall for RootConnection { async fn sudo_unchecked(&self, call: Call, status: TxStatus) -> anyhow::Result { - info!(target: "aleph-client", "sending call as sudo {:?}", call); + info!(target: "aleph-client", "sending call as sudo_unchecked {:?}", call); let sudo = api::tx().sudo().sudo_unchecked_weight(call, 0); - let progress = self - .connection - .client - .tx() - .sign_and_submit_then_watch_default(&sudo, &self.root) - .await?; + self.as_signed().send_tx(sudo, status).await + } - let hash = match status { - TxStatus::InBlock => progress.wait_for_in_block().await?.block_hash(), - TxStatus::Finalized => progress.wait_for_finalized_success().await?.block_hash(), - }; + async fn sudo(&self, call: Call, status: TxStatus) -> anyhow::Result { + info!(target: "aleph-client", "sending call as sudo {:?}", call); + let sudo = api::tx().sudo().sudo(call); - Ok(hash) + self.as_signed().send_tx(sudo, status).await } } diff --git a/aleph-client/src/pallets/system.rs b/aleph-client/src/pallets/system.rs index 3fe06640e6..f0931c9bec 100644 --- a/aleph-client/src/pallets/system.rs +++ b/aleph-client/src/pallets/system.rs @@ -35,7 +35,7 @@ impl SystemSudoApi for RootConnection { ratio: Perbill(SPerbill::from_percent(target_ratio_percent as u32).deconstruct()), }); - self.sudo_unchecked(call, status).await + self.sudo(call, status).await } } From 7b493d515f3a1dce8677695a8561f6efb8195a16 Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Thu, 17 Nov 2022 17:33:07 +0100 Subject: [PATCH 07/24] adjust flooder --- aleph-client/src/connections.rs | 2 + aleph-client/src/lib.rs | 1 + flooder/Cargo.lock | 4580 +++++++++++++++++++++++++++++++ flooder/Cargo.toml | 5 +- flooder/src/config.rs | 24 +- flooder/src/main.rs | 642 +---- flooder/src/ws_rpc_client.rs | 249 -- 7 files changed, 4712 insertions(+), 791 deletions(-) create mode 100644 flooder/Cargo.lock delete mode 100644 flooder/src/ws_rpc_client.rs diff --git a/aleph-client/src/connections.rs b/aleph-client/src/connections.rs index e82610a1e2..c3b8565f98 100644 --- a/aleph-client/src/connections.rs +++ b/aleph-client/src/connections.rs @@ -127,9 +127,11 @@ impl SignedConnection { .sign_and_submit_then_watch(&tx, &self.signer, params) .await?; + // In case of Submitted hash does not mean anything let hash = match status { TxStatus::InBlock => progress.wait_for_in_block().await?.block_hash(), TxStatus::Finalized => progress.wait_for_finalized_success().await?.block_hash(), + TxStatus::Submitted => H256::random(), }; info!(target: "aleph-client", "tx included in block {:?}", hash); diff --git a/aleph-client/src/lib.rs b/aleph-client/src/lib.rs index b6962ee172..bd39346ac6 100644 --- a/aleph-client/src/lib.rs +++ b/aleph-client/src/lib.rs @@ -34,6 +34,7 @@ pub use connections::{Connection, RootConnection, SignedConnection, SudoCall}; pub enum TxStatus { InBlock, Finalized, + Submitted, } pub fn keypair_from_string(seed: &str) -> KeyPair { diff --git a/flooder/Cargo.lock b/flooder/Cargo.lock new file mode 100644 index 0000000000..33e3f5d672 --- /dev/null +++ b/flooder/Cargo.lock @@ -0,0 +1,4580 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.8", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +dependencies = [ + "memchr", +] + +[[package]] +name = "aleph_client" +version = "2.0.0" +dependencies = [ + "anyhow", + "async-trait", + "contract-metadata 1.5.0", + "contract-transcode", + "frame-support", + "futures", + "hex", + "ink_metadata", + "log", + "parity-scale-codec", + "primitives", + "rayon", + "serde", + "serde_json", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "subxt", + "thiserror", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "anyhow" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +dependencies = [ + "nodrop", +] + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "async-lock" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" +dependencies = [ + "event-listener", + "futures-lite", +] + +[[package]] +name = "async-trait" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + +[[package]] +name = "base58" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b12e5fd123190ce1c2e559308a94c9bacad77907d4c6005d9e58fe1a0689e55e" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "blake2-rfc" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" +dependencies = [ + "arrayvec 0.4.12", + "constant_time_eq", +] + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array 0.12.4", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array 0.14.6", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array 0.14.6", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "brownstone" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "030ea61398f34f1395ccbeb046fb68c87b631d1f34567fed0f0f11fa35d18d8d" +dependencies = [ + "arrayvec 0.7.2", +] + +[[package]] +name = "bumpalo" +version = "3.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +dependencies = [ + "byteorder", + "iovec", +] + +[[package]] +name = "bytes" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" + +[[package]] +name = "bzip2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "cc" +version = "1.0.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a284da2e6fe2092f2353e51713435363112dfd60030e22add80be333fb928f" + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +dependencies = [ + "iana-time-zone", + "num-integer", + "num-traits", + "winapi 0.3.9", +] + +[[package]] +name = "clap" +version = "3.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +dependencies = [ + "atty", + "bitflags", + "clap_derive", + "clap_lex", + "indexmap", + "once_cell", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_derive" +version = "3.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "contract-metadata" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36318b44d658ee23a2daf66811822bdf6ac686aa534ea87eb9e16e7430ca6928" +dependencies = [ + "impl-serde", + "semver", + "serde", + "serde_json", + "url", +] + +[[package]] +name = "contract-metadata" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f25bdb57a728064a0e4909dfbb29957ebb06d205307e337d3b5596c7e67dd3a" +dependencies = [ + "impl-serde", + "semver", + "serde", + "serde_json", + "url", +] + +[[package]] +name = "contract-transcode" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfa6db9d18dd5ef92d29c52d30c8503c857d390d9e4043e12466f1490c43c05e" +dependencies = [ + "anyhow", + "contract-metadata 0.6.0", + "env_logger 0.9.3", + "escape8259", + "hex", + "indexmap", + "ink_env", + "ink_metadata", + "itertools", + "log", + "nom", + "nom-supreme", + "parity-scale-codec", + "scale-info", + "serde", + "serde_json", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" +dependencies = [ + "autocfg", + "cfg-if 1.0.0", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" +dependencies = [ + "generic-array 0.14.6", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array 0.14.6", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array 0.14.6", + "subtle", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array 0.14.6", + "subtle", +] + +[[package]] +name = "curve25519-dalek" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" +dependencies = [ + "byteorder", + "digest 0.8.1", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "cxx" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97abf9f0eca9e52b7f81b945524e76710e6cb2366aead23b7d4fbf72e281f888" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cc32cc5fea1d894b77d269ddb9f192110069a8a9c1f1d441195fba90553dea3" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca220e4794c934dc6b1207c3b42856ad4c302f2df1712e9f8d2eec5afaacf1f" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b846f081361125bfc8dc9d3940c84e1fd83ba54bbca7b17cd29483c828be0704" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.6", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer 0.10.3", + "crypto-common", + "subtle", +] + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "dyn-clonable" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" +dependencies = [ + "dyn-clonable-impl", + "dyn-clone", +] + +[[package]] +name = "dyn-clonable-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dyn-clone" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f94fa09c2aeea5b8839e414b7b841bf429fd25b9c522116ac97ee87856d88b2" + +[[package]] +name = "ecdsa" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" +dependencies = [ + "der", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek 3.2.0", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "either" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" + +[[package]] +name = "elliptic-curve" +version = "0.11.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" +dependencies = [ + "base16ct", + "crypto-bigint", + "der", + "ff", + "generic-array 0.14.6", + "group", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "env_logger" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "environmental" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" + +[[package]] +name = "escape8259" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba4f4911e3666fcd7826997b4745c8224295a6f3072f1418c3067b97a67557ee" +dependencies = [ + "rustversion", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + +[[package]] +name = "ff" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "fixed-hash" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "flate2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "flooder" +version = "0.2.1" +dependencies = [ + "aleph_client", + "anyhow", + "clap", + "env_logger 0.8.4", + "futures", + "hdrhistogram", + "log", + "mio 0.6.23", + "parity-scale-codec", + "serde_json", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "subxt", + "tokio", + "ws", + "zip", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "frame-metadata" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df6bb8542ef006ef0de09a5c4420787d79823c0ed7924225822362fd2bf2ff2d" +dependencies = [ + "cfg-if 1.0.0", + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "frame-support" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "bitflags", + "frame-metadata", + "frame-support-procedural", + "impl-trait-for-tuples", + "k256", + "log", + "once_cell", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "smallvec", + "sp-api", + "sp-arithmetic 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-core-hashing-proc-macro", + "sp-inherents", + "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-staking", + "sp-state-machine 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-tracing 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "tt-call", +] + +[[package]] +name = "frame-support-procedural" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "Inflector", + "frame-support-procedural-tools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "frame-support-procedural-tools-derive", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "frame-support-procedural-tools-derive" +version = "3.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +dependencies = [ + "bitflags", + "fuchsia-zircon-sys", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" + +[[package]] +name = "futures-executor" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" + +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" + +[[package]] +name = "futures-task" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" + +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + +[[package]] +name = "futures-util" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gimli" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" + +[[package]] +name = "group" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "hash-db" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "hdrhistogram" +version = "7.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" +dependencies = [ + "base64", + "byteorder", + "crossbeam-channel", + "flate2", + "nom", + "num-traits", +] + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac 0.8.0", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.1", + "digest 0.9.0", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array 0.14.6", + "hmac 0.8.1", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes 1.2.1", + "fnv", + "itoa", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "iana-time-zone" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "winapi 0.3.9", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-serde" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "indent_write" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cfe9645a18782869361d9c8732246be7b410ad4e919d3609ebabdac00ba12c3" + +[[package]] +name = "indexmap" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "ink_allocator" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c9588a59a0e8997c0b2153cd11b5aaa77c06a0537a6b18f3811d1f1aa098b12" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "ink_engine" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487c3b390b7feb0620496b0cd38683433c7d7e6946b1caabda51e1f23eb24b30" +dependencies = [ + "blake2", + "derive_more", + "parity-scale-codec", + "rand 0.8.5", + "secp256k1 0.24.1", + "sha2 0.10.6", + "sha3", +] + +[[package]] +name = "ink_env" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a891d34301a3dbb1c7b7424c49ae184282b163491c54f9acd17fcbe14a80447b" +dependencies = [ + "arrayref", + "blake2", + "cfg-if 1.0.0", + "derive_more", + "ink_allocator", + "ink_engine", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "num-traits", + "parity-scale-codec", + "paste", + "rand 0.8.5", + "rlibc", + "scale-info", + "secp256k1 0.24.1", + "sha2 0.10.6", + "sha3", + "static_assertions", +] + +[[package]] +name = "ink_metadata" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74913aaed5751f5615af4631b7559328b8ed56c9cb821b89e14af0706176e849" +dependencies = [ + "derive_more", + "impl-serde", + "ink_prelude", + "ink_primitives", + "scale-info", + "serde", +] + +[[package]] +name = "ink_prelude" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f031e6b8495594a7288b089bf4122e76c26b994959d1b2b693bdfe846b14c0e" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "ink_primitives" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12cf42dce81d060401c7cec95a392ad6d3c2f18661fa3083f619ce135133c33" +dependencies = [ + "cfg-if 1.0.0", + "ink_prelude", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" + +[[package]] +name = "joinery" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" + +[[package]] +name = "js-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jsonrpsee" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bd0d559d5e679b1ab2f869b486a11182923863b1b3ee8b421763cdd707b783a" +dependencies = [ + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8752740ecd374bcbf8b69f3e80b0327942df76f793f8d4e60d3355650c31fb74" +dependencies = [ + "futures-util", + "http", + "jsonrpsee-core", + "jsonrpsee-types", + "pin-project", + "rustls-native-certs", + "soketto", + "thiserror", + "tokio", + "tokio-rustls", + "tokio-util", + "tracing", + "webpki-roots", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3dc3e9cf2ba50b7b1d7d76a667619f82846caa39e8e8daa8a4962d74acaddca" +dependencies = [ + "anyhow", + "async-lock", + "async-trait", + "beef", + "futures-channel", + "futures-timer", + "futures-util", + "jsonrpsee-types", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e290bba767401b646812f608c099b922d8142603c9e73a50fb192d3ac86f4a0d" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "k256" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" +dependencies = [ + "cfg-if 1.0.0", + "ecdsa", + "elliptic-curve", + "sec1", +] + +[[package]] +name = "keccak" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3afef3b6eff9ce9d8ff9b3601125eec7f0c8cbac7abd14f355d053fa56c98768" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" + +[[package]] +name = "libsecp256k1" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" +dependencies = [ + "arrayref", + "base64", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.8.5", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "link-cplusplus" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +dependencies = [ + "cc", +] + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "matchers" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memory-db" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" +dependencies = [ + "hash-db", + "hashbrown", + "parity-util-mem", +] + +[[package]] +name = "memory_units" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" + +[[package]] +name = "merlin" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.6.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +dependencies = [ + "cfg-if 0.1.10", + "fuchsia-zircon", + "fuchsia-zircon-sys", + "iovec", + "kernel32-sys", + "libc", + "log", + "miow", + "net2", + "slab", + "winapi 0.2.8", +] + +[[package]] +name = "mio" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.42.0", +] + +[[package]] +name = "mio-extras" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" +dependencies = [ + "lazycell", + "log", + "mio 0.6.23", + "slab", +] + +[[package]] +name = "miow" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +dependencies = [ + "kernel32-sys", + "net2", + "winapi 0.2.8", + "ws2_32-sys", +] + +[[package]] +name = "net2" +version = "0.2.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "nom" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nom-supreme" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f909b25a8371ad5c054abc2c48205d677231e6a2dcbf83704ed57bb147f30e0" +dependencies = [ + "brownstone", + "indent_write", + "joinery", + "memchr", + "nom", +] + +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-format" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54b862ff8df690cf089058c98b183676a7ed0f974cc08b426800093227cbff3b" +dependencies = [ + "arrayvec 0.7.2", + "itoa", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl" +version = "0.10.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" +dependencies = [ + "bitflags", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "os_str_bytes" +version = "6.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5bf27447411e9ee3ff51186bf7a08e16c341efdde93f4d823e8844429bed7e" + +[[package]] +name = "parity-scale-codec" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a" +dependencies = [ + "arrayvec 0.7.2", + "bitvec", + "byte-slice-cast", + "bytes 1.2.1", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "parity-util-mem" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" +dependencies = [ + "cfg-if 1.0.0", + "hashbrown", + "impl-trait-for-tuples", + "parity-util-mem-derive", + "parking_lot", + "primitive-types", + "winapi 0.3.9", +] + +[[package]] +name = "parity-util-mem-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" +dependencies = [ + "proc-macro2", + "syn", + "synstructure", +] + +[[package]] +name = "parity-wasm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" + +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.42.0", +] + +[[package]] +name = "paste" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" + +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac 0.8.0", +] + +[[package]] +name = "pbkdf2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +dependencies = [ + "crypto-mac 0.11.1", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "primitive-types" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" +dependencies = [ + "fixed-hash", + "impl-codec", + "impl-serde", + "scale-info", + "uint", +] + +[[package]] +name = "primitives" +version = "0.5.0" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-staking", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", +] + +[[package]] +name = "proc-macro-crate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +dependencies = [ + "once_cell", + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.8", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rayon" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +dependencies = [ + "autocfg", + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "ref-cast" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b15debb4f9d60d767cd8ca9ef7abb2452922f3214671ff052defc7f3502c44" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abfa8511e9e94fd3de6585a3d3cd00e01ed556dc9814829280af0e8dc72a8f36" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "regex" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" + +[[package]] +name = "rfc6979" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" +dependencies = [ + "crypto-bigint", + "hmac 0.11.0", + "zeroize", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi 0.3.9", +] + +[[package]] +name = "rlibc" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc874b127765f014d792f16763a81245ab80500e2ad921ed4ee9e82481ee08fe" + +[[package]] +name = "rustc-demangle" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustls" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" +dependencies = [ + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +dependencies = [ + "base64", +] + +[[package]] +name = "rustversion" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" + +[[package]] +name = "ryu" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" + +[[package]] +name = "scale-bits" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd7aca73785181cc41f0bbe017263e682b585ca660540ba569133901d013ecf" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "scale-decode" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d823d4be477fc33321f93d08fb6c2698273d044f01362dc27573a750deb7c233" +dependencies = [ + "parity-scale-codec", + "scale-bits", + "scale-info", + "thiserror", +] + +[[package]] +name = "scale-info" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d8a765117b237ef233705cc2cc4c6a27fccd46eea6ef0c8c6dae5f3ef407f8" +dependencies = [ + "bitvec", + "cfg-if 1.0.0", + "derive_more", + "parity-scale-codec", + "scale-info-derive", + "serde", +] + +[[package]] +name = "scale-info-derive" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdcd47b380d8c4541044e341dcd9475f55ba37ddc50c908d945fc036a8642496" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "scale-value" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16a5e7810815bd295da73e4216d1dfbced3c7c7c7054d70fa5f6e4c58123fff4" +dependencies = [ + "either", + "frame-metadata", + "parity-scale-codec", + "scale-bits", + "scale-decode", + "scale-info", + "serde", + "thiserror", + "yap", +] + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys 0.36.1", +] + +[[package]] +name = "schnorrkel" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "curve25519-dalek 2.1.3", + "getrandom 0.1.16", + "merlin", + "rand 0.7.3", + "rand_core 0.5.1", + "sha2 0.8.2", + "subtle", + "zeroize", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "scratch" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "sec1" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" +dependencies = [ + "der", + "generic-array 0.14.6", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c42e6f1735c5f00f51e43e28d6634141f2bcad10931b2609ddd74a86d751260" +dependencies = [ + "secp256k1-sys 0.4.2", +] + +[[package]] +name = "secp256k1" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff55dc09d460954e9ef2fa8a7ced735a964be9981fd50e870b2b3b0705e14964" +dependencies = [ + "secp256k1-sys 0.6.1", +] + +[[package]] +name = "secp256k1-sys" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957da2573cde917463ece3570eab4a0b3f19de6f1646cde62e6fd3868f566036" +dependencies = [ + "cc", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +dependencies = [ + "cc", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha-1" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.6", +] + +[[package]] +name = "sha3" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" +dependencies = [ + "digest 0.10.6", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" +dependencies = [ + "digest 0.9.0", + "rand_core 0.6.4", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64", + "bytes 1.2.1", + "futures", + "httparse", + "log", + "rand 0.8.5", + "sha-1 0.9.8", +] + +[[package]] +name = "sp-api" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "sp-api-proc-macro", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-state-machine 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-version", + "thiserror", +] + +[[package]] +name = "sp-api-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "blake2", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-application-crypto" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acb4490364cb3b097a6755343e552495b0013778152300714be4647d107e9a2e" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-io 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sp-application-crypto" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", +] + +[[package]] +name = "sp-arithmetic" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31ef21f82cc10f75ed046b65e2f8048080ee76e59f1b8aed55c7150daebfd35b" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-debug-derive 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "static_assertions", +] + +[[package]] +name = "sp-arithmetic" +version = "5.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-debug-derive 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "static_assertions", +] + +[[package]] +name = "sp-core" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77963e2aa8fadb589118c3aede2e78b6c4bcf1c01d588fbf33e915b390825fbd" +dependencies = [ + "base58", + "bitflags", + "blake2-rfc", + "byteorder", + "dyn-clonable", + "ed25519-dalek", + "futures", + "hash-db", + "hash256-std-hasher", + "hex", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log", + "merlin", + "num-traits", + "parity-scale-codec", + "parity-util-mem", + "parking_lot", + "primitive-types", + "rand 0.7.3", + "regex", + "scale-info", + "schnorrkel", + "secp256k1 0.21.3", + "secrecy", + "serde", + "sp-core-hashing 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-debug-derive 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-externalities 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime-interface 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ss58-registry", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "wasmi", + "zeroize", +] + +[[package]] +name = "sp-core" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "base58", + "bitflags", + "blake2-rfc", + "byteorder", + "dyn-clonable", + "ed25519-dalek", + "futures", + "hash-db", + "hash256-std-hasher", + "hex", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log", + "merlin", + "num-traits", + "parity-scale-codec", + "parity-util-mem", + "parking_lot", + "primitive-types", + "rand 0.7.3", + "regex", + "scale-info", + "schnorrkel", + "secp256k1 0.24.1", + "secrecy", + "serde", + "sp-core-hashing 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-debug-derive 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-externalities 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-storage 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "ss58-registry", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "wasmi", + "zeroize", +] + +[[package]] +name = "sp-core-hashing" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec864a6a67249f0c8dd3d5acab43623a61677e85ff4f2f9b04b802d2fe780e83" +dependencies = [ + "blake2-rfc", + "byteorder", + "sha2 0.9.9", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tiny-keccak", + "twox-hash", +] + +[[package]] +name = "sp-core-hashing" +version = "4.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "blake2", + "byteorder", + "digest 0.10.6", + "sha2 0.10.6", + "sha3", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "twox-hash", +] + +[[package]] +name = "sp-core-hashing-proc-macro" +version = "5.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "proc-macro2", + "quote", + "sp-core-hashing 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "syn", +] + +[[package]] +name = "sp-debug-derive" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d676664972e22a0796176e81e7bec41df461d1edf52090955cdab55f2c956ff2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-debug-derive" +version = "4.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-externalities" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcfd91f92a2a59224230a77c4a5d6f51709620c0aab4e51f108ccece6adc56f" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sp-externalities" +version = "0.12.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-storage 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", +] + +[[package]] +name = "sp-inherents" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "thiserror", +] + +[[package]] +name = "sp-io" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "935fd3c71bad6811a7984cabb74d323b8ca3107024024c3eabb610e0182ba8d3" +dependencies = [ + "futures", + "hash-db", + "libsecp256k1", + "log", + "parity-scale-codec", + "parking_lot", + "secp256k1 0.21.3", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-externalities 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-keystore 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime-interface 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-state-machine 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-tracing 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-trie 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-wasm-interface 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-io" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "bytes 1.2.1", + "futures", + "hash-db", + "libsecp256k1", + "log", + "parity-scale-codec", + "parking_lot", + "secp256k1 0.24.1", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-externalities 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-keystore 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-state-machine 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-tracing 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-trie 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-wasm-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-keystore" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3261eddca8c8926e3e1de136a7980cb3afc3455247d9d6f3119d9b292f73aaee" +dependencies = [ + "async-trait", + "futures", + "merlin", + "parity-scale-codec", + "parking_lot", + "schnorrkel", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-externalities 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", +] + +[[package]] +name = "sp-keystore" +version = "0.12.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "async-trait", + "futures", + "merlin", + "parity-scale-codec", + "parking_lot", + "schnorrkel", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-externalities 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "thiserror", +] + +[[package]] +name = "sp-panic-handler" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2101f3c555fceafcfcfb0e61c55ea9ed80dc60bd77d54d9f25b369edb029e9a4" +dependencies = [ + "backtrace", + "lazy_static", + "regex", +] + +[[package]] +name = "sp-panic-handler" +version = "4.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "backtrace", + "lazy_static", + "regex", +] + +[[package]] +name = "sp-runtime" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb7d8a8d5ab5d349c6cf9300af1721b7b6446ba63401dbb11c10a1d65197aa5f" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "parity-util-mem", + "paste", + "rand 0.7.3", + "scale-info", + "serde", + "sp-application-crypto 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-io 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sp-runtime" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "parity-util-mem", + "paste", + "rand 0.7.3", + "scale-info", + "serde", + "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-arithmetic 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", +] + +[[package]] +name = "sp-runtime-interface" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "158bf0305c75a50fc0e334b889568f519a126e32b87900c3f4251202dece7b4b" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types", + "sp-externalities 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime-interface-proc-macro 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-tracing 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-wasm-interface 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "bytes 1.2.1", + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types", + "sp-externalities 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime-interface-proc-macro 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-storage 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-tracing 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-wasm-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ecb916b9664ed9f90abef0ff5a3e61454c1efea5861b2997e03f39b59b955f" +dependencies = [ + "Inflector", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "5.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "Inflector", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-staking" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", +] + +[[package]] +name = "sp-state-machine" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecee3b33eb78c99997676a571656bcc35db6886abecfddd13e76a73b5871c6c1" +dependencies = [ + "hash-db", + "log", + "num-traits", + "parity-scale-codec", + "parking_lot", + "rand 0.7.3", + "smallvec", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-externalities 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-panic-handler 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-trie 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", + "tracing", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-state-machine" +version = "0.12.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "hash-db", + "log", + "num-traits", + "parity-scale-codec", + "parking_lot", + "rand 0.7.3", + "smallvec", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-externalities 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-panic-handler 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-trie 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "thiserror", + "tracing", + "trie-root", +] + +[[package]] +name = "sp-std" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14804d6069ee7a388240b665f17908d98386ffb0b5d39f89a4099fc7a2a4c03f" + +[[package]] +name = "sp-std" +version = "4.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" + +[[package]] +name = "sp-storage" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dab53af846068e3e0716d3ccc70ea0db44035c79b2ed5821aaa6635039efa37" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sp-storage" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", +] + +[[package]] +name = "sp-tracing" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69a67e555d171c4238bd223393cda747dd20ec7d4f5fe5c042c056cb7fde9eda" +dependencies = [ + "parity-scale-codec", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-tracing" +version = "5.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "parity-scale-codec", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-trie" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6fc34f4f291886914733e083b62708d829f3e6b8d7a7ca7fa8a55a3d7640b0b" +dependencies = [ + "hash-db", + "memory-db", + "parity-scale-codec", + "scale-info", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-trie" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "hash-db", + "memory-db", + "parity-scale-codec", + "scale-info", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "thiserror", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-version" +version = "5.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "parity-wasm", + "scale-info", + "serde", + "sp-core-hashing-proc-macro", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-version-proc-macro", + "thiserror", +] + +[[package]] +name = "sp-version-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "parity-scale-codec", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-wasm-interface" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10d88debe690c2b24eaa9536a150334fcef2ae184c21a0e5b3e80135407a7d52" +dependencies = [ + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmi", +] + +[[package]] +name = "sp-wasm-interface" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "wasmi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "ss58-registry" +version = "1.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37a9821878e1f13aba383aa40a86fb1b33c7265774ec91e32563cb1dd1577496" +dependencies = [ + "Inflector", + "num-format", + "proc-macro2", + "quote", + "serde", + "serde_json", + "unicode-xid", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "substrate-bip39" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49eee6965196b32f882dd2ee85a92b1dbead41b04e53907f269de3b0dc04733c" +dependencies = [ + "hmac 0.11.0", + "pbkdf2 0.8.0", + "schnorrkel", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "subxt" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a8757ee0e19f87e722577282ab1386c86592a4b13ff963b9c6ec4176348104c" +dependencies = [ + "bitvec", + "derivative", + "frame-metadata", + "futures", + "hex", + "jsonrpsee", + "parity-scale-codec", + "parking_lot", + "scale-decode", + "scale-info", + "scale-value", + "serde", + "serde_json", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "subxt-macro", + "subxt-metadata", + "thiserror", + "tracing", +] + +[[package]] +name = "subxt-codegen" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb77f93e11e6ff3ff95fe33e3d24c27c342e16feca8ef47759993614ebe90d2c" +dependencies = [ + "darling", + "frame-metadata", + "heck", + "parity-scale-codec", + "proc-macro-error", + "proc-macro2", + "quote", + "scale-info", + "subxt-metadata", + "syn", +] + +[[package]] +name = "subxt-macro" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051cc21d77a54ae944b872eafdf9edfe1d9134fdfcfc3477dc10f763c76564a9" +dependencies = [ + "darling", + "proc-macro-error", + "subxt-codegen", + "syn", +] + +[[package]] +name = "subxt-metadata" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ed78d80db3a97d55e8b1cfecc1f6f9e21793a589d4e2e5f4fe2d6d5850c2e54" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "thiserror" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", +] + +[[package]] +name = "time" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi 0.3.9", +] + +[[package]] +name = "tiny-bip39" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +dependencies = [ + "anyhow", + "hmac 0.8.1", + "once_cell", + "pbkdf2 0.4.0", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +dependencies = [ + "autocfg", + "bytes 1.2.1", + "libc", + "memchr", + "mio 0.8.5", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "winapi 0.3.9", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes 1.2.1", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +dependencies = [ + "serde", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if 1.0.0", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "ansi_term", + "chrono", + "lazy_static", + "matchers", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", +] + +[[package]] +name = "trie-db" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32d034c0d3db64b43c31de38e945f15b40cd4ca6d2dcfc26d4798ce8de4ab83" +dependencies = [ + "hash-db", + "hashbrown", + "log", + "rustc-hex", + "smallvec", +] + +[[package]] +name = "trie-root" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" +dependencies = [ + "hash-db", +] + +[[package]] +name = "tt-call" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e66dcbec4290c69dd03c57e76c2469ea5c7ce109c6dd4351c13055cf71ea055" + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if 1.0.0", + "digest 0.10.6", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "uint" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a45526d29728d135c2900b0d30573fe3ee79fceb12ef534c7bb30e810a91b601" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "wasmi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca00c5147c319a8ec91ec1a0edbec31e566ce2c9cc93b3f9bb86a9efd0eb795d" +dependencies = [ + "downcast-rs", + "libc", + "memory_units", + "num-rational", + "num-traits", + "parity-wasm", + "wasmi-validation", +] + +[[package]] +name = "wasmi-validation" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "165343ecd6c018fc09ebcae280752702c9a2ef3e6f8d02f1cfcbdb53ef6d7937" +dependencies = [ + "parity-wasm", +] + +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" +dependencies = [ + "webpki", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi 0.3.9", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + +[[package]] +name = "ws" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25fe90c75f236a0a00247d5900226aea4f2d7b05ccc34da9e7a8880ff59b5848" +dependencies = [ + "byteorder", + "bytes 0.4.12", + "httparse", + "log", + "mio 0.6.23", + "mio-extras", + "openssl", + "rand 0.7.3", + "sha-1 0.8.2", + "slab", + "url", +] + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yap" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc77f52dc9e9b10d55d3f4462c3b7fc393c4f17975d641542833ab2d3bc26ef" + +[[package]] +name = "zeroize" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zip" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815" +dependencies = [ + "byteorder", + "bzip2", + "crc32fast", + "flate2", + "thiserror", + "time", +] diff --git a/flooder/Cargo.toml b/flooder/Cargo.toml index 92694e075b..514d608440 100644 --- a/flooder/Cargo.toml +++ b/flooder/Cargo.toml @@ -6,8 +6,6 @@ edition = "2021" license = "Apache 2.0" [dependencies] -substrate-api-client = { git = "https://github.com/Cardinal-Cryptography/substrate-api-client.git", branch = "aleph-v0.9.28" } - sp-core = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28", features = ["full_crypto"] } sp-runtime = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } @@ -23,6 +21,7 @@ env_logger = "0.8" futures = { version = "0.3", features = ["alloc"] } hdrhistogram = "7.3" log = "0.4" -rayon = "1.5" +subxt = "0.24.0" +tokio = { version = "1.21.2", features = ["full"] } aleph_client = { path = "../aleph-client" } diff --git a/flooder/src/config.rs b/flooder/src/config.rs index 3d6e4b84a6..48cc3ae413 100644 --- a/flooder/src/config.rs +++ b/flooder/src/config.rs @@ -6,7 +6,7 @@ use clap::Parser; #[clap(version = "1.0")] pub struct Config { /// URL address(es) of the nodes to send transactions to - #[clap(long, default_value = "127.0.0.1:9944")] + #[clap(long, default_value = "ws://127.0.0.1:9944")] pub nodes: Vec, /// how many transactions to send @@ -21,7 +21,7 @@ pub struct Config { #[clap(long, conflicts_with_all = &["phrase"])] pub seed: Option, - /// allows to skip accounts initialization process and just attempt to download their nonces + /// allows to skip accounts #[clap(long)] pub skip_initialization: bool, @@ -29,30 +29,10 @@ pub struct Config { #[clap(long, default_value = "0")] pub first_account_in_range: u64, - /// load transactions from file or generate ad-hoc - #[clap(long)] - pub load_txs: bool, - - /// path to encoded txs - #[clap(long)] - pub tx_store_path: Option, - - /// number of threads spawn during the flooding process - #[clap(long)] - pub threads: Option, - - /// allows to download nonces instead of using zeros for each account - #[clap(long)] - pub download_nonces: bool, - /// changes the awaited status of every transaction from `SubmitOnly` to `Ready` #[clap(long)] pub wait_for_ready: bool, - /// store txs after generation - #[clap(long)] - pub store_txs: bool, - /// How many transactions to put in the interval #[clap(long)] pub transactions_in_interval: Option, diff --git a/flooder/src/main.rs b/flooder/src/main.rs index a932b45888..7b4eaba125 100644 --- a/flooder/src/main.rs +++ b/flooder/src/main.rs @@ -1,41 +1,109 @@ -use std::{ - convert::TryInto, - io::{Read, Write}, - iter::{once, repeat}, - path::Path, - sync::{Arc, Mutex}, - thread, - time::{Duration, Instant}, -}; +use std::time::Duration; -use aleph_client::{create_custom_connection, Extrinsic}; +use aleph_client::{ + account_from_keypair, pallets::balances::BalanceUserApi, raw_keypair_from_string, AccountId, + KeyPair, SignedConnection, TxStatus, +}; use clap::Parser; -use codec::{Compact, Decode, Encode}; use config::Config; -use hdrhistogram::Histogram as HdrHistogram; -use log::{debug, info}; -use rayon::prelude::*; -use sp_core::{sr25519, Pair}; -use sp_runtime::{generic, traits::BlakeTwo256, MultiAddress, OpaqueExtrinsic}; -use substrate_api_client::{ - compose_call, compose_extrinsic_offline, AccountId, Api, GenericAddress, - PlainTipExtrinsicParams, XtStatus, -}; -use ws_rpc_client::WsRpcClient; +use futures::future::join_all; +use log::info; +use subxt::ext::sp_core::{sr25519, Pair}; +use tokio::{time, time::sleep}; mod config; -mod ws_rpc_client; -type TransferTransaction = Extrinsic<([u8; 2], MultiAddress, codec::Compact)>; -type BlockNumber = u32; -type Header = generic::Header; -type Block = generic::Block; -type Nonce = u32; -type Connection = Api; +async fn flood( + connections: Vec, + dest: AccountId, + transfer_amount: u128, + tx_count: u64, + rate_limiting: Option<(u64, u64)>, + status: TxStatus, +) -> anyhow::Result<()> { + let handles: Vec<_> = connections + .into_iter() + .map(|conn| { + let dest = dest.clone(); + let rl = rate_limiting.clone(); + tokio::spawn(async move { + let (time, (tx_count, round_count)) = match rl { + Some((tx_in_interval, interval_secs)) => ( + interval_secs, + (tx_in_interval, (tx_count + tx_in_interval) / tx_in_interval), + ), + _ => (0, (tx_count, 1)), + }; + + for i in 0..round_count { + info!("starting round #{}", i); + let start = time::Instant::now(); + + info!("sending #{} transactions", tx_count); + for _ in 0..tx_count { + conn.transfer(dest.clone(), transfer_amount, status) + .await + .unwrap(); + } + + let dur = time::Instant::now().saturating_duration_since(start); + + let left_duration = Duration::from_secs(time).saturating_sub(dur); + + info!("sleeping for {}ms", left_duration.as_millis()); + sleep(left_duration).await; + } + }) + }) + .collect(); + + join_all(handles).await; + + Ok(()) +} + +async fn initialize_n_accounts String>( + connection: SignedConnection, + n: u32, + node: F, + account_balance: u128, + skip: bool, +) -> Vec { + let mut connections = vec![]; + for i in 0..n { + let seed = i.to_string(); + let signer = KeyPair::new(raw_keypair_from_string(&("//".to_string() + &seed))); + connections.push(SignedConnection::new(node(i), signer).await); + } -fn main() -> Result<(), anyhow::Error> { - let time_stats = Instant::now(); + if skip { + return connections; + } + for conn in connections.iter() { + connection + .transfer( + conn.signer.account_id().clone(), + account_balance, + TxStatus::Submitted, + ) + .await + .unwrap(); + } + connection + .transfer( + connection.signer.account_id().clone(), + 1, + TxStatus::Finalized, + ) + .await + .unwrap(); + + connections +} + +#[tokio::main(flavor = "multi_thread")] +async fn main() -> anyhow::Result<()> { env_logger::init(); let config: Config = Config::parse(); info!("Starting benchmark with config {:#?}", &config); @@ -44,258 +112,20 @@ fn main() -> Result<(), anyhow::Error> { if !config.skip_initialization && config.phrase.is_none() && config.seed.is_none() { panic!("Needs --phrase or --seed"); } + + let tx_count = config.transactions; + let accounts = (tx_count + 1) / 100; + let tx_per_account = 100; let rate_limiting = match (config.transactions_in_interval, config.interval_secs) { (Some(tii), Some(is)) => Some((tii, is)), (None, None) => None, _ => panic!("--transactions-in-interval needs to be specified with --interval-secs"), }; let tx_status = match config.wait_for_ready { - true => XtStatus::Ready, - false => XtStatus::SubmitOnly, - }; - info!( - "initializing thread-pool: {}ms", - time_stats.elapsed().as_millis() - ); - let mut thread_pool_builder = rayon::ThreadPoolBuilder::new(); - if let Some(threads) = config.threads { - let threads = threads.try_into().expect("`threads` within usize range"); - thread_pool_builder = thread_pool_builder.num_threads(threads); - } - let thread_pool = thread_pool_builder - .build() - .expect("thread-pool should be created"); - - info!( - "thread-pool initialized: {}ms", - time_stats.elapsed().as_millis() - ); - let threads = thread_pool.current_num_threads(); - info!("thread-pool reported {} threads", threads); - // each thread should have its own connection - info!( - "creating connection-pool: {}ms", - time_stats.elapsed().as_millis() - ); - let pool = create_connection_pool(&config.nodes, threads); - info!( - "connection-pool created: {}ms", - time_stats.elapsed().as_millis() - ); - let connection = pool.get(0).unwrap().get(0).unwrap().clone(); - - info!( - "preparing transactions: {}ms", - time_stats.elapsed().as_millis() - ); - let txs = thread_pool.install(|| prepare_txs(&config, &connection)); - info!( - "transactions prepared: {}ms", - time_stats.elapsed().as_millis() - ); - - let histogram = Arc::new(Mutex::new( - HdrHistogram::::new_with_bounds(1, u64::MAX, 3).unwrap(), - )); - - let (transactions_in_interval, interval_duration) = rate_limiting.map_or( - (txs.len(), Duration::from_secs(0)), - |(transactions_in_interval, secs)| { - ( - transactions_in_interval - .try_into() - .expect("`transactions_in_interval` should be within usize range"), - Duration::from_secs(secs), - ) - }, - ); - - let pool_getter = |thread_id: ThreadId, tx_ix: usize| { - pool.get(thread_id % pool.len()) - .and_then(|threads_pool| threads_pool.get(tx_ix % threads_pool.len())) - .unwrap() - }; - - info!("flooding: {}ms", time_stats.elapsed().as_millis()); - let tick = Instant::now(); - - flood( - pool_getter, - txs, - tx_status, - &histogram, - transactions_in_interval, - interval_duration, - &thread_pool, - ); - - let tock = tick.elapsed().as_millis(); - let histogram = histogram.lock().unwrap(); - - println!( - "Summary:\n\ - TransferTransactions sent: {}\n\ - Total time: {} ms\n\ - Slowest tx: {} ms\n\ - Fastest tx: {} ms\n\ - Average: {:.1} ms\n\ - Throughput: {:.1} tx/s", - histogram.len(), - tock, - histogram.max(), - histogram.min(), - histogram.mean(), - 1000.0 * histogram.len() as f64 / tock as f64 - ); - - Ok(()) -} - -type ThreadId = usize; - -fn flood<'a>( - pool: impl Fn(ThreadId, usize) -> &'a Connection + Sync, - txs: Vec, - status: XtStatus, - histogram: &Arc>>, - transactions_in_interval: usize, - interval_duration: Duration, - thread_pool: &rayon::ThreadPool, -) { - let mut current_start_ix = 0; - thread_pool.install(|| { - txs - .chunks(transactions_in_interval) - .enumerate() - .for_each(|(interval_idx, interval)| { - let start = Instant::now(); - info!("Starting {} interval", interval_idx); - - let interval_len = interval.len(); - - interval. - into_par_iter() - .enumerate() - .map(|(tx_ix, tx)| (tx_ix + current_start_ix, tx)) - .for_each(|(tx_ix, tx)| { - const DEFAULT_THREAD_ID: usize = 0; - let thread_id = thread_pool.current_thread_index().unwrap_or(DEFAULT_THREAD_ID); - send_tx( - pool(thread_id, tx_ix), - tx, - status, - Arc::clone(histogram), - ); - }); - - let exec_time = start.elapsed(); - - if let Some(remaining_time) = interval_duration.checked_sub(exec_time) { - debug!("Sleeping for {}ms", remaining_time.as_millis()); - thread::sleep(remaining_time); - } else { - debug!( - "Execution for interval {} was slower than desired the target {}ms, was {}ms", - interval_idx, - interval_duration.as_millis(), - exec_time.as_millis() - ); - } - current_start_ix += interval_len; - }); - }); -} - -fn estimate_tx_fee(connection: &Connection, tx: &TransferTransaction) -> u128 { - let block = connection.get_block::(None).unwrap().unwrap(); - let block_hash = block.header.hash(); - let fee = connection - .get_fee_details(&tx.hex_encode(), Some(block_hash)) - .unwrap() - .unwrap(); - - let inclusion_fee = fee.inclusion_fee.unwrap(); - - fee.tip + inclusion_fee.base_fee + inclusion_fee.len_fee + inclusion_fee.adjusted_weight_fee -} - -fn load_transactions(file_path: impl AsRef) -> Vec { - let zipfile = std::fs::File::open(file_path).expect("Missing file with txs"); - let mut archive = zip::ZipArchive::new(zipfile).expect("Zipfile is not properly created"); - assert!(archive.len() == 1, "There should be one file with txs"); - - let mut file = archive.by_index(0).unwrap(); - let mut bytes = Vec::with_capacity(file.size() as usize); - file.read_to_end(&mut bytes).expect("buffer overflow"); - - Vec::::decode(&mut &bytes[..]).expect("Error while decoding txs") -} - -fn prepare_txs(config: &Config, connection: &Connection) -> Vec { - match config.load_txs { - true => { - let path = match &config.tx_store_path { - Some(path) => path, - None => panic!("tx_store_path is not set"), - }; - load_transactions(path) - } - false => generate_txs(config, connection), - } -} - -fn generate_txs(config: &Config, connection: &Connection) -> Vec { - let tx_store_path = match (config.store_txs, &config.tx_store_path) { - (true, None) => panic!("tx_store_path is not set"), - (true, path) => path, - (false, _) => &None, + true => TxStatus::InBlock, + false => TxStatus::Submitted, }; - let first_account_in_range = config.first_account_in_range; - let total_users = config.transactions; - let transfer_amount = 1u128; - let initialize_accounts_flag = !config.skip_initialization; - let accounts = (first_account_in_range..first_account_in_range + total_users) - .into_par_iter() - .map(derive_user_account) - .collect::>(); - - if initialize_accounts_flag { - initialize_accounts(config, connection, transfer_amount, &accounts); - } - - let nonces: Vec<_> = match config.download_nonces { - false => repeat(0).take(accounts.len()).collect(), - true => accounts - .par_iter() - .map(|account| get_nonce(connection, &AccountId::from(account.public()))) - .collect(), - }; - let receiver = accounts - .first() - .expect("we should have some accounts available for this test, but the list is empty") - .clone(); - let txs: Vec<_> = sign_transactions( - connection, - receiver, - accounts.into_par_iter().zip(nonces), - transfer_amount, - ) - .collect(); - - if let Some(tx_store_path) = tx_store_path { - zip_and_store_txs(&txs, tx_store_path); - } - - txs -} - -fn initialize_accounts( - config: &Config, - connection: &Connection, - transfer_amount: u128, - accounts: &[sr25519::Pair], -) { let account = match &config.phrase { Some(phrase) => { sr25519::Pair::from_phrase(&config::read_phrase(phrase.clone()), None) @@ -308,251 +138,29 @@ fn initialize_accounts( ) .unwrap(), }; - let source_account_id = AccountId::from(account.public()); - let source_account_nonce = get_nonce(connection, &source_account_id); - let total_amount = estimate_amount(connection, &account, source_account_nonce, transfer_amount); - - assert!( - get_funds(connection, &source_account_id) - .ge(&(total_amount * u128::from(config.transactions))), - "Account is too poor" - ); - - initialize_accounts_on_chain( - connection, - &account, - source_account_nonce, - accounts, - total_amount, - ); - debug!("all accounts have received funds"); -} - -fn sign_tx( - connection: &Connection, - signer: &sr25519::Pair, - nonce: Nonce, - to: &AccountId, - amount: u128, -) -> TransferTransaction { - let call = compose_call!( - connection.metadata, - "Balances", - "transfer", - GenericAddress::Id(to.clone()), - Compact(amount) - ); - - compose_extrinsic_offline!(signer, call, connection.extrinsic_params(nonce)) -} - -/// prepares payload for flooding -fn sign_transactions<'a>( - connection: &'a Connection, - account: sr25519::Pair, - users_and_nonces: impl IntoParallelIterator + 'a, - transfer_amount: u128, -) -> impl ParallelIterator + 'a { - let to = AccountId::from(account.public()); - // NOTE : assumes one tx per derived user account - // but we could create less accounts and send them round robin fashion - // (will need to seed them with more funds as well, tx_per_account times more to be exact) - users_and_nonces - .into_par_iter() - .map(move |(from, nonce)| sign_tx(connection, &from, nonce, &to, transfer_amount)) -} - -fn estimate_amount( - connection: &Connection, - account: &sr25519::Pair, - account_nonce: u32, - transfer_amount: u128, -) -> u128 { - let existential_deposit = connection.get_existential_deposit().unwrap(); - // start with a heuristic tx fee - let total_amount = existential_deposit + (transfer_amount + 375_000_000); - - let tx = sign_tx( - connection, - account, - account_nonce, - &AccountId::from(account.public()), - total_amount, - ); - - // estimate fees - let tx_fee = estimate_tx_fee(connection, &tx); - info!("Estimated transfer tx fee {}", tx_fee); - // adjust with estimated tx fee - existential_deposit + (transfer_amount + tx_fee) -} - -fn initialize_accounts_on_chain( - connection: &Connection, - source_account: &sr25519::Pair, - mut source_account_nonce: u32, - accounts: &[sr25519::Pair], - total_amount: u128, -) { - // NOTE: use a new connection for the last transaction. - // This is a workaround for issues with accounts initialization using our hacky - // single-threaded WsRpcClient. It seems like `subscriptions` - // for all `wait-until-Ready` transactions should be cancelled, - // otherwise they are producing a lot of noise, which can be incorrectly - // interpreted by the `substrate-api-client` library. Creating a separate - // connection for the last `wait-until-Finalized` transaction should `partially` - // fix this issue. - let conn_copy = connection.clone(); - let connections = repeat(connection) - .take(accounts.len() - 1) - .chain(once(&conn_copy)); - // ensure all txs are finalized by waiting for the last one sent - let status = repeat(XtStatus::Ready) - .take(accounts.len() - 1) - .chain(once(XtStatus::Finalized)); - for ((derived, status), connection) in accounts.iter().zip(status).zip(connections) { - source_account_nonce = initialize_account( - connection, - source_account, - source_account_nonce, - derived, - total_amount, - status, - ); - } -} - -fn initialize_account( - connection: &Connection, - account: &sr25519::Pair, - account_nonce: Nonce, - derived: &sr25519::Pair, - total_amount: u128, - status: XtStatus, -) -> Nonce { - let tx = sign_tx( - connection, - account, - account_nonce, - &AccountId::from(derived.public()), - total_amount, - ); - - info!("sending funds to account {}", &derived.public()); - - let hash = connection - .send_extrinsic(tx.hex_encode(), status) - .expect("Could not send transaction"); + let main_connection = + SignedConnection::new(config.nodes[0].to_string(), KeyPair::new(account.clone())).await; - info!( - "account {} will receive funds, tx hash {:?}", - &derived.public(), - hash - ); + let nodes = config.nodes.clone(); - account_nonce + 1 -} - -fn derive_user_account(seed: u64) -> sr25519::Pair { - debug!("deriving an account from seed={}", seed); - let seed = seed.to_string(); - sr25519::Pair::from_string(&("//".to_string() + &seed), None).unwrap() -} - -fn send_tx( - connection: &Connection, - tx: &Extrinsic, - status: XtStatus, - histogram: Arc>>, -) where - Call: Encode, -{ - let start_time = Instant::now(); - - connection - .send_extrinsic(tx.hex_encode(), status) - .expect("Could not send transaction"); - - let elapsed_time = start_time.elapsed().as_millis(); - - let mut hist = histogram.lock().unwrap(); - *hist += elapsed_time as u64; -} - -fn create_connection_pool(nodes: &[String], threads: usize) -> Vec> { - repeat(nodes) - .cycle() - .take(threads) - .map(|urls| { - urls.iter() - .map(|url| { - create_custom_connection(url).expect("it should return initialized connection") - }) - .collect() - }) - .collect() -} - -fn get_nonce(connection: &Connection, account: &AccountId) -> u32 { - connection - .get_account_info(account) - .map(|acc_opt| acc_opt.map_or_else(|| 0, |acc| acc.nonce)) - .expect("retrieved nonce's value") -} - -fn get_funds(connection: &Connection, account: &AccountId) -> u128 { - match connection.get_account_data(account).unwrap() { - Some(data) => data.free, - None => 0, - } -} - -fn zip_and_store_txs(txs: &[TransferTransaction], path: impl AsRef) { - let file = std::fs::File::create(path).unwrap(); - let mut zip = zip::ZipWriter::new(file); - let options = - zip::write::FileOptions::default().compression_method(zip::CompressionMethod::Deflated); - zip.start_file("tx_store", options) - .expect("Failed to initialize accounts"); - zip.write_all(&txs.encode()) - .expect("Failed to store encoded bytes"); - zip.finish().expect("Failed to zip the encoded txs"); -} - -#[cfg(test)] -mod tests { - use super::*; - - #[ignore] // requires access to a chain - #[test] - fn write_read_txs() { - env_logger::init(); - - let url = "127.0.0.1:9944".to_string(); - let mut config = Config { - nodes: vec![url.clone()], - transactions: 313, - phrase: None, - seed: None, - skip_initialization: true, - first_account_in_range: 0, - load_txs: false, - tx_store_path: Some("/tmp/tx_store".to_string()), - threads: None, - download_nonces: false, - wait_for_ready: false, - store_txs: true, - interval_secs: None, - transactions_in_interval: None, - }; - let conn = create_custom_connection(&url).unwrap(); - - let txs_gen = prepare_txs(&config, &conn); - - config.load_txs = true; + let connections = initialize_n_accounts( + main_connection, + accounts as u32, + |i| nodes[i as usize % nodes.len()].clone(), + tx_per_account + tx_per_account * 10_000, + config.skip_initialization, + ) + .await; - let txs_read = prepare_txs(&config, &conn); + flood( + connections, + account_from_keypair(&account), + 1, + tx_per_account as u64, + rate_limiting, + tx_status, + ) + .await?; - assert!(txs_gen == txs_read) - } + Ok(()) } diff --git a/flooder/src/ws_rpc_client.rs b/flooder/src/ws_rpc_client.rs deleted file mode 100644 index 21dd16c6a3..0000000000 --- a/flooder/src/ws_rpc_client.rs +++ /dev/null @@ -1,249 +0,0 @@ -use std::{ - sync::{mpsc::channel, Arc, Mutex}, - thread, - thread::JoinHandle, -}; - -use aleph_client::FromStr; -use log::info; -use serde_json::Value; -use sp_core::H256 as Hash; -use substrate_api_client::{ - rpc::{ - json_req, - ws_client::{ - on_extrinsic_msg_submit_only, on_extrinsic_msg_until_broadcast, - on_extrinsic_msg_until_finalized, on_extrinsic_msg_until_in_block, - on_extrinsic_msg_until_ready, on_get_request_msg, OnMessageFn, RpcClient, - }, - }, - ApiClientError, ApiResult, FromHexString, RpcClient as RpcClientTrait, XtStatus, -}; -use ws::{ - connect, Error as WsError, ErrorKind, Handler, Message, Result as WsResult, Sender as WsSender, -}; - -// It attempts to run a single thread with a single WebSocket connection that processes all outgoing requests. -// The upstream approach is to open a new socket for every request, but the number of sockets ends -// up being the bottleneck for flooding, so we need to do it better. -pub struct WsRpcClient { - mux: Mutex<()>, - next_handler: Arc>>, - join_handle: Option>>, - out: WsSender, - url: String, -} - -impl WsRpcClient { - pub fn new(url: &str) -> Result { - let RunningRpcClient { - ws_sender, - client_handle, - client, - } = start_rpc_client_thread(url.to_string())?; - - Ok(WsRpcClient { - next_handler: client, - join_handle: Some(client_handle), - out: ws_sender, - mux: Mutex::new(()), - url: url.to_string(), - }) - } -} - -impl Clone for WsRpcClient { - fn clone(&self) -> Self { - Self::new(&self.url).unwrap() - } -} - -impl Drop for WsRpcClient { - fn drop(&mut self) { - self.close(); - } -} - -impl RpcClientTrait for WsRpcClient { - fn get_request(&self, jsonreq: Value) -> ApiResult { - let _mux = self.mux.lock(); - - Ok(self.get(jsonreq.to_string())?) - } - - fn send_extrinsic( - &self, - xthex_prefixed: String, - exit_on: XtStatus, - ) -> ApiResult> { - let _mux = self.mux.lock(); - - let jsonreq = match exit_on { - XtStatus::SubmitOnly => json_req::author_submit_extrinsic(&xthex_prefixed).to_string(), - _ => json_req::author_submit_and_watch_extrinsic(&xthex_prefixed).to_string(), - }; - - let result = match exit_on { - XtStatus::Finalized => { - let res = self.send_extrinsic_and_wait_until_finalized(jsonreq)?; - info!("finalized: {}", res); - Ok(Some(Hash::from_hex(res)?)) - } - XtStatus::InBlock => { - let res = self.send_extrinsic_and_wait_until_in_block(jsonreq)?; - info!("inBlock: {}", res); - Ok(Some(Hash::from_hex(res)?)) - } - XtStatus::Broadcast => { - let res = self.send_extrinsic_and_wait_until_broadcast(jsonreq)?; - info!("broadcast: {}", res); - Ok(None) - } - XtStatus::Ready => { - let res = self.send_extrinsic_until_ready(jsonreq)?; - info!("ready: {}", res); - Ok(None) - } - XtStatus::SubmitOnly => { - let res = self.send_extrinsic(jsonreq)?; - info!("submitted xt: {}", res); - Ok(None) - } - _ => Err(ApiClientError::UnsupportedXtStatus(exit_on)), - }; - - self.set_next_handler(None); - result - } -} - -impl FromStr for WsRpcClient { - type Err = String; - - fn from_str(url: &str) -> Result { - WsRpcClient::new(url) - } -} - -impl WsRpcClient { - fn get(&self, json_req: String) -> WsResult { - self.send_rpc_request(json_req, on_get_request_msg) - } - - fn send_extrinsic(&self, json_req: String) -> WsResult { - self.send_rpc_request(json_req, on_extrinsic_msg_submit_only) - } - - fn send_extrinsic_until_ready(&self, json_req: String) -> WsResult { - self.send_rpc_request(json_req, on_extrinsic_msg_until_ready) - } - - fn send_extrinsic_and_wait_until_broadcast(&self, json_req: String) -> WsResult { - self.send_rpc_request(json_req, on_extrinsic_msg_until_broadcast) - } - - fn send_extrinsic_and_wait_until_in_block(&self, json_req: String) -> WsResult { - self.send_rpc_request(json_req, on_extrinsic_msg_until_in_block) - } - - fn send_extrinsic_and_wait_until_finalized(&self, json_req: String) -> WsResult { - self.send_rpc_request(json_req, on_extrinsic_msg_until_finalized) - } - - // FIXME: - // here we are using a deprecated `mio::channel::sync_channel` instead of the - // now-recommended `mio-extras` channel, because the ws library (in the latest version) - // is not yet updated to use the `mio-extras` version (and no conversion exists). - // We need to change it to `mio-extras` as soon as `ws` is updated. - #[allow(deprecated)] - fn send_rpc_request(&self, jsonreq: String, on_message_fn: OnMessageFn) -> WsResult { - // ws_sender below is used by the RpcClient while being executed by another thread, - // but we don't want it actually to do anything, since we are sending the given request here - // 1 used by `on_open` of RpcClient + 1 for `close` - const MAGIC_SEND_CONST: usize = 2; - let (ws_tx, _ws_rx) = mio::channel::sync_channel(MAGIC_SEND_CONST); - let ws_sender = ws::Sender::new(0.into(), ws_tx, 0); - - let (result_in, result_out) = channel(); - let rpc_client = RpcClient { - out: ws_sender, - request: jsonreq.clone(), - result: result_in, - on_message_fn, - }; - self.set_next_handler(Some(rpc_client)); - self.out.send(jsonreq)?; - let res = result_out.recv().map_err(|err| { - WsError::new( - ErrorKind::Custom(Box::new(err)), - "unable to read an answer from the `result_out` channel", - ) - })?; - self.set_next_handler(None); - WsResult::Ok(res) - } - - pub fn close(&mut self) { - self.out - .shutdown() - .expect("unable to send close on the WebSocket"); - self.join_handle - .take() - .map(|handle| handle.join().expect("unable to join WebSocket's thread")); - } - - fn set_next_handler(&self, handler: Option) { - *self - .next_handler - .lock() - .expect("unable to acquire a lock on RpcClient") = handler; - } -} - -struct RunningRpcClient { - ws_sender: WsSender, - client_handle: JoinHandle>, - client: Arc>>, -} - -fn start_rpc_client_thread(url: String) -> Result { - let (tx, rx) = std::sync::mpsc::sync_channel(0); - let rpc_client = Arc::new(Mutex::new(None)); - let connect_rpc_client = Arc::clone(&rpc_client); - let join = thread::Builder::new() - .name("client".to_owned()) - .spawn(|| -> WsResult<()> { - connect(url, move |out| { - tx.send(out).expect("main thread was already stopped"); - WsHandler { - next_handler: connect_rpc_client.clone(), - } - }) - }) - .map_err(|_| "unable to spawn WebSocket's thread")?; - let out = rx.recv().map_err(|_| "WebSocket's unexpectedly died")?; - Ok(RunningRpcClient { - ws_sender: out, - client_handle: join, - client: rpc_client, - }) -} - -struct WsHandler { - next_handler: Arc>>, -} - -impl Handler for WsHandler { - fn on_message(&mut self, msg: Message) -> WsResult<()> { - if let Some(handler) = self - .next_handler - .lock() - .expect("main thread probably died") - .as_mut() - { - handler.on_message(msg) - } else { - Ok(()) - } - } -} From 5c6671c1efa590ac3992422780647802b1a363bf Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Thu, 17 Nov 2022 17:35:26 +0100 Subject: [PATCH 08/24] fix test --- scripts/catchup_version_upgrade_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/catchup_version_upgrade_test.sh b/scripts/catchup_version_upgrade_test.sh index e62e57ef6b..2481cf3cfb 100755 --- a/scripts/catchup_version_upgrade_test.sh +++ b/scripts/catchup_version_upgrade_test.sh @@ -46,7 +46,7 @@ function get_best_finalized { local validator=$1 local rpc_port=$2 - local best_finalized=$(VALIDATOR=$validator RPC_HOST="127.0.0.1" RPC_PORT=$rpc_port ./.github/scripts/check_finalization.sh | sed 's/Last finalized block number: "\(.*\)"/\1/') + local best_finalized=$(VALIDATOR=$validator RPC_HOST="ws://127.0.0.1" RPC_PORT=$rpc_port ./.github/scripts/check_finalization.sh | sed 's/Last finalized block number: "\(.*\)"/\1/') printf "%d" $best_finalized } @@ -58,7 +58,7 @@ function set_upgrade_session { local seed=$5 local status=$6 - docker run --rm --network container:$validator cliain:latest --node 127.0.0.1:$port --seed $seed version-upgrade-schedule --version $version --session $session --expected-state $status + docker run --rm --network container:$validator cliain:latest --node ws://127.0.0.1:$port --seed $seed version-upgrade-schedule --version $version --session $session --expected-state $status } function check_if_disconnected() { From 3c3d2369a0ef365151ff33cda5979b30c9d62690 Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Thu, 17 Nov 2022 18:12:45 +0100 Subject: [PATCH 09/24] clippy --- flooder/src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flooder/src/main.rs b/flooder/src/main.rs index 7b4eaba125..f9c1b8c9c5 100644 --- a/flooder/src/main.rs +++ b/flooder/src/main.rs @@ -25,9 +25,8 @@ async fn flood( .into_iter() .map(|conn| { let dest = dest.clone(); - let rl = rate_limiting.clone(); tokio::spawn(async move { - let (time, (tx_count, round_count)) = match rl { + let (time, (tx_count, round_count)) = match rate_limiting { Some((tx_in_interval, interval_secs)) => ( interval_secs, (tx_in_interval, (tx_count + tx_in_interval) / tx_in_interval), From 547cdefd89c319e5655c9fa29219f32b43a45071 Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Thu, 17 Nov 2022 18:30:32 +0100 Subject: [PATCH 10/24] fix test --- e2e-tests/src/test/electing_validators.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e-tests/src/test/electing_validators.rs b/e2e-tests/src/test/electing_validators.rs index 6d82940ebd..3faa218bdc 100644 --- a/e2e-tests/src/test/electing_validators.rs +++ b/e2e-tests/src/test/electing_validators.rs @@ -226,7 +226,7 @@ pub async fn authorities_are_staking(config: &Config) -> anyhow::Result<()> { let connection = root_connection.as_signed(); connection .connection - .wait_for_n_eras(1, BlockStatus::Best) + .wait_for_n_eras(2, BlockStatus::Best) .await; let current_era = connection.connection.get_current_era(None).await; info!("New validators are in force (era: {})", current_era); @@ -262,7 +262,7 @@ pub async fn authorities_are_staking(config: &Config) -> anyhow::Result<()> { connection .connection - .wait_for_n_eras(1, BlockStatus::Best) + .wait_for_n_eras(2, BlockStatus::Best) .await; let current_era = connection.connection.get_current_era(None).await; info!( From 0908441b21b4b9fe0da170d7207821e3cad4b84c Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Thu, 17 Nov 2022 18:32:55 +0100 Subject: [PATCH 11/24] clippy --- e2e-tests/src/test/electing_validators.rs | 2 +- e2e-tests/src/test/validators_rotate.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e-tests/src/test/electing_validators.rs b/e2e-tests/src/test/electing_validators.rs index 3faa218bdc..60d78e7f63 100644 --- a/e2e-tests/src/test/electing_validators.rs +++ b/e2e-tests/src/test/electing_validators.rs @@ -238,7 +238,7 @@ pub async fn authorities_are_staking(config: &Config) -> anyhow::Result<()> { .connection .get_stakers_storage_keys_from_accounts( current_era, - &accounts.get_stash_accounts(), + accounts.get_stash_accounts(), None, ) .await diff --git a/e2e-tests/src/test/validators_rotate.rs b/e2e-tests/src/test/validators_rotate.rs index aadeb510ce..51f9ad9da9 100644 --- a/e2e-tests/src/test/validators_rotate.rs +++ b/e2e-tests/src/test/validators_rotate.rs @@ -56,7 +56,7 @@ pub async fn validators_rotate(config: &Config) -> anyhow::Result<()> { .await; let non_reserved = get_members_subset_for_session( - seats.non_reserved_seats.clone(), + seats.non_reserved_seats, &non_reserved_validators, session, ); From 0d53c566dc4d174a2f3fbc038497ef15b521504d Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Thu, 17 Nov 2022 18:56:59 +0100 Subject: [PATCH 12/24] clippy --- aleph-client/src/lib.rs | 1 + aleph-client/src/pallets/contract.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/aleph-client/src/lib.rs b/aleph-client/src/lib.rs index bd39346ac6..3c96d51ce9 100644 --- a/aleph-client/src/lib.rs +++ b/aleph-client/src/lib.rs @@ -9,6 +9,7 @@ use subxt::{ use crate::api::runtime_types::aleph_runtime::Call; // generated by running `subxt codegen --derive Clone Debug Eq PartialEq | rustfmt --edition=2018 > src/aleph_zero.rs` +#[allow(clippy::all)] mod aleph_zero; mod connections; pub mod contract; diff --git a/aleph-client/src/pallets/contract.rs b/aleph-client/src/pallets/contract.rs index 7072d459aa..f7a85544cf 100644 --- a/aleph-client/src/pallets/contract.rs +++ b/aleph-client/src/pallets/contract.rs @@ -32,6 +32,7 @@ pub trait ContractsUserApi { storage_limit: Option>, status: TxStatus, ) -> anyhow::Result; + #[allow(clippy::too_many_arguments)] async fn instantiate( &self, code_hash: H256, @@ -42,6 +43,7 @@ pub trait ContractsUserApi { salt: Vec, status: TxStatus, ) -> anyhow::Result; + #[allow(clippy::too_many_arguments)] async fn instantiate_with_code( &self, code: Vec, From a808a0457aa48110fce9cef1d3eb6408ae8bb94a Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Thu, 17 Nov 2022 21:30:47 +0100 Subject: [PATCH 13/24] review + fix --- aleph-client/src/connections.rs | 22 +++--- aleph-client/src/lib.rs | 3 +- aleph-client/src/pallets/aleph.rs | 16 ++--- aleph-client/src/pallets/balances.rs | 31 ++++----- aleph-client/src/pallets/contract.rs | 52 ++++++++------ aleph-client/src/pallets/elections.rs | 55 ++++++++------- aleph-client/src/pallets/fee.rs | 8 +-- aleph-client/src/pallets/multisig.rs | 18 ++--- aleph-client/src/pallets/session.rs | 21 +++--- aleph-client/src/pallets/staking.rs | 91 +++++++++++++------------ aleph-client/src/pallets/system.rs | 23 ++++--- aleph-client/src/pallets/treasury.rs | 31 ++++----- aleph-client/src/pallets/utility.rs | 8 +-- aleph-client/src/pallets/vesting.rs | 40 +++++++---- aleph-client/src/utility.rs | 19 +++--- e2e-tests/Cargo.lock | 2 +- e2e-tests/Cargo.toml | 2 +- scripts/catchup_version_upgrade_test.sh | 2 +- 18 files changed, 233 insertions(+), 211 deletions(-) diff --git a/aleph-client/src/connections.rs b/aleph-client/src/connections.rs index c3b8565f98..3ec78f69d6 100644 --- a/aleph-client/src/connections.rs +++ b/aleph-client/src/connections.rs @@ -1,7 +1,7 @@ use codec::Decode; use log::info; use subxt::{ - ext::sp_core::{Bytes, H256}, + ext::sp_core::Bytes, metadata::DecodeWithMetadata, rpc::RpcParams, storage::{address::Yes, StaticStorageAddress, StorageAddress}, @@ -9,7 +9,7 @@ use subxt::{ SubstrateConfig, }; -use crate::{api, Call, Client, KeyPair, TxStatus}; +use crate::{api, BlockHash, Call, Client, KeyPair, TxStatus}; #[derive(Clone)] pub struct Connection { @@ -28,20 +28,20 @@ pub struct RootConnection { #[async_trait::async_trait] pub trait SudoCall { - async fn sudo_unchecked(&self, call: Call, status: TxStatus) -> anyhow::Result; - async fn sudo(&self, call: Call, status: TxStatus) -> anyhow::Result; + async fn sudo_unchecked(&self, call: Call, status: TxStatus) -> anyhow::Result; + async fn sudo(&self, call: Call, status: TxStatus) -> anyhow::Result; } #[async_trait::async_trait] impl SudoCall for RootConnection { - async fn sudo_unchecked(&self, call: Call, status: TxStatus) -> anyhow::Result { + async fn sudo_unchecked(&self, call: Call, status: TxStatus) -> anyhow::Result { info!(target: "aleph-client", "sending call as sudo_unchecked {:?}", call); let sudo = api::tx().sudo().sudo_unchecked_weight(call, 0); self.as_signed().send_tx(sudo, status).await } - async fn sudo(&self, call: Call, status: TxStatus) -> anyhow::Result { + async fn sudo(&self, call: Call, status: TxStatus) -> anyhow::Result { info!(target: "aleph-client", "sending call as sudo {:?}", call); let sudo = api::tx().sudo().sudo(call); @@ -61,7 +61,7 @@ impl Connection { pub async fn get_storage_entry( &self, addrs: &StaticStorageAddress, - at: Option, + at: Option, ) -> T::Target { self.get_storage_entry_maybe(addrs, at) .await @@ -71,7 +71,7 @@ impl Connection { pub async fn get_storage_entry_maybe( &self, addrs: &StaticStorageAddress, - at: Option, + at: Option, ) -> Option { info!(target: "aleph-client", "accessing storage at {}::{} at block {:?}", addrs.pallet_name(), addrs.entry_name(), at); self.client @@ -106,7 +106,7 @@ impl SignedConnection { &self, tx: Call, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { self.send_tx_with_params(tx, Default::default(), status) .await } @@ -116,7 +116,7 @@ impl SignedConnection { tx: Call, params: BaseExtrinsicParamsBuilder, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { if let Some(details) = tx.validation_details() { info!(target:"aleph-client", "Sending extrinsic {}.{} with params: {:?}", details.pallet_name, details.call_name, params); } @@ -131,7 +131,7 @@ impl SignedConnection { let hash = match status { TxStatus::InBlock => progress.wait_for_in_block().await?.block_hash(), TxStatus::Finalized => progress.wait_for_finalized_success().await?.block_hash(), - TxStatus::Submitted => H256::random(), + TxStatus::Submitted => return Ok(BlockHash::from_low_u64_be(0)), }; info!(target: "aleph-client", "tx included in block {:?}", hash); diff --git a/aleph-client/src/lib.rs b/aleph-client/src/lib.rs index 3c96d51ce9..e0a1f0ce0b 100644 --- a/aleph-client/src/lib.rs +++ b/aleph-client/src/lib.rs @@ -2,7 +2,7 @@ extern crate core; pub use subxt::ext::sp_core::Pair; use subxt::{ - ext::sp_core::{ed25519, sr25519}, + ext::sp_core::{ed25519, sr25519, H256}, tx::PairSigner, OnlineClient, PolkadotConfig, }; @@ -28,6 +28,7 @@ pub type RawKeyPair = sr25519::Pair; pub type KeyPair = PairSigner; pub type AccountId = subxt::ext::sp_core::crypto::AccountId32; pub type Client = OnlineClient; +pub type BlockHash = H256; pub use connections::{Connection, RootConnection, SignedConnection, SudoCall}; diff --git a/aleph-client/src/pallets/aleph.rs b/aleph-client/src/pallets/aleph.rs index 60a509b60c..5e7ece9824 100644 --- a/aleph-client/src/pallets/aleph.rs +++ b/aleph-client/src/pallets/aleph.rs @@ -1,6 +1,6 @@ use codec::Encode; use primitives::{BlockNumber, SessionIndex}; -use subxt::{ext::sp_core::H256, rpc_params}; +use subxt::rpc_params; use crate::{ api::runtime_types::{ @@ -8,7 +8,7 @@ use crate::{ sp_core::ed25519::Public as EdPublic, }, pallet_aleph::pallet::Call::schedule_finality_version_change, - AccountId, AlephKeyPair, + AccountId, AlephKeyPair, BlockHash, Call::Aleph, Connection, Pair, RootConnection, SudoCall, TxStatus, }; @@ -19,14 +19,14 @@ pub trait AlephSudoApi { &self, finalizer: AccountId, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; async fn schedule_finality_version_change( &self, version: u32, session: SessionIndex, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; } #[async_trait::async_trait] @@ -34,7 +34,7 @@ pub trait AlephRpc { async fn emergency_finalize( &self, number: BlockNumber, - hash: H256, + hash: BlockHash, key_pair: AlephKeyPair, ) -> anyhow::Result<()>; } @@ -45,7 +45,7 @@ impl AlephSudoApi for RootConnection { &self, finalizer: AccountId, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let call = Aleph(set_emergency_finalizer { emergency_finalizer: Public(EdPublic(finalizer.into())), }); @@ -57,7 +57,7 @@ impl AlephSudoApi for RootConnection { version: u32, session: SessionIndex, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let call = Aleph(schedule_finality_version_change { version_incoming: version, session, @@ -72,7 +72,7 @@ impl AlephRpc for Connection { async fn emergency_finalize( &self, number: BlockNumber, - hash: H256, + hash: BlockHash, key_pair: AlephKeyPair, ) -> anyhow::Result<()> { let method = "alephNode_emergencyFinalize"; diff --git a/aleph-client/src/pallets/balances.rs b/aleph-client/src/pallets/balances.rs index b831cf510c..166cf56271 100644 --- a/aleph-client/src/pallets/balances.rs +++ b/aleph-client/src/pallets/balances.rs @@ -1,14 +1,11 @@ use primitives::Balance; -use subxt::{ - ext::{sp_core::H256, sp_runtime::MultiAddress}, - tx::PolkadotExtrinsicParamsBuilder, -}; +use subxt::{ext::sp_runtime::MultiAddress, tx::PolkadotExtrinsicParamsBuilder}; use crate::{ aleph_zero::{self, api, api::runtime_types::pallet_balances::BalanceLock}, pallet_balances::pallet::Call::transfer, pallets::utility::UtilityApi, - AccountId, + AccountId, BlockHash, Call::Balances, Connection, SignedConnection, TxStatus, }; @@ -18,14 +15,14 @@ pub trait BalanceApi { async fn locks_for_account( &self, account: AccountId, - at: Option, + at: Option, ) -> Vec>; async fn locks( &self, accounts: &[AccountId], - at: Option, + at: Option, ) -> Vec>>; - async fn total_issuance(&self, at: Option) -> Balance; + async fn total_issuance(&self, at: Option) -> Balance; } #[async_trait::async_trait] @@ -35,14 +32,14 @@ pub trait BalanceUserApi { dest: AccountId, amount: Balance, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; async fn transfer_with_tip( &self, dest: AccountId, amount: Balance, tip: Balance, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; } #[async_trait::async_trait] @@ -52,7 +49,7 @@ pub trait BalanceUserBatchExtApi { dest: &[AccountId], amount: Balance, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; } #[async_trait::async_trait] @@ -60,7 +57,7 @@ impl BalanceApi for Connection { async fn locks_for_account( &self, account: AccountId, - at: Option, + at: Option, ) -> Vec> { let address = aleph_zero::api::storage().balances().locks(&account); @@ -70,7 +67,7 @@ impl BalanceApi for Connection { async fn locks( &self, accounts: &[AccountId], - at: Option, + at: Option, ) -> Vec>> { let mut locks = vec![]; @@ -81,7 +78,7 @@ impl BalanceApi for Connection { locks } - async fn total_issuance(&self, at: Option) -> Balance { + async fn total_issuance(&self, at: Option) -> Balance { let address = api::storage().balances().total_issuance(); self.get_storage_entry(&address, at).await @@ -95,7 +92,7 @@ impl BalanceUserApi for SignedConnection { dest: AccountId, amount: Balance, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let tx = api::tx() .balances() .transfer(MultiAddress::Id(dest), amount); @@ -108,7 +105,7 @@ impl BalanceUserApi for SignedConnection { amount: Balance, tip: Balance, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let tx = api::tx() .balances() .transfer(MultiAddress::Id(dest), amount); @@ -125,7 +122,7 @@ impl BalanceUserBatchExtApi for SignedConnection { dests: &[AccountId], amount: Balance, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let calls = dests .iter() .map(|dest| { diff --git a/aleph-client/src/pallets/contract.rs b/aleph-client/src/pallets/contract.rs index f7a85544cf..ba9a7ccd3e 100644 --- a/aleph-client/src/pallets/contract.rs +++ b/aleph-client/src/pallets/contract.rs @@ -1,13 +1,11 @@ use codec::{Compact, Decode}; use primitives::Balance; use serde::Serialize; -use subxt::{ - ext::{sp_core::H256, sp_runtime::MultiAddress}, - rpc_params, -}; +use subxt::{ext::sp_runtime::MultiAddress, rpc_params}; use crate::{ - api, pallet_contracts::wasm::OwnerInfo, AccountId, Connection, SignedConnection, TxStatus, + api, pallet_contracts::wasm::OwnerInfo, AccountId, BlockHash, Connection, SignedConnection, + TxStatus, }; #[derive(Serialize)] @@ -21,7 +19,11 @@ pub struct ContractCallArgs { #[async_trait::async_trait] pub trait ContractsApi { - async fn get_owner_info(&self, code_hash: H256, at: Option) -> Option; + async fn get_owner_info( + &self, + code_hash: BlockHash, + at: Option, + ) -> Option; } #[async_trait::async_trait] @@ -31,18 +33,18 @@ pub trait ContractsUserApi { code: Vec, storage_limit: Option>, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; #[allow(clippy::too_many_arguments)] async fn instantiate( &self, - code_hash: H256, + code_hash: BlockHash, balance: Balance, gas_limit: u64, storage_limit: Option>, data: Vec, salt: Vec, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; #[allow(clippy::too_many_arguments)] async fn instantiate_with_code( &self, @@ -53,7 +55,7 @@ pub trait ContractsUserApi { data: Vec, salt: Vec, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; async fn call( &self, destination: AccountId, @@ -62,8 +64,12 @@ pub trait ContractsUserApi { storage_limit: Option>, data: Vec, status: TxStatus, - ) -> anyhow::Result; - async fn remove_code(&self, code_hash: H256, status: TxStatus) -> anyhow::Result; + ) -> anyhow::Result; + async fn remove_code( + &self, + code_hash: BlockHash, + status: TxStatus, + ) -> anyhow::Result; } #[async_trait::async_trait] @@ -73,7 +79,11 @@ pub trait ContractRpc { #[async_trait::async_trait] impl ContractsApi for Connection { - async fn get_owner_info(&self, code_hash: H256, at: Option) -> Option { + async fn get_owner_info( + &self, + code_hash: BlockHash, + at: Option, + ) -> Option { let addrs = api::storage().contracts().owner_info_of(code_hash); self.get_storage_entry_maybe(&addrs, at).await @@ -87,7 +97,7 @@ impl ContractsUserApi for SignedConnection { code: Vec, storage_limit: Option>, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let tx = api::tx().contracts().upload_code(code, storage_limit); self.send_tx(tx, status).await @@ -95,14 +105,14 @@ impl ContractsUserApi for SignedConnection { async fn instantiate( &self, - code_hash: H256, + code_hash: BlockHash, balance: Balance, gas_limit: u64, storage_limit: Option>, data: Vec, salt: Vec, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let tx = api::tx().contracts().instantiate( balance, gas_limit, @@ -124,7 +134,7 @@ impl ContractsUserApi for SignedConnection { data: Vec, salt: Vec, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let tx = api::tx().contracts().instantiate_with_code( balance, gas_limit, @@ -145,7 +155,7 @@ impl ContractsUserApi for SignedConnection { storage_limit: Option>, data: Vec, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let tx = api::tx().contracts().call( MultiAddress::Id(destination), balance, @@ -156,7 +166,11 @@ impl ContractsUserApi for SignedConnection { self.send_tx(tx, status).await } - async fn remove_code(&self, code_hash: H256, status: TxStatus) -> anyhow::Result { + async fn remove_code( + &self, + code_hash: BlockHash, + status: TxStatus, + ) -> anyhow::Result { let tx = api::tx().contracts().remove_code(code_hash); self.send_tx(tx, status).await diff --git a/aleph-client/src/pallets/elections.rs b/aleph-client/src/pallets/elections.rs index fa27da09a2..fcdc64406a 100644 --- a/aleph-client/src/pallets/elections.rs +++ b/aleph-client/src/pallets/elections.rs @@ -1,5 +1,4 @@ use primitives::{EraIndex, SessionCount}; -use sp_core::H256; use crate::{ api, @@ -9,38 +8,38 @@ use crate::{ }, pallet_elections::pallet::Call::{ban_from_committee, change_validators}, primitives::{BanConfig, BanInfo}, - AccountId, + AccountId, BlockHash, Call::Elections, Connection, RootConnection, SudoCall, TxStatus, }; #[async_trait::async_trait] pub trait ElectionsApi { - async fn get_ban_config(&self, at: Option) -> BanConfig; - async fn get_committee_seats(&self, at: Option) -> CommitteeSeats; - async fn get_next_era_committee_seats(&self, at: Option) -> CommitteeSeats; + async fn get_ban_config(&self, at: Option) -> BanConfig; + async fn get_committee_seats(&self, at: Option) -> CommitteeSeats; + async fn get_next_era_committee_seats(&self, at: Option) -> CommitteeSeats; async fn get_validator_block_count( &self, validator: AccountId, - at: Option, + at: Option, ) -> Option; - async fn get_current_era_validators(&self, at: Option) -> EraValidators; - async fn get_next_era_reserved_validators(&self, at: Option) -> Vec; - async fn get_next_era_non_reserved_validators(&self, at: Option) -> Vec; + async fn get_current_era_validators(&self, at: Option) -> EraValidators; + async fn get_next_era_reserved_validators(&self, at: Option) -> Vec; + async fn get_next_era_non_reserved_validators(&self, at: Option) -> Vec; async fn get_underperformed_validator_session_count( &self, validator: AccountId, - at: Option, + at: Option, ) -> Option; async fn get_ban_reason_for_validator( &self, validator: AccountId, - at: Option, + at: Option, ) -> Option; async fn get_ban_info_for_validator( &self, validator: AccountId, - at: Option, + at: Option, ) -> Option; async fn get_session_period(&self) -> u32; } @@ -54,7 +53,7 @@ pub trait ElectionsSudoApi { clean_session_counter_delay: Option, ban_period: Option, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; async fn change_validators( &self, @@ -62,30 +61,30 @@ pub trait ElectionsSudoApi { new_non_reserved_validators: Option>, committee_size: Option, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; async fn ban_from_committee( &self, account: AccountId, ban_reason: Vec, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; } #[async_trait::async_trait] impl ElectionsApi for Connection { - async fn get_ban_config(&self, at: Option) -> BanConfig { + async fn get_ban_config(&self, at: Option) -> BanConfig { let addrs = api::storage().elections().ban_config(); self.get_storage_entry(&addrs, at).await } - async fn get_committee_seats(&self, at: Option) -> CommitteeSeats { + async fn get_committee_seats(&self, at: Option) -> CommitteeSeats { let addrs = api::storage().elections().committee_size(); self.get_storage_entry(&addrs, at).await } - async fn get_next_era_committee_seats(&self, at: Option) -> CommitteeSeats { + async fn get_next_era_committee_seats(&self, at: Option) -> CommitteeSeats { let addrs = api::storage().elections().next_era_committee_size(); self.get_storage_entry(&addrs, at).await @@ -94,7 +93,7 @@ impl ElectionsApi for Connection { async fn get_validator_block_count( &self, validator: AccountId, - at: Option, + at: Option, ) -> Option { let addrs = api::storage() .elections() @@ -103,19 +102,19 @@ impl ElectionsApi for Connection { self.get_storage_entry_maybe(&addrs, at).await } - async fn get_current_era_validators(&self, at: Option) -> EraValidators { + async fn get_current_era_validators(&self, at: Option) -> EraValidators { let addrs = api::storage().elections().current_era_validators(); self.get_storage_entry(&addrs, at).await } - async fn get_next_era_reserved_validators(&self, at: Option) -> Vec { + async fn get_next_era_reserved_validators(&self, at: Option) -> Vec { let addrs = api::storage().elections().next_era_reserved_validators(); self.get_storage_entry(&addrs, at).await } - async fn get_next_era_non_reserved_validators(&self, at: Option) -> Vec { + async fn get_next_era_non_reserved_validators(&self, at: Option) -> Vec { let addrs = api::storage() .elections() .next_era_non_reserved_validators(); @@ -126,7 +125,7 @@ impl ElectionsApi for Connection { async fn get_underperformed_validator_session_count( &self, validator: AccountId, - at: Option, + at: Option, ) -> Option { let addrs = api::storage() .elections() @@ -138,7 +137,7 @@ impl ElectionsApi for Connection { async fn get_ban_reason_for_validator( &self, validator: AccountId, - at: Option, + at: Option, ) -> Option { let addrs = api::storage().elections().banned(validator); @@ -151,7 +150,7 @@ impl ElectionsApi for Connection { async fn get_ban_info_for_validator( &self, validator: AccountId, - at: Option, + at: Option, ) -> Option { let addrs = api::storage().elections().banned(validator); @@ -174,7 +173,7 @@ impl ElectionsSudoApi for RootConnection { clean_session_counter_delay: Option, ban_period: Option, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let call = Elections(set_ban_config { minimal_expected_performance, underperformed_session_count_threshold, @@ -191,7 +190,7 @@ impl ElectionsSudoApi for RootConnection { new_non_reserved_validators: Option>, committee_size: Option, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let call = Elections(change_validators { reserved_validators: new_reserved_validators, non_reserved_validators: new_non_reserved_validators, @@ -206,7 +205,7 @@ impl ElectionsSudoApi for RootConnection { account: AccountId, ban_reason: Vec, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let call = Elections(ban_from_committee { banned: account, ban_reason, diff --git a/aleph-client/src/pallets/fee.rs b/aleph-client/src/pallets/fee.rs index 6e2e22e56f..1b7e595ec8 100644 --- a/aleph-client/src/pallets/fee.rs +++ b/aleph-client/src/pallets/fee.rs @@ -1,17 +1,15 @@ -use sp_core::H256; - -use crate::{api, Connection}; +use crate::{api, BlockHash, Connection}; pub type FeeMultiplier = u128; #[async_trait::async_trait] pub trait TransactionPaymentApi { - async fn get_next_fee_multiplier(&self, at: Option) -> FeeMultiplier; + async fn get_next_fee_multiplier(&self, at: Option) -> FeeMultiplier; } #[async_trait::async_trait] impl TransactionPaymentApi for Connection { - async fn get_next_fee_multiplier(&self, at: Option) -> FeeMultiplier { + async fn get_next_fee_multiplier(&self, at: Option) -> FeeMultiplier { let addrs = api::storage().transaction_payment().next_fee_multiplier(); match self.get_storage_entry_maybe(&addrs, at).await { diff --git a/aleph-client/src/pallets/multisig.rs b/aleph-client/src/pallets/multisig.rs index 8192c5a4ae..ff7f2a519f 100644 --- a/aleph-client/src/pallets/multisig.rs +++ b/aleph-client/src/pallets/multisig.rs @@ -1,20 +1,12 @@ use primitives::{Balance, BlockNumber}; -use subxt::ext::sp_core::H256; -use crate::{api, api::runtime_types, AccountId, SignedConnection, TxStatus}; +use crate::{api, api::runtime_types, AccountId, BlockHash, SignedConnection, TxStatus}; pub type CallHash = [u8; 32]; pub type Call = Vec; pub type Timepoint = api::runtime_types::pallet_multisig::Timepoint; pub type Multisig = runtime_types::pallet_multisig::Multisig; -// pub fn compute_call_hash(call: &Extrinsic) -> CallHash { -// blake2_256(&call.function.encode()) -// } - -#[async_trait::async_trait] -pub trait MultisigApi {} - #[async_trait::async_trait] pub trait MultisigUserApi { async fn approve_as_multi( @@ -25,7 +17,7 @@ pub trait MultisigUserApi { max_weight: u64, call_hash: CallHash, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; async fn cancel_as_multi( &self, threshold: u16, @@ -33,7 +25,7 @@ pub trait MultisigUserApi { timepoint: Timepoint, call_hash: CallHash, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; } #[async_trait::async_trait] @@ -46,7 +38,7 @@ impl MultisigUserApi for SignedConnection { max_weight: u64, call_hash: CallHash, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let tx = api::tx().multisig().approve_as_multi( threshold, other_signatories, @@ -65,7 +57,7 @@ impl MultisigUserApi for SignedConnection { timepoint: Timepoint, call_hash: CallHash, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let tx = api::tx().multisig().cancel_as_multi( threshold, other_signatories, diff --git a/aleph-client/src/pallets/session.rs b/aleph-client/src/pallets/session.rs index 834ddc2528..c5393e2a49 100644 --- a/aleph-client/src/pallets/session.rs +++ b/aleph-client/src/pallets/session.rs @@ -1,9 +1,8 @@ use primitives::SessionIndex; -use sp_core::H256; use crate::{ - api, api::runtime_types::aleph_runtime::SessionKeys, AccountId, Connection, SignedConnection, - TxStatus, + api, api::runtime_types::aleph_runtime::SessionKeys, AccountId, BlockHash, Connection, + SignedConnection, TxStatus, }; #[async_trait::async_trait] @@ -11,15 +10,15 @@ pub trait SessionApi { async fn get_next_session_keys( &self, account: AccountId, - at: Option, + at: Option, ) -> Option; - async fn get_session(&self, at: Option) -> SessionIndex; - async fn get_validators(&self, at: Option) -> Vec; + async fn get_session(&self, at: Option) -> SessionIndex; + async fn get_validators(&self, at: Option) -> Vec; } #[async_trait::async_trait] pub trait SessionUserApi { - async fn set_keys(&self, new_keys: SessionKeys, status: TxStatus) -> anyhow::Result; + async fn set_keys(&self, new_keys: SessionKeys, status: TxStatus) -> anyhow::Result; } #[async_trait::async_trait] @@ -27,14 +26,14 @@ impl SessionApi for Connection { async fn get_next_session_keys( &self, account: AccountId, - at: Option, + at: Option, ) -> Option { let addrs = api::storage().session().next_keys(account); self.get_storage_entry_maybe(&addrs, at).await } - async fn get_session(&self, at: Option) -> SessionIndex { + async fn get_session(&self, at: Option) -> SessionIndex { let addrs = api::storage().session().current_index(); self.get_storage_entry_maybe(&addrs, at) @@ -42,7 +41,7 @@ impl SessionApi for Connection { .unwrap_or_default() } - async fn get_validators(&self, at: Option) -> Vec { + async fn get_validators(&self, at: Option) -> Vec { let addrs = api::storage().session().validators(); self.get_storage_entry(&addrs, at).await @@ -51,7 +50,7 @@ impl SessionApi for Connection { #[async_trait::async_trait] impl SessionUserApi for SignedConnection { - async fn set_keys(&self, new_keys: SessionKeys, status: TxStatus) -> anyhow::Result { + async fn set_keys(&self, new_keys: SessionKeys, status: TxStatus) -> anyhow::Result { let tx = api::tx().session().set_keys(new_keys, vec![]); self.send_tx(tx, status).await diff --git a/aleph-client/src/pallets/staking.rs b/aleph-client/src/pallets/staking.rs index 920b013299..fc7ea62ef7 100644 --- a/aleph-client/src/pallets/staking.rs +++ b/aleph-client/src/pallets/staking.rs @@ -1,5 +1,4 @@ use primitives::{Balance, EraIndex}; -use sp_core::H256; use subxt::{ ext::{ sp_core::storage::StorageKey, @@ -21,30 +20,30 @@ use crate::{ pallet_sudo::pallet::Call::sudo_as, pallets::utility::UtilityApi, sp_arithmetic::per_things::Perbill, - AccountId, + AccountId, BlockHash, Call::{Staking, Sudo}, Connection, RootConnection, SignedConnection, SudoCall, TxStatus, }; #[async_trait::async_trait] pub trait StakingApi { - async fn get_active_era(&self, at: Option) -> EraIndex; - async fn get_current_era(&self, at: Option) -> EraIndex; - async fn get_bonded(&self, stash: AccountId, at: Option) -> Option; - async fn get_ledger(&self, controller: AccountId, at: Option) -> StakingLedger; - async fn get_payout_for_era(&self, era: EraIndex, at: Option) -> u128; + async fn get_active_era(&self, at: Option) -> EraIndex; + async fn get_current_era(&self, at: Option) -> EraIndex; + async fn get_bonded(&self, stash: AccountId, at: Option) -> Option; + async fn get_ledger(&self, controller: AccountId, at: Option) -> StakingLedger; + async fn get_payout_for_era(&self, era: EraIndex, at: Option) -> u128; async fn get_exposure( &self, era: EraIndex, account_id: &AccountId, - at: Option, + at: Option, ) -> Exposure; async fn get_era_reward_points( &self, era: EraIndex, - at: Option, + at: Option, ) -> Option>; - async fn get_minimum_validator_count(&self, at: Option) -> u32; + async fn get_minimum_validator_count(&self, at: Option) -> u32; async fn get_session_per_era(&self) -> u32; } @@ -55,29 +54,29 @@ pub trait StakingUserApi { initial_stake: Balance, controller_id: AccountId, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; async fn validate( &self, validator_commission_percentage: u8, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; async fn payout_stakers( &self, stash_account: AccountId, era: EraIndex, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; async fn nominate( &self, nominee_account_id: AccountId, status: TxStatus, - ) -> anyhow::Result; - async fn chill(&self, status: TxStatus) -> anyhow::Result; + ) -> anyhow::Result; + async fn chill(&self, status: TxStatus) -> anyhow::Result; async fn bond_extra_stake( &self, extra_stake: Balance, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; } #[async_trait::async_trait] @@ -87,17 +86,17 @@ pub trait StakingApiExt { accounts: &[(AccountId, AccountId)], stake: Balance, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; async fn batch_nominate( &self, nominator_nominee_pairs: &[(AccountId, AccountId)], status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; } #[async_trait::async_trait] pub trait StakingSudoApi { - async fn force_new_era(&self, status: TxStatus) -> anyhow::Result; + async fn force_new_era(&self, status: TxStatus) -> anyhow::Result; async fn set_staking_config( &self, minimal_nominator_bond: u128, @@ -105,47 +104,51 @@ pub trait StakingSudoApi { max_nominators_count: Option, max_validators_count: Option, status: TxStatus, - ) -> anyhow::Result; + ) -> anyhow::Result; } #[async_trait::async_trait] pub trait StakingRawApi { - async fn get_stakers_storage_keys(&self, era: EraIndex, at: Option) -> Vec; + async fn get_stakers_storage_keys( + &self, + era: EraIndex, + at: Option, + ) -> Vec; async fn get_stakers_storage_keys_from_accounts( &self, era: EraIndex, accounts: &[AccountId], - at: Option, + at: Option, ) -> Vec; } #[async_trait::async_trait] impl StakingApi for Connection { - async fn get_active_era(&self, at: Option) -> EraIndex { + async fn get_active_era(&self, at: Option) -> EraIndex { let addrs = api::storage().staking().active_era(); self.get_storage_entry(&addrs, at).await.index } - async fn get_current_era(&self, at: Option) -> EraIndex { + async fn get_current_era(&self, at: Option) -> EraIndex { let addrs = api::storage().staking().current_era(); self.get_storage_entry(&addrs, at).await } - async fn get_bonded(&self, stash: AccountId, at: Option) -> Option { + async fn get_bonded(&self, stash: AccountId, at: Option) -> Option { let addrs = api::storage().staking().bonded(stash); self.get_storage_entry_maybe(&addrs, at).await } - async fn get_ledger(&self, controller: AccountId, at: Option) -> StakingLedger { + async fn get_ledger(&self, controller: AccountId, at: Option) -> StakingLedger { let addrs = api::storage().staking().ledger(controller); self.get_storage_entry(&addrs, at).await } - async fn get_payout_for_era(&self, era: EraIndex, at: Option) -> u128 { + async fn get_payout_for_era(&self, era: EraIndex, at: Option) -> u128 { let addrs = api::storage().staking().eras_validator_reward(era); self.get_storage_entry(&addrs, at).await @@ -155,7 +158,7 @@ impl StakingApi for Connection { &self, era: EraIndex, account_id: &AccountId, - at: Option, + at: Option, ) -> Exposure { let addrs = api::storage().staking().eras_stakers(era, account_id); @@ -165,14 +168,14 @@ impl StakingApi for Connection { async fn get_era_reward_points( &self, era: EraIndex, - at: Option, + at: Option, ) -> Option> { let addrs = api::storage().staking().eras_reward_points(era); self.get_storage_entry_maybe(&addrs, at).await } - async fn get_minimum_validator_count(&self, at: Option) -> u32 { + async fn get_minimum_validator_count(&self, at: Option) -> u32 { let addrs = api::storage().staking().minimum_validator_count(); self.get_storage_entry(&addrs, at).await @@ -192,7 +195,7 @@ impl StakingUserApi for SignedConnection { initial_stake: Balance, controller_id: AccountId, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let tx = api::tx().staking().bond( MultiAddress::::Id(controller_id), initial_stake, @@ -206,7 +209,7 @@ impl StakingUserApi for SignedConnection { &self, validator_commission_percentage: u8, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let tx = api::tx().staking().validate(ValidatorPrefs { commission: Perbill( SPerbill::from_percent(validator_commission_percentage as u32).deconstruct(), @@ -222,7 +225,7 @@ impl StakingUserApi for SignedConnection { stash_account: AccountId, era: EraIndex, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let tx = api::tx().staking().payout_stakers(stash_account, era); self.send_tx(tx, status).await @@ -232,7 +235,7 @@ impl StakingUserApi for SignedConnection { &self, nominee_account_id: AccountId, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let tx = api::tx() .staking() .nominate(vec![MultiAddress::Id(nominee_account_id)]); @@ -240,7 +243,7 @@ impl StakingUserApi for SignedConnection { self.send_tx(tx, status).await } - async fn chill(&self, status: TxStatus) -> anyhow::Result { + async fn chill(&self, status: TxStatus) -> anyhow::Result { let tx = api::tx().staking().chill(); self.send_tx(tx, status).await @@ -250,7 +253,7 @@ impl StakingUserApi for SignedConnection { &self, extra_stake: Balance, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let tx = api::tx().staking().bond_extra(extra_stake); self.send_tx(tx, status).await @@ -259,7 +262,7 @@ impl StakingUserApi for SignedConnection { #[async_trait::async_trait] impl StakingSudoApi for RootConnection { - async fn force_new_era(&self, status: TxStatus) -> anyhow::Result { + async fn force_new_era(&self, status: TxStatus) -> anyhow::Result { let call = Staking(force_new_era); self.sudo_unchecked(call, status).await @@ -272,7 +275,7 @@ impl StakingSudoApi for RootConnection { max_nominator_count: Option, max_validator_count: Option, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let call = Staking(set_staking_configs { min_nominator_bond: Set(min_nominator_bond), min_validator_bond: Set(min_validator_bond), @@ -293,7 +296,11 @@ impl StakingSudoApi for RootConnection { #[async_trait::async_trait] impl StakingRawApi for Connection { - async fn get_stakers_storage_keys(&self, era: EraIndex, at: Option) -> Vec { + async fn get_stakers_storage_keys( + &self, + era: EraIndex, + at: Option, + ) -> Vec { let key_addrs = api::storage().staking().eras_stakers_root(); let mut key = key_addrs.to_root_bytes(); StorageMapKey::new(&era, StorageHasher::Twox64Concat).to_bytes(&mut key); @@ -308,7 +315,7 @@ impl StakingRawApi for Connection { &self, era: EraIndex, accounts: &[AccountId], - _: Option, + _: Option, ) -> Vec { let key_addrs = api::storage().staking().eras_stakers_root(); let mut key = key_addrs.to_root_bytes(); @@ -332,7 +339,7 @@ impl StakingApiExt for RootConnection { accounts: &[(AccountId, AccountId)], stake: Balance, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let calls = accounts .iter() .map(|(c, s)| { @@ -356,7 +363,7 @@ impl StakingApiExt for RootConnection { &self, nominator_nominee_pairs: &[(AccountId, AccountId)], status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let calls = nominator_nominee_pairs .iter() .map(|(nominator, nominee)| { diff --git a/aleph-client/src/pallets/system.rs b/aleph-client/src/pallets/system.rs index f0931c9bec..102d3bf095 100644 --- a/aleph-client/src/pallets/system.rs +++ b/aleph-client/src/pallets/system.rs @@ -1,36 +1,43 @@ use primitives::Balance; -use sp_core::H256; use subxt::ext::sp_runtime::Perbill as SPerbill; use crate::{ api, frame_system::pallet::Call::{fill_block, set_code}, sp_arithmetic::per_things::Perbill, - AccountId, + AccountId, BlockHash, Call::System, Connection, RootConnection, SudoCall, TxStatus, }; #[async_trait::async_trait] pub trait SystemApi { - async fn get_free_balance(&self, account: AccountId, at: Option) -> Balance; + async fn get_free_balance(&self, account: AccountId, at: Option) -> Balance; } #[async_trait::async_trait] pub trait SystemSudoApi { - async fn set_code(&self, code: Vec, status: TxStatus) -> anyhow::Result; - async fn fill_block(&self, target_ratio_percent: u8, status: TxStatus) -> anyhow::Result; + async fn set_code(&self, code: Vec, status: TxStatus) -> anyhow::Result; + async fn fill_block( + &self, + target_ratio_percent: u8, + status: TxStatus, + ) -> anyhow::Result; } #[async_trait::async_trait] impl SystemSudoApi for RootConnection { - async fn set_code(&self, code: Vec, status: TxStatus) -> anyhow::Result { + async fn set_code(&self, code: Vec, status: TxStatus) -> anyhow::Result { let call = System(set_code { code }); self.sudo_unchecked(call, status).await } - async fn fill_block(&self, target_ratio_percent: u8, status: TxStatus) -> anyhow::Result { + async fn fill_block( + &self, + target_ratio_percent: u8, + status: TxStatus, + ) -> anyhow::Result { let call = System(fill_block { ratio: Perbill(SPerbill::from_percent(target_ratio_percent as u32).deconstruct()), }); @@ -41,7 +48,7 @@ impl SystemSudoApi for RootConnection { #[async_trait::async_trait] impl SystemApi for Connection { - async fn get_free_balance(&self, account: AccountId, at: Option) -> Balance { + async fn get_free_balance(&self, account: AccountId, at: Option) -> Balance { let addrs = api::storage().system().account(&account); match self.get_storage_entry_maybe(&addrs, at).await { diff --git a/aleph-client/src/pallets/treasury.rs b/aleph-client/src/pallets/treasury.rs index 4bed8c80ce..c47eb75643 100644 --- a/aleph-client/src/pallets/treasury.rs +++ b/aleph-client/src/pallets/treasury.rs @@ -1,6 +1,5 @@ use frame_support::PalletId; use primitives::{Balance, MILLISECS_PER_BLOCK}; -use sp_core::H256; use sp_runtime::traits::AccountIdConversion; use subxt::ext::sp_runtime::MultiAddress; @@ -8,7 +7,7 @@ use crate::{ api, pallet_treasury::pallet::Call::{approve_proposal, reject_proposal}, pallets::{elections::ElectionsApi, staking::StakingApi}, - AccountId, + AccountId, BlockHash, Call::Treasury, Connection, RootConnection, SignedConnection, SudoCall, TxStatus, }; @@ -16,8 +15,8 @@ use crate::{ #[async_trait::async_trait] pub trait TreasuryApi { async fn treasury_account(&self) -> AccountId; - async fn proposals_count(&self, at: Option) -> Option; - async fn approvals(&self, at: Option) -> Vec; + async fn proposals_count(&self, at: Option) -> Option; + async fn approvals(&self, at: Option) -> Vec; } #[async_trait::async_trait] @@ -27,9 +26,9 @@ pub trait TreasuryUserApi { amount: Balance, beneficiary: AccountId, status: TxStatus, - ) -> anyhow::Result; - async fn approve(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result; - async fn reject(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result; + ) -> anyhow::Result; + async fn approve(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result; + async fn reject(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result; } #[async_trait::async_trait] @@ -39,8 +38,8 @@ pub trait TreasureApiExt { #[async_trait::async_trait] pub trait TreasurySudoApi { - async fn approve(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result; - async fn reject(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result; + async fn approve(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result; + async fn reject(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result; } #[async_trait::async_trait] @@ -49,13 +48,13 @@ impl TreasuryApi for Connection { PalletId(*b"a0/trsry").into_account_truncating() } - async fn proposals_count(&self, at: Option) -> Option { + async fn proposals_count(&self, at: Option) -> Option { let addrs = api::storage().treasury().proposal_count(); self.get_storage_entry_maybe(&addrs, at).await } - async fn approvals(&self, at: Option) -> Vec { + async fn approvals(&self, at: Option) -> Vec { let addrs = api::storage().treasury().approvals(); self.get_storage_entry(&addrs, at).await.0 @@ -69,7 +68,7 @@ impl TreasuryUserApi for SignedConnection { amount: Balance, beneficiary: AccountId, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let tx = api::tx() .treasury() .propose_spend(amount, MultiAddress::Id(beneficiary)); @@ -77,13 +76,13 @@ impl TreasuryUserApi for SignedConnection { self.send_tx(tx, status).await } - async fn approve(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result { + async fn approve(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result { let tx = api::tx().treasury().approve_proposal(proposal_id); self.send_tx(tx, status).await } - async fn reject(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result { + async fn reject(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result { let tx = api::tx().treasury().reject_proposal(proposal_id); self.send_tx(tx, status).await @@ -92,13 +91,13 @@ impl TreasuryUserApi for SignedConnection { #[async_trait::async_trait] impl TreasurySudoApi for RootConnection { - async fn approve(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result { + async fn approve(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result { let call = Treasury(approve_proposal { proposal_id }); self.sudo_unchecked(call, status).await } - async fn reject(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result { + async fn reject(&self, proposal_id: u32, status: TxStatus) -> anyhow::Result { let call = Treasury(reject_proposal { proposal_id }); self.sudo_unchecked(call, status).await diff --git a/aleph-client/src/pallets/utility.rs b/aleph-client/src/pallets/utility.rs index 9c61a632a9..9374b8480e 100644 --- a/aleph-client/src/pallets/utility.rs +++ b/aleph-client/src/pallets/utility.rs @@ -1,15 +1,13 @@ -use subxt::ext::sp_core::H256; - -use crate::{api, Call, SignedConnection, TxStatus}; +use crate::{api, BlockHash, Call, SignedConnection, TxStatus}; #[async_trait::async_trait] pub trait UtilityApi { - async fn batch_call(&self, calls: Vec, status: TxStatus) -> anyhow::Result; + async fn batch_call(&self, calls: Vec, status: TxStatus) -> anyhow::Result; } #[async_trait::async_trait] impl UtilityApi for SignedConnection { - async fn batch_call(&self, calls: Vec, status: TxStatus) -> anyhow::Result { + async fn batch_call(&self, calls: Vec, status: TxStatus) -> anyhow::Result { let tx = api::tx().utility().batch(calls); self.send_tx(tx, status).await diff --git a/aleph-client/src/pallets/vesting.rs b/aleph-client/src/pallets/vesting.rs index f8a0fd13f9..567c35202d 100644 --- a/aleph-client/src/pallets/vesting.rs +++ b/aleph-client/src/pallets/vesting.rs @@ -1,32 +1,44 @@ -use subxt::ext::{sp_core::H256, sp_runtime::MultiAddress}; +use subxt::ext::sp_runtime::MultiAddress; use crate::{ - api, pallet_vesting::vesting_info::VestingInfo, AccountId, Connection, SignedConnection, - TxStatus, + api, pallet_vesting::vesting_info::VestingInfo, AccountId, BlockHash, Connection, + SignedConnection, TxStatus, }; #[async_trait::async_trait] pub trait VestingApi { - async fn get_vesting(&self, who: AccountId, at: Option) -> Vec>; + async fn get_vesting( + &self, + who: AccountId, + at: Option, + ) -> Vec>; } #[async_trait::async_trait] pub trait VestingUserApi { - async fn vest(&self, status: TxStatus) -> anyhow::Result; - async fn vest_other(&self, status: TxStatus, other: AccountId) -> anyhow::Result; + async fn vest(&self, status: TxStatus) -> anyhow::Result; + async fn vest_other(&self, status: TxStatus, other: AccountId) -> anyhow::Result; async fn vested_transfer( &self, receiver: AccountId, schedule: VestingInfo, status: TxStatus, - ) -> anyhow::Result; - async fn merge_schedules(&self, idx1: u32, idx2: u32, status: TxStatus) - -> anyhow::Result; + ) -> anyhow::Result; + async fn merge_schedules( + &self, + idx1: u32, + idx2: u32, + status: TxStatus, + ) -> anyhow::Result; } #[async_trait::async_trait] impl VestingApi for Connection { - async fn get_vesting(&self, who: AccountId, at: Option) -> Vec> { + async fn get_vesting( + &self, + who: AccountId, + at: Option, + ) -> Vec> { let addrs = api::storage().vesting().vesting(who); self.get_storage_entry(&addrs, at).await.0 @@ -35,13 +47,13 @@ impl VestingApi for Connection { #[async_trait::async_trait] impl VestingUserApi for SignedConnection { - async fn vest(&self, status: TxStatus) -> anyhow::Result { + async fn vest(&self, status: TxStatus) -> anyhow::Result { let tx = api::tx().vesting().vest(); self.send_tx(tx, status).await } - async fn vest_other(&self, status: TxStatus, other: AccountId) -> anyhow::Result { + async fn vest_other(&self, status: TxStatus, other: AccountId) -> anyhow::Result { let tx = api::tx().vesting().vest_other(MultiAddress::Id(other)); self.send_tx(tx, status).await @@ -52,7 +64,7 @@ impl VestingUserApi for SignedConnection { receiver: AccountId, schedule: VestingInfo, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let tx = api::tx() .vesting() .vested_transfer(MultiAddress::Id(receiver), schedule); @@ -65,7 +77,7 @@ impl VestingUserApi for SignedConnection { idx1: u32, idx2: u32, status: TxStatus, - ) -> anyhow::Result { + ) -> anyhow::Result { let tx = api::tx().vesting().merge_schedules(idx1, idx2); self.send_tx(tx, status).await diff --git a/aleph-client/src/utility.rs b/aleph-client/src/utility.rs index 4ef87912f9..5d2003d0ee 100644 --- a/aleph-client/src/utility.rs +++ b/aleph-client/src/utility.rs @@ -1,19 +1,18 @@ use log::info; use primitives::{BlockNumber, EraIndex, SessionIndex}; -use subxt::ext::sp_core::H256; use crate::{ pallets::{elections::ElectionsApi, staking::StakingApi}, - Connection, + BlockHash, Connection, }; #[async_trait::async_trait] pub trait BlocksApi { - async fn first_block_of_session(&self, session: SessionIndex) -> Option; - async fn get_block_hash(&self, block: BlockNumber) -> Option; + async fn first_block_of_session(&self, session: SessionIndex) -> Option; + async fn get_block_hash(&self, block: BlockNumber) -> Option; async fn get_best_block(&self) -> BlockNumber; - async fn get_finalized_block_hash(&self) -> H256; - async fn get_block_number(&self, block: H256) -> Option; + async fn get_finalized_block_hash(&self) -> BlockHash; + async fn get_block_number(&self, block: BlockHash) -> Option; } #[async_trait::async_trait] @@ -23,14 +22,14 @@ pub trait SessionEraApi { #[async_trait::async_trait] impl BlocksApi for Connection { - async fn first_block_of_session(&self, session: SessionIndex) -> Option { + async fn first_block_of_session(&self, session: SessionIndex) -> Option { let period = self.get_session_period().await; let block_num = period * session; self.get_block_hash(block_num).await } - async fn get_block_hash(&self, block: BlockNumber) -> Option { + async fn get_block_hash(&self, block: BlockNumber) -> Option { info!(target: "aleph-client", "querying block hash for number #{}", block); self.client .rpc() @@ -49,11 +48,11 @@ impl BlocksApi for Connection { .number } - async fn get_finalized_block_hash(&self) -> H256 { + async fn get_finalized_block_hash(&self) -> BlockHash { self.client.rpc().finalized_head().await.unwrap() } - async fn get_block_number(&self, block: H256) -> Option { + async fn get_block_number(&self, block: BlockHash) -> Option { self.client .rpc() .header(Some(block)) diff --git a/e2e-tests/Cargo.lock b/e2e-tests/Cargo.lock index a70e1b0718..53686a553f 100644 --- a/e2e-tests/Cargo.lock +++ b/e2e-tests/Cargo.lock @@ -49,7 +49,7 @@ dependencies = [ [[package]] name = "aleph-e2e-client" -version = "0.7.0" +version = "0.9.0" dependencies = [ "aleph_client", "anyhow", diff --git a/e2e-tests/Cargo.toml b/e2e-tests/Cargo.toml index 96477a5b5f..8da6c8e3bb 100644 --- a/e2e-tests/Cargo.toml +++ b/e2e-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aleph-e2e-client" -version = "0.7.0" +version = "0.9.0" edition = "2021" license = "Apache 2.0" diff --git a/scripts/catchup_version_upgrade_test.sh b/scripts/catchup_version_upgrade_test.sh index 2481cf3cfb..97972b1578 100755 --- a/scripts/catchup_version_upgrade_test.sh +++ b/scripts/catchup_version_upgrade_test.sh @@ -46,7 +46,7 @@ function get_best_finalized { local validator=$1 local rpc_port=$2 - local best_finalized=$(VALIDATOR=$validator RPC_HOST="ws://127.0.0.1" RPC_PORT=$rpc_port ./.github/scripts/check_finalization.sh | sed 's/Last finalized block number: "\(.*\)"/\1/') + local best_finalized=$(VALIDATOR=$validator RPC_HOST="127.0.0.1" RPC_PORT=$rpc_port ./.github/scripts/check_finalization.sh | sed 's/Last finalized block number: "\(.*\)"/\1/') printf "%d" $best_finalized } From d6c17f4d7a61490206f6fd03af893519583ddfb5 Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Thu, 17 Nov 2022 22:18:48 +0100 Subject: [PATCH 14/24] review part2 --- aleph-client/src/lib.rs | 1 - .../src/{rpc/mod.rs => pallets/author.rs} | 8 +- aleph-client/src/pallets/mod.rs | 1 + bin/cliain/src/contracts.rs | 131 ++++++++++-------- bin/cliain/src/finalization.rs | 10 +- bin/cliain/src/keys.rs | 6 +- bin/cliain/src/main.rs | 4 +- e2e-tests/src/rewards.rs | 4 +- e2e-tests/src/test/finalization.rs | 14 +- e2e-tests/src/test/staking.rs | 4 +- e2e-tests/src/validators.rs | 11 +- 11 files changed, 111 insertions(+), 83 deletions(-) rename aleph-client/src/{rpc/mod.rs => pallets/author.rs} (58%) diff --git a/aleph-client/src/lib.rs b/aleph-client/src/lib.rs index e0a1f0ce0b..8547a290ba 100644 --- a/aleph-client/src/lib.rs +++ b/aleph-client/src/lib.rs @@ -14,7 +14,6 @@ mod aleph_zero; mod connections; pub mod contract; pub mod pallets; -pub mod rpc; mod runtime_types; pub mod utility; pub mod waiting; diff --git a/aleph-client/src/rpc/mod.rs b/aleph-client/src/pallets/author.rs similarity index 58% rename from aleph-client/src/rpc/mod.rs rename to aleph-client/src/pallets/author.rs index 1b8756db16..f614e9e545 100644 --- a/aleph-client/src/rpc/mod.rs +++ b/aleph-client/src/pallets/author.rs @@ -1,16 +1,16 @@ use codec::Decode; -use crate::{aleph_runtime::SessionKeys, SignedConnection}; +use crate::{aleph_runtime::SessionKeys, Connection}; #[async_trait::async_trait] -pub trait Rpc { +pub trait AuthorRpc { async fn author_rotate_keys(&self) -> SessionKeys; } #[async_trait::async_trait] -impl Rpc for SignedConnection { +impl AuthorRpc for Connection { async fn author_rotate_keys(&self) -> SessionKeys { - let bytes = self.connection.client.rpc().rotate_keys().await.unwrap(); + let bytes = self.client.rpc().rotate_keys().await.unwrap(); SessionKeys::decode(&mut bytes.0.as_slice()).unwrap() } diff --git a/aleph-client/src/pallets/mod.rs b/aleph-client/src/pallets/mod.rs index 07944484d3..eaa9e11277 100644 --- a/aleph-client/src/pallets/mod.rs +++ b/aleph-client/src/pallets/mod.rs @@ -1,4 +1,5 @@ pub mod aleph; +pub mod author; pub mod balances; pub mod contract; pub mod elections; diff --git a/bin/cliain/src/contracts.rs b/bin/cliain/src/contracts.rs index c7b130074e..5759950939 100644 --- a/bin/cliain/src/contracts.rs +++ b/bin/cliain/src/contracts.rs @@ -45,6 +45,19 @@ pub async fn upload_code( let wasm = fs::read(wasm_path).expect("WASM artifact not found"); debug!(target: "contracts", "Found WASM contract code {:?}", wasm); + let connection = signed_connection.connection.clone(); + let event_handler = tokio::spawn(async move { + connection + .wait_for_event( + |e: &CodeStored| { + info!(target : "contracts", "Received CodeStored event {:?}", e); + true + }, + BlockStatus::Finalized, + ) + .await + }); + let _block_hash = signed_connection .upload_code( wasm, @@ -52,16 +65,7 @@ pub async fn upload_code( TxStatus::InBlock, ) .await?; - let code_stored_event = signed_connection - .connection - .wait_for_event( - |e: &CodeStored| { - info!(target : "contracts", "Received CodeStored event {:?}", e); - true - }, - BlockStatus::Finalized, - ) - .await; + let code_stored_event = event_handler.await?; Ok(code_stored_event) } @@ -90,6 +94,21 @@ pub async fn instantiate( debug!("Encoded constructor data {:?}", data); + let connection = signed_connection.connection.clone(); + let signer_id = signed_connection.signer.account_id().clone(); + + let event_handler = tokio::spawn(async move { + connection + .wait_for_event( + |e: &Instantiated| { + info!(target : "contracts", "Received ContractInstantiated event {:?}", e); + signer_id.eq(&e.deployer) + }, + BlockStatus::Finalized, + ) + .await + }); + let _block_hash = signed_connection .instantiate( code_hash, @@ -102,17 +121,7 @@ pub async fn instantiate( ) .await?; - let signer_id = signed_connection.signer.account_id().clone(); - let contract_instantiated_event = signed_connection - .connection - .wait_for_event( - |e: &Instantiated| { - info!(target : "contracts", "Received ContractInstantiated event {:?}", e); - signer_id.eq(&e.deployer) - }, - BlockStatus::Finalized, - ) - .await; + let contract_instantiated_event = event_handler.await?; Ok(contract_instantiated_event) } @@ -144,6 +153,35 @@ pub async fn instantiate_with_code( debug!("Encoded constructor data {:?}", data); + let signer_id = signed_connection.signer.account_id().clone(); + let connection_0 = signed_connection.connection.clone(); + let connection_1 = signed_connection.connection.clone(); + + let event_handler_0 = tokio::spawn(async move { + connection_0 + .wait_for_event( + |e: &CodeStored| { + info!(target : "contracts", "Received CodeStored event {:?}", e); + // TODO : can we pre-calculate what the code hash will be? + true + }, + BlockStatus::Finalized, + ) + .await + }); + + let event_handler_1 = tokio::spawn(async move { + connection_1 + .wait_for_event( + |e: &Instantiated| { + info!(target : "contracts", "Received ContractInstantiated event {:?}", e); + signer_id.eq(&e.deployer) + }, + BlockStatus::Finalized, + ) + .await + }); + let _block_hash = signed_connection .instantiate_with_code( wasm, @@ -156,30 +194,8 @@ pub async fn instantiate_with_code( ) .await?; - let code_stored_event = signed_connection - .connection - .wait_for_event( - |e: &CodeStored| { - info!(target : "contracts", "Received CodeStored event {:?}", e); - // TODO : can we pre-calculate what the code hash will be? - true - }, - BlockStatus::Finalized, - ) - .await; - - let signer_id = signed_connection.signer.account_id().clone(); - - let contract_instantiated_event = signed_connection - .connection - .wait_for_event( - |e: &Instantiated| { - info!(target : "contracts", "Received ContractInstantiated event {:?}", e); - signer_id.eq(&e.deployer) - }, - BlockStatus::Finalized, - ) - .await; + let code_stored_event = event_handler_0.await?; + let contract_instantiated_event = event_handler_1.await?; Ok(InstantiateWithCodeReturnValue { contract: contract_instantiated_event.contract, @@ -237,20 +253,25 @@ pub async fn remove_code( ) -> anyhow::Result { let ContractRemoveCode { code_hash } = command; + let connection = signed_connection.connection.clone(); + + let event_handler = tokio::spawn(async move { + connection + .wait_for_event( + |e: &CodeRemoved| { + info!(target : "contracts", "Received ContractCodeRemoved event {:?}", e); + e.code_hash.eq(&code_hash) + }, + BlockStatus::Finalized, + ) + .await + }); + let _block_hash = signed_connection .remove_code(code_hash, TxStatus::InBlock) .await?; - let contract_removed_event = signed_connection - .connection - .wait_for_event( - |e: &CodeRemoved| { - info!(target : "contracts", "Received ContractCodeRemoved event {:?}", e); - e.code_hash.eq(&code_hash) - }, - BlockStatus::Finalized, - ) - .await; + let contract_removed_event = event_handler.await?; Ok(contract_removed_event) } diff --git a/bin/cliain/src/finalization.rs b/bin/cliain/src/finalization.rs index e536c0fe2e..9df300cd9c 100644 --- a/bin/cliain/src/finalization.rs +++ b/bin/cliain/src/finalization.rs @@ -1,9 +1,6 @@ use std::str::FromStr; -use aleph_client::{ - pallets::aleph::{AlephRpc, AlephSudoApi}, - AccountId, AlephKeyPair, SignedConnection, TxStatus, -}; +use aleph_client::{pallets::aleph::{AlephRpc, AlephSudoApi}, AccountId, AlephKeyPair, SignedConnection, TxStatus, Connection}; use primitives::{BlockHash, BlockNumber}; use crate::RootConnection; @@ -18,14 +15,13 @@ pub async fn set_emergency_finalizer(connection: RootConnection, finalizer: Acco /// Finalizes the given block using the key pair from provided seed as emergency finalizer. pub async fn finalize( - connection: SignedConnection, + connection: Connection, number: BlockNumber, hash: String, key_pair: AlephKeyPair, ) { let hash = BlockHash::from_str(&hash).expect("Hash is properly hex encoded"); - connection - .connection + connection .emergency_finalize(number, hash, key_pair) .await .unwrap(); diff --git a/bin/cliain/src/keys.rs b/bin/cliain/src/keys.rs index b615d70e76..a75ff66cda 100644 --- a/bin/cliain/src/keys.rs +++ b/bin/cliain/src/keys.rs @@ -1,10 +1,10 @@ use aleph_client::{ aleph_runtime::SessionKeys, pallets::{ + author::AuthorRpc, session::{SessionApi, SessionUserApi}, staking::StakingUserApi, }, - rpc::Rpc, AccountId, Connection, RootConnection, SignedConnection, TxStatus, }; use hex::ToHex; @@ -23,7 +23,7 @@ pub async fn prepare_keys(connection: RootConnection, controller_account_id: Acc ) .await .unwrap(); - let new_keys = connection.as_signed().author_rotate_keys().await; + let new_keys = connection.connection.author_rotate_keys().await; connection .as_signed() .set_keys(new_keys, TxStatus::Finalized) @@ -38,7 +38,7 @@ pub async fn set_keys(connection: SignedConnection, new_keys: String) { .unwrap(); } -pub async fn rotate_keys(connection: SignedConnection) { +pub async fn rotate_keys(connection: Connection) { let new_keys = connection.author_rotate_keys().await; info!("Rotated keys: {:?}", new_keys); diff --git a/bin/cliain/src/main.rs b/bin/cliain/src/main.rs index 2b231c6dc1..8d619f373c 100644 --- a/bin/cliain/src/main.rs +++ b/bin/cliain/src/main.rs @@ -96,7 +96,7 @@ async fn main() { } => { let finalizer_seed = read_secret(finalizer_seed, "Provide finalizer seed:"); let finalizer = aleph_keypair_from_string(&finalizer_seed); - finalize(cfg.get_singed_connection().await, block, hash, finalizer).await; + finalize(cfg.get_connection().await, block, hash, finalizer).await; } Command::SetEmergencyFinalizer { finalizer_seed } => { let finalizer_seed = read_secret(finalizer_seed, "Provide finalizer seed:"); @@ -138,7 +138,7 @@ async fn main() { Command::TreasuryReject { proposal_id } => { treasury_reject(cfg.get_root_connection().await, proposal_id).await } - Command::RotateKeys => rotate_keys(cfg.get_singed_connection().await).await, + Command::RotateKeys => rotate_keys(cfg.get_connection().await).await, Command::NextSessionKeys { account_id } => { next_session_keys(cfg.get_connection().await, account_id).await } diff --git a/e2e-tests/src/rewards.rs b/e2e-tests/src/rewards.rs index 8e82dcf890..a386326d2c 100644 --- a/e2e-tests/src/rewards.rs +++ b/e2e-tests/src/rewards.rs @@ -5,13 +5,13 @@ use aleph_client::{ aleph_runtime::SessionKeys, api::runtime_types, pallets::{ + author::AuthorRpc, balances::{BalanceUserApi, BalanceUserBatchExtApi}, elections::{ElectionsApi, ElectionsSudoApi}, session::{SessionApi, SessionUserApi}, staking::{StakingApi, StakingUserApi}, }, primitives::{CommitteeSeats, EraValidators}, - rpc::Rpc, utility::BlocksApi, waiting::{AlephWaiting, BlockStatus, WaitingExt}, AccountId, SignedConnection, TxStatus, @@ -62,7 +62,7 @@ pub async fn set_invalid_keys_for_validator( /// Rotates session_keys of a given `controller`, making it able to rejoin the `consensus`. pub async fn reset_validator_keys(controller_connection: &SignedConnection) -> anyhow::Result<()> { - let validator_keys = controller_connection.author_rotate_keys().await; + let validator_keys = controller_connection.connection.author_rotate_keys().await; controller_connection .set_keys(validator_keys, TxStatus::InBlock) .await diff --git a/e2e-tests/src/test/finalization.rs b/e2e-tests/src/test/finalization.rs index fa827267e5..72b71a3d18 100644 --- a/e2e-tests/src/test/finalization.rs +++ b/e2e-tests/src/test/finalization.rs @@ -1,12 +1,22 @@ -use aleph_client::waiting::{AlephWaiting, BlockStatus}; +use aleph_client::{ + utility::BlocksApi, + waiting::{AlephWaiting, BlockStatus}, +}; use crate::config::Config; pub async fn finalization(config: &Config) -> anyhow::Result<()> { let connection = config.create_root_connection().await; + + let finalized = connection.connection.get_finalized_block_hash().await; + let finalized_number = connection + .connection + .get_block_number(finalized) + .await + .unwrap(); connection .connection - .wait_for_block(|n| n >= 1, BlockStatus::Finalized) + .wait_for_block(|n| n >= finalized_number + 1, BlockStatus::Finalized) .await; Ok(()) } diff --git a/e2e-tests/src/test/staking.rs b/e2e-tests/src/test/staking.rs index f533f0ed8d..1c22f1183f 100644 --- a/e2e-tests/src/test/staking.rs +++ b/e2e-tests/src/test/staking.rs @@ -2,13 +2,13 @@ use aleph_client::{ account_from_keypair, keypair_from_string, pallet_staking::StakingLedger, pallets::{ + author::AuthorRpc, balances::{BalanceApi, BalanceUserApi, BalanceUserBatchExtApi}, elections::ElectionsSudoApi, session::SessionUserApi, staking::{StakingApi, StakingUserApi}, }, primitives::CommitteeSeats, - rpc::Rpc, sp_runtime::bounded::bounded_vec::BoundedVec, waiting::{BlockStatus, WaitingExt}, AccountId, KeyPair, Pair, SignedConnection, TxStatus, @@ -174,7 +174,7 @@ pub async fn staking_new_validator(config: &Config) -> anyhow::Result<()> { &stash_account, &controller_account, &bonded_controller_account ); - let validator_keys = root_connection.as_signed().author_rotate_keys().await; + let validator_keys = root_connection.connection.author_rotate_keys().await; let controller_connection = SignedConnection::new(node.to_string(), KeyPair::new(controller.signer().clone())).await; controller_connection diff --git a/e2e-tests/src/validators.rs b/e2e-tests/src/validators.rs index 29b27c176a..9a8df557e5 100644 --- a/e2e-tests/src/validators.rs +++ b/e2e-tests/src/validators.rs @@ -1,10 +1,11 @@ use aleph_client::{ account_from_keypair, keypair_from_string, - pallets::{balances::BalanceUserBatchExtApi, session::SessionUserApi, staking::StakingUserApi}, + pallets::{ + author::AuthorRpc, balances::BalanceUserBatchExtApi, session::SessionUserApi, + staking::StakingUserApi, + }, primitives::EraValidators, - raw_keypair_from_string, - rpc::Rpc, - AccountId, KeyPair, RawKeyPair, SignedConnection, TxStatus, + raw_keypair_from_string, AccountId, KeyPair, RawKeyPair, SignedConnection, TxStatus, }; use futures::future::join_all; use primitives::{staking::MIN_VALIDATOR_BOND, TOKEN}; @@ -133,7 +134,7 @@ pub async fn prepare_validators(connection: &SignedConnection, node: &str, accou } for controller in accounts.controller_raw_keys.iter() { - let keys = connection.author_rotate_keys().await; + let keys = connection.connection.author_rotate_keys().await; let connection = SignedConnection::new(node.to_string(), KeyPair::new(controller.clone())).await; handles.push(tokio::spawn(async move { From c01d7e92aed9f8bfd37e92169c59da7cfe9e3da5 Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Thu, 17 Nov 2022 22:22:11 +0100 Subject: [PATCH 15/24] clippy... --- e2e-tests/src/test/finalization.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-tests/src/test/finalization.rs b/e2e-tests/src/test/finalization.rs index 72b71a3d18..1aca8bbfc3 100644 --- a/e2e-tests/src/test/finalization.rs +++ b/e2e-tests/src/test/finalization.rs @@ -16,7 +16,7 @@ pub async fn finalization(config: &Config) -> anyhow::Result<()> { .unwrap(); connection .connection - .wait_for_block(|n| n >= finalized_number + 1, BlockStatus::Finalized) + .wait_for_block(|n| n > finalized_number, BlockStatus::Finalized) .await; Ok(()) } From 8dbbbd64dc499cbdc3ee1f095fbcbf08dbec5830 Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Thu, 17 Nov 2022 22:26:15 +0100 Subject: [PATCH 16/24] fix seed to root --- scripts/catchup_version_upgrade_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/catchup_version_upgrade_test.sh b/scripts/catchup_version_upgrade_test.sh index 97972b1578..fdfd440ee0 100755 --- a/scripts/catchup_version_upgrade_test.sh +++ b/scripts/catchup_version_upgrade_test.sh @@ -8,7 +8,7 @@ UPGRADE_VERSION=${UPGRADE_VERSION:-1} NODES=${NODES:-"Node1:Node2"} PORTS=${PORTS:-9934:9935} UPGRADE_BEFORE_DISABLE=${UPGRADE_BEFORE_DISABLE:-false} -SEED=${SEED:-"//0"} +SEED=${SEED:-"//Alice"} ALL_NODES=${ALL_NODES:-"Node0:Node1:Node2:Node3:Node4"} ALL_NODES_PORTS=${ALL_NODES_PORTS:-"9933:9934:9935:9936:9937"} WAIT_BLOCKS=${WAIT_BLOCKS:-30} From 2b693d34411bb2a8dfc6e1656759d73047fca261 Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Thu, 17 Nov 2022 22:30:47 +0100 Subject: [PATCH 17/24] lint --- bin/cliain/src/finalization.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/cliain/src/finalization.rs b/bin/cliain/src/finalization.rs index 9df300cd9c..4c4ead123e 100644 --- a/bin/cliain/src/finalization.rs +++ b/bin/cliain/src/finalization.rs @@ -1,6 +1,9 @@ use std::str::FromStr; -use aleph_client::{pallets::aleph::{AlephRpc, AlephSudoApi}, AccountId, AlephKeyPair, SignedConnection, TxStatus, Connection}; +use aleph_client::{ + pallets::aleph::{AlephRpc, AlephSudoApi}, + AccountId, AlephKeyPair, Connection, SignedConnection, TxStatus, +}; use primitives::{BlockHash, BlockNumber}; use crate::RootConnection; @@ -21,7 +24,7 @@ pub async fn finalize( key_pair: AlephKeyPair, ) { let hash = BlockHash::from_str(&hash).expect("Hash is properly hex encoded"); - connection + connection .emergency_finalize(number, hash, key_pair) .await .unwrap(); From 3c55596946bd7c348d3265f89687ce70bf022848 Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Thu, 17 Nov 2022 22:36:57 +0100 Subject: [PATCH 18/24] clippy... --- bin/cliain/src/finalization.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cliain/src/finalization.rs b/bin/cliain/src/finalization.rs index 4c4ead123e..9f3833c313 100644 --- a/bin/cliain/src/finalization.rs +++ b/bin/cliain/src/finalization.rs @@ -2,7 +2,7 @@ use std::str::FromStr; use aleph_client::{ pallets::aleph::{AlephRpc, AlephSudoApi}, - AccountId, AlephKeyPair, Connection, SignedConnection, TxStatus, + AccountId, AlephKeyPair, Connection, TxStatus, }; use primitives::{BlockHash, BlockNumber}; From aaa058963cc02774760b85df7144bafa374437ae Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Fri, 18 Nov 2022 12:30:47 +0100 Subject: [PATCH 19/24] fix benches and remove finality-check --- .github/workflows/e2e-tests-main-devnet.yml | 2 +- aleph-client/src/pallets/staking.rs | 2 +- benches/payout-stakers/Cargo.lock | 4296 +++++++++++++++++++ benches/payout-stakers/src/main.rs | 20 +- 4 files changed, 4303 insertions(+), 17 deletions(-) create mode 100644 benches/payout-stakers/Cargo.lock diff --git a/.github/workflows/e2e-tests-main-devnet.yml b/.github/workflows/e2e-tests-main-devnet.yml index a61e5a6aa0..21aba1058c 100644 --- a/.github/workflows/e2e-tests-main-devnet.yml +++ b/.github/workflows/e2e-tests-main-devnet.yml @@ -439,7 +439,7 @@ jobs: node-count: 6 reserved-seats: 3 non-reserved-seats: 3 - follow-up-finalization-check: true + follow-up-finalization-check: false timeout-minutes: 15 run-e2e-ban-automatic: diff --git a/aleph-client/src/pallets/staking.rs b/aleph-client/src/pallets/staking.rs index fc7ea62ef7..226f19c62e 100644 --- a/aleph-client/src/pallets/staking.rs +++ b/aleph-client/src/pallets/staking.rs @@ -342,7 +342,7 @@ impl StakingApiExt for RootConnection { ) -> anyhow::Result { let calls = accounts .iter() - .map(|(c, s)| { + .map(|(s, c)| { let b = Staking(bond { controller: MultiAddress::Id(c.clone()), value: stake, diff --git a/benches/payout-stakers/Cargo.lock b/benches/payout-stakers/Cargo.lock new file mode 100644 index 0000000000..8df218dfc9 --- /dev/null +++ b/benches/payout-stakers/Cargo.lock @@ -0,0 +1,4296 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom 0.2.8", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +dependencies = [ + "memchr", +] + +[[package]] +name = "aleph_client" +version = "2.0.0" +dependencies = [ + "anyhow", + "async-trait", + "contract-metadata 1.5.0", + "contract-transcode", + "frame-support", + "futures", + "hex", + "ink_metadata", + "log", + "parity-scale-codec", + "primitives", + "rayon", + "serde", + "serde_json", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "subxt", + "thiserror", +] + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "anyhow" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216261ddc8289130e551ddcd5ce8a064710c0d064a4d2895c67151c92b5443f6" + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +dependencies = [ + "nodrop", +] + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + +[[package]] +name = "async-lock" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8101efe8695a6c17e02911402145357e718ac92d3ff88ae8419e84b1707b685" +dependencies = [ + "event-listener", + "futures-lite", +] + +[[package]] +name = "async-trait" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + +[[package]] +name = "base58" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b12e5fd123190ce1c2e559308a94c9bacad77907d4c6005d9e58fe1a0689e55e" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "blake2-rfc" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" +dependencies = [ + "arrayvec 0.4.12", + "constant_time_eq", +] + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding", + "byte-tools", + "byteorder", + "generic-array 0.12.4", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array 0.14.6", +] + +[[package]] +name = "block-buffer" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" +dependencies = [ + "generic-array 0.14.6", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "brownstone" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "030ea61398f34f1395ccbeb046fb68c87b631d1f34567fed0f0f11fa35d18d8d" +dependencies = [ + "arrayvec 0.7.2", +] + +[[package]] +name = "bumpalo" +version = "3.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" + +[[package]] +name = "cc" +version = "1.0.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a284da2e6fe2092f2353e51713435363112dfd60030e22add80be333fb928f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" +dependencies = [ + "iana-time-zone", + "num-integer", + "num-traits", + "winapi", +] + +[[package]] +name = "clap" +version = "3.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +dependencies = [ + "atty", + "bitflags", + "clap_derive", + "clap_lex", + "indexmap", + "once_cell", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_derive" +version = "3.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "contract-metadata" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36318b44d658ee23a2daf66811822bdf6ac686aa534ea87eb9e16e7430ca6928" +dependencies = [ + "impl-serde", + "semver", + "serde", + "serde_json", + "url", +] + +[[package]] +name = "contract-metadata" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f25bdb57a728064a0e4909dfbb29957ebb06d205307e337d3b5596c7e67dd3a" +dependencies = [ + "impl-serde", + "semver", + "serde", + "serde_json", + "url", +] + +[[package]] +name = "contract-transcode" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfa6db9d18dd5ef92d29c52d30c8503c857d390d9e4043e12466f1490c43c05e" +dependencies = [ + "anyhow", + "contract-metadata 0.6.0", + "env_logger 0.9.3", + "escape8259", + "hex", + "indexmap", + "ink_env", + "ink_metadata", + "itertools", + "log", + "nom", + "nom-supreme", + "parity-scale-codec", + "scale-info", + "serde", + "serde_json", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" +dependencies = [ + "generic-array 0.14.6", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array 0.14.6", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array 0.14.6", + "subtle", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array 0.14.6", + "subtle", +] + +[[package]] +name = "curve25519-dalek" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b85542f99a2dfa2a1b8e192662741c9859a846b296bef1c92ef9b58b5a216" +dependencies = [ + "byteorder", + "digest 0.8.1", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "cxx" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97abf9f0eca9e52b7f81b945524e76710e6cb2366aead23b7d4fbf72e281f888" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cc32cc5fea1d894b77d269ddb9f192110069a8a9c1f1d441195fba90553dea3" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca220e4794c934dc6b1207c3b42856ad4c302f2df1712e9f8d2eec5afaacf1f" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b846f081361125bfc8dc9d3940c84e1fd83ba54bbca7b17cd29483c828be0704" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "darling" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a784d2ccaf7c98501746bf0be29b2022ba41fd62a2e622af997a03e9f972859f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.6", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer 0.10.3", + "crypto-common", + "subtle", +] + +[[package]] +name = "downcast-rs" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "dyn-clonable" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e9232f0e607a262ceb9bd5141a3dfb3e4db6994b31989bbfd845878cba59fd4" +dependencies = [ + "dyn-clonable-impl", + "dyn-clone", +] + +[[package]] +name = "dyn-clonable-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dyn-clone" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f94fa09c2aeea5b8839e414b7b841bf429fd25b9c522116ac97ee87856d88b2" + +[[package]] +name = "ecdsa" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" +dependencies = [ + "der", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek 3.2.0", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "either" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" + +[[package]] +name = "elliptic-curve" +version = "0.11.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" +dependencies = [ + "base16ct", + "crypto-bigint", + "der", + "ff", + "generic-array 0.14.6", + "group", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "env_logger" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "environmental" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b91989ae21441195d7d9b9993a2f9295c7e1a8c96255d8b729accddc124797" + +[[package]] +name = "escape8259" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba4f4911e3666fcd7826997b4745c8224295a6f3072f1418c3067b97a67557ee" +dependencies = [ + "rustversion", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "fastrand" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +dependencies = [ + "instant", +] + +[[package]] +name = "ff" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "fixed-hash" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "frame-metadata" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df6bb8542ef006ef0de09a5c4420787d79823c0ed7924225822362fd2bf2ff2d" +dependencies = [ + "cfg-if", + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "frame-support" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "bitflags", + "frame-metadata", + "frame-support-procedural", + "impl-trait-for-tuples", + "k256", + "log", + "once_cell", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "smallvec", + "sp-api", + "sp-arithmetic 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-core-hashing-proc-macro", + "sp-inherents", + "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-staking", + "sp-state-machine 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-tracing 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "tt-call", +] + +[[package]] +name = "frame-support-procedural" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "Inflector", + "frame-support-procedural-tools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "frame-support-procedural-tools-derive", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "frame-support-procedural-tools-derive" +version = "3.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" + +[[package]] +name = "futures-executor" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + +[[package]] +name = "futures-io" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" + +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" + +[[package]] +name = "futures-task" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" + +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + +[[package]] +name = "futures-util" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gimli" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" + +[[package]] +name = "group" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "hash-db" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac 0.8.0", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.1", + "digest 0.9.0", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array 0.14.6", + "hmac 0.8.1", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "iana-time-zone" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-serde" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "indent_write" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cfe9645a18782869361d9c8732246be7b410ad4e919d3609ebabdac00ba12c3" + +[[package]] +name = "indexmap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "ink_allocator" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c9588a59a0e8997c0b2153cd11b5aaa77c06a0537a6b18f3811d1f1aa098b12" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ink_engine" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487c3b390b7feb0620496b0cd38683433c7d7e6946b1caabda51e1f23eb24b30" +dependencies = [ + "blake2", + "derive_more", + "parity-scale-codec", + "rand 0.8.5", + "secp256k1 0.24.1", + "sha2 0.10.6", + "sha3", +] + +[[package]] +name = "ink_env" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a891d34301a3dbb1c7b7424c49ae184282b163491c54f9acd17fcbe14a80447b" +dependencies = [ + "arrayref", + "blake2", + "cfg-if", + "derive_more", + "ink_allocator", + "ink_engine", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "num-traits", + "parity-scale-codec", + "paste", + "rand 0.8.5", + "rlibc", + "scale-info", + "secp256k1 0.24.1", + "sha2 0.10.6", + "sha3", + "static_assertions", +] + +[[package]] +name = "ink_metadata" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74913aaed5751f5615af4631b7559328b8ed56c9cb821b89e14af0706176e849" +dependencies = [ + "derive_more", + "impl-serde", + "ink_prelude", + "ink_primitives", + "scale-info", + "serde", +] + +[[package]] +name = "ink_prelude" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f031e6b8495594a7288b089bf4122e76c26b994959d1b2b693bdfe846b14c0e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ink_primitives" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12cf42dce81d060401c7cec95a392ad6d3c2f18661fa3083f619ce135133c33" +dependencies = [ + "cfg-if", + "ink_prelude", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" + +[[package]] +name = "joinery" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" + +[[package]] +name = "js-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jsonrpsee" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bd0d559d5e679b1ab2f869b486a11182923863b1b3ee8b421763cdd707b783a" +dependencies = [ + "jsonrpsee-client-transport", + "jsonrpsee-core", + "jsonrpsee-types", +] + +[[package]] +name = "jsonrpsee-client-transport" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8752740ecd374bcbf8b69f3e80b0327942df76f793f8d4e60d3355650c31fb74" +dependencies = [ + "futures-util", + "http", + "jsonrpsee-core", + "jsonrpsee-types", + "pin-project", + "rustls-native-certs", + "soketto", + "thiserror", + "tokio", + "tokio-rustls", + "tokio-util", + "tracing", + "webpki-roots", +] + +[[package]] +name = "jsonrpsee-core" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3dc3e9cf2ba50b7b1d7d76a667619f82846caa39e8e8daa8a4962d74acaddca" +dependencies = [ + "anyhow", + "async-lock", + "async-trait", + "beef", + "futures-channel", + "futures-timer", + "futures-util", + "jsonrpsee-types", + "rustc-hash", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "tracing-futures", +] + +[[package]] +name = "jsonrpsee-types" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e290bba767401b646812f608c099b922d8142603c9e73a50fb192d3ac86f4a0d" +dependencies = [ + "anyhow", + "beef", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "k256" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sec1", +] + +[[package]] +name = "keccak" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3afef3b6eff9ce9d8ff9b3601125eec7f0c8cbac7abd14f355d053fa56c98768" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.137" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" + +[[package]] +name = "libsecp256k1" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" +dependencies = [ + "arrayref", + "base64", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.8.5", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "link-cplusplus" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +dependencies = [ + "cc", +] + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "matchers" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memory-db" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" +dependencies = [ + "hash-db", + "hashbrown", + "parity-util-mem", +] + +[[package]] +name = "memory_units" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" + +[[package]] +name = "merlin" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e261cf0f8b3c42ded9f7d2bb59dea03aa52bc8a1cbc7482f9fc3fd1229d3b42" +dependencies = [ + "byteorder", + "keccak", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.42.0", +] + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "nom" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nom-supreme" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f909b25a8371ad5c054abc2c48205d677231e6a2dcbf83704ed57bb147f30e0" +dependencies = [ + "brownstone", + "indent_write", + "joinery", + "memchr", + "nom", +] + +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-format" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54b862ff8df690cf089058c98b183676a7ed0f974cc08b426800093227cbff3b" +dependencies = [ + "arrayvec 0.7.2", + "itoa", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "os_str_bytes" +version = "6.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5bf27447411e9ee3ff51186bf7a08e16c341efdde93f4d823e8844429bed7e" + +[[package]] +name = "parity-scale-codec" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a" +dependencies = [ + "arrayvec 0.7.2", + "bitvec", + "byte-slice-cast", + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "parity-util-mem" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" +dependencies = [ + "cfg-if", + "hashbrown", + "impl-trait-for-tuples", + "parity-util-mem-derive", + "parking_lot", + "primitive-types", + "winapi", +] + +[[package]] +name = "parity-util-mem-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" +dependencies = [ + "proc-macro2", + "syn", + "synstructure", +] + +[[package]] +name = "parity-wasm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" + +[[package]] +name = "parking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.42.0", +] + +[[package]] +name = "paste" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" + +[[package]] +name = "payout-stakers" +version = "0.2.0" +dependencies = [ + "aleph_client", + "anyhow", + "clap", + "env_logger 0.8.4", + "futures", + "hex", + "log", + "parity-scale-codec", + "primitives", + "rand 0.8.5", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-keyring", + "subxt", + "tokio", +] + +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac 0.8.0", +] + +[[package]] +name = "pbkdf2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +dependencies = [ + "crypto-mac 0.11.1", +] + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "primitive-types" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" +dependencies = [ + "fixed-hash", + "impl-codec", + "impl-serde", + "scale-info", + "uint", +] + +[[package]] +name = "primitives" +version = "0.5.0" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-staking", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", +] + +[[package]] +name = "proc-macro-crate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" +dependencies = [ + "once_cell", + "thiserror", + "toml", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.8", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rayon" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +dependencies = [ + "autocfg", + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "ref-cast" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b15debb4f9d60d767cd8ca9ef7abb2452922f3214671ff052defc7f3502c44" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abfa8511e9e94fd3de6585a3d3cd00e01ed556dc9814829280af0e8dc72a8f36" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "regex" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" + +[[package]] +name = "rfc6979" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" +dependencies = [ + "crypto-bigint", + "hmac 0.11.0", + "zeroize", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rlibc" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc874b127765f014d792f16763a81245ab80500e2ad921ed4ee9e82481ee08fe" + +[[package]] +name = "rustc-demangle" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustls" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" +dependencies = [ + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +dependencies = [ + "base64", +] + +[[package]] +name = "rustversion" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" + +[[package]] +name = "ryu" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" + +[[package]] +name = "scale-bits" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd7aca73785181cc41f0bbe017263e682b585ca660540ba569133901d013ecf" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", +] + +[[package]] +name = "scale-decode" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d823d4be477fc33321f93d08fb6c2698273d044f01362dc27573a750deb7c233" +dependencies = [ + "parity-scale-codec", + "scale-bits", + "scale-info", + "thiserror", +] + +[[package]] +name = "scale-info" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d8a765117b237ef233705cc2cc4c6a27fccd46eea6ef0c8c6dae5f3ef407f8" +dependencies = [ + "bitvec", + "cfg-if", + "derive_more", + "parity-scale-codec", + "scale-info-derive", + "serde", +] + +[[package]] +name = "scale-info-derive" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdcd47b380d8c4541044e341dcd9475f55ba37ddc50c908d945fc036a8642496" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "scale-value" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16a5e7810815bd295da73e4216d1dfbced3c7c7c7054d70fa5f6e4c58123fff4" +dependencies = [ + "either", + "frame-metadata", + "parity-scale-codec", + "scale-bits", + "scale-decode", + "scale-info", + "serde", + "thiserror", + "yap", +] + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys 0.36.1", +] + +[[package]] +name = "schnorrkel" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" +dependencies = [ + "arrayref", + "arrayvec 0.5.2", + "curve25519-dalek 2.1.3", + "getrandom 0.1.16", + "merlin", + "rand 0.7.3", + "rand_core 0.5.1", + "sha2 0.8.2", + "subtle", + "zeroize", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "scratch" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" + +[[package]] +name = "sct" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "sec1" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" +dependencies = [ + "der", + "generic-array 0.14.6", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c42e6f1735c5f00f51e43e28d6634141f2bcad10931b2609ddd74a86d751260" +dependencies = [ + "secp256k1-sys 0.4.2", +] + +[[package]] +name = "secp256k1" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff55dc09d460954e9ef2fa8a7ced735a964be9981fd50e870b2b3b0705e14964" +dependencies = [ + "secp256k1-sys 0.6.1", +] + +[[package]] +name = "secp256k1-sys" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957da2573cde917463ece3570eab4a0b3f19de6f1646cde62e6fd3868f566036" +dependencies = [ + "cc", +] + +[[package]] +name = "secp256k1-sys" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +dependencies = [ + "cc", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e8b3801309262e8184d9687fb697586833e939767aea0dda89f5a8e650e8bd7" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.6", +] + +[[package]] +name = "sha3" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" +dependencies = [ + "digest 0.10.6", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" +dependencies = [ + "digest 0.9.0", + "rand_core 0.6.4", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64", + "bytes", + "futures", + "httparse", + "log", + "rand 0.8.5", + "sha-1", +] + +[[package]] +name = "sp-api" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "sp-api-proc-macro", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-state-machine 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-version", + "thiserror", +] + +[[package]] +name = "sp-api-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "blake2", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-application-crypto" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acb4490364cb3b097a6755343e552495b0013778152300714be4647d107e9a2e" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-io 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sp-application-crypto" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", +] + +[[package]] +name = "sp-arithmetic" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31ef21f82cc10f75ed046b65e2f8048080ee76e59f1b8aed55c7150daebfd35b" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-debug-derive 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "static_assertions", +] + +[[package]] +name = "sp-arithmetic" +version = "5.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-debug-derive 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "static_assertions", +] + +[[package]] +name = "sp-core" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77963e2aa8fadb589118c3aede2e78b6c4bcf1c01d588fbf33e915b390825fbd" +dependencies = [ + "base58", + "bitflags", + "blake2-rfc", + "byteorder", + "dyn-clonable", + "ed25519-dalek", + "futures", + "hash-db", + "hash256-std-hasher", + "hex", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log", + "merlin", + "num-traits", + "parity-scale-codec", + "parity-util-mem", + "parking_lot", + "primitive-types", + "rand 0.7.3", + "regex", + "scale-info", + "schnorrkel", + "secp256k1 0.21.3", + "secrecy", + "serde", + "sp-core-hashing 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-debug-derive 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-externalities 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime-interface 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ss58-registry", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "wasmi", + "zeroize", +] + +[[package]] +name = "sp-core" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "base58", + "bitflags", + "blake2-rfc", + "byteorder", + "dyn-clonable", + "ed25519-dalek", + "futures", + "hash-db", + "hash256-std-hasher", + "hex", + "impl-serde", + "lazy_static", + "libsecp256k1", + "log", + "merlin", + "num-traits", + "parity-scale-codec", + "parity-util-mem", + "parking_lot", + "primitive-types", + "rand 0.7.3", + "regex", + "scale-info", + "schnorrkel", + "secp256k1 0.24.1", + "secrecy", + "serde", + "sp-core-hashing 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-debug-derive 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-externalities 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-storage 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "ss58-registry", + "substrate-bip39", + "thiserror", + "tiny-bip39", + "wasmi", + "zeroize", +] + +[[package]] +name = "sp-core-hashing" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec864a6a67249f0c8dd3d5acab43623a61677e85ff4f2f9b04b802d2fe780e83" +dependencies = [ + "blake2-rfc", + "byteorder", + "sha2 0.9.9", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tiny-keccak", + "twox-hash", +] + +[[package]] +name = "sp-core-hashing" +version = "4.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "blake2", + "byteorder", + "digest 0.10.6", + "sha2 0.10.6", + "sha3", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "twox-hash", +] + +[[package]] +name = "sp-core-hashing-proc-macro" +version = "5.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "proc-macro2", + "quote", + "sp-core-hashing 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "syn", +] + +[[package]] +name = "sp-debug-derive" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d676664972e22a0796176e81e7bec41df461d1edf52090955cdab55f2c956ff2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-debug-derive" +version = "4.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-externalities" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcfd91f92a2a59224230a77c4a5d6f51709620c0aab4e51f108ccece6adc56f" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sp-externalities" +version = "0.12.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-storage 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", +] + +[[package]] +name = "sp-inherents" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "thiserror", +] + +[[package]] +name = "sp-io" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "935fd3c71bad6811a7984cabb74d323b8ca3107024024c3eabb610e0182ba8d3" +dependencies = [ + "futures", + "hash-db", + "libsecp256k1", + "log", + "parity-scale-codec", + "parking_lot", + "secp256k1 0.21.3", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-externalities 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-keystore 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime-interface 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-state-machine 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-tracing 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-trie 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-wasm-interface 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-io" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "bytes", + "futures", + "hash-db", + "libsecp256k1", + "log", + "parity-scale-codec", + "parking_lot", + "secp256k1 0.24.1", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-externalities 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-keystore 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-state-machine 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-tracing 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-trie 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-wasm-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-keyring" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "lazy_static", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "strum", +] + +[[package]] +name = "sp-keystore" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3261eddca8c8926e3e1de136a7980cb3afc3455247d9d6f3119d9b292f73aaee" +dependencies = [ + "async-trait", + "futures", + "merlin", + "parity-scale-codec", + "parking_lot", + "schnorrkel", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-externalities 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", +] + +[[package]] +name = "sp-keystore" +version = "0.12.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "async-trait", + "futures", + "merlin", + "parity-scale-codec", + "parking_lot", + "schnorrkel", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-externalities 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "thiserror", +] + +[[package]] +name = "sp-panic-handler" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2101f3c555fceafcfcfb0e61c55ea9ed80dc60bd77d54d9f25b369edb029e9a4" +dependencies = [ + "backtrace", + "lazy_static", + "regex", +] + +[[package]] +name = "sp-panic-handler" +version = "4.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "backtrace", + "lazy_static", + "regex", +] + +[[package]] +name = "sp-runtime" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb7d8a8d5ab5d349c6cf9300af1721b7b6446ba63401dbb11c10a1d65197aa5f" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "parity-util-mem", + "paste", + "rand 0.7.3", + "scale-info", + "serde", + "sp-application-crypto 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-arithmetic 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-io 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sp-runtime" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "parity-util-mem", + "paste", + "rand 0.7.3", + "scale-info", + "serde", + "sp-application-crypto 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-arithmetic 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-io 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", +] + +[[package]] +name = "sp-runtime-interface" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "158bf0305c75a50fc0e334b889568f519a126e32b87900c3f4251202dece7b4b" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types", + "sp-externalities 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime-interface-proc-macro 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-storage 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-tracing 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-wasm-interface 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types", + "sp-externalities 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-runtime-interface-proc-macro 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-storage 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-tracing 5.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-wasm-interface 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ecb916b9664ed9f90abef0ff5a3e61454c1efea5861b2997e03f39b59b955f" +dependencies = [ + "Inflector", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "5.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "Inflector", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-staking" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", +] + +[[package]] +name = "sp-state-machine" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecee3b33eb78c99997676a571656bcc35db6886abecfddd13e76a73b5871c6c1" +dependencies = [ + "hash-db", + "log", + "num-traits", + "parity-scale-codec", + "parking_lot", + "rand 0.7.3", + "smallvec", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-externalities 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-panic-handler 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-trie 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", + "tracing", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-state-machine" +version = "0.12.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "hash-db", + "log", + "num-traits", + "parity-scale-codec", + "parking_lot", + "rand 0.7.3", + "smallvec", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-externalities 0.12.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-panic-handler 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-trie 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "thiserror", + "tracing", + "trie-root", +] + +[[package]] +name = "sp-std" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14804d6069ee7a388240b665f17908d98386ffb0b5d39f89a4099fc7a2a4c03f" + +[[package]] +name = "sp-std" +version = "4.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" + +[[package]] +name = "sp-storage" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dab53af846068e3e0716d3ccc70ea0db44035c79b2ed5821aaa6635039efa37" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sp-storage" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", +] + +[[package]] +name = "sp-tracing" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69a67e555d171c4238bd223393cda747dd20ec7d4f5fe5c042c056cb7fde9eda" +dependencies = [ + "parity-scale-codec", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-tracing" +version = "5.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "parity-scale-codec", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-trie" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6fc34f4f291886914733e083b62708d829f3e6b8d7a7ca7fa8a55a3d7640b0b" +dependencies = [ + "hash-db", + "memory-db", + "parity-scale-codec", + "scale-info", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-trie" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "hash-db", + "memory-db", + "parity-scale-codec", + "scale-info", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "thiserror", + "trie-db", + "trie-root", +] + +[[package]] +name = "sp-version" +version = "5.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "parity-wasm", + "scale-info", + "serde", + "sp-core-hashing-proc-macro", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-version-proc-macro", + "thiserror", +] + +[[package]] +name = "sp-version-proc-macro" +version = "4.0.0-dev" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "parity-scale-codec", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sp-wasm-interface" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10d88debe690c2b24eaa9536a150334fcef2ae184c21a0e5b3e80135407a7d52" +dependencies = [ + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-std 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmi", +] + +[[package]] +name = "sp-wasm-interface" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "wasmi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "ss58-registry" +version = "1.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37a9821878e1f13aba383aa40a86fb1b33c7265774ec91e32563cb1dd1577496" +dependencies = [ + "Inflector", + "num-format", + "proc-macro2", + "quote", + "serde", + "serde_json", + "unicode-xid", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn", +] + +[[package]] +name = "substrate-bip39" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49eee6965196b32f882dd2ee85a92b1dbead41b04e53907f269de3b0dc04733c" +dependencies = [ + "hmac 0.11.0", + "pbkdf2 0.8.0", + "schnorrkel", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "subxt" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a8757ee0e19f87e722577282ab1386c86592a4b13ff963b9c6ec4176348104c" +dependencies = [ + "bitvec", + "derivative", + "frame-metadata", + "futures", + "hex", + "jsonrpsee", + "parity-scale-codec", + "parking_lot", + "scale-decode", + "scale-info", + "scale-value", + "serde", + "serde_json", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "subxt-macro", + "subxt-metadata", + "thiserror", + "tracing", +] + +[[package]] +name = "subxt-codegen" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb77f93e11e6ff3ff95fe33e3d24c27c342e16feca8ef47759993614ebe90d2c" +dependencies = [ + "darling", + "frame-metadata", + "heck", + "parity-scale-codec", + "proc-macro-error", + "proc-macro2", + "quote", + "scale-info", + "subxt-metadata", + "syn", +] + +[[package]] +name = "subxt-macro" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "051cc21d77a54ae944b872eafdf9edfe1d9134fdfcfc3477dc10f763c76564a9" +dependencies = [ + "darling", + "proc-macro-error", + "subxt-codegen", + "syn", +] + +[[package]] +name = "subxt-metadata" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ed78d80db3a97d55e8b1cfecc1f6f9e21793a589d4e2e5f4fe2d6d5850c2e54" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", + "sp-core 6.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "thiserror" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tiny-bip39" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +dependencies = [ + "anyhow", + "hmac 0.8.1", + "once_cell", + "pbkdf2 0.4.0", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-io", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +dependencies = [ + "serde", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +dependencies = [ + "ansi_term", + "chrono", + "lazy_static", + "matchers", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", +] + +[[package]] +name = "trie-db" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32d034c0d3db64b43c31de38e945f15b40cd4ca6d2dcfc26d4798ce8de4ab83" +dependencies = [ + "hash-db", + "hashbrown", + "log", + "rustc-hex", + "smallvec", +] + +[[package]] +name = "trie-root" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" +dependencies = [ + "hash-db", +] + +[[package]] +name = "tt-call" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e66dcbec4290c69dd03c57e76c2469ea5c7ce109c6dd4351c13055cf71ea055" + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "digest 0.10.6", + "rand 0.8.5", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "uint" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a45526d29728d135c2900b0d30573fe3ee79fceb12ef534c7bb30e810a91b601" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "wasmi" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca00c5147c319a8ec91ec1a0edbec31e566ce2c9cc93b3f9bb86a9efd0eb795d" +dependencies = [ + "downcast-rs", + "libc", + "memory_units", + "num-rational", + "num-traits", + "parity-wasm", + "wasmi-validation", +] + +[[package]] +name = "wasmi-validation" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "165343ecd6c018fc09ebcae280752702c9a2ef3e6f8d02f1cfcbdb53ef6d7937" +dependencies = [ + "parity-wasm", +] + +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.22.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" +dependencies = [ + "webpki", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yap" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc77f52dc9e9b10d55d3f4462c3b7fc393c4f17975d641542833ab2d3bc26ef" + +[[package]] +name = "zeroize" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] diff --git a/benches/payout-stakers/src/main.rs b/benches/payout-stakers/src/main.rs index 4842056455..40b1d60bb7 100644 --- a/benches/payout-stakers/src/main.rs +++ b/benches/payout-stakers/src/main.rs @@ -232,28 +232,18 @@ async fn nominate_validator( .zip(nominator_controller_accounts.iter().cloned()) .collect::>(); - let mut handles = vec![]; + let mut rng = thread_rng(); for chunk in stash_controller_accounts .chunks(BOND_CALL_BATCH_LIMIT) .map(|c| c.to_vec()) { - let root = RootConnection::try_from_connection( - connection.connection.clone(), - KeyPair::new(connection.root.signer().clone()), - ) - .await - .unwrap(); - let mut rng = thread_rng(); let stake = (rng.gen::() % 100) * TOKEN + MIN_NOMINATOR_BOND; - handles.push(tokio::spawn(async move { - root.batch_bond(&chunk, stake, TxStatus::InBlock) - .await - .unwrap(); - })); + connection.batch_bond(&chunk, stake, TxStatus::Submitted) + .await + .unwrap(); } - join_all(handles).await; let nominator_nominee_accounts = nominator_controller_accounts .iter() .cloned() @@ -292,7 +282,7 @@ async fn bond_validators_funds_and_choose_controllers( /// Submits candidate validators via controller accounts. /// We assume stash == validator != controller. -async fn send_validate_txs(address: &str, controllers: Vec) { +async fn send_validate_txs(address: &str, controllers: Vec) { let mut handles = vec![]; for controller in controllers { let node_address = address.to_string(); From 92c3ec3304da04cdbaafc4f4db913bca7642a4bf Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Fri, 18 Nov 2022 12:37:19 +0100 Subject: [PATCH 20/24] lint --- benches/payout-stakers/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/benches/payout-stakers/src/main.rs b/benches/payout-stakers/src/main.rs index 40b1d60bb7..81aef363a4 100644 --- a/benches/payout-stakers/src/main.rs +++ b/benches/payout-stakers/src/main.rs @@ -237,9 +237,9 @@ async fn nominate_validator( .chunks(BOND_CALL_BATCH_LIMIT) .map(|c| c.to_vec()) { - let stake = (rng.gen::() % 100) * TOKEN + MIN_NOMINATOR_BOND; - connection.batch_bond(&chunk, stake, TxStatus::Submitted) + connection + .batch_bond(&chunk, stake, TxStatus::Submitted) .await .unwrap(); } @@ -282,7 +282,7 @@ async fn bond_validators_funds_and_choose_controllers( /// Submits candidate validators via controller accounts. /// We assume stash == validator != controller. -async fn send_validate_txs(address: &str, controllers: Vec) { +async fn send_validate_txs(address: &str, controllers: Vec) { let mut handles = vec![]; for controller in controllers { let node_address = address.to_string(); From a3c75ebb949681ad419257d42f77e8cf5b150a36 Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Fri, 18 Nov 2022 17:48:08 +0100 Subject: [PATCH 21/24] reviews --- aleph-client/src/connections.rs | 24 ++++++++++++++------- aleph-client/src/pallets/elections.rs | 4 ++-- aleph-client/src/pallets/staking.rs | 30 +++++++++++++-------------- aleph-client/src/utility.rs | 4 ++-- bin/cliain/src/lib.rs | 2 +- bin/cliain/src/main.rs | 28 ++++++++++++------------- bin/cliain/src/staking.rs | 4 ++-- e2e-tests/src/ban.rs | 16 ++------------ e2e-tests/src/config.rs | 2 +- e2e-tests/src/rewards.rs | 14 ++----------- e2e-tests/src/test/ban.rs | 6 ++---- e2e-tests/src/test/rewards.rs | 16 +++++++++----- 12 files changed, 70 insertions(+), 80 deletions(-) diff --git a/aleph-client/src/connections.rs b/aleph-client/src/connections.rs index 3ec78f69d6..7f3c7143a4 100644 --- a/aleph-client/src/connections.rs +++ b/aleph-client/src/connections.rs @@ -1,3 +1,4 @@ +use anyhow::anyhow; use codec::Decode; use log::info; use subxt::{ @@ -58,9 +59,9 @@ impl Connection { Self { client } } - pub async fn get_storage_entry( + pub async fn get_storage_entry( &self, - addrs: &StaticStorageAddress, + addrs: &StaticStorageAddress, at: Option, ) -> T::Target { self.get_storage_entry_maybe(addrs, at) @@ -68,9 +69,9 @@ impl Connection { .expect("There should be a value") } - pub async fn get_storage_entry_maybe( + pub async fn get_storage_entry_maybe( &self, - addrs: &StaticStorageAddress, + addrs: &StaticStorageAddress, at: Option, ) -> Option { info!(target: "aleph-client", "accessing storage at {}::{} at block {:?}", addrs.pallet_name(), addrs.entry_name(), at); @@ -140,20 +141,27 @@ impl SignedConnection { } impl RootConnection { - pub async fn new(address: String, root: KeyPair) -> Result { + pub async fn new(address: String, root: KeyPair) -> anyhow::Result { RootConnection::try_from_connection(Connection::new(address).await, root).await } - pub async fn try_from_connection(connection: Connection, signer: KeyPair) -> Result { + pub async fn try_from_connection( + connection: Connection, + signer: KeyPair, + ) -> anyhow::Result { let root_address = api::storage().sudo().key(); let root = match connection.client.storage().fetch(&root_address, None).await { Ok(Some(account)) => account, - _ => return Err(()), + _ => return Err(anyhow!("Could not read sudo key from chain")), }; if root != *signer.account_id() { - return Err(()); + return Err(anyhow!( + "Provided account is not a sudo on chain. sudo key - {}, provided: {}", + root, + signer.account_id() + )); } Ok(Self { diff --git a/aleph-client/src/pallets/elections.rs b/aleph-client/src/pallets/elections.rs index fcdc64406a..b4b770cd65 100644 --- a/aleph-client/src/pallets/elections.rs +++ b/aleph-client/src/pallets/elections.rs @@ -46,7 +46,7 @@ pub trait ElectionsApi { #[async_trait::async_trait] pub trait ElectionsSudoApi { - async fn change_ban_config( + async fn set_ban_config( &self, minimal_expected_performance: Option, underperformed_session_count_threshold: Option, @@ -166,7 +166,7 @@ impl ElectionsApi for Connection { #[async_trait::async_trait] impl ElectionsSudoApi for RootConnection { - async fn change_ban_config( + async fn set_ban_config( &self, minimal_expected_performance: Option, underperformed_session_count_threshold: Option, diff --git a/aleph-client/src/pallets/staking.rs b/aleph-client/src/pallets/staking.rs index 226f19c62e..6790db6b1b 100644 --- a/aleph-client/src/pallets/staking.rs +++ b/aleph-client/src/pallets/staking.rs @@ -13,7 +13,7 @@ use crate::{ pallet::pallet::{ Call::{bond, force_new_era, nominate, set_staking_configs}, ConfigOp, - ConfigOp::Set, + ConfigOp::{Noop, Set}, }, EraRewardPoints, Exposure, RewardDestination, StakingLedger, ValidatorPrefs, }, @@ -99,8 +99,8 @@ pub trait StakingSudoApi { async fn force_new_era(&self, status: TxStatus) -> anyhow::Result; async fn set_staking_config( &self, - minimal_nominator_bond: u128, - minimal_validator_bond: u128, + minimal_nominator_bond: Option, + minimal_validator_bond: Option, max_nominators_count: Option, max_validators_count: Option, status: TxStatus, @@ -270,23 +270,23 @@ impl StakingSudoApi for RootConnection { async fn set_staking_config( &self, - min_nominator_bond: u128, - min_validator_bond: u128, + min_nominator_bond: Option, + min_validator_bond: Option, max_nominator_count: Option, max_validator_count: Option, status: TxStatus, ) -> anyhow::Result { + fn convert(arg: Option) -> ConfigOp { + match arg { + Some(v) => Set(v), + None => Noop, + } + } let call = Staking(set_staking_configs { - min_nominator_bond: Set(min_nominator_bond), - min_validator_bond: Set(min_validator_bond), - max_nominator_count: match max_nominator_count { - None => ConfigOp::Noop, - Some(m) => Set(m), - }, - max_validator_count: match max_validator_count { - None => ConfigOp::Noop, - Some(m) => Set(m), - }, + min_nominator_bond: convert(min_nominator_bond), + min_validator_bond: convert(min_validator_bond), + max_nominator_count: convert(max_nominator_count), + max_validator_count: convert(max_validator_count), chill_threshold: ConfigOp::Noop, min_commission: ConfigOp::Noop, }); diff --git a/aleph-client/src/utility.rs b/aleph-client/src/utility.rs index 5d2003d0ee..eb59983f03 100644 --- a/aleph-client/src/utility.rs +++ b/aleph-client/src/utility.rs @@ -17,7 +17,7 @@ pub trait BlocksApi { #[async_trait::async_trait] pub trait SessionEraApi { - async fn get_era_for_session(&self, session: SessionIndex) -> EraIndex; + async fn get_active_era_for_session(&self, session: SessionIndex) -> EraIndex; } #[async_trait::async_trait] @@ -64,7 +64,7 @@ impl BlocksApi for Connection { #[async_trait::async_trait] impl SessionEraApi for Connection { - async fn get_era_for_session(&self, session: SessionIndex) -> EraIndex { + async fn get_active_era_for_session(&self, session: SessionIndex) -> EraIndex { let block = self.first_block_of_session(session).await; self.get_active_era(block).await } diff --git a/bin/cliain/src/lib.rs b/bin/cliain/src/lib.rs index 5fe78f4b0a..0c49fdc0b5 100644 --- a/bin/cliain/src/lib.rs +++ b/bin/cliain/src/lib.rs @@ -48,7 +48,7 @@ impl ConnectionConfig { Connection::new(self.node_endpoint.clone()).await } - pub async fn get_singed_connection(&self) -> SignedConnection { + pub async fn get_signed_connection(&self) -> SignedConnection { SignedConnection::new( self.node_endpoint.clone(), keypair_from_string(&self.signer_seed), diff --git a/bin/cliain/src/main.rs b/bin/cliain/src/main.rs index 8d619f373c..bd89b9f464 100644 --- a/bin/cliain/src/main.rs +++ b/bin/cliain/src/main.rs @@ -83,7 +83,7 @@ async fn main() { initial_stake_tokens, } => { bond( - cfg.get_singed_connection().await, + cfg.get_signed_connection().await, initial_stake_tokens, controller_account, ) @@ -105,17 +105,17 @@ async fn main() { set_emergency_finalizer(cfg.get_root_connection().await, finalizer).await; } Command::SetKeys { new_keys } => { - set_keys(cfg.get_singed_connection().await, new_keys).await + set_keys(cfg.get_signed_connection().await, new_keys).await } Command::Validate { commission_percentage, - } => validate(cfg.get_singed_connection().await, commission_percentage).await, + } => validate(cfg.get_signed_connection().await, commission_percentage).await, Command::Transfer { amount_in_tokens, to_account, } => { transfer( - cfg.get_singed_connection().await, + cfg.get_signed_connection().await, amount_in_tokens, to_account, ) @@ -126,7 +126,7 @@ async fn main() { beneficiary, } => { treasury_propose( - cfg.get_singed_connection().await, + cfg.get_signed_connection().await, amount_in_tokens, beneficiary, ) @@ -170,9 +170,9 @@ async fn main() { Command::UpdateRuntime { runtime } => { update_runtime(cfg.get_root_connection().await, runtime).await } - Command::Vest => vest(cfg.get_singed_connection().await).await, + Command::Vest => vest(cfg.get_signed_connection().await).await, Command::VestOther { vesting_account } => { - vest_other(cfg.get_singed_connection().await, vesting_account).await + vest_other(cfg.get_signed_connection().await, vesting_account).await } Command::VestedTransfer { to_account, @@ -181,7 +181,7 @@ async fn main() { starting_block, } => { vested_transfer( - cfg.get_singed_connection().await, + cfg.get_signed_connection().await, to_account, amount_in_tokens, per_block, @@ -189,9 +189,9 @@ async fn main() { ) .await } - Command::Nominate { nominee } => nominate(cfg.get_singed_connection().await, nominee).await, + Command::Nominate { nominee } => nominate(cfg.get_signed_connection().await, nominee).await, Command::ContractInstantiateWithCode(command) => { - match instantiate_with_code(cfg.get_singed_connection().await, command).await { + match instantiate_with_code(cfg.get_signed_connection().await, command).await { Ok(result) => println!( "{}", serde_json::to_string(&result).expect("Can't encode the result as JSON") @@ -200,19 +200,19 @@ async fn main() { }; } Command::ContractUploadCode(command) => { - match upload_code(cfg.get_singed_connection().await, command).await { + match upload_code(cfg.get_signed_connection().await, command).await { Ok(result) => println!("{:?}", result), Err(why) => error!("Contract upload failed {:?}", why), } } Command::ContractCall(command) => { - match call(cfg.get_singed_connection().await, command).await { + match call(cfg.get_signed_connection().await, command).await { Ok(result) => println!("{:?}", result), Err(why) => error!("Contract call failed {:?}", why), } } Command::ContractInstantiate(command) => { - match instantiate(cfg.get_singed_connection().await, command).await { + match instantiate(cfg.get_signed_connection().await, command).await { Ok(result) => println!("{:?}", result), Err(why) => error!("Contract instantiate failed {:?}", why), } @@ -224,7 +224,7 @@ async fn main() { ) } Command::ContractRemoveCode(command) => { - match remove_code(cfg.get_singed_connection().await, command).await { + match remove_code(cfg.get_signed_connection().await, command).await { Ok(result) => println!("{:?}", result), Err(why) => error!("Contract remove code failed {:?}", why), } diff --git a/bin/cliain/src/staking.rs b/bin/cliain/src/staking.rs index 185c505fa8..0a5d0186df 100644 --- a/bin/cliain/src/staking.rs +++ b/bin/cliain/src/staking.rs @@ -44,8 +44,8 @@ pub async fn set_staking_limits( ) { root_connection .set_staking_config( - minimal_nominator_stake_tokens as u128 * TOKEN, - minimal_validator_stake_tokens as u128 * TOKEN, + Some(minimal_nominator_stake_tokens as u128 * TOKEN), + Some(minimal_validator_stake_tokens as u128 * TOKEN), max_nominators_count, max_validators_count, TxStatus::Finalized, diff --git a/e2e-tests/src/ban.rs b/e2e-tests/src/ban.rs index 9a48ba165d..f4542853ae 100644 --- a/e2e-tests/src/ban.rs +++ b/e2e-tests/src/ban.rs @@ -122,20 +122,8 @@ pub async fn check_underperformed_validator_reason( .get_ban_info_for_validator(validator.clone(), None) .await; - match (validator_ban_info.as_ref(), expected_info) { - (Some(info), Some(expected_info)) => { - // terrible hack for now :( - assert_eq!(info.reason.encode(), expected_info.reason.encode()); - assert_eq!(info.start, expected_info.start); - - validator_ban_info - } - (None, None) => None, - _ => panic!( - "expected infos to be equal: expected {:?}, got {:?}", - expected_info, validator_ban_info - ), - } + assert_eq!(validator_ban_info.as_ref(), expected_info); + validator_ban_info } pub async fn check_ban_info_for_validator( diff --git a/e2e-tests/src/config.rs b/e2e-tests/src/config.rs index a69be41e6c..0dd4a68143 100644 --- a/e2e-tests/src/config.rs +++ b/e2e-tests/src/config.rs @@ -8,7 +8,7 @@ use crate::accounts::{get_sudo_key, get_validators_keys, get_validators_seeds, N #[clap(version = "1.0")] pub struct Config { /// WS endpoint address of the node to connect to - #[clap(long, default_value = "127.0.0.1:9943")] + #[clap(long, default_value = "ws://127.0.0.1:9943")] pub node: String, /// Test cases to run. diff --git a/e2e-tests/src/rewards.rs b/e2e-tests/src/rewards.rs index a386326d2c..ad3ef85845 100644 --- a/e2e-tests/src/rewards.rs +++ b/e2e-tests/src/rewards.rs @@ -2,8 +2,6 @@ use std::collections::{HashMap, HashSet}; use aleph_client::{ account_from_keypair, - aleph_runtime::SessionKeys, - api::runtime_types, pallets::{ author::AuthorRpc, balances::{BalanceUserApi, BalanceUserBatchExtApi}, @@ -37,19 +35,11 @@ type RewardPoint = u32; pub async fn set_invalid_keys_for_validator( controller_connection: &SignedConnection, ) -> anyhow::Result<()> { - const ZERO_SESSION_KEYS: SessionKeys = SessionKeys { - // todo: clean this - aura: runtime_types::sp_consensus_aura::sr25519::app_sr25519::Public( - runtime_types::sp_core::sr25519::Public([0; 32]), - ), - aleph: runtime_types::primitives::app::Public(runtime_types::sp_core::ed25519::Public( - [0; 32], - )), - }; + let zero_session_keys = [0; 64].to_vec().into(); // wait until our node is forced to use new keys, i.e. current session + 2 controller_connection - .set_keys(ZERO_SESSION_KEYS, TxStatus::InBlock) + .set_keys(zero_session_keys, TxStatus::InBlock) .await .unwrap(); controller_connection diff --git a/e2e-tests/src/test/ban.rs b/e2e-tests/src/test/ban.rs index 5e2371d9ea..8047aac627 100644 --- a/e2e-tests/src/test/ban.rs +++ b/e2e-tests/src/test/ban.rs @@ -226,10 +226,8 @@ pub async fn clearing_session_count(config: &Config) -> anyhow::Result<()> { let (root_connection, reserved_validators, non_reserved_validators, _) = setup_test(config).await?; - info!(target: "aleph-client", "changing ban config"); - root_connection - .change_ban_config(None, Some(3), Some(2), None, TxStatus::InBlock) + .set_ban_config(None, Some(3), Some(2), None, TxStatus::InBlock) .await?; let validator_to_disable = @@ -294,7 +292,7 @@ pub async fn ban_threshold(config: &Config) -> anyhow::Result<()> { // Change ban config to require prohibitively high performance from all validators. root_connection - .change_ban_config( + .set_ban_config( Some(MIN_EXPECTED_PERFORMANCE), None, None, diff --git a/e2e-tests/src/test/rewards.rs b/e2e-tests/src/test/rewards.rs index 4ab255c71b..514cdb170a 100644 --- a/e2e-tests/src/test/rewards.rs +++ b/e2e-tests/src/test/rewards.rs @@ -43,7 +43,10 @@ pub async fn points_basic(config: &Config) -> anyhow::Result<()> { ); for session in start_session..end_session { - let era = connection.connection.get_era_for_session(session).await; + let era = connection + .connection + .get_active_era_for_session(session) + .await; let (members_active, members_bench) = get_and_test_members_for_session( &connection.connection, committee_size.clone(), @@ -99,7 +102,10 @@ pub async fn points_stake_change(config: &Config) -> anyhow::Result<()> { ); for session in start_session..end_session { - let era = connection.connection.get_era_for_session(session).await; + let era = connection + .connection + .get_active_era_for_session(session) + .await; let (members_active, members_bench) = get_and_test_members_for_session( &connection.connection, committee_size.clone(), @@ -152,7 +158,7 @@ pub async fn disable_node(config: &Config) -> anyhow::Result<()> { for session in start_session..end_session { let era = root_connection .connection - .get_era_for_session(session) + .get_active_era_for_session(session) .await; let (members_active, members_bench) = get_and_test_members_for_session( &controller_connection.connection, @@ -188,7 +194,7 @@ pub async fn force_new_era(config: &Config) -> anyhow::Result<()> { let root_connection = config.create_root_connection().await; let start_era = connection .connection - .get_era_for_session(start_session) + .get_active_era_for_session(start_session) .await; info!("Start | era: {}, session: {}", start_era, start_session); @@ -231,7 +237,7 @@ pub async fn change_stake_and_force_new_era(config: &Config) -> anyhow::Result<( let start_era = connection .connection - .get_era_for_session(start_session) + .get_active_era_for_session(start_session) .await; info!("Start | era: {}, session: {}", start_era, start_session); From 8f417bd10c9f7b041ea8b56668724fd8edb7dadb Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Fri, 18 Nov 2022 19:28:21 +0100 Subject: [PATCH 22/24] retries --- aleph-client/Cargo.lock | 77 --------------------------------- aleph-client/Cargo.toml | 1 - aleph-client/src/connections.rs | 23 ++++++++-- bin/cliain/Cargo.lock | 77 --------------------------------- e2e-tests/Cargo.lock | 1 - 5 files changed, 19 insertions(+), 160 deletions(-) diff --git a/aleph-client/Cargo.lock b/aleph-client/Cargo.lock index 2e4cd499da..22b67d2035 100644 --- a/aleph-client/Cargo.lock +++ b/aleph-client/Cargo.lock @@ -62,7 +62,6 @@ dependencies = [ "log", "parity-scale-codec", "primitives", - "rayon", "serde", "serde_json", "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", @@ -440,49 +439,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" -dependencies = [ - "cfg-if", -] - [[package]] name = "crunchy" version = "0.2.2" @@ -1639,15 +1595,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - [[package]] name = "memory-db" version = "0.29.0" @@ -2152,30 +2099,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rayon" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" -dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "num_cpus", -] - [[package]] name = "redox_syscall" version = "0.2.16" diff --git a/aleph-client/Cargo.toml b/aleph-client/Cargo.toml index edb1fae5f6..7c844fc11c 100644 --- a/aleph-client/Cargo.toml +++ b/aleph-client/Cargo.toml @@ -10,7 +10,6 @@ anyhow = "1.0" codec = { package = 'parity-scale-codec', version = "3.0.0", features = ['derive'] } hex = { version = "0.4.3", features = ["alloc"] } log = "0.4" -rayon = "1.5" serde_json = { version = "1.0" } thiserror = "1.0" contract-metadata = "1.5" diff --git a/aleph-client/src/connections.rs b/aleph-client/src/connections.rs index 7f3c7143a4..ed94c16b1a 100644 --- a/aleph-client/src/connections.rs +++ b/aleph-client/src/connections.rs @@ -1,3 +1,5 @@ +use std::{thread::sleep, time::Duration}; + use anyhow::anyhow; use codec::Decode; use log::info; @@ -51,12 +53,25 @@ impl SudoCall for RootConnection { } impl Connection { + const DEFAULT_RETRIES: u32 = 10; + const RETRY_WAIT_SECS: u64 = 1; + pub async fn new(address: String) -> Self { - let client = Client::from_url(address) - .await - .expect("Should connect to the chain"); + Self::new_with_retries(address, Self::DEFAULT_RETRIES).await + } - Self { client } + pub async fn new_with_retries(address: String, mut retries: u32) -> Self { + loop { + let client = Client::from_url(&address).await; + match (retries, client) { + (_, Ok(client)) => return Self { client }, + (0, Err(e)) => panic!("{:?}", e), + _ => { + sleep(Duration::from_secs(Self::RETRY_WAIT_SECS)); + retries -= 1; + } + } + } } pub async fn get_storage_entry( diff --git a/bin/cliain/Cargo.lock b/bin/cliain/Cargo.lock index 2010ae5492..42e96808f4 100644 --- a/bin/cliain/Cargo.lock +++ b/bin/cliain/Cargo.lock @@ -62,7 +62,6 @@ dependencies = [ "log", "parity-scale-codec", "primitives", - "rayon", "serde", "serde_json", "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", @@ -538,49 +537,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" -dependencies = [ - "cfg-if", -] - [[package]] name = "crunchy" version = "0.2.2" @@ -1858,15 +1814,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - [[package]] name = "memory-db" version = "0.29.0" @@ -2517,30 +2464,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" -[[package]] -name = "rayon" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" -dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "num_cpus", -] - [[package]] name = "redox_syscall" version = "0.2.16" diff --git a/e2e-tests/Cargo.lock b/e2e-tests/Cargo.lock index 53686a553f..e574d80b0e 100644 --- a/e2e-tests/Cargo.lock +++ b/e2e-tests/Cargo.lock @@ -87,7 +87,6 @@ dependencies = [ "log", "parity-scale-codec", "primitives", - "rayon", "serde", "serde_json", "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", From f42c121bdeeefe63b56668f50e0d29aa9c71e0a2 Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Mon, 21 Nov 2022 08:14:37 +0100 Subject: [PATCH 23/24] versions + readme --- aleph-client/README.md | 7 +++++++ aleph-client/src/lib.rs | 2 +- benches/payout-stakers/Cargo.toml | 2 +- scripts/run_e2e.sh | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 aleph-client/README.md diff --git a/aleph-client/README.md b/aleph-client/README.md new file mode 100644 index 0000000000..340175d835 --- /dev/null +++ b/aleph-client/README.md @@ -0,0 +1,7 @@ +### Metadata + +We use autogenerated metadata in this lib. To generate it you will need subxt-cli. See [here](https://github.com/paritytech/subxt) for instructions how to install it. +The metadata is generated by: +```bash +subxt codegen --derive Clone Debug Eq PartialEq | rustfmt --edition=2021 > src/aleph_zero.rs +``` \ No newline at end of file diff --git a/aleph-client/src/lib.rs b/aleph-client/src/lib.rs index 8547a290ba..779dac03ac 100644 --- a/aleph-client/src/lib.rs +++ b/aleph-client/src/lib.rs @@ -8,7 +8,7 @@ use subxt::{ }; use crate::api::runtime_types::aleph_runtime::Call; -// generated by running `subxt codegen --derive Clone Debug Eq PartialEq | rustfmt --edition=2018 > src/aleph_zero.rs` +// generated by running `subxt codegen --derive Clone Debug Eq PartialEq | rustfmt --edition=2021 > src/aleph_zero.rs` #[allow(clippy::all)] mod aleph_zero; mod connections; diff --git a/benches/payout-stakers/Cargo.toml b/benches/payout-stakers/Cargo.toml index 35267af561..4c1bf5ad5c 100644 --- a/benches/payout-stakers/Cargo.toml +++ b/benches/payout-stakers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "payout-stakers" -version = "0.2.0" +version = "0.3.0" authors = ["Cardinal Cryptography"] edition = "2021" diff --git a/scripts/run_e2e.sh b/scripts/run_e2e.sh index d717f9b398..56c7343ee1 100755 --- a/scripts/run_e2e.sh +++ b/scripts/run_e2e.sh @@ -4,6 +4,6 @@ set -e cd e2e-tests/ -RUST_LOG=aleph_e2e_client=info,aleph-client=info cargo run -- --node ws://127.0.0.1:9944 +RUST_LOG=aleph_e2e_client=info,aleph-client=info cargo run -- --node ws://127.0.0.1:9943 exit $? From 223a5145b36dfccd75545632429be353b973e2c7 Mon Sep 17 00:00:00 2001 From: Jan Koscisz Date: Mon, 21 Nov 2022 12:50:12 +0100 Subject: [PATCH 24/24] contract rpc fix --- aleph-client/Cargo.lock | 26 ++++++++++++++++++++++++++ aleph-client/Cargo.toml | 1 + aleph-client/src/contract/mod.rs | 1 + aleph-client/src/pallets/contract.rs | 20 ++++++++++++++------ bin/cliain/Cargo.lock | 26 ++++++++++++++++++++++++++ bin/cliain/src/commands.rs | 2 +- 6 files changed, 69 insertions(+), 7 deletions(-) diff --git a/aleph-client/Cargo.lock b/aleph-client/Cargo.lock index 22b67d2035..377b507e8e 100644 --- a/aleph-client/Cargo.lock +++ b/aleph-client/Cargo.lock @@ -60,6 +60,7 @@ dependencies = [ "hex", "ink_metadata", "log", + "pallet-contracts-primitives", "parity-scale-codec", "primitives", "serde", @@ -1775,6 +1776,21 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "pallet-contracts-primitives" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "bitflags", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-rpc", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", +] + [[package]] name = "parity-scale-codec" version = "3.2.1" @@ -2986,6 +3002,16 @@ dependencies = [ "regex", ] +[[package]] +name = "sp-rpc" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "rustc-hash", + "serde", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", +] + [[package]] name = "sp-runtime" version = "6.0.0" diff --git a/aleph-client/Cargo.toml b/aleph-client/Cargo.toml index 7c844fc11c..acc908c76b 100644 --- a/aleph-client/Cargo.toml +++ b/aleph-client/Cargo.toml @@ -22,4 +22,5 @@ serde = { version = "1.0", features = ["derive"] } frame-support = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } sp-core = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28", features = ["full_crypto"] } sp-runtime = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } +pallet-contracts-primitives = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" } primitives = { path = "../primitives" } diff --git a/aleph-client/src/contract/mod.rs b/aleph-client/src/contract/mod.rs index b1b7db75b9..2157ed52d5 100644 --- a/aleph-client/src/contract/mod.rs +++ b/aleph-client/src/contract/mod.rs @@ -111,6 +111,7 @@ impl ContractInstance { value: 0, gas_limit: Self::MAX_READ_GAS, input_data: payload, + storage_deposit_limit: None, }; conn.call_and_get(args) .await diff --git a/aleph-client/src/pallets/contract.rs b/aleph-client/src/pallets/contract.rs index ba9a7ccd3e..885221d998 100644 --- a/aleph-client/src/pallets/contract.rs +++ b/aleph-client/src/pallets/contract.rs @@ -1,19 +1,23 @@ -use codec::{Compact, Decode}; +use codec::{Compact, Decode, Encode}; +use pallet_contracts_primitives::ContractExecResult; use primitives::Balance; -use serde::Serialize; -use subxt::{ext::sp_runtime::MultiAddress, rpc_params}; +use subxt::{ + ext::{sp_core::Bytes, sp_runtime::MultiAddress}, + rpc_params, +}; use crate::{ api, pallet_contracts::wasm::OwnerInfo, AccountId, BlockHash, Connection, SignedConnection, TxStatus, }; -#[derive(Serialize)] +#[derive(Encode)] pub struct ContractCallArgs { pub origin: AccountId, pub dest: AccountId, pub value: Balance, pub gas_limit: u64, + pub storage_deposit_limit: Option, pub input_data: Vec, } @@ -180,8 +184,12 @@ impl ContractsUserApi for SignedConnection { #[async_trait::async_trait] impl ContractRpc for Connection { async fn call_and_get(&self, args: ContractCallArgs) -> anyhow::Result { - let params = rpc_params![args]; + let params = rpc_params!["ContractsApi_call", Bytes(args.encode())]; + + let res: ContractExecResult = + self.rpc_call("state_call".to_string(), params).await?; + let res = T::decode(&mut (res.result.unwrap().data.0.as_slice()))?; - self.rpc_call("contracts_call".to_string(), params).await + Ok(res) } } diff --git a/bin/cliain/Cargo.lock b/bin/cliain/Cargo.lock index 42e96808f4..48c2b05542 100644 --- a/bin/cliain/Cargo.lock +++ b/bin/cliain/Cargo.lock @@ -60,6 +60,7 @@ dependencies = [ "hex", "ink_metadata", "log", + "pallet-contracts-primitives", "parity-scale-codec", "primitives", "serde", @@ -2065,6 +2066,21 @@ dependencies = [ "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", ] +[[package]] +name = "pallet-contracts-primitives" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "bitflags", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-rpc", + "sp-runtime 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", + "sp-std 4.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", +] + [[package]] name = "pallet-session" version = "4.0.0-dev" @@ -3407,6 +3423,16 @@ dependencies = [ "regex", ] +[[package]] +name = "sp-rpc" +version = "6.0.0" +source = "git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28#5e8b6fa2130236497878e53c169e41f1f7871e6b" +dependencies = [ + "rustc-hash", + "serde", + "sp-core 6.0.0 (git+https://github.com/Cardinal-Cryptography/substrate.git?branch=aleph-v0.9.28)", +] + [[package]] name = "sp-runtime" version = "6.0.0" diff --git a/bin/cliain/src/commands.rs b/bin/cliain/src/commands.rs index d3a4a3da3e..0217a376e9 100644 --- a/bin/cliain/src/commands.rs +++ b/bin/cliain/src/commands.rs @@ -15,7 +15,7 @@ pub struct ContractOptions { #[clap(long, default_value = "0")] pub balance: u128, /// The gas limit enforced when executing the constructor - #[clap(long, default_value = "1_000_000_000")] + #[clap(long, default_value = "1000000000")] pub gas_limit: u64, /// The maximum amount of balance that can be charged/reserved from the caller to pay for the storage consumed #[clap(long)]