diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index a313bd11b..2784dd838 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -28,18 +28,28 @@ jobs: target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - uses: actions-rs/toolchain@v1 + - name: Install nightly `rust-fmt` + uses: actions-rs/toolchain@v1 with: # NOTE: Until https://github.com/actions-rs/toolchain/pull/209 is merged, # this should be synced with rust-toolchain.toml file. # After merge, this section should be removed. toolchain: nightly-2021-12-05 - components: rustfmt, clippy, llvm-tools-preview + components: rustfmt + profile: minimal + + - name: Install Rust toolchain 1.64 + uses: actions-rs/toolchain@v1 + with: + toolchain: 1.64 + components: clippy, llvm-tools-preview + default: true profile: minimal - name: Check code formatting uses: actions-rs/cargo@v1 with: + toolchain: nightly-2021-12-05 command: fmt args: --check @@ -49,7 +59,7 @@ jobs: command: test args: --workspace --exclude fuzzing env: - RUSTFLAGS: "-Zinstrument-coverage" + RUSTFLAGS: "-C instrument-coverage" LLVM_PROFILE_FILE: "profile-%p-%m.profraw" SKIP_WASM_BUILD: true diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml index bd18b71fb..1c9961d2e 100644 --- a/.github/workflows/releaser.yml +++ b/.github/workflows/releaser.yml @@ -124,4 +124,4 @@ jobs: file: ./Dockerfile platforms: linux/amd64 push: true - tags: 0xpolygon/avail:${{ steps.prepare.outputs.tag_name }} + tags: 0xpolygon/avail:${{ steps.prepare.outputs.tag_name }} \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 7660a7b48..904618d94 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,7 +27,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" dependencies = [ - "gimli 0.26.1", + "gimli 0.26.2", ] [[package]] @@ -42,7 +42,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] @@ -53,7 +53,7 @@ checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" dependencies = [ "cfg-if 1.0.0", "cipher", - "cpufeatures 0.2.2", + "cpufeatures 0.2.5", "opaque-debug 0.3.0", ] @@ -73,13 +73,15 @@ dependencies = [ [[package]] name = "afl" -version = "0.12.2" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f72c8857a0339099c5b95cdbabbc9de5c4df5b25df2b295ed7577637acd5105" +checksum = "29d4b3411687df6020ec99478c56acd3c23b1caf0485575918f9c8852fda854d" dependencies = [ - "clap 3.1.9", + "clap 4.0.18", + "fs_extra", "libc", "rustc_version 0.4.0", + "tempfile", "xdg", ] @@ -95,20 +97,29 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom 0.2.6", + "getrandom 0.2.7", "once_cell", "version_check", ] [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" dependencies = [ "memchr", ] +[[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" @@ -120,9 +131,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.56" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27" +checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" [[package]] name = "approx" @@ -168,9 +179,9 @@ checksum = "e22d1f4b888c298a027c99dc9048015fac177587de20fc30232a057dfbe24a21" [[package]] name = "async-channel" -version = "1.6.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +checksum = "e14485364214912d3b19cc3435dde4df66065127f05fa0d75c712f36f12c2f28" dependencies = [ "concurrent-queue", "event-listener", @@ -193,26 +204,26 @@ dependencies = [ [[package]] name = "async-global-executor" -version = "2.0.4" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c290043c9a95b05d45e952fb6383c67bcb61471f60cfa21e890dba6654234f43" +checksum = "0da5b41ee986eed3f524c380e6d64965aea573882a8907682ad100f7859305ca" dependencies = [ "async-channel", "async-executor", "async-io", - "async-mutex", + "async-lock", "blocking", "futures-lite", - "num_cpus", "once_cell", ] [[package]] name = "async-io" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" +checksum = "83e21f3a490c72b3b0cf44962180e60045de2925d8dff97918f7ee43c8f637c7" dependencies = [ + "autocfg", "concurrent-queue", "futures-lite", "libc", @@ -221,7 +232,7 @@ dependencies = [ "parking", "polling", "slab", - "socket2 0.4.4", + "socket2 0.4.7", "waker-fn", "winapi 0.3.9", ] @@ -235,22 +246,14 @@ dependencies = [ "event-listener", ] -[[package]] -name = "async-mutex" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" -dependencies = [ - "event-listener", -] - [[package]] name = "async-process" -version = "1.3.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83137067e3a2a6a06d67168e49e68a0957d215410473a740cea95a2425c0b7c6" +checksum = "02111fd8655a613c25069ea89fc8d9bb89331fa77486eb3bc059ee757cfa481c" dependencies = [ "async-io", + "autocfg", "blocking", "cfg-if 1.0.0", "event-listener", @@ -263,9 +266,9 @@ dependencies = [ [[package]] name = "async-std" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52580991739c5cdb36cde8b2a516371c0a3b70dda36d916cc08b82372916808c" +checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" dependencies = [ "async-channel", "async-global-executor", @@ -281,9 +284,8 @@ dependencies = [ "kv-log-macro", "log", "memchr", - "num_cpus", "once_cell", - "pin-project-lite 0.2.8", + "pin-project-lite 0.2.9", "pin-utils", "slab", "wasm-bindgen-futures", @@ -305,15 +307,15 @@ dependencies = [ [[package]] name = "async-task" -version = "4.2.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" +checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" [[package]] name = "async-trait" -version = "0.1.53" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" +checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" dependencies = [ "proc-macro2", "quote", @@ -326,11 +328,11 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb4401f0a3622dad2e0763fa79e0eb328bc70fb7dccfdd645341f00d671247d6" dependencies = [ - "bytes 1.1.0", + "bytes 1.2.1", "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.8", + "pin-project-lite 0.2.9", ] [[package]] @@ -339,11 +341,11 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0de5164e5edbf51c45fb8c2d9664ae1c095cce1b265ecf7569093c0d66ef690" dependencies = [ - "bytes 1.1.0", + "bytes 1.2.1", "futures-sink", "futures-util", "memchr", - "pin-project-lite 0.2.8", + "pin-project-lite 0.2.9", ] [[package]] @@ -380,24 +382,24 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a17d453482a265fd5f8479f2a3f405566e6ca627837aaddb85af8b1ab8ef61" +checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" dependencies = [ "addr2line 0.17.0", "cc", "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.28.3", + "object 0.29.0", "rustc-demangle", ] [[package]] name = "base-x" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" +checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" [[package]] name = "base16ct" @@ -451,6 +453,11 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dabbe35f96fb9507f7330793dc490461b2962659ac5d427181e451a623751d1" +[[package]] +name = "beefy-merkle-tree" +version = "4.0.0-dev" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" + [[package]] name = "bimap" version = "0.6.2" @@ -485,21 +492,6 @@ dependencies = [ "shlex", ] -[[package]] -name = "bit-set" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - [[package]] name = "bitflags" version = "1.3.2" @@ -541,9 +533,9 @@ dependencies = [ [[package]] name = "bitvec" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1489fcb93a5bb47da0462ca93ad252ad6af2145cce58d10d46a83931ba9f016b" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty 2.0.0", "radium 0.7.0", @@ -628,16 +620,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ "block-padding 0.2.1", - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] @@ -712,9 +704,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.9.1" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" [[package]] name = "byte-slice-cast" @@ -746,9 +738,9 @@ dependencies = [ [[package]] name = "bytes" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" dependencies = [ "serde", ] @@ -783,12 +775,9 @@ dependencies = [ [[package]] name = "cast" -version = "0.2.7" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c24dab4283a142afa2fdca129b80ad2c6284e073930f964c3a1293c225ee39a" -dependencies = [ - "rustc_version 0.4.0", -] +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" @@ -847,14 +836,16 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" dependencies = [ - "libc", + "iana-time-zone", + "js-sys", "num-integer", "num-traits", "time", + "wasm-bindgen", "winapi 0.3.9", ] @@ -875,7 +866,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] @@ -889,9 +880,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cc00842eed744b858222c4c9faf7243aafc6d33f92f96935263ef4d8a41ce21" +checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3" dependencies = [ "glob", "libc", @@ -908,32 +899,30 @@ dependencies = [ "atty", "bitflags", "strsim 0.8.0", - "textwrap 0.11.0", + "textwrap", "unicode-width", "vec_map", ] [[package]] name = "clap" -version = "3.1.9" +version = "4.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aad2534fad53df1cc12519c5cda696dd3e20e6118a027e24054aea14a0bdcbe" +checksum = "335867764ed2de42325fafe6d18b8af74ba97ee0c590fa016f157535b42ab04b" dependencies = [ "atty", "bitflags", "clap_lex", - "indexmap", - "lazy_static", + "once_cell", "strsim 0.10.0", "termcolor", - "textwrap 0.15.0", ] [[package]] name = "clap_lex" -version = "0.1.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "189ddd3b5d32a70b35e7686054371742a937b0d99128e76dde6340210e966669" +checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" dependencies = [ "os_str_bytes", ] @@ -948,7 +937,7 @@ dependencies = [ "bs58", "coins-core", "digest 0.9.0", - "getrandom 0.2.6", + "getrandom 0.2.7", "hmac 0.11.0", "k256", "lazy_static", @@ -965,7 +954,7 @@ checksum = "8f473ea37dfc9d2cb94fdde50c3d41f28c3f384b367573d66386fea38d76d466" dependencies = [ "bitvec 0.17.4", "coins-bip32", - "getrandom 0.2.6", + "getrandom 0.2.7", "hex", "hmac 0.11.0", "pbkdf2 0.8.0", @@ -985,7 +974,7 @@ dependencies = [ "bech32", "blake2", "digest 0.9.0", - "generic-array 0.14.5", + "generic-array 0.14.6", "hex", "ripemd160", "serde", @@ -997,9 +986,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "1.2.2" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +checksum = "af4780a44ab5696ea9e28294517f1fffb421a83a25af521333c838635509db9c" dependencies = [ "cache-padded", ] @@ -1064,9 +1053,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" dependencies = [ "libc", ] @@ -1154,7 +1143,7 @@ dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools 0.10.3", + "itertools 0.10.5", "log", "smallvec", "wasmparser", @@ -1172,16 +1161,16 @@ dependencies = [ [[package]] name = "criterion" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1604dafd25fba2fe2d5895a9da139f8dc9b319a5fe5354ca137cbbce4e178d10" +checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" dependencies = [ "atty", "cast", "clap 2.34.0", "criterion-plot", "csv", - "itertools 0.10.3", + "itertools 0.10.5", "lazy_static", "num-traits", "oorandom", @@ -1198,19 +1187,19 @@ dependencies = [ [[package]] name = "criterion-plot" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d00996de9f2f7559f7f4dc286073197f83e92256a59ed395f9aac01fe717da57" +checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" dependencies = [ "cast", - "itertools 0.10.3", + "itertools 0.10.5", ] [[package]] name = "crossbeam-channel" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -1218,9 +1207,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ "cfg-if 1.0.0", "crossbeam-epoch", @@ -1229,26 +1218,24 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.8" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" +checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" dependencies = [ "autocfg", "cfg-if 1.0.0", "crossbeam-utils", - "lazy_static", "memoffset", "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.8" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "edbafec5fa1f196ca66527c1b12c2ec4745ca14b50f1ad8f9f6f720b55d11fac" dependencies = [ "cfg-if 1.0.0", - "lazy_static", ] [[package]] @@ -1263,8 +1250,8 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" dependencies = [ - "generic-array 0.14.5", - "rand_core 0.6.3", + "generic-array 0.14.6", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -1275,7 +1262,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "typenum", ] @@ -1285,7 +1272,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "subtle", ] @@ -1295,7 +1282,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "subtle", ] @@ -1386,6 +1373,35 @@ dependencies = [ "zeroize", ] +[[package]] +name = "da-bridge" +version = "1.0.0" +dependencies = [ + "da-control", + "da-primitives", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "hex-literal", + "merkle", + "nomad-base", + "nomad-core", + "nomad-home", + "pallet-transaction-payment", + "parity-scale-codec 2.3.1", + "primitive-types 0.10.1", + "rand 0.8.5", + "scale-info", + "serde", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "updater-manager", +] + [[package]] name = "da-control" version = "1.0.0" @@ -1410,8 +1426,11 @@ dependencies = [ [[package]] name = "da-primitives" -version = "0.1.0" +version = "0.2.2" +source = "git+https://github.com/maticnetwork/avail-core.git?tag=v0.2.2#e2fd5c4dc4a02f5f48f2261db1cd5f8f28ae360d" dependencies = [ + "beefy-merkle-tree", + "derive_more", "frame-support", "log", "parity-scale-codec 2.3.1", @@ -1424,14 +1443,17 @@ dependencies = [ "sp-runtime", "sp-runtime-interface", "sp-std", + "thiserror-no-std", ] [[package]] name = "da-runtime" -version = "4.0.0" +version = "6.0.0" dependencies = [ + "da-bridge", "da-control", "da-primitives", + "env_logger", "frame-benchmarking", "frame-election-provider-support", "frame-executive", @@ -1443,6 +1465,8 @@ dependencies = [ "hex-literal", "kate", "kate-rpc-runtime-api", + "log", + "nomad-home", "pallet-asset-tx-payment", "pallet-authority-discovery", "pallet-authorship", @@ -1496,29 +1520,31 @@ dependencies = [ "static_assertions", "substrate-wasm-builder", "test-case", + "updater-manager", ] [[package]] name = "data-avail" -version = "1.1.0" +version = "1.3.0" dependencies = [ + "da-bridge", "da-control", "da-primitives", "da-runtime", - "dusk-plonk", "frame-benchmarking", "frame-benchmarking-cli", "frame-support", "frame-system", "frame-system-rpc-runtime-api", - "futures 0.3.21", + "futures 0.3.24", "hex-literal", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", "kate", "kate-rpc", - "lru 0.7.5", + "lru 0.7.8", + "nomad-home", "pallet-asset-tx-payment", "pallet-im-online", "pallet-mmr-rpc", @@ -1576,6 +1602,7 @@ dependencies = [ "substrate-build-script-utils", "substrate-frame-rpc-system", "tempfile", + "updater-manager", ] [[package]] @@ -1652,16 +1679,16 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", ] [[package]] name = "digest" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" dependencies = [ - "block-buffer 0.10.2", + "block-buffer 0.10.3", "crypto-common", "subtle", ] @@ -1723,7 +1750,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4d33be9473d06f75f58220f71f7a9317aca647dc061dbd3c361b0bef505fbea" dependencies = [ "byteorder", - "quick-error 1.2.3", + "quick-error", ] [[package]] @@ -1740,42 +1767,42 @@ checksum = "56899898ce76aaf4a0f24d914c97ea6ed976d42fec6ad33fcbb0a1103e07b2b0" [[package]] name = "dusk-bls12_381" -version = "0.8.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22aa3d0bb1f8a54723a33b056022b2f71eca929a86e2e03653f18b9dff0b1b8" +checksum = "e24fd566c9601db3afc08574e9592bac981d2adeca458439e1f06615f511ce09" dependencies = [ "byteorder", "dusk-bytes", - "rand_core 0.6.3", + "rand_core 0.6.4", "rayon", "subtle", ] [[package]] name = "dusk-bytes" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4422ec33d6a528cc35d889a75f79e58101a9bc73522f34bb3405a36bedc90f8a" +checksum = "f4aae12696d965c95ce5b79bc5612575e8aeac958c9e037b74ffa9e73e1cd8c7" dependencies = [ "derive-hex", ] [[package]] name = "dusk-jubjub" -version = "0.10.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f842f5a6811741a236f46d4b7cd9da8a21e435e3395b4c3878681e0bb8e38d6f" +checksum = "2a6097b9d4dc11110f6dea84f7d3594736764a789ce16b17a7a492f5d5926e62" dependencies = [ "dusk-bls12_381", "dusk-bytes", - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", ] [[package]] name = "dusk-plonk" -version = "0.8.2" -source = "git+https://github.com/maticnetwork/plonk.git?branch=v0.8.2-polygon-5#08d6cacb994e898645b975a4f745c0c643a121ad" +version = "0.12.0" +source = "git+https://github.com/maticnetwork/plonk.git?tag=v0.12.0-polygon-1#d8cdbd1787405ecceb494b9d1438254b1c1de53b" dependencies = [ "cfg-if 1.0.0", "dusk-bls12_381", @@ -1784,7 +1811,7 @@ dependencies = [ "hashbrown 0.9.1", "itertools 0.9.0", "merlin 3.0.0", - "rand_core 0.6.3", + "rand_core 0.6.4", "rayon", ] @@ -1811,9 +1838,9 @@ dependencies = [ [[package]] name = "dyn-clone" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e50f3adc76d6a43f5ed73b698a87d0760ca74617f60f7c3b879003536fdd28" +checksum = "4f94fa09c2aeea5b8839e414b7b841bf429fd25b9c522116ac97ee87856d88b2" [[package]] name = "ecdsa" @@ -1829,9 +1856,9 @@ dependencies = [ [[package]] name = "ed25519" -version = "1.4.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d5c4b5e5959dc2c2b89918d8e2cc40fcdd623cef026ed09d2f0ee05199dc8e4" +checksum = "1e9c280362032ea4203659fc489832d0204ef09f247a0506f170dafcac08c369" dependencies = [ "signature 1.4.0", ] @@ -1852,9 +1879,9 @@ dependencies = [ [[package]] name = "either" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "elliptic-curve" @@ -1866,9 +1893,9 @@ dependencies = [ "crypto-bigint", "der", "ff 0.11.1", - "generic-array 0.14.5", + "generic-array 0.14.6", "group 0.11.0", - "rand_core 0.6.3", + "rand_core 0.6.4", "sec1", "subtle", "zeroize", @@ -1888,9 +1915,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +checksum = "c90bf5f19754d10198ccb95b70664fc925bd1fc090a0fd9a6ebc54acc8cd6272" dependencies = [ "atty", "humantime", @@ -1934,7 +1961,7 @@ checksum = "6f65b750ac950f2f825b36d08bef4cda4112e19a7b1a68f6e2bb499413e12440" dependencies = [ "aes", "ctr", - "digest 0.10.3", + "digest 0.10.5", "hex", "hmac 0.12.1", "pbkdf2 0.11.0", @@ -1942,8 +1969,8 @@ dependencies = [ "scrypt", "serde", "serde_json", - "sha2 0.10.2", - "sha3 0.10.4", + "sha2 0.10.6", + "sha3 0.10.5", "thiserror", "uuid", ] @@ -1960,9 +1987,9 @@ dependencies = [ "regex", "serde", "serde_json", - "sha3 0.10.4", + "sha3 0.10.5", "thiserror", - "uint 0.9.3", + "uint 0.9.4", ] [[package]] @@ -2002,7 +2029,7 @@ dependencies = [ "impl-rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "impl-serde 0.3.2", "primitive-types 0.10.1", - "uint 0.9.3", + "uint 0.9.4", ] [[package]] @@ -2016,7 +2043,7 @@ dependencies = [ "impl-rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "impl-serde 0.3.2", "primitive-types 0.11.1", - "uint 0.9.3", + "uint 0.9.4", ] [[package]] @@ -2026,12 +2053,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4536e70feeae231b73ac2221f1339a9a1969dea9cf1d679be26b73a36f14f4e7" dependencies = [ "arrayvec 0.7.2", - "bytes 1.1.0", + "bytes 1.2.1", "chrono", "convert_case 0.5.0", "elliptic-curve", "ethabi", - "generic-array 0.14.5", + "generic-array 0.14.6", "hex", "k256", "proc-macro2", @@ -2068,9 +2095,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "exit-future" @@ -2078,7 +2105,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", ] [[package]] @@ -2095,9 +2122,9 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" dependencies = [ "instant", ] @@ -2128,7 +2155,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" dependencies = [ - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", ] @@ -2149,12 +2176,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8ac3ff5224ef91f3c97e03eb1de2db82743427e91aaa5ac635f454f0b164f5a" dependencies = [ "either", - "futures 0.3.21", + "futures 0.3.24", "futures-timer 3.0.2", "log", "num-traits", "parity-scale-codec 2.3.1", - "parking_lot", + "parking_lot 0.11.2", "scale-info", ] @@ -2183,19 +2210,17 @@ dependencies = [ [[package]] name = "fixedbitset" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279fb028e20b3c4c320317955b77c5e0c9701f05a1d309905d6fc702cdc5053e" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" dependencies = [ - "cfg-if 1.0.0", "crc32fast", - "libc", "libz-sys", "miniz_oxide", ] @@ -2216,12 +2241,11 @@ dependencies = [ [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", - "percent-encoding 2.1.0", + "percent-encoding 2.2.0", ] [[package]] @@ -2367,7 +2391,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.2.1", "proc-macro2", "quote", "syn", @@ -2387,6 +2411,7 @@ dependencies = [ name = "frame-system" version = "4.0.0-dev" dependencies = [ + "beefy-merkle-tree", "criterion", "da-primitives", "frame-support", @@ -2455,6 +2480,12 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "fs_extra" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" + [[package]] name = "fuchsia-zircon" version = "0.3.3" @@ -2491,9 +2522,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" dependencies = [ "futures-channel", "futures-core", @@ -2506,9 +2537,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" dependencies = [ "futures-core", "futures-sink", @@ -2516,15 +2547,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" +checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" [[package]] name = "futures-executor" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" dependencies = [ "futures-core", "futures-task", @@ -2534,9 +2565,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" [[package]] name = "futures-lite" @@ -2549,15 +2580,15 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.8", + "pin-project-lite 0.2.9", "waker-fn", ] [[package]] name = "futures-macro" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" dependencies = [ "proc-macro2", "quote", @@ -2577,15 +2608,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" [[package]] name = "futures-timer" @@ -2601,9 +2632,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" dependencies = [ "futures 0.1.31", "futures-channel", @@ -2613,7 +2644,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.8", + "pin-project-lite 0.2.9", "pin-utils", "slab", ] @@ -2640,9 +2671,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" dependencies = [ "typenum", "version_check", @@ -2663,14 +2694,14 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if 1.0.0", "js-sys", "libc", - "wasi 0.10.0+wasi-snapshot-preview1", + "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", ] @@ -2697,9 +2728,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" [[package]] name = "glob" @@ -2709,9 +2740,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "globset" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd" +checksum = "0a1e17342619edbc21a964c2afbeb6c820c6a2560032872f397bb97ea127bd0a" dependencies = [ "aho-corasick", "bstr", @@ -2751,17 +2782,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" dependencies = [ "ff 0.11.1", - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", ] [[package]] name = "h2" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" dependencies = [ - "bytes 1.1.0", + "bytes 1.2.1", "fnv", "futures-core", "futures-sink", @@ -2770,7 +2801,7 @@ dependencies = [ "indexmap", "slab", "tokio", - "tokio-util 0.7.1", + "tokio-util 0.7.4", "tracing", ] @@ -2782,16 +2813,16 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "handlebars" -version = "4.2.2" +version = "4.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d6a30320f094710245150395bc763ad23128d6a1ebbad7594dc4164b62c56b" +checksum = "433e4ab33f1213cdc25b5fa45c76881240cfe79284cf2b395e8b9e312a30a2fd" dependencies = [ "log", "pest", "pest_derive", - "quick-error 2.0.1", "serde", "serde_json", + "thiserror", ] [[package]] @@ -2827,6 +2858,15 @@ dependencies = [ "ahash 0.7.6", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.6", +] + [[package]] name = "heck" version = "0.3.3" @@ -2895,7 +2935,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.3", + "digest 0.10.5", ] [[package]] @@ -2905,7 +2945,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array 0.14.5", + "generic-array 0.14.6", "hmac 0.8.1", ] @@ -2922,31 +2962,31 @@ dependencies = [ [[package]] name = "http" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ - "bytes 1.1.0", + "bytes 1.2.1", "fnv", - "itoa 1.0.1", + "itoa 1.0.4", ] [[package]] name = "http-body" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ - "bytes 1.1.0", + "bytes 1.2.1", "http", - "pin-project-lite 0.2.8", + "pin-project-lite 0.2.9", ] [[package]] name = "httparse" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6330e8a36bd8c859f3fa6d9382911fbb7147ec39807f63b923933a247240b9ba" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -2962,11 +3002,11 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.18" +version = "0.14.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b26ae0a80afebe130861d90abf98e3814a4f28a4c6ffeb5ab8ebb2be311e0ef2" +checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" dependencies = [ - "bytes 1.1.0", + "bytes 1.2.1", "futures-channel", "futures-core", "futures-util", @@ -2975,9 +3015,9 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa 1.0.1", - "pin-project-lite 0.2.8", - "socket2 0.4.4", + "itoa 1.0.4", + "pin-project-lite 0.2.9", + "socket2 0.4.7", "tokio", "tower-service", "tracing", @@ -3001,6 +3041,19 @@ dependencies = [ "webpki", ] +[[package]] +name = "iana-time-zone" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd911b35d940d2bd0bea0f9100068e5b97b51a1cbe13d13382f132e0365257a0" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "js-sys", + "wasm-bindgen", + "winapi 0.3.9", +] + [[package]] name = "idna" version = "0.1.5" @@ -3023,6 +3076,16 @@ dependencies = [ "unicode-normalization", ] +[[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 = "if-addrs" version = "0.6.7" @@ -3051,7 +3114,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae8ab7f67bad3240049cb24fb9cb0b4c2c6af4c245840917fbbdededeee91179" dependencies = [ "async-io", - "futures 0.3.21", + "futures 0.3.24", "futures-lite", "if-addrs", "ipnet", @@ -3074,7 +3137,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ - "parity-scale-codec 3.1.5", + "parity-scale-codec 3.2.1", ] [[package]] @@ -3124,12 +3187,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.8.1" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", - "hashbrown 0.11.2", + "hashbrown 0.12.3", "serde", ] @@ -3157,7 +3220,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64fa110ec7b8f493f416eed552740d10e7030ad5f63b2308f82c9608ec2df275" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "futures-timer 2.0.2", ] @@ -3215,9 +3278,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] @@ -3230,24 +3293,24 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" [[package]] name = "jobserver" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.57" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" dependencies = [ "wasm-bindgen", ] @@ -3259,7 +3322,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2b99d4207e2a04fb4581746903c2bb7eb376f88de9c699d0f3e10feeac0cd3a" dependencies = [ "derive_more", - "futures 0.3.21", + "futures 0.3.24", "jsonrpc-core", "jsonrpc-pubsub", "log", @@ -3274,7 +3337,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "futures-executor", "futures-util", "log", @@ -3289,7 +3352,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b51da17abecbdab3e3d4f26b01c5ec075e88d3abe3ab3b05dc9aa69392764ec0" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "jsonrpc-client-transports", ] @@ -3311,13 +3374,13 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1dea6e07251d9ce6a552abfb5d7ad6bc290a4596c8dcc3d795fae2bbdc1f3ff" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "hyper", "jsonrpc-core", "jsonrpc-server-utils", "log", "net2", - "parking_lot", + "parking_lot 0.11.2", "unicase", ] @@ -3327,12 +3390,12 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "382bb0206323ca7cda3dcd7e245cea86d37d02457a02a975e3378fb149a48845" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "jsonrpc-core", "jsonrpc-server-utils", "log", "parity-tokio-ipc", - "parking_lot", + "parking_lot 0.11.2", "tower-service", ] @@ -3342,11 +3405,11 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240f87695e6c6f62fb37f05c02c04953cf68d6408b8c1c89de85c7a0125b1011" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "jsonrpc-core", "lazy_static", "log", - "parking_lot", + "parking_lot 0.11.2", "rand 0.7.3", "serde", ] @@ -3357,15 +3420,15 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa4fdea130485b572c39a460d50888beb00afb3e35de23ccd7fad8ff19f0e0d4" dependencies = [ - "bytes 1.1.0", - "futures 0.3.21", + "bytes 1.2.1", + "futures 0.3.24", "globset", "jsonrpc-core", "lazy_static", "log", "tokio", "tokio-stream", - "tokio-util 0.6.9", + "tokio-util 0.6.10", "unicase", ] @@ -3375,12 +3438,12 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f892c7d766369475ab7b0669f417906302d7c0fb521285c0a0c92e52e7c8e946" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "jsonrpc-core", "jsonrpc-server-utils", "log", "parity-ws", - "parking_lot", + "parking_lot 0.11.2", "slab", ] @@ -3400,25 +3463,20 @@ dependencies = [ [[package]] name = "kate" -version = "0.1.0" +version = "0.3.2" +source = "git+https://github.com/maticnetwork/avail-core.git?tag=v0.2.2#e2fd5c4dc4a02f5f48f2261db1cd5f8f28ae360d" dependencies = [ "bls12_381", - "criterion", "da-primitives", "dusk-bytes", "dusk-plonk", "frame-support", - "getrandom 0.2.6", + "getrandom 0.2.7", "hex", - "hex-literal", - "itertools 0.10.3", - "kate-proof", - "kate-recovery", "log", "num_cpus", "once_cell", - "parity-scale-codec 3.1.5", - "proptest", + "parity-scale-codec 3.2.1", "rand 0.8.5", "rand_chacha 0.3.1", "rand_core 0.5.1", @@ -3427,33 +3485,19 @@ dependencies = [ "sp-core", "sp-std", "static_assertions", - "test-case", -] - -[[package]] -name = "kate-proof" -version = "0.1.0" -dependencies = [ - "anyhow", - "dusk-bytes", - "dusk-plonk", - "merlin 3.0.0", - "rand 0.8.5", - "rand_chacha 0.3.1", ] [[package]] name = "kate-recovery" -version = "0.1.0" +version = "0.1.2" +source = "git+https://github.com/maticnetwork/avail-core.git?tag=v0.2.2#e2fd5c4dc4a02f5f48f2261db1cd5f8f28ae360d" dependencies = [ "dusk-bytes", "dusk-plonk", - "getrandom 0.2.6", - "parity-scale-codec 3.1.5", - "rand 0.8.5", - "rand_chacha 0.3.1", + "getrandom 0.2.7", + "parity-scale-codec 3.2.1", "serde", - "thiserror", + "thiserror-no-std", ] [[package]] @@ -3461,7 +3505,6 @@ name = "kate-rpc" version = "0.1.0" dependencies = [ "da-primitives", - "dusk-plonk", "frame-support", "frame-system", "frame-system-rpc-runtime-api", @@ -3470,32 +3513,40 @@ dependencies = [ "jsonrpc-derive", "kate", "kate-rpc-runtime-api", - "lru 0.7.5", + "lru 0.7.8", "parity-scale-codec 2.3.1", "rs_merkle", "sc-client-api", "sc-client-db", "sp-api", "sp-blockchain", + "sp-core", "sp-rpc", "sp-runtime", "sp-std", + "thiserror", ] [[package]] name = "kate-rpc-runtime-api" version = "0.1.0" dependencies = [ + "beefy-merkle-tree", + "da-primitives", "frame-system", + "parity-scale-codec 2.3.1", + "serde", "sp-api", + "sp-arithmetic", + "sp-core", "sp-std", ] [[package]] name = "keccak" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" +checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" [[package]] name = "kernel32-sys" @@ -3534,7 +3585,7 @@ checksum = "c3b6b85fc643f5acd0bffb2cc8a6d150209379267af0d41db72170021841f9f5" dependencies = [ "kvdb", "parity-util-mem", - "parking_lot", + "parking_lot 0.11.2", ] [[package]] @@ -3549,7 +3600,7 @@ dependencies = [ "num_cpus", "owning_ref", "parity-util-mem", - "parking_lot", + "parking_lot 0.11.2", "regex", "rocksdb", "smallvec", @@ -3569,9 +3620,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.123" +version = "0.2.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb691a747a7ab48abc15c5b42066eaafde10dc427e3b6ee2a1cf43db04c763bd" +checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb" [[package]] name = "libloading" @@ -3595,9 +3646,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33a33a362ce288760ec6a508b94caaec573ae7d3bbbd91b87aa0bad4456839db" +checksum = "292a948cd991e376cf75541fe5b97a1081d713c618b4f1b9500f8844e49eb565" [[package]] name = "libp2p" @@ -3606,8 +3657,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bec54343492ba5940a6c555e512c6721139835d28c59bc22febece72dfd0d9d" dependencies = [ "atomic", - "bytes 1.1.0", - "futures 0.3.21", + "bytes 1.2.1", + "futures 0.3.24", "lazy_static", "libp2p-core", "libp2p-deflate", @@ -3634,8 +3685,8 @@ dependencies = [ "libp2p-websocket", "libp2p-yamux", "multiaddr", - "parking_lot", - "pin-project 1.0.10", + "parking_lot 0.11.2", + "pin-project 1.0.12", "smallvec", "wasm-timer", ] @@ -3651,7 +3702,7 @@ dependencies = [ "ed25519-dalek", "either", "fnv", - "futures 0.3.21", + "futures 0.3.24", "futures-timer 3.0.2", "instant", "lazy_static", @@ -3660,8 +3711,8 @@ dependencies = [ "multiaddr", "multihash 0.14.0", "multistream-select", - "parking_lot", - "pin-project 1.0.10", + "parking_lot 0.11.2", + "pin-project 1.0.12", "prost", "prost-build", "rand 0.8.5", @@ -3682,7 +3733,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51a800adb195f33de63f4b17b63fe64cfc23bf2c6a0d3d0d5321328664e65197" dependencies = [ "flate2", - "futures 0.3.21", + "futures 0.3.24", "libp2p-core", ] @@ -3693,7 +3744,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb8f89d15cb6e3c5bc22afff7513b11bab7856f2872d3cfba86f7f63a06bc498" dependencies = [ "async-std-resolver", - "futures 0.3.21", + "futures 0.3.24", "libp2p-core", "log", "smallvec", @@ -3708,7 +3759,7 @@ checksum = "aab3d7210901ea51b7bae2b581aa34521797af8c4ec738c980bda4a06434067f" dependencies = [ "cuckoofilter", "fnv", - "futures 0.3.21", + "futures 0.3.24", "libp2p-core", "libp2p-swarm", "log", @@ -3727,9 +3778,9 @@ dependencies = [ "asynchronous-codec 0.6.0", "base64 0.13.0", "byteorder", - "bytes 1.1.0", + "bytes 1.2.1", "fnv", - "futures 0.3.21", + "futures 0.3.24", "hex_fmt", "libp2p-core", "libp2p-swarm", @@ -3750,7 +3801,7 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cca1275574183f288ff8b72d535d5ffa5ea9292ef7829af8b47dcb197c7b0dcd" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "libp2p-core", "libp2p-swarm", "log", @@ -3769,10 +3820,10 @@ checksum = "a2297dc0ca285f3a09d1368bde02449e539b46f94d32d53233f53f6625bcd3ba" dependencies = [ "arrayvec 0.5.2", "asynchronous-codec 0.6.0", - "bytes 1.1.0", + "bytes 1.2.1", "either", "fnv", - "futures 0.3.21", + "futures 0.3.24", "libp2p-core", "libp2p-swarm", "log", @@ -3781,7 +3832,7 @@ dependencies = [ "rand 0.7.3", "sha2 0.9.9", "smallvec", - "uint 0.9.3", + "uint 0.9.4", "unsigned-varint 0.7.1", "void", "wasm-timer", @@ -3796,7 +3847,7 @@ dependencies = [ "async-io", "data-encoding", "dns-parser", - "futures 0.3.21", + "futures 0.3.24", "if-watch", "lazy_static", "libp2p-core", @@ -3804,7 +3855,7 @@ dependencies = [ "log", "rand 0.8.5", "smallvec", - "socket2 0.4.4", + "socket2 0.4.7", "void", ] @@ -3829,12 +3880,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f2cd64ef597f40e14bfce0497f50ecb63dd6d201c61796daeb4227078834fbf" dependencies = [ "asynchronous-codec 0.6.0", - "bytes 1.1.0", - "futures 0.3.21", + "bytes 1.2.1", + "futures 0.3.24", "libp2p-core", "log", "nohash-hasher", - "parking_lot", + "parking_lot 0.11.2", "rand 0.7.3", "smallvec", "unsigned-varint 0.7.1", @@ -3846,9 +3897,9 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8772c7a99088221bb7ca9c5c0574bf55046a7ab4c319f3619b275f28c8fb87a" dependencies = [ - "bytes 1.1.0", + "bytes 1.2.1", "curve25519-dalek 3.2.0", - "futures 0.3.21", + "futures 0.3.24", "lazy_static", "libp2p-core", "log", @@ -3868,7 +3919,7 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80ef7b0ec5cf06530d9eb6cf59ae49d46a2c45663bde31c25a12f682664adbcf" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "libp2p-core", "libp2p-swarm", "log", @@ -3884,8 +3935,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fba1a6ff33e4a274c89a3b1d78b9f34f32af13265cc5c46c16938262d4e945a" dependencies = [ "asynchronous-codec 0.6.0", - "bytes 1.1.0", - "futures 0.3.21", + "bytes 1.2.1", + "futures 0.3.24", "libp2p-core", "log", "prost", @@ -3900,9 +3951,9 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f1a458bbda880107b5b36fcb9b5a1ef0c329685da0e203ed692a8ebe64cc92c" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "log", - "pin-project 1.0.10", + "pin-project 1.0.12", "rand 0.7.3", "salsa20", "sha3 0.9.1", @@ -3915,13 +3966,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2852b61c90fa8ce3c8fcc2aba76e6cefc20d648f9df29157d6b3a916278ef3e3" dependencies = [ "asynchronous-codec 0.6.0", - "bytes 1.1.0", - "futures 0.3.21", + "bytes 1.2.1", + "futures 0.3.24", "futures-timer 3.0.2", "libp2p-core", "libp2p-swarm", "log", - "pin-project 1.0.10", + "pin-project 1.0.12", "prost", "prost-build", "rand 0.7.3", @@ -3939,7 +3990,7 @@ checksum = "14a6d2b9e7677eff61dc3d2854876aaf3976d84a01ef6664b610c77a0c9407c5" dependencies = [ "asynchronous-codec 0.6.0", "bimap", - "futures 0.3.21", + "futures 0.3.24", "libp2p-core", "libp2p-swarm", "log", @@ -3960,12 +4011,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a877a4ced6d46bf84677e1974e8cf61fb434af73b2e96fb48d6cb6223a4634d8" dependencies = [ "async-trait", - "bytes 1.1.0", - "futures 0.3.21", + "bytes 1.2.1", + "futures 0.3.24", "libp2p-core", "libp2p-swarm", "log", - "lru 0.7.5", + "lru 0.7.8", "rand 0.7.3", "smallvec", "unsigned-varint 0.7.1", @@ -3979,7 +4030,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f5184a508f223bc100a12665517773fb8730e9f36fc09eefb670bf01b107ae9" dependencies = [ "either", - "futures 0.3.21", + "futures 0.3.24", "libp2p-core", "log", "rand 0.7.3", @@ -4005,14 +4056,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7399c5b6361ef525d41c11fcf51635724f832baf5819b30d3d873eabb4fbae4b" dependencies = [ "async-io", - "futures 0.3.21", + "futures 0.3.24", "futures-timer 3.0.2", "if-watch", "ipnet", "libc", "libp2p-core", "log", - "socket2 0.4.4", + "socket2 0.4.7", ] [[package]] @@ -4022,7 +4073,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8b7563e46218165dfd60f64b96f7ce84590d75f53ecbdc74a7dd01450dc5973" dependencies = [ "async-std", - "futures 0.3.21", + "futures 0.3.24", "libp2p-core", "log", ] @@ -4033,7 +4084,7 @@ version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1008a302b73c5020251f9708c653f5ed08368e530e247cc9cd2f109ff30042cf" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -4048,14 +4099,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22e12df82d1ed64969371a9e65ea92b91064658604cc2576c2757f18ead9a1cf" dependencies = [ "either", - "futures 0.3.21", + "futures 0.3.24", "futures-rustls", "libp2p-core", "log", "quicksink", "rw-stream-sink", "soketto", - "url 2.2.2", + "url 2.3.1", "webpki-roots", ] @@ -4065,9 +4116,9 @@ version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e7362abb8867d7187e7e93df17f460d554c997fc5c8ac57dc1259057f6889af" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "libp2p-core", - "parking_lot", + "parking_lot 0.11.2", "thiserror", "yamux", ] @@ -4086,9 +4137,9 @@ dependencies = [ [[package]] name = "libsecp256k1" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0452aac8bab02242429380e9b2f94ea20cea2b37e2c1777a1358799bbe97f37" +checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" dependencies = [ "arrayref", "base64 0.13.0", @@ -4134,9 +4185,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.5" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f35facd4a5673cb5a48822be2be1d4236c1c99cb4113cab7061ac720d5bf859" +checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" dependencies = [ "cc", "pkg-config", @@ -4145,9 +4196,9 @@ dependencies = [ [[package]] name = "linked-hash-map" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linked_hash_set" @@ -4176,9 +4227,9 @@ checksum = "687387ff42ec7ea4f2149035a5675fedb675d26f98db90a1846ac63d3addb5f5" [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ "autocfg", "scopeguard", @@ -4186,9 +4237,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.16" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ "cfg-if 1.0.0", "value-bag", @@ -4205,11 +4256,11 @@ dependencies = [ [[package]] name = "lru" -version = "0.7.5" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32613e41de4c47ab04970c348ca7ae7382cf116625755af070b008a15516a889" +checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" dependencies = [ - "hashbrown 0.11.2", + "hashbrown 0.12.3", ] [[package]] @@ -4223,9 +4274,9 @@ dependencies = [ [[package]] name = "lz4" -version = "1.23.3" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edcb94251b1c375c459e5abe9fb0168c1c826c3370172684844f8f3f8d1a885" +checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" dependencies = [ "libc", "lz4-sys", @@ -4233,9 +4284,9 @@ dependencies = [ [[package]] name = "lz4-sys" -version = "1.9.3" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7be8908e2ed6f31c02db8a9fa962f03e36c53fbfde437363eae3306b85d7e17" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" dependencies = [ "cc", "libc", @@ -4250,12 +4301,6 @@ dependencies = [ "libc", ] -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - [[package]] name = "match_cfg" version = "0.1.0" @@ -4288,9 +4333,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memmap2" @@ -4303,9 +4348,9 @@ dependencies = [ [[package]] name = "memmap2" -version = "0.5.3" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057a3db23999c867821a7a59feb06a578fcb03685e983dff90daf9e7d24ac08f" +checksum = "95af15f345b17af2efc8ead6080fb8bc376f8cec1b35277b935637595fe77498" dependencies = [ "libc", ] @@ -4338,9 +4383,9 @@ checksum = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" [[package]] name = "merkle" -version = "0.1.0" +version = "0.1.1" +source = "git+https://github.com/maticnetwork/avail-core.git?tag=v0.2.2#e2fd5c4dc4a02f5f48f2261db1cd5f8f28ae360d" dependencies = [ - "ethers-core", "frame-support", "hex-literal", "nomad-core", @@ -4349,7 +4394,6 @@ dependencies = [ "primitive-types 0.10.1", "scale-info", "serde", - "serde_json", "sp-core", "sp-io", "sp-runtime", @@ -4379,7 +4423,7 @@ checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" dependencies = [ "byteorder", "keccak", - "rand_core 0.6.3", + "rand_core 0.6.4", "zeroize", ] @@ -4397,9 +4441,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.5.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" dependencies = [ "adler", ] @@ -4417,7 +4461,7 @@ dependencies = [ "kernel32-sys", "libc", "log", - "miow 0.2.2", + "miow", "net2", "slab", "winapi 0.2.8", @@ -4425,16 +4469,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" dependencies = [ "libc", "log", - "miow 0.3.7", - "ntapi", "wasi 0.11.0+wasi-snapshot-preview1", - "winapi 0.3.9", + "windows-sys", ] [[package]] @@ -4461,15 +4503,6 @@ dependencies = [ "ws2_32-sys", ] -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "mocked-runtime" version = "1.0.0" @@ -4515,11 +4548,11 @@ dependencies = [ "byteorder", "data-encoding", "multihash 0.14.0", - "percent-encoding 2.1.0", + "percent-encoding 2.2.0", "serde", "static_assertions", "unsigned-varint 0.7.1", - "url 2.2.2", + "url 2.3.1", ] [[package]] @@ -4543,7 +4576,7 @@ dependencies = [ "blake2s_simd", "blake3", "digest 0.9.0", - "generic-array 0.14.5", + "generic-array 0.14.6", "multihash-derive", "sha2 0.9.9", "sha3 0.9.1", @@ -4557,7 +4590,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "752a61cd890ff691b4411423d23816d5866dd5621e4d1c5687a53b94b5a979d8" dependencies = [ "digest 0.9.0", - "generic-array 0.14.5", + "generic-array 0.14.6", "multihash-derive", "sha2 0.9.9", "unsigned-varint 0.7.1", @@ -4569,7 +4602,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "424f6e86263cd5294cbd7f1e95746b95aca0e0d66bff31e5a40d6baa87b4aa99" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.2.1", "proc-macro-error", "proc-macro2", "quote", @@ -4589,10 +4622,10 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56a336acba8bc87c8876f6425407dbbe6c417bf478b22015f8fb0994ef3bc0ab" dependencies = [ - "bytes 1.1.0", - "futures 0.3.21", + "bytes 1.2.1", + "futures 0.3.24", "log", - "pin-project 1.0.10", + "pin-project 1.0.12", "smallvec", "unsigned-varint 0.7.1", ] @@ -4607,7 +4640,7 @@ dependencies = [ "matrixmultiply", "nalgebra-macros", "num-complex", - "num-rational 0.4.0", + "num-rational 0.4.1", "num-traits", "rand 0.8.5", "rand_distr", @@ -4670,7 +4703,8 @@ dependencies = [ [[package]] name = "nomad-base" -version = "0.1.0" +version = "0.1.1" +source = "git+https://github.com/maticnetwork/avail-core.git?tag=v0.2.2#e2fd5c4dc4a02f5f48f2261db1cd5f8f28ae360d" dependencies = [ "ethers-signers", "frame-support", @@ -4681,7 +4715,7 @@ dependencies = [ "primitive-types 0.10.1", "scale-info", "serde", - "signature 0.1.0", + "signature 0.1.1", "sp-core", "sp-io", "sp-std", @@ -4690,19 +4724,19 @@ dependencies = [ [[package]] name = "nomad-core" -version = "0.1.0" +version = "0.1.1" +source = "git+https://github.com/maticnetwork/avail-core.git?tag=v0.2.2#e2fd5c4dc4a02f5f48f2261db1cd5f8f28ae360d" dependencies = [ - "async-trait", "ethers-core", "ethers-signers", "frame-support", - "getrandom 0.2.6", + "getrandom 0.2.7", "parity-scale-codec 2.3.1", "parity-util-mem", "primitive-types 0.10.1", "scale-info", "serde", - "signature 0.1.0", + "signature 0.1.1", "sp-core", "sp-io", "sp-runtime", @@ -4711,12 +4745,31 @@ dependencies = [ ] [[package]] -name = "ntapi" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" +name = "nomad-home" +version = "4.0.0-dev" dependencies = [ - "winapi 0.3.9", + "da-primitives", + "ethers-signers", + "frame-benchmarking", + "frame-support", + "frame-system", + "hex-literal", + "merkle", + "nomad-base", + "nomad-core", + "parity-scale-codec 2.3.1", + "primitive-types 0.10.1", + "scale-info", + "serde", + "signature 0.1.1", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "test-case", + "thiserror-no-std", + "updater-manager", ] [[package]] @@ -4732,9 +4785,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26873667bbbb7c5182d4a37c1add32cdf09f841af72da53318fdb81543c15085" +checksum = "7ae39348c8bc5fbd7f40c727a9925f03517afd2ab27d46702108b6a7e5414c19" dependencies = [ "num-traits", ] @@ -4751,9 +4804,9 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg", "num-traits", @@ -4773,9 +4826,9 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" dependencies = [ "autocfg", "num-integer", @@ -4784,9 +4837,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", "libm", @@ -4815,18 +4868,18 @@ dependencies = [ [[package]] name = "object" -version = "0.28.3" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bec70ba014595f99f7aa110b84331ffe1ee9aece7fe6f387cc7e3ecda4d456" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" [[package]] name = "oorandom" @@ -4877,9 +4930,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "os_str_bytes" -version = "6.0.0" +version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" +checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" [[package]] name = "owning_ref" @@ -5309,7 +5362,7 @@ name = "pallet-staking-reward-curve" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.2.1", "proc-macro2", "quote", "syn", @@ -5453,7 +5506,7 @@ dependencies = [ "log", "lz4", "memmap2 0.2.3", - "parking_lot", + "parking_lot 0.11.2", "rand 0.8.5", "snap", ] @@ -5474,12 +5527,12 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.1.5" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9182e4a71cae089267ab03e67c99368db7cd877baf50f931e5d6d4b71e195ac0" +checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a" dependencies = [ "arrayvec 0.7.2", - "bitvec 1.0.0", + "bitvec 1.0.1", "byte-slice-cast", "impl-trait-for-tuples", "parity-scale-codec-derive 3.1.3", @@ -5492,7 +5545,7 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.2.1", "proc-macro2", "quote", "syn", @@ -5504,7 +5557,7 @@ version = "3.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9299338969a3d2f491d65f140b00ddec470858402f888af98e8642fb5e8965cd" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.2.1", "proc-macro2", "quote", "syn", @@ -5522,7 +5575,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9981e32fb75e004cc148f5fb70342f393830e0a4aa62e3cc93b50976218d42b6" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "libc", "log", "rand 0.7.3", @@ -5542,7 +5595,7 @@ dependencies = [ "impl-trait-for-tuples", "lru 0.6.6", "parity-util-mem-derive", - "parking_lot", + "parking_lot 0.11.2", "primitive-types 0.10.1", "smallvec", "winapi 0.3.9", @@ -5589,7 +5642,7 @@ dependencies = [ "rand 0.7.3", "sha-1 0.8.2", "slab", - "url 2.2.2", + "url 2.3.1", ] [[package]] @@ -5606,7 +5659,17 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core", + "parking_lot_core 0.8.5", +] + +[[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 0.9.3", ] [[package]] @@ -5623,6 +5686,19 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "parking_lot_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + [[package]] name = "password-hash" version = "0.2.3" @@ -5630,7 +5706,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77e0b28ace46c5a396546bcf443bf422b57049617433d8854227352a4a9b24e7" dependencies = [ "base64ct", - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", ] @@ -5641,7 +5717,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d791538a6dcc1e7cb7fe6f6b58aca40e7f79403c45b2bc274008b5e647af1d8" dependencies = [ "base64ct", - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", ] @@ -5652,15 +5728,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", - "rand_core 0.6.3", + "rand_core 0.6.4", "subtle", ] [[package]] name = "paste" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c520e05135d6e763148b6426a837e239041653ba7becd2e538c076c738025fc" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" [[package]] name = "pbkdf2" @@ -5690,7 +5766,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271779f35b581956db91a3e55737327a03aa051e90b1c47aeb189508533adfd7" dependencies = [ - "digest 0.10.3", + "digest 0.10.5", ] [[package]] @@ -5699,10 +5775,10 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest 0.10.3", + "digest 0.10.5", "hmac 0.12.1", "password-hash 0.4.2", - "sha2 0.10.2", + "sha2 0.10.6", ] [[package]] @@ -5719,24 +5795,25 @@ checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pest" -version = "2.1.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" +checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a" dependencies = [ + "thiserror", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.1.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" +checksum = "60b75706b9642ebcb34dab3bc7750f811609a0eb1dd8b88c2d15bf628c1c65b2" dependencies = [ "pest", "pest_generator", @@ -5744,9 +5821,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.1.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" +checksum = "f4f9272122f5979a6511a749af9db9bfc810393f63119970d7085fed1c4ea0db" dependencies = [ "pest", "pest_meta", @@ -5757,20 +5834,20 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.1.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" +checksum = "4c8717927f9b79515e565a64fe46c38b8cd0427e64c40680b14a7365ab09ac8d" dependencies = [ - "maplit", + "once_cell", "pest", - "sha-1 0.8.2", + "sha1", ] [[package]] name = "petgraph" -version = "0.6.0" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" +checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" dependencies = [ "fixedbitset", "indexmap", @@ -5778,27 +5855,27 @@ dependencies = [ [[package]] name = "pin-project" -version = "0.4.29" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9615c18d31137579e9ff063499264ddc1278e7b1982757ebc111028c4d1dc909" +checksum = "3ef0f924a5ee7ea9cbcea77529dba45f8a9ba9f622419fe3386ca581a3ae9d5a" dependencies = [ - "pin-project-internal 0.4.29", + "pin-project-internal 0.4.30", ] [[package]] name = "pin-project" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ - "pin-project-internal 1.0.10", + "pin-project-internal 1.0.12", ] [[package]] name = "pin-project-internal" -version = "0.4.29" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "044964427019eed9d49d9d5bbce6047ef18f37100ea400912a9fa4a3523ab12a" +checksum = "851c8d0ce9bebe43790dedfc86614c23494ac9f423dd618d3a61fc693eafe61e" dependencies = [ "proc-macro2", "quote", @@ -5807,9 +5884,9 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", @@ -5824,9 +5901,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pin-utils" @@ -5859,9 +5936,9 @@ checksum = "989d43012e2ca1c4a02507c67282691a0a3207f9dc67cec596b43fe925b3d325" [[package]] name = "plotters" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a3fd9ec30b9749ce28cd91f255d569591cdf937fe280c312143e3c4bad6f2a" +checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" dependencies = [ "num-traits", "plotters-backend", @@ -5872,25 +5949,26 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.2" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d88417318da0eaf0fdcdb51a0ee6c3bed624333bff8f946733049380be67ac1c" +checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" [[package]] name = "plotters-svg" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521fa9638fa597e1dc53e9412a4f9cefb01187ee1f7413076f9e6749e2885ba9" +checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" dependencies = [ "plotters-backend", ] [[package]] name = "polling" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" +checksum = "899b00b9c8ab553c743b3e11e87c5c7d423b2a2de229ba95b24a756344748011" dependencies = [ + "autocfg", "cfg-if 1.0.0", "libc", "log", @@ -5904,7 +5982,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" dependencies = [ - "cpufeatures 0.2.2", + "cpufeatures 0.2.5", "opaque-debug 0.3.0", "universal-hash", ] @@ -5916,7 +5994,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" dependencies = [ "cfg-if 1.0.0", - "cpufeatures 0.2.2", + "cpufeatures 0.2.5", "opaque-debug 0.3.0", "universal-hash", ] @@ -5950,7 +6028,7 @@ dependencies = [ "impl-codec 0.6.0", "impl-rlp 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "impl-serde 0.3.2", - "uint 0.9.3", + "uint 0.9.4", ] [[package]] @@ -5964,10 +6042,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.1.3" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" dependencies = [ + "once_cell", "thiserror", "toml", ] @@ -5998,54 +6077,34 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.43" +version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" dependencies = [ "unicode-ident", ] [[package]] name = "prometheus" -version = "0.13.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f64969ffd5dd8f39bd57a68ac53c163a095ed9d0fb707146da1b27025a3504" +checksum = "45c8babc29389186697fe5a2a4859d697825496b83db5d0b65271cdc0488e88c" dependencies = [ "cfg-if 1.0.0", "fnv", "lazy_static", "memchr", - "parking_lot", + "parking_lot 0.12.1", "thiserror", ] -[[package]] -name = "proptest" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0d9cc07f18492d879586c92b485def06bc850da3118075cd45d50e9c95b0e5" -dependencies = [ - "bit-set", - "bitflags", - "byteorder", - "lazy_static", - "num-traits", - "quick-error 2.0.1", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rand_xorshift", - "regex-syntax", - "rusty-fork", - "tempfile", -] - [[package]] name = "prost" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" dependencies = [ - "bytes 1.1.0", + "bytes 1.2.1", "prost-derive", ] @@ -6055,9 +6114,9 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" dependencies = [ - "bytes 1.1.0", + "bytes 1.2.1", "heck 0.3.3", - "itertools 0.10.3", + "itertools 0.10.5", "lazy_static", "log", "multimap", @@ -6076,7 +6135,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" dependencies = [ "anyhow", - "itertools 0.10.3", + "itertools 0.10.5", "proc-macro2", "quote", "syn", @@ -6088,15 +6147,15 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" dependencies = [ - "bytes 1.1.0", + "bytes 1.2.1", "prost", ] [[package]] name = "psm" -version = "0.1.18" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871372391786ccec00d3c5d3d6608905b3d4db263639cfe075d3b60a736d115a" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" dependencies = [ "cc", ] @@ -6118,12 +6177,6 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" -[[package]] -name = "quick-error" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" - [[package]] name = "quicksink" version = "0.1.2" @@ -6137,9 +6190,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.18" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] @@ -6184,7 +6237,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha 0.3.1", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -6204,7 +6257,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -6218,11 +6271,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.6", + "getrandom 0.2.7", ] [[package]] @@ -6253,15 +6306,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_xorshift" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" -dependencies = [ - "rand_core 0.6.3", -] - [[package]] name = "rawpointer" version = "0.2.1" @@ -6270,9 +6314,9 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" dependencies = [ "autocfg", "crossbeam-deque", @@ -6282,9 +6326,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f51245e1e62e1f1629cbfec37b5793bbabcaeb90f30e94d2ba03564687353e4" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" dependencies = [ "crossbeam-channel", "crossbeam-deque", @@ -6294,9 +6338,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.13" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags", ] @@ -6307,25 +6351,25 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.6", + "getrandom 0.2.7", "redox_syscall", "thiserror", ] [[package]] name = "ref-cast" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300f2a835d808734ee295d45007adacb9ebb29dd3ae2424acfa17930cae541da" +checksum = "ed13bcd201494ab44900a96490291651d200730904221832b9547d24a87d332b" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c38e3aecd2b21cb3959637b883bb3714bc7e43f0268b9a29d3743ee3e55cdd2" +checksum = "5234cd6063258a5e32903b53b1b6ac043a0541c8adc1f610f67b0326c7a578fa" dependencies = [ "proc-macro2", "quote", @@ -6345,9 +6389,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.5" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ "aho-corasick", "memchr", @@ -6365,9 +6409,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "region" @@ -6397,14 +6441,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" dependencies = [ "hostname", - "quick-error 1.2.3", + "quick-error", ] [[package]] name = "retain_mut" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c31b5c4033f8fdde8700e4657be2c497e7288f01515be52168c631e2e4d4086" +checksum = "4389f1d5789befaf6029ebd9f7dac4af7f7e3d61b69d4f30e2ac02b57e7712b0" [[package]] name = "rfc6979" @@ -6449,7 +6493,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "999508abb0ae792aabed2460c45b89106d97fe4adac593bdaef433c2605847b5" dependencies = [ - "bytes 1.1.0", + "bytes 1.2.1", "rustc-hex", ] @@ -6458,7 +6502,7 @@ name = "rlp" version = "0.5.1" source = "git+https://github.com/paritytech/parity-common.git?tag=parity-util-mem-v0.10.1#3030a6dd28352a4a12169340d22f130f331e0d12" dependencies = [ - "bytes 1.1.0", + "bytes 1.2.1", "rustc-hex", ] @@ -6500,7 +6544,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a632a43487c1332be8e183588079f89b6820fab24e04db49521eacd536837372" dependencies = [ "micromath", - "sha2 0.10.2", + "sha2 0.10.6", ] [[package]] @@ -6573,7 +6617,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.7", + "semver 1.0.14", ] [[package]] @@ -6607,34 +6651,22 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" -[[package]] -name = "rusty-fork" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" -dependencies = [ - "fnv", - "quick-error 1.2.3", - "tempfile", - "wait-timeout", -] - [[package]] name = "rw-stream-sink" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ - "futures 0.3.21", - "pin-project 0.4.29", + "futures 0.3.24", + "pin-project 0.4.30", "static_assertions", ] [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] name = "safe-mix" @@ -6681,7 +6713,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.1 dependencies = [ "async-trait", "derive_more", - "futures 0.3.21", + "futures 0.3.24", "futures-timer 3.0.2", "ip_network", "libp2p", @@ -6706,7 +6738,7 @@ name = "sc-basic-authorship" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "futures-timer 3.0.2", "log", "parity-scale-codec 2.3.1", @@ -6746,7 +6778,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ "impl-trait-for-tuples", - "memmap2 0.5.3", + "memmap2 0.5.7", "parity-scale-codec 2.3.1", "sc-chain-spec-derive", "sc-network", @@ -6762,7 +6794,7 @@ name = "sc-chain-spec-derive" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.2.1", "proc-macro2", "quote", "syn", @@ -6775,7 +6807,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.1 dependencies = [ "chrono", "fdlimit", - "futures 0.3.21", + "futures 0.3.24", "hex", "libp2p", "log", @@ -6812,11 +6844,11 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ "fnv", - "futures 0.3.21", + "futures 0.3.24", "hash-db", "log", "parity-scale-codec 2.3.1", - "parking_lot", + "parking_lot 0.11.2", "sc-executor", "sc-transaction-pool-api", "sc-utils", @@ -6847,7 +6879,7 @@ dependencies = [ "log", "parity-db", "parity-scale-codec 2.3.1", - "parking_lot", + "parking_lot 0.11.2", "sc-client-api", "sc-state-db", "sp-arithmetic", @@ -6865,11 +6897,11 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ "async-trait", - "futures 0.3.21", + "futures 0.3.24", "futures-timer 3.0.2", "libp2p", "log", - "parking_lot", + "parking_lot 0.11.2", "sc-client-api", "sc-utils", "serde", @@ -6890,7 +6922,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.1 dependencies = [ "async-trait", "derive_more", - "futures 0.3.21", + "futures 0.3.24", "log", "parity-scale-codec 2.3.1", "sc-block-builder", @@ -6920,14 +6952,14 @@ dependencies = [ "async-trait", "derive_more", "fork-tree", - "futures 0.3.21", + "futures 0.3.24", "log", "merlin 2.0.1", "num-bigint", "num-rational 0.2.4", "num-traits", "parity-scale-codec 2.3.1", - "parking_lot", + "parking_lot 0.11.2", "rand 0.7.3", "retain_mut", "sc-client-api", @@ -6961,7 +6993,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ "derive_more", - "futures 0.3.21", + "futures 0.3.24", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -6998,7 +7030,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ "async-trait", - "futures 0.3.21", + "futures 0.3.24", "futures-timer 3.0.2", "log", "parity-scale-codec 2.3.1", @@ -7038,7 +7070,7 @@ dependencies = [ "libsecp256k1", "log", "parity-scale-codec 2.3.1", - "parking_lot", + "parking_lot 0.11.2", "sc-executor-common", "sc-executor-wasmi", "sc-executor-wasmtime", @@ -7118,11 +7150,11 @@ dependencies = [ "dyn-clone", "finality-grandpa", "fork-tree", - "futures 0.3.21", + "futures 0.3.24", "futures-timer 3.0.2", "log", "parity-scale-codec 2.3.1", - "parking_lot", + "parking_lot 0.11.2", "rand 0.8.5", "sc-block-builder", "sc-client-api", @@ -7152,7 +7184,7 @@ source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.1 dependencies = [ "derive_more", "finality-grandpa", - "futures 0.3.21", + "futures 0.3.24", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -7175,7 +7207,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ "ansi_term", - "futures 0.3.21", + "futures 0.3.24", "futures-timer 3.0.2", "log", "parity-util-mem", @@ -7194,7 +7226,7 @@ dependencies = [ "async-trait", "derive_more", "hex", - "parking_lot", + "parking_lot 0.11.2", "serde_json", "sp-application-crypto", "sp-core", @@ -7210,13 +7242,13 @@ dependencies = [ "async-trait", "asynchronous-codec 0.5.0", "bitflags", - "bytes 1.1.0", + "bytes 1.2.1", "cid", "derive_more", "either", "fnv", "fork-tree", - "futures 0.3.21", + "futures 0.3.24", "futures-timer 3.0.2", "hex", "ip_network", @@ -7224,10 +7256,10 @@ dependencies = [ "linked-hash-map", "linked_hash_set", "log", - "lru 0.7.5", + "lru 0.7.8", "parity-scale-codec 2.3.1", - "parking_lot", - "pin-project 1.0.10", + "parking_lot 0.11.2", + "pin-project 1.0.12", "prost", "prost-build", "rand 0.7.3", @@ -7257,11 +7289,11 @@ name = "sc-network-gossip" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "futures-timer 3.0.2", "libp2p", "log", - "lru 0.7.5", + "lru 0.7.8", "sc-network", "sp-runtime", "substrate-prometheus-endpoint", @@ -7273,9 +7305,9 @@ name = "sc-offchain" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ - "bytes 1.1.0", + "bytes 1.2.1", "fnv", - "futures 0.3.21", + "futures 0.3.24", "futures-timer 3.0.2", "hex", "hyper", @@ -7283,7 +7315,7 @@ dependencies = [ "num_cpus", "once_cell", "parity-scale-codec 2.3.1", - "parking_lot", + "parking_lot 0.11.2", "rand 0.7.3", "sc-client-api", "sc-network", @@ -7301,7 +7333,7 @@ name = "sc-peerset" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "libp2p", "log", "sc-utils", @@ -7323,13 +7355,13 @@ name = "sc-rpc" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "hash-db", "jsonrpc-core", "jsonrpc-pubsub", "log", "parity-scale-codec 2.3.1", - "parking_lot", + "parking_lot 0.11.2", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -7354,14 +7386,14 @@ name = "sc-rpc-api" version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", "jsonrpc-pubsub", "log", "parity-scale-codec 2.3.1", - "parking_lot", + "parking_lot 0.11.2", "sc-chain-spec", "sc-transaction-pool-api", "serde", @@ -7379,7 +7411,7 @@ name = "sc-rpc-server" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "jsonrpc-core", "jsonrpc-http-server", "jsonrpc-ipc-server", @@ -7399,7 +7431,7 @@ dependencies = [ "async-trait", "directories", "exit-future", - "futures 0.3.21", + "futures 0.3.24", "futures-timer 3.0.2", "hash-db", "jsonrpc-core", @@ -7407,8 +7439,8 @@ dependencies = [ "log", "parity-scale-codec 2.3.1", "parity-util-mem", - "parking_lot", - "pin-project 1.0.10", + "parking_lot 0.11.2", + "pin-project 1.0.12", "rand 0.7.3", "sc-block-builder", "sc-chain-spec", @@ -7464,7 +7496,7 @@ dependencies = [ "parity-scale-codec 2.3.1", "parity-util-mem", "parity-util-mem-derive", - "parking_lot", + "parking_lot 0.11.2", "sc-client-api", "sp-core", ] @@ -7497,11 +7529,11 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ "chrono", - "futures 0.3.21", + "futures 0.3.24", "libp2p", "log", - "parking_lot", - "pin-project 1.0.10", + "parking_lot 0.11.2", + "pin-project 1.0.12", "rand 0.7.3", "serde", "serde_json", @@ -7521,7 +7553,7 @@ dependencies = [ "libc", "log", "once_cell", - "parking_lot", + "parking_lot 0.11.2", "regex", "rustc-hash", "sc-client-api", @@ -7545,7 +7577,7 @@ name = "sc-tracing-proc-macro" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.2.1", "proc-macro2", "quote", "syn", @@ -7556,13 +7588,13 @@ name = "sc-transaction-pool" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "intervalier", "linked-hash-map", "log", "parity-scale-codec 2.3.1", "parity-util-mem", - "parking_lot", + "parking_lot 0.11.2", "retain_mut", "sc-client-api", "sc-transaction-pool-api", @@ -7584,7 +7616,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ "derive_more", - "futures 0.3.21", + "futures 0.3.24", "log", "serde", "sp-blockchain", @@ -7597,7 +7629,7 @@ name = "sc-utils" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "futures-timer 3.0.2", "lazy_static", "prometheus", @@ -7623,7 +7655,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baeb2780690380592f86205aa4ee49815feb2acad8c2f59e6dd207148c3f1fcd" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.2.1", "proc-macro2", "quote", "syn", @@ -7631,12 +7663,12 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ "lazy_static", - "winapi 0.3.9", + "windows-sys", ] [[package]] @@ -7679,7 +7711,7 @@ dependencies = [ "password-hash 0.3.2", "pbkdf2 0.10.1", "salsa20", - "sha2 0.10.2", + "sha2 0.10.6", ] [[package]] @@ -7699,7 +7731,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" dependencies = [ "der", - "generic-array 0.14.5", + "generic-array 0.14.6", "pkcs8", "subtle", "zeroize", @@ -7716,9 +7748,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" dependencies = [ "bitflags", "core-foundation", @@ -7767,9 +7799,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.7" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" [[package]] name = "semver-parser" @@ -7788,9 +7820,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.136" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" dependencies = [ "serde_derive", ] @@ -7807,9 +7839,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.136" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" dependencies = [ "proc-macro2", "quote", @@ -7818,11 +7850,11 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.79" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" +checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" dependencies = [ - "itoa 1.0.1", + "itoa 1.0.4", "ryu", "serde", ] @@ -7847,11 +7879,22 @@ checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", - "cpufeatures 0.2.2", + "cpufeatures 0.2.5", "digest 0.9.0", "opaque-debug 0.3.0", ] +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures 0.2.5", + "digest 0.10.5", +] + [[package]] name = "sha2" version = "0.8.2" @@ -7872,20 +7915,20 @@ checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", "cfg-if 1.0.0", - "cpufeatures 0.2.2", + "cpufeatures 0.2.5", "digest 0.9.0", "opaque-debug 0.3.0", ] [[package]] name = "sha2" -version = "0.10.2" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ "cfg-if 1.0.0", - "cpufeatures 0.2.2", - "digest 0.10.3", + "cpufeatures 0.2.5", + "digest 0.10.5", ] [[package]] @@ -7902,11 +7945,11 @@ dependencies = [ [[package]] name = "sha3" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaedf34ed289ea47c2b741bb72e5357a209512d67bcd4bda44359e5bf0470f56" +checksum = "e2904bea16a1ae962b483322a1c7b81d976029203aea1f461e51cd7705db7ba9" dependencies = [ - "digest 0.10.3", + "digest 0.10.5", "keccak", ] @@ -7927,9 +7970,9 @@ checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" [[package]] name = "signal-hook" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "647c97df271007dcea485bb74ffdb57f2e683f1306c854f468a0c244badabf2d" +checksum = "a253b5e89e2698464fc26b545c9edceb338e18a89effeeecfea192c3025be29d" dependencies = [ "libc", "signal-hook-registry", @@ -7946,18 +7989,17 @@ dependencies = [ [[package]] name = "signature" -version = "0.1.0" +version = "0.1.1" +source = "git+https://github.com/maticnetwork/avail-core.git?tag=v0.2.2#e2fd5c4dc4a02f5f48f2261db1cd5f8f28ae360d" dependencies = [ "arrayvec 0.7.2", - "byte-slice-cast", "elliptic-curve", "ethabi", "ethers-core", "frame-support", - "generic-array 0.14.5", + "generic-array 0.14.6", "hex", "k256", - "once_cell", "parity-scale-codec 2.3.1", "parity-util-mem", "primitive-types 0.10.1", @@ -7979,7 +8021,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" dependencies = [ "digest 0.9.0", - "rand_core 0.6.3", + "rand_core 0.6.4", ] [[package]] @@ -7996,15 +8038,18 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] [[package]] name = "smallvec" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "snap" @@ -8022,7 +8067,7 @@ dependencies = [ "blake2", "chacha20poly1305", "rand 0.8.5", - "rand_core 0.6.3", + "rand_core 0.6.4", "ring", "rustc_version 0.3.3", "sha2 0.9.9", @@ -8043,9 +8088,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi 0.3.9", @@ -8058,9 +8103,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" dependencies = [ "base64 0.13.0", - "bytes 1.1.0", + "bytes 1.2.1", "flate2", - "futures 0.3.21", + "futures 0.3.24", "httparse", "log", "rand 0.8.5", @@ -8090,7 +8135,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ "blake2-rfc", - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.2.1", "proc-macro2", "quote", "syn", @@ -8166,11 +8211,11 @@ name = "sp-blockchain" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "log", - "lru 0.7.5", + "lru 0.7.8", "parity-scale-codec 2.3.1", - "parking_lot", + "parking_lot 0.11.2", "sp-api", "sp-consensus", "sp-database", @@ -8185,7 +8230,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ "async-trait", - "futures 0.3.21", + "futures 0.3.24", "futures-timer 3.0.2", "log", "parity-scale-codec 2.3.1", @@ -8274,7 +8319,7 @@ dependencies = [ "byteorder", "dyn-clonable", "ed25519-dalek", - "futures 0.3.21", + "futures 0.3.24", "hash-db", "hash256-std-hasher", "hex", @@ -8286,7 +8331,7 @@ dependencies = [ "num-traits", "parity-scale-codec 2.3.1", "parity-util-mem", - "parking_lot", + "parking_lot 0.11.2", "primitive-types 0.10.1", "rand 0.7.3", "regex", @@ -8341,7 +8386,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ "kvdb", - "parking_lot", + "parking_lot 0.11.2", ] [[package]] @@ -8402,12 +8447,12 @@ name = "sp-io" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "hash-db", "libsecp256k1", "log", "parity-scale-codec 2.3.1", - "parking_lot", + "parking_lot 0.11.2", "sp-core", "sp-externalities", "sp-keystore", @@ -8439,10 +8484,10 @@ source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.1 dependencies = [ "async-trait", "derive_more", - "futures 0.3.21", + "futures 0.3.24", "merlin 2.0.1", "parity-scale-codec 2.3.1", - "parking_lot", + "parking_lot 0.11.2", "schnorrkel", "serde", "sp-core", @@ -8477,7 +8522,7 @@ name = "sp-npos-elections-solution-type" version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.2.1", "proc-macro2", "quote", "syn", @@ -8558,7 +8603,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ "Inflector", - "proc-macro-crate 1.1.3", + "proc-macro-crate 1.2.1", "proc-macro2", "quote", "syn", @@ -8607,7 +8652,7 @@ dependencies = [ "log", "num-traits", "parity-scale-codec 2.3.1", - "parking_lot", + "parking_lot 0.11.2", "rand 0.7.3", "smallvec", "sp-core", @@ -8776,9 +8821,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.17.0" +version = "1.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b84a70894df7a73666e0694f44b41a9571625e9546fb58a0818a565d2c7e084" +checksum = "1de151faef619cb7b5c26b32d42bc7ddccac0d202beb7a84344b44e9232b92f7" dependencies = [ "Inflector", "num-format", @@ -8921,7 +8966,7 @@ version = "4.0.0-dev" source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.13#afb74de23dfe2994e7ce38c0870efb9734e966f7" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.21", + "futures 0.3.24", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -9003,9 +9048,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fa7e55043acb85fca6b3c01485a2eeb6b69c5d21002e273c79e465f43b7ac1" +checksum = "c02424087780c9b71cc96799eaeddff35af2bc513278cda5c99fc1f5d026d3c1" [[package]] name = "tempfile" @@ -9052,26 +9097,20 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "textwrap" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" - [[package]] name = "thiserror" -version = "1.0.34" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1b05ca9d106ba7d2e31a9dab4a64e7be2cce415321966ea3132c49a656e252" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.34" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8f2591983642de85c921015f3f070c665a197ed69e417af436115e3a1407487" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ "proc-macro2", "quote", @@ -9167,9 +9206,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] @@ -9182,18 +9221,19 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.19.2" -source = "git+https://github.com/tokio-rs/tokio?tag=tokio-1.19.2#340c4dc3b2123d0bf5ec2795bd9c157d8a10ccf6" +version = "1.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" dependencies = [ - "bytes 1.1.0", + "autocfg", + "bytes 1.2.1", "libc", "memchr", - "mio 0.8.2", + "mio 0.8.4", "num_cpus", - "once_cell", - "pin-project-lite 0.2.8", + "pin-project-lite 0.2.9", "signal-hook-registry", - "socket2 0.4.4", + "socket2 0.4.7", "winapi 0.3.9", ] @@ -9210,39 +9250,39 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.8" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50145484efff8818b5ccd256697f36863f587da82cf8b409c53adf1e840798e3" +checksum = "f6edf2d6bc038a43d31353570e27270603f4648d18f5ed10c0e179abe43255af" dependencies = [ "futures-core", - "pin-project-lite 0.2.8", + "pin-project-lite 0.2.9", "tokio", ] [[package]] name = "tokio-util" -version = "0.6.9" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" dependencies = [ - "bytes 1.1.0", + "bytes 1.2.1", "futures-core", "futures-sink", "log", - "pin-project-lite 0.2.8", + "pin-project-lite 0.2.9", "tokio", ] [[package]] name = "tokio-util" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0edfdeb067411dba2044da6d1cb2df793dd35add7888d73c16e3381ded401764" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" dependencies = [ - "bytes 1.1.0", + "bytes 1.2.1", "futures-core", "futures-sink", - "pin-project-lite 0.2.8", + "pin-project-lite 0.2.9", "tokio", "tracing", ] @@ -9258,27 +9298,27 @@ dependencies = [ [[package]] name = "tower-service" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.34" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0ecdcb44a79f0fe9844f0c4f33a342cbcbb5117de8001e6ba0dc2351327d09" +checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" dependencies = [ "cfg-if 1.0.0", - "pin-project-lite 0.2.8", + "pin-project-lite 0.2.9", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-attributes" -version = "0.1.20" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e65ce065b4b5c53e73bb28912318cb8c9e9ad3921f1d669eb0e68b4c8143a2b" +checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" dependencies = [ "proc-macro2", "quote", @@ -9287,11 +9327,11 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.26" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f54c8ca710e81886d498c2fd3331b56c93aa248d49de2222ad2742247c60072f" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ - "lazy_static", + "once_cell", "valuable", ] @@ -9301,15 +9341,15 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 1.0.10", + "pin-project 1.0.12", "tracing", ] [[package]] name = "tracing-log" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6923477a48e41c1951f1999ef8bb5a3023eb723ceadafe78ffb65dc366761e3" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" dependencies = [ "lazy_static", "log", @@ -9336,7 +9376,7 @@ dependencies = [ "chrono", "lazy_static", "matchers", - "parking_lot", + "parking_lot 0.11.2", "regex", "serde", "serde_json", @@ -9392,7 +9432,7 @@ dependencies = [ "smallvec", "thiserror", "tinyvec", - "url 2.2.2", + "url 2.3.1", ] [[package]] @@ -9407,7 +9447,7 @@ dependencies = [ "lazy_static", "log", "lru-cache", - "parking_lot", + "parking_lot 0.11.2", "resolv-conf", "smallvec", "thiserror", @@ -9428,12 +9468,12 @@ checksum = "5e66dcbec4290c69dd03c57e76c2469ea5c7ce109c6dd4351c13055cf71ea055" [[package]] name = "twox-hash" -version = "1.6.2" +version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee73e6e4924fe940354b8d4d98cad5231175d615cd855b758adc658c0aac6a0" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", - "rand 0.7.3", + "cfg-if 1.0.0", + "rand 0.8.5", "static_assertions", ] @@ -9445,9 +9485,9 @@ checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] name = "ucd-trie" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "uint" @@ -9462,9 +9502,9 @@ dependencies = [ [[package]] name = "uint" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" +checksum = "a45526d29728d135c2900b0d30573fe3ee79fceb12ef534c7bb30e810a91b601" dependencies = [ "byteorder", "crunchy", @@ -9483,42 +9523,42 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" +checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" [[package]] name = "unicode-width" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unicode-xid" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "universal-hash" @@ -9526,7 +9566,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" dependencies = [ - "generic-array 0.14.5", + "generic-array 0.14.6", "subtle", ] @@ -9543,7 +9583,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35581ff83d4101e58b582e607120c7f5ffb17e632a980b1f38334d76b36908b2" dependencies = [ "asynchronous-codec 0.5.0", - "bytes 1.1.0", + "bytes 1.2.1", "futures-io", "futures-util", ] @@ -9555,7 +9595,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86a8dc7f45e4c1b0d30e43038c38f274e77af056aa5f74b93c2cf9eb3c1c836" dependencies = [ "asynchronous-codec 0.6.0", - "bytes 1.1.0", + "bytes 1.2.1", "futures-io", "futures-util", ] @@ -9566,6 +9606,26 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "updater-manager" +version = "1.0.0" +dependencies = [ + "da-primitives", + "frame-benchmarking", + "frame-support", + "frame-system", + "nomad-core", + "parity-scale-codec 2.3.1", + "primitive-types 0.10.1", + "scale-info", + "serde", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + [[package]] name = "url" version = "1.7.2" @@ -9579,14 +9639,13 @@ dependencies = [ [[package]] name = "url" -version = "2.2.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", - "idna 0.2.3", - "matches", - "percent-encoding 2.1.0", + "idna 0.3.0", + "percent-encoding 2.2.0", ] [[package]] @@ -9595,7 +9654,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "getrandom 0.2.6", + "getrandom 0.2.7", "serde", ] @@ -9607,9 +9666,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.0.0-alpha.8" +version = "1.0.0-alpha.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79923f7731dc61ebfba3633098bf3ac533bbd35ccd8c57e7088d9a5eebe0263f" +checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" dependencies = [ "ctor", "version_check", @@ -9639,15 +9698,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -[[package]] -name = "wait-timeout" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" -dependencies = [ - "libc", -] - [[package]] name = "waker-fn" version = "1.1.0" @@ -9695,9 +9745,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.80" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -9705,13 +9755,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.80" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", "syn", @@ -9720,9 +9770,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.30" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -9732,9 +9782,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.80" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -9742,9 +9792,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.80" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", @@ -9755,9 +9805,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.80" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" [[package]] name = "wasm-gc-api" @@ -9776,9 +9826,9 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "js-sys", - "parking_lot", + "parking_lot 0.11.2", "pin-utils", "wasm-bindgen", "wasm-bindgen-futures", @@ -9974,9 +10024,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.57" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" dependencies = [ "js-sys", "wasm-bindgen", @@ -10012,13 +10062,13 @@ dependencies = [ [[package]] name = "which" -version = "4.2.5" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" +checksum = "1c831fbbee9e129a8cf93e7747a82da9d95ba8e16621cae60ec2cdc849bacb7b" dependencies = [ "either", - "lazy_static", "libc", + "once_cell", ] [[package]] @@ -10070,6 +10120,49 @@ 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", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[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_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[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_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + [[package]] name = "winreg" version = "0.6.2" @@ -10130,19 +10223,19 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7d9028f208dd5e63c614be69f115c1b53cacc1111437d4c765185856666c107" dependencies = [ - "futures 0.3.21", + "futures 0.3.24", "log", "nohash-hasher", - "parking_lot", + "parking_lot 0.11.2", "rand 0.8.5", "static_assertions", ] [[package]] name = "zeroize" -version = "1.5.4" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb5728b8afd3f280a869ce1d4c554ffaed35f45c231fc41bfbd0381bef50317" +checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" dependencies = [ "zeroize_derive", ] @@ -10187,3 +10280,8 @@ dependencies = [ "cc", "libc", ] + +[[patch.unused]] +name = "tokio" +version = "1.19.2" +source = "git+https://github.com/tokio-rs/tokio?tag=tokio-1.19.2#340c4dc3b2123d0bf5ec2795bd9c157d8a10ccf6" diff --git a/Cargo.toml b/Cargo.toml index 85ec42169..fd52e410d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,28 +1,24 @@ [workspace] members = [ - "kate", - "kate/recovery", - "kate/proof", "fuzzing", - "primitives/avail", - "primitives/nomad/merkle", - "primitives/nomad/signature", - "primitives/nomad/nomad-core", - "primitives/nomad/nomad-base", "pallets/executive", "pallets/system", "pallets/dactr", + "pallets/nomad/updater-manager", + "pallets/nomad/home", + "pallets/nomad/da-bridge", "runtime", "node", ] + + [patch."https://github.com/paritytech/substrate.git"] frame-system = { path = "pallets/system" } frame-executive = { path = "pallets/executive" } frame-system-rpc-runtime-api = { path = "pallets/system/rpc/runtime-api" } [patch.crates-io] -dusk-plonk = { git = "https://github.com/maticnetwork/plonk.git", branch = "v0.8.2-polygon-5" } frame-system = { path = "pallets/system" } frame-executive = { path = "pallets/executive" } frame-system-rpc-runtime-api = { path = "pallets/system/rpc/runtime-api" } diff --git a/avail-subxt/Cargo.toml b/avail-subxt/Cargo.toml index 6db775f82..cd6ed174e 100644 --- a/avail-subxt/Cargo.toml +++ b/avail-subxt/Cargo.toml @@ -4,17 +4,38 @@ version = "0.1.0" authors = ["Luka Borkovic "] edition = "2021" +[lib] +name = "avail_subxt" +path = "src/lib.rs" + +[[bin]] +name = "e2e" +path = "src/e2e.rs" [dependencies] -subxt = "0.23.0" +subxt = "0.24.0" codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "full", "bit-vec"] } serde = { version = "1.0", features = ["derive"] } parity-util-mem = "0.11.0" scale-info = { version = "2.0.0", features = ["bit-vec"] } +derive_more = "0.99.17" +structopt = "0.3.25" +anyhow = "1.0.66" +tokio = { version = "1.21.2", features = [ "process", "fs", "rt-multi-thread"]} +futures = "0.3.25" +jsonrpsee = { version ="0.15.1", features = ["client", "async-client", "macros"]} + [dev-dependencies] async-std = { version = "1.9.0", features = ["attributes", "tokio1"] } sp-keyring = "6.0.0" futures = "0.3.13" +hex-literal = "0.3.4" +test-case = "1.2.3" + +[features] +default = ["api-dev"] +api-dev = [] +api-main = [] -[workspace] \ No newline at end of file +[workspace] diff --git a/avail-subxt/README.md b/avail-subxt/README.md new file mode 100644 index 000000000..777fee813 --- /dev/null +++ b/avail-subxt/README.md @@ -0,0 +1,24 @@ +# Data-Availability SubXt Library + +Facilities to use `subxt` to connect with a Data-Availability Node. + +## Generate/Update `src/api_dev.rs` + +Once node is updated, we can re-generate the `src/api_dev.rs` file using the following script: + +**NOTE:** The script requires a running node at `localhost:9933` + +```Bash +#> ./build_api.sh +``` + +# E2E Binary + +This binary executes each example on a Data-Availability Node. It launches the node before run any +example. + +The following command uses the node located in `./target/release/data-avail` to run each example + +```Bash +$> cargo run -- --avail-path ../target/release/data-avail +``` diff --git a/avail-subxt/avail.dev.metadata.scale b/avail-subxt/avail.dev.metadata.scale new file mode 100644 index 000000000..e69de29bb diff --git a/avail-subxt/build_api.sh b/avail-subxt/build_api.sh new file mode 100755 index 000000000..f543114aa --- /dev/null +++ b/avail-subxt/build_api.sh @@ -0,0 +1,28 @@ +#!/bin/sh +cargo install --git https://github.com/fmiguelgarcia/subxt --branch cli_derives_for_type_2 +subxt codegen \ + --derive Clone \ + --derive PartialEq \ + --derive Eq \ + --derive-for-type da_primitives::header::extension::HeaderExtension=serde::Serialize \ + --derive-for-type da_primitives::header::extension::HeaderExtension=serde::Deserialize \ + --derive-for-type da_primitives::header::extension::v1::HeaderExtension=serde::Serialize \ + --derive-for-type da_primitives::header::extension::v1::HeaderExtension=serde::Deserialize \ + --derive-for-type da_primitives::header::extension::v1::HeaderExtension=Default \ + --derive-for-type da_primitives::kate_commitment::KateCommitment=serde::Serialize \ + --derive-for-type da_primitives::kate_commitment::KateCommitment=serde::Deserialize \ + --derive-for-type da_primitives::kate_commitment::KateCommitment=Default \ + --derive-for-type da_primitives::asdr::data_lookup::DataLookup=serde::Serialize \ + --derive-for-type da_primitives::asdr::data_lookup::DataLookup=serde::Deserialize \ + --derive-for-type da_primitives::asdr::data_lookup::DataLookup=Default \ + --derive-for-type da_primitives::asdr::data_lookup::DataLookupIndexItem=serde::Serialize \ + --derive-for-type da_primitives::asdr::data_lookup::DataLookupIndexItem=serde::Deserialize \ + --derive-for-type da_primitives::asdr::AppId=serde::Serialize \ + --derive-for-type da_primitives::asdr::AppId=serde::Deserialize \ + --derive-for-type da_primitives::asdr::AppId=Default \ + --derive-for-type da_primitives::asdr::AppId=Copy \ + --derive-for-type da_primitives::asdr::AppId=derive_more::From \ + --url http://localhost:9933 \ + | sed -En "s/pub struct KateCommitment/#\[serde\(rename_all = \"camelCase\"\)\] \0/p" \ + | sed '1i \#\[allow(clippy::all)]' \ + | rustfmt --edition=2021 --emit=stdout > src/api_dev.rs diff --git a/avail-subxt/examples/accounts_from_mnemonics.rs b/avail-subxt/examples/accounts_from_mnemonics.rs index 958bf134f..5ea0ec4f3 100644 --- a/avail-subxt/examples/accounts_from_mnemonics.rs +++ b/avail-subxt/examples/accounts_from_mnemonics.rs @@ -1,48 +1,43 @@ -use avail_subxt::*; +use anyhow::Result; +use avail_subxt::{api, build_client, primitives::AvailExtrinsicParams, AvailConfig, Opts}; use sp_keyring::sr25519::sr25519; +use structopt::StructOpt; use subxt::{ ext::{sp_core::Pair, sp_runtime::MultiAddress}, tx::PairSigner, - OnlineClient, }; /// This example demonstrates using mnemonic seed for generating signer pairs. It creates Alice and Bob /// from seeds, but could also be used for an arbitrary account. +const ALICE_SEED: &str = + "bottom drive obey lake curtain smoke basket hold race lonely fit walk//Alice"; +const BOB_SEED: &str = "bottom drive obey lake curtain smoke basket hold race lonely fit walk//Bob"; #[async_std::main] -async fn main() -> Result<(), Box> { - let signer_a: PairSigner = PairSigner::new( - Pair::from_string_with_seed( - "bottom drive obey lake curtain smoke basket hold race lonely fit walk//Alice", - None, - ) - .unwrap() - .0, - ); - let signer_b: PairSigner = PairSigner::new( - Pair::from_string_with_seed( - "bottom drive obey lake curtain smoke basket hold race lonely fit walk//Bob", - None, - ) - .unwrap() - .0, - ); - let api = OnlineClient::::new().await?; - let balance_transfer = avail::tx() +async fn main() -> Result<()> { + let args = Opts::from_args(); + let client = build_client(args.ws).await?; + + // Accounts + let pair_a = Pair::from_string_with_seed(ALICE_SEED, None).unwrap(); + let signer_a = PairSigner::::new(pair_a.0); + let pair_b = Pair::from_string_with_seed(BOB_SEED, None).unwrap(); + let signer_b = PairSigner::::new(pair_b.0); + + // Transfer and wait finalized + let balance_transfer = api::tx() .balances() .transfer(MultiAddress::Id(signer_b.account_id().clone()), 2); - let _ = api + let _ = client .tx() .sign_and_submit_then_watch( &balance_transfer, &signer_a, - AvailExtrinsicParams::new_with_app_id(0), + AvailExtrinsicParams::new_with_app_id(0.into()), ) - .await - .unwrap() + .await? .wait_for_finalized_success() - .await - .unwrap(); + .await?; Ok(()) } diff --git a/avail-subxt/examples/da_bridge_actor.rs b/avail-subxt/examples/da_bridge_actor.rs new file mode 100644 index 000000000..8ef173e46 --- /dev/null +++ b/avail-subxt/examples/da_bridge_actor.rs @@ -0,0 +1,88 @@ +use anyhow::Result; +use avail_subxt::{ + api::{ + self, data_availability::calls::SubmitData, + runtime_types::frame_support::storage::bounded_vec::BoundedVec, + }, + build_client, Opts, +}; +use sp_keyring::AccountKeyring; +use structopt::StructOpt; +use subxt::{ + ext::sp_core::H160, + tx::{PairSigner, StaticTxPayload}, +}; + +const DESTINATION_DOMAIN: u32 = 1000; +const DA_BRIDGE_ROUTER_ADDRESS: &str = "0x3f28a3e66326c3aa494d4f8e9477d1397ee94432"; + +fn submit_some_data() -> Result> { + let data = BoundedVec(b"Test Data".to_vec()); + let submit_data_tx = api::tx().data_availability().submit_data(data); + Ok(submit_data_tx) +} + +#[async_std::main] +async fn main() -> Result<()> { + let args = Opts::from_args(); + let client = build_client(args.ws).await?; + + let signer = PairSigner::new(AccountKeyring::Alice.pair()); + let mut finalized_blocks = client.rpc().subscribe_finalized_blocks().await?; + + if let Some(finalized_block) = finalized_blocks.next().await { + let header = finalized_block?; + if let Some(_block_hash) = client.rpc().block_hash(Some(header.number.into())).await? { + // 1. Send some data. + let block_hash = client + .tx() + .sign_and_submit_then_watch_default(&submit_some_data()?, &signer) + .await? + .wait_for_finalized_success() + .await? + .block_hash(); + println!("Block hash: {:?}", block_hash); + let submit_data_header = client + .rpc() + .block(Some(block_hash)) + .await? + .expect("Block exists .qed") + .block + .header; + println!("Finalized block header: {:?}", &submit_data_header); + println!("Header data root: {:?}", submit_data_header.data_root()); + + // 2. Send the `DaBridge::try_dispatch_data_root`. + let bridge_router_eth_addr: H160 = DA_BRIDGE_ROUTER_ADDRESS.parse()?; + let tx = api::tx().da_bridge().try_dispatch_data_root( + DESTINATION_DOMAIN, + bridge_router_eth_addr.into(), + submit_data_header.into(), + ); + + println!( + "Sending finalized block header. Domain: {}. Recipient: {}", + DESTINATION_DOMAIN, DA_BRIDGE_ROUTER_ADDRESS + ); + let block_hash = client + .tx() + .sign_and_submit_then_watch(&tx, &signer, Default::default()) + .await? + .wait_for_finalized_success() + .await? + .block_hash(); + + // Get block + let submitted_block = client + .rpc() + .block(Some(block_hash)) + .await? + .expect("Block exists .qed"); + + let xts = submitted_block.block.extrinsics; + println!("Submitted block extrinsic: {xts:?}"); + } + } + + Ok(()) +} diff --git a/avail-subxt/examples/headers.rs b/avail-subxt/examples/headers.rs index 6c8c7f42c..b4ef1af4f 100644 --- a/avail-subxt/examples/headers.rs +++ b/avail-subxt/examples/headers.rs @@ -1,16 +1,23 @@ -use avail_subxt::AvailConfig; -use futures::{future::join_all, TryFutureExt}; -use subxt::{rpc::BlockNumber, OnlineClient}; +use anyhow::Result; +use avail_subxt::{build_client, Opts}; +use futures::future::{join_all, TryFutureExt}; +use structopt::StructOpt; +use subxt::{ext::sp_runtime::traits::Header as XtHeader, rpc::BlockNumber}; /// This example gets all the headers from testnet. It requests them in concurrently in batches of BATCH_NUM. /// Fetching headers one by one is too slow for a large number of blocks. const BATCH_NUM: usize = 1000; #[async_std::main] -async fn main() -> Result<(), Box> { - let api = OnlineClient::::new().await?; +async fn main() -> Result<()> { + let args = Opts::from_args(); + let client = build_client(args.ws).await?; - let head_block = api.rpc().block(None).await.unwrap().unwrap(); + let head_block = client + .rpc() + .block(None) + .await? + .expect("Best block always exists .qed"); let block_num = head_block.block.header.number; println!("Current head: {block_num}"); @@ -32,9 +39,11 @@ async fn main() -> Result<(), Box> { join_all( e.iter() .map(|n| { - api.rpc() - .block_hash(Some(BlockNumber::from(*n))) - .and_then(|h| api.rpc().header(h)) + let block_number = Some(BlockNumber::from(*n)); + client + .rpc() + .block_hash(block_number) + .and_then(|h| client.rpc().header(h)) }) .collect::>(), ) @@ -42,6 +51,16 @@ async fn main() -> Result<(), Box> { headers.extend(batch.await); } println!("Headers: {num}", num = headers.len()); + let header_hashes = headers + .iter() + .map(|result_maybe_header| { + result_maybe_header + .as_ref() + .map(|maybe_header| maybe_header.as_ref().map(XtHeader::hash)) + .unwrap_or_default() + }) + .collect::>(); + println!("Header hashes: {:?}", header_hashes); assert_eq!( headers.len(), diff --git a/avail-subxt/examples/max_block_submit.rs b/avail-subxt/examples/max_block_submit.rs index 34166d028..2fb93d7de 100644 --- a/avail-subxt/examples/max_block_submit.rs +++ b/avail-subxt/examples/max_block_submit.rs @@ -1,8 +1,15 @@ use std::time::Instant; -use avail_subxt::{avail::runtime_types::frame_support::storage::bounded_vec::BoundedVec, *}; +use anyhow::Result; +use avail_subxt::{ + api::{self, runtime_types::frame_support::storage::bounded_vec::BoundedVec}, + build_client, + primitives::AvailExtrinsicParams, + Opts, +}; use sp_keyring::AccountKeyring; -use subxt::{ext::sp_core::H256, tx::PairSigner, OnlineClient}; +use structopt::StructOpt; +use subxt::tx::PairSigner; /// This example attempts to submit data to fill the entire block. Note that this doesn't guarantee /// that the block will be filled, but if you submit more than a full block, then it will spill over @@ -11,28 +18,27 @@ use subxt::{ext::sp_core::H256, tx::PairSigner, OnlineClient}; /// it may not be possible to transfer so many in 20 s (the default block time) #[async_std::main] -async fn main() -> Result<(), Box> { - let signer = PairSigner::new(AccountKeyring::Alice.pair()); +async fn main() -> Result<()> { + let args = Opts::from_args(); + let client = build_client(args.ws).await?; - let api = OnlineClient::::new().await?; + let signer = PairSigner::new(AccountKeyring::Alice.pair()); let size: usize = 2 * 1024 * 1024; let max_size: usize = 16 * 1024; let num_chunks = size / max_size; - let mut hashes = Vec::::new(); - let extrinsic_params = AvailExtrinsicParams::new_with_app_id(1); + let extrinsic_params = AvailExtrinsicParams::new_with_app_id(1.into()); let start = Instant::now(); + for i in 1..=num_chunks { let data_transfer = - avail::tx() + api::tx() .data_availability() .submit_data(BoundedVec(vec![(i & 255) as u8; max_size])); - let h = api + let h = client .tx() .sign_and_submit(&data_transfer, &signer, extrinsic_params.clone()) - .await - .unwrap(); - println!("hash #{i}: {h}"); - hashes.push(h); + .await?; + println!("hash #{i}: {:?}", h); } let end = start.elapsed(); diff --git a/avail-subxt/examples/submit_data.rs b/avail-subxt/examples/submit_data.rs index 18490c603..803723086 100644 --- a/avail-subxt/examples/submit_data.rs +++ b/avail-subxt/examples/submit_data.rs @@ -1,47 +1,54 @@ -use avail_subxt::{avail::runtime_types::frame_support::storage::bounded_vec::BoundedVec, *}; +use anyhow::Result; +use avail_subxt::{ + api::{ + self, + runtime_types::{ + da_control::pallet::Call as DaCall, frame_support::storage::bounded_vec::BoundedVec, + }, + }, + build_client, + primitives::AvailExtrinsicParams, + Call, Opts, +}; use sp_keyring::AccountKeyring; -use subxt::{tx::PairSigner, OnlineClient}; +use structopt::StructOpt; +use subxt::tx::PairSigner; /// This example submits an Avail data extrinsic, then retrieves the block containing the /// extrinsic and matches the data. #[async_std::main] -async fn main() -> Result<(), Box> { - let api = OnlineClient::::from_url("ws://127.0.0.1:9944").await?; +async fn main() -> Result<()> { + let args = Opts::from_args(); + let client = build_client(args.ws).await?; + let signer = PairSigner::new(AccountKeyring::Alice.pair()); let example_data = b"example".to_vec(); - let data_transfer = avail::tx() + let data_transfer = api::tx() .data_availability() .submit_data(BoundedVec(example_data.clone())); - let extrinsic_params = AvailExtrinsicParams::new_with_app_id(1); + let extrinsic_params = AvailExtrinsicParams::new_with_app_id(1.into()); + println!("Sending example data..."); - let h = api + let h = client .tx() .sign_and_submit_then_watch(&data_transfer, &signer, extrinsic_params) - .await - .unwrap() + .await? .wait_for_finalized_success() - .await - .unwrap(); - - let submitted_block = api - .rpc() - .block(Some(h.block_hash())) - .await - .unwrap() - .unwrap(); + .await?; - let xts = submitted_block.block.extrinsics; - println!("Submitted block extrinsic: {xts:?}"); + let submitted_block = client.rpc().block(Some(h.block_hash())).await?.unwrap(); - let matched_xt = xts.iter().find(move |e| match e { - AvailExtrinsic::AvailDataExtrinsic { - signature: _, - data, - address: _, - extra_params, - } => extra_params.app_id == 1 && data.eq(&example_data), - _ => false, - }); + let matched_xt = submitted_block + .block + .extrinsics + .into_iter() + .find(|ext| match &ext.function { + Call::DataAvailability(da_call) => match da_call { + DaCall::submit_data { data } => data.0 == example_data, + _ => false, + }, + _ => false, + }); assert!(matched_xt.is_some(), "Submitted data not found"); diff --git a/avail-subxt/examples/submit_data_and_dispatch_data_root.rs b/avail-subxt/examples/submit_data_and_dispatch_data_root.rs new file mode 100644 index 000000000..45a116302 --- /dev/null +++ b/avail-subxt/examples/submit_data_and_dispatch_data_root.rs @@ -0,0 +1,79 @@ +use anyhow::Result; +use avail_subxt::{ + api::{self, runtime_types::frame_support::storage::bounded_vec::BoundedVec}, + build_client, + primitives::AvailExtrinsicParams, + Opts, +}; +use sp_keyring::AccountKeyring; +use structopt::StructOpt; +use subxt::{ext::sp_core::H160, tx::PairSigner}; + +const DESTINATION_DOMAIN: u32 = 1000; +const DA_BRIDGE_ROUTER_ADDRESS: &str = "0x3f28a3e66326c3aa494d4f8e9477d1397ee94432"; + +/// This example submits an Avail data extrinsic, then retrieves the block containing the +/// extrinsic and matches the data. +#[async_std::main] +async fn main() -> Result<()> { + let args = Opts::from_args(); + let client = build_client(args.ws).await?; + + let signer = PairSigner::new(AccountKeyring::Alice.pair()); + let example_data = b"example".to_vec(); + let data_transfer = api::tx() + .data_availability() + .submit_data(BoundedVec(example_data.clone())); + + let extrinsic_params = AvailExtrinsicParams::new_with_app_id(1.into()); + println!("Sending example data..."); + let block_hash = client + .tx() + .sign_and_submit_then_watch(&data_transfer, &signer, extrinsic_params) + .await? + .wait_for_finalized_success() + .await? + .block_hash(); + + let header = client + .rpc() + .header(Some(block_hash.clone())) + .await? + .expect("Valid block hash .qed"); + + println!("Hash of block with example data: {:?}", &header); + println!("Header data root: {:?}", header.data_root()); + println!("Block hash: {:?}", block_hash); + + let bridge_router_eth_addr: H160 = DA_BRIDGE_ROUTER_ADDRESS.parse().unwrap(); + let tx = api::tx().da_bridge().try_dispatch_data_root( + DESTINATION_DOMAIN, + bridge_router_eth_addr.into(), + header.into(), + ); + + println!( + "Sending finalized block header. Domain: {}. Recipient: {}", + DESTINATION_DOMAIN, DA_BRIDGE_ROUTER_ADDRESS + ); + let h = client + .tx() + .sign_and_submit_then_watch(&tx, &signer, Default::default()) + .await + .unwrap() + .wait_for_finalized_success() + .await + .unwrap(); + + let submitted_block = client + .rpc() + .block(Some(h.block_hash())) + .await + .unwrap() + .unwrap(); + + let xts = submitted_block.block.extrinsics; + println!("Submitted block extrinsic: {xts:?}"); + + Ok(()) +} diff --git a/avail-subxt/src/api_dev.rs b/avail-subxt/src/api_dev.rs new file mode 100644 index 000000000..f643618bd --- /dev/null +++ b/avail-subxt/src/api_dev.rs @@ -0,0 +1,24860 @@ +#[allow(clippy::all)] +#[allow(dead_code, unused_imports, non_camel_case_types)] +pub mod api { + use super::api as root_mod; + pub static PALLETS: [&str; 32usize] = [ + "System", + "Utility", + "Babe", + "Timestamp", + "Authorship", + "Indices", + "Balances", + "TransactionPayment", + "ElectionProviderMultiPhase", + "Staking", + "Session", + "Democracy", + "Council", + "TechnicalCommittee", + "Elections", + "TechnicalMembership", + "Grandpa", + "Treasury", + "Sudo", + "ImOnline", + "AuthorityDiscovery", + "Offences", + "Historical", + "Scheduler", + "Bounties", + "Tips", + "Mmr", + "BagsList", + "DataAvailability", + "UpdaterManager", + "NomadHome", + "DABridge", + ]; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Event { + #[codec(index = 0)] + System(system::Event), + #[codec(index = 1)] + Utility(utility::Event), + #[codec(index = 5)] + Indices(indices::Event), + #[codec(index = 6)] + Balances(balances::Event), + #[codec(index = 9)] + ElectionProviderMultiPhase(election_provider_multi_phase::Event), + #[codec(index = 10)] + Staking(staking::Event), + #[codec(index = 11)] + Session(session::Event), + #[codec(index = 12)] + Democracy(democracy::Event), + #[codec(index = 13)] + Council(council::Event), + #[codec(index = 14)] + TechnicalCommittee(technical_committee::Event), + #[codec(index = 15)] + Elections(elections::Event), + #[codec(index = 16)] + TechnicalMembership(technical_membership::Event), + #[codec(index = 17)] + Grandpa(grandpa::Event), + #[codec(index = 18)] + Treasury(treasury::Event), + #[codec(index = 19)] + Sudo(sudo::Event), + #[codec(index = 20)] + ImOnline(im_online::Event), + #[codec(index = 22)] + Offences(offences::Event), + #[codec(index = 24)] + Scheduler(scheduler::Event), + #[codec(index = 25)] + Bounties(bounties::Event), + #[codec(index = 26)] + Tips(tips::Event), + #[codec(index = 28)] + BagsList(bags_list::Event), + #[codec(index = 29)] + DataAvailability(data_availability::Event), + #[codec(index = 30)] + UpdaterManager(updater_manager::Event), + #[codec(index = 31)] + NomadHome(nomad_home::Event), + #[codec(index = 32)] + DABridge(da_bridge::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 expensive."] + #[doc = "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 block."] + #[doc = "# "] + 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."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(b)` where b is the length of the remark."] + #[doc = "- 1 event."] + #[doc = "# "] + 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. \\[info\\]"] + pub struct ExtrinsicSuccess(pub runtime_types::frame_support::weights::DispatchInfo); + impl ::subxt::events::StaticEvent for ExtrinsicSuccess { + const EVENT: &'static str = "ExtrinsicSuccess"; + const PALLET: &'static str = "System"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An extrinsic failed. \\[error, info\\]"] + pub struct ExtrinsicFailed( + pub runtime_types::sp_runtime::DispatchError, + pub runtime_types::frame_support::weights::DispatchInfo, + ); + impl ::subxt::events::StaticEvent for ExtrinsicFailed { + const EVENT: &'static str = "ExtrinsicFailed"; + const PALLET: &'static str = "System"; + } + #[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 EVENT: &'static str = "CodeUpdated"; + const PALLET: &'static str = "System"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A new \\[account\\] was created."] + pub struct NewAccount(pub ::subxt::ext::sp_core::crypto::AccountId32); + impl ::subxt::events::StaticEvent for NewAccount { + const EVENT: &'static str = "NewAccount"; + const PALLET: &'static str = "System"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An \\[account\\] was reaped."] + pub struct KilledAccount(pub ::subxt::ext::sp_core::crypto::AccountId32); + impl ::subxt::events::StaticEvent for KilledAccount { + const EVENT: &'static str = "KilledAccount"; + const PALLET: &'static str = "System"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "On on-chain remark happened. \\[origin, remark_hash\\]"] + pub struct Remarked( + pub ::subxt::ext::sp_core::crypto::AccountId32, + pub ::subxt::ext::sp_core::H256, + ); + impl ::subxt::events::StaticEvent for Remarked { + const EVENT: &'static str = "Remarked"; + const PALLET: &'static str = "System"; + } + } + 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, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "AllExtrinsicsLen", + vec![], + [ + 139u8, 123u8, 64u8, 5u8, 243u8, 234u8, 235u8, 6u8, 225u8, 27u8, 65u8, + 41u8, 104u8, 177u8, 170u8, 192u8, 102u8, 111u8, 87u8, 192u8, 111u8, + 233u8, 122u8, 148u8, 45u8, 172u8, 30u8, 173u8, 155u8, 45u8, 196u8, + 233u8, + ], + ) + } + + #[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< + runtime_types::da_primitives::asdr::AppExtrinsic, + >, + ::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, + )], + [ + 119u8, 13u8, 145u8, 135u8, 63u8, 188u8, 118u8, 55u8, 255u8, 212u8, + 39u8, 232u8, 231u8, 180u8, 129u8, 247u8, 65u8, 190u8, 22u8, 81u8, + 225u8, 135u8, 104u8, 238u8, 208u8, 111u8, 68u8, 104u8, 35u8, 219u8, + 156u8, 155u8, + ], + ) + } + + #[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< + runtime_types::da_primitives::asdr::AppExtrinsic, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "ExtrinsicData", + Vec::new(), + [ + 119u8, 13u8, 145u8, 135u8, 63u8, 188u8, 118u8, 55u8, 255u8, 212u8, + 39u8, 232u8, 231u8, 180u8, 129u8, 247u8, 65u8, 190u8, 22u8, 81u8, + 225u8, 135u8, 104u8, 238u8, 208u8, 111u8, 68u8, 104u8, 35u8, 219u8, + 156u8, 155u8, + ], + ) + } + + #[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: This storage item is explicitly unbounded since it is never intended to be read"] + #[doc = " 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::da_runtime::Event, + ::subxt::ext::sp_core::H256, + >, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "Events", + vec![], + [ + 192u8, 110u8, 236u8, 62u8, 86u8, 15u8, 78u8, 228u8, 172u8, 116u8, + 121u8, 129u8, 109u8, 54u8, 16u8, 3u8, 181u8, 137u8, 42u8, 89u8, 170u8, + 177u8, 94u8, 2u8, 67u8, 99u8, 31u8, 95u8, 175u8, 50u8, 27u8, 2u8, + ], + ) + } + + #[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, + ], + ) + } + + #[doc = " The dynamic block length"] + pub fn dynamic_block_length( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_system::limits::BlockLength, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "System", + "DynamicBlockLength", + vec![], + [ + 61u8, 67u8, 254u8, 36u8, 130u8, 136u8, 2u8, 229u8, 41u8, 248u8, 72u8, + 49u8, 111u8, 31u8, 211u8, 59u8, 4u8, 82u8, 119u8, 131u8, 217u8, 158u8, + 138u8, 241u8, 103u8, 99u8, 129u8, 82u8, 173u8, 126u8, 196u8, 195u8, + ], + ) + } + } + } + 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", [ + 230u8, 122u8, 219u8, 215u8, 152u8, 88u8, 232u8, 109u8, 180u8, 145u8, 116u8, + 158u8, 216u8, 21u8, 118u8, 159u8, 251u8, 21u8, 28u8, 72u8, 170u8, 152u8, + 207u8, 17u8, 153u8, 57u8, 9u8, 151u8, 46u8, 182u8, 160u8, 65u8, + ]) + } + + #[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", [ + 131u8, 233u8, 3u8, 141u8, 149u8, 146u8, 0u8, 55u8, 80u8, 231u8, 9u8, 247u8, + 242u8, 126u8, 200u8, 190u8, 193u8, 77u8, 190u8, 153u8, 139u8, 76u8, 2u8, + 152u8, 160u8, 250u8, 183u8, 26u8, 6u8, 174u8, 130u8, 105u8, + ]) + } + + #[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 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, + } + 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 }, [ + 115u8, 117u8, 162u8, 24u8, 13u8, 112u8, 34u8, 183u8, 187u8, 162u8, 45u8, + 46u8, 164u8, 13u8, 50u8, 60u8, 151u8, 233u8, 204u8, 36u8, 211u8, 244u8, + 54u8, 185u8, 194u8, 210u8, 57u8, 102u8, 113u8, 230u8, 22u8, 96u8, + ]) + } + + #[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::da_runtime::Call, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Utility", + "as_derivative", + AsDerivative { + index, + call: ::std::boxed::Box::new(call), + }, + [ + 183u8, 32u8, 43u8, 178u8, 59u8, 70u8, 107u8, 153u8, 84u8, 73u8, 184u8, + 132u8, 193u8, 89u8, 101u8, 141u8, 37u8, 238u8, 112u8, 36u8, 122u8, + 149u8, 19u8, 239u8, 13u8, 103u8, 123u8, 91u8, 115u8, 225u8, 98u8, + 117u8, + ], + ) + } + + #[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 }, [ + 11u8, 123u8, 115u8, 50u8, 151u8, 84u8, 240u8, 219u8, 54u8, 38u8, 47u8, + 65u8, 113u8, 131u8, 165u8, 0u8, 76u8, 233u8, 224u8, 6u8, 53u8, 202u8, + 248u8, 53u8, 181u8, 240u8, 21u8, 240u8, 207u8, 98u8, 79u8, 193u8, + ]) + } + + #[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::da_runtime::OriginCaller, + call: runtime_types::da_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), + }, + [ + 51u8, 162u8, 124u8, 243u8, 152u8, 118u8, 138u8, 1u8, 155u8, 77u8, + 191u8, 138u8, 146u8, 237u8, 97u8, 139u8, 42u8, 75u8, 190u8, 228u8, + 160u8, 114u8, 16u8, 29u8, 196u8, 134u8, 67u8, 139u8, 31u8, 36u8, 43u8, + 47u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-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 EVENT: &'static str = "BatchInterrupted"; + const PALLET: &'static str = "Utility"; + } + #[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 EVENT: &'static str = "BatchCompleted"; + const PALLET: &'static str = "Utility"; + } + #[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 EVENT: &'static str = "ItemCompleted"; + const PALLET: &'static str = "Utility"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A call was dispatched. \\[result\\]"] + pub struct DispatchedAs( + pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::events::StaticEvent for DispatchedAs { + const EVENT: &'static str = "DispatchedAs"; + const PALLET: &'static str = "Utility"; + } + } + 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 babe { + 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 ReportEquivocation { + pub equivocation_proof: ::std::boxed::Box< + runtime_types::sp_consensus_slots::EquivocationProof< + runtime_types::da_primitives::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + runtime_types::sp_consensus_babe::app::Public, + >, + >, + pub key_owner_proof: runtime_types::sp_session::MembershipProof, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ReportEquivocationUnsigned { + pub equivocation_proof: ::std::boxed::Box< + runtime_types::sp_consensus_slots::EquivocationProof< + runtime_types::da_primitives::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + runtime_types::sp_consensus_babe::app::Public, + >, + >, + pub key_owner_proof: runtime_types::sp_session::MembershipProof, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct PlanConfigChange { + pub config: runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Report authority equivocation/misbehavior. This method will verify"] + #[doc = "the equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence will"] + #[doc = "be reported."] + pub fn report_equivocation( + &self, + equivocation_proof: runtime_types::sp_consensus_slots::EquivocationProof< + runtime_types::da_primitives::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + runtime_types::sp_consensus_babe::app::Public, + >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Babe", + "report_equivocation", + ReportEquivocation { + equivocation_proof: ::std::boxed::Box::new(equivocation_proof), + key_owner_proof, + }, + [ + 208u8, 111u8, 191u8, 81u8, 157u8, 234u8, 10u8, 180u8, 203u8, 148u8, + 110u8, 31u8, 10u8, 197u8, 220u8, 146u8, 223u8, 49u8, 196u8, 217u8, + 137u8, 8u8, 40u8, 76u8, 125u8, 15u8, 135u8, 205u8, 146u8, 60u8, 3u8, + 117u8, + ], + ) + } + + #[doc = "Report authority equivocation/misbehavior. This method will verify"] + #[doc = "the equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence will"] + #[doc = "be reported."] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + pub fn report_equivocation_unsigned( + &self, + equivocation_proof: runtime_types::sp_consensus_slots::EquivocationProof< + runtime_types::da_primitives::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + runtime_types::sp_consensus_babe::app::Public, + >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Babe", + "report_equivocation_unsigned", + ReportEquivocationUnsigned { + equivocation_proof: ::std::boxed::Box::new(equivocation_proof), + key_owner_proof, + }, + [ + 150u8, 91u8, 173u8, 165u8, 128u8, 39u8, 104u8, 129u8, 157u8, 194u8, + 26u8, 152u8, 85u8, 26u8, 78u8, 245u8, 8u8, 144u8, 211u8, 252u8, 216u8, + 230u8, 16u8, 206u8, 61u8, 163u8, 41u8, 62u8, 124u8, 220u8, 37u8, 143u8, + ], + ) + } + + #[doc = "Plan an epoch config change. The epoch config change is recorded and will be enacted on"] + #[doc = "the next call to `enact_epoch_change`. The config will be activated one epoch after."] + #[doc = "Multiple calls to this method will replace any existing planned config change that had"] + #[doc = "not been enacted yet."] + pub fn plan_config_change( + &self, + config: runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Babe", + "plan_config_change", + PlanConfigChange { config }, + [ + 229u8, 157u8, 41u8, 58u8, 56u8, 4u8, 52u8, 107u8, 104u8, 20u8, 42u8, + 110u8, 1u8, 17u8, 45u8, 196u8, 30u8, 135u8, 63u8, 46u8, 40u8, 137u8, + 209u8, 37u8, 24u8, 108u8, 251u8, 189u8, 77u8, 208u8, 74u8, 32u8, + ], + ) + } + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Current epoch index."] + pub fn epoch_index( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "EpochIndex", + vec![], + [ + 51u8, 27u8, 91u8, 156u8, 118u8, 99u8, 46u8, 219u8, 190u8, 147u8, 205u8, + 23u8, 106u8, 169u8, 121u8, 218u8, 208u8, 235u8, 135u8, 127u8, 243u8, + 41u8, 55u8, 243u8, 235u8, 122u8, 57u8, 86u8, 37u8, 90u8, 208u8, 71u8, + ], + ) + } + + #[doc = " Current epoch authorities."] + pub fn authorities( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec<( + runtime_types::sp_consensus_babe::app::Public, + ::core::primitive::u64, + )>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "Authorities", + vec![], + [ + 61u8, 8u8, 133u8, 111u8, 169u8, 120u8, 0u8, 213u8, 31u8, 159u8, 204u8, + 212u8, 18u8, 205u8, 93u8, 84u8, 140u8, 108u8, 136u8, 209u8, 234u8, + 107u8, 145u8, 9u8, 204u8, 224u8, 105u8, 9u8, 238u8, 241u8, 65u8, 30u8, + ], + ) + } + + #[doc = " The slot at which the first epoch actually started. This is 0"] + #[doc = " until the first block of the chain."] + pub fn genesis_slot( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "GenesisSlot", + vec![], + [ + 234u8, 127u8, 243u8, 100u8, 124u8, 160u8, 66u8, 248u8, 48u8, 218u8, + 61u8, 52u8, 54u8, 142u8, 158u8, 77u8, 32u8, 63u8, 156u8, 39u8, 94u8, + 255u8, 192u8, 238u8, 170u8, 118u8, 58u8, 42u8, 199u8, 61u8, 199u8, + 77u8, + ], + ) + } + + #[doc = " Current slot number."] + 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( + "Babe", + "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, + ], + ) + } + + #[doc = " The epoch randomness for the *current* epoch."] + #[doc = ""] + #[doc = " # Security"] + #[doc = ""] + #[doc = " This MUST NOT be used for gambling, as it can be influenced by a"] + #[doc = " malicious validator in the short term. It MAY be used in many"] + #[doc = " cryptographic protocols, however, so long as one remembers that this"] + #[doc = " (like everything else on-chain) it is public. For example, it can be"] + #[doc = " used where a number is needed that cannot have been chosen by an"] + #[doc = " adversary, for purposes such as public-coin zero-knowledge proofs."] + pub fn randomness( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<[::core::primitive::u8; 32usize]>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "Randomness", + vec![], + [ + 191u8, 197u8, 25u8, 164u8, 104u8, 248u8, 247u8, 193u8, 244u8, 60u8, + 181u8, 195u8, 248u8, 90u8, 41u8, 199u8, 82u8, 123u8, 72u8, 126u8, 18u8, + 17u8, 128u8, 215u8, 34u8, 251u8, 227u8, 70u8, 166u8, 10u8, 104u8, + 140u8, + ], + ) + } + + #[doc = " Pending epoch configuration change that will be applied when the next epoch is enacted."] + pub fn pending_epoch_config_change( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "PendingEpochConfigChange", + vec![], + [ + 4u8, 201u8, 0u8, 204u8, 47u8, 246u8, 4u8, 185u8, 163u8, 242u8, 242u8, + 152u8, 29u8, 222u8, 71u8, 127u8, 49u8, 203u8, 206u8, 180u8, 244u8, + 50u8, 80u8, 49u8, 199u8, 97u8, 3u8, 170u8, 156u8, 139u8, 106u8, 113u8, + ], + ) + } + + #[doc = " Next epoch randomness."] + pub fn next_randomness( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<[::core::primitive::u8; 32usize]>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "NextRandomness", + vec![], + [ + 185u8, 98u8, 45u8, 109u8, 253u8, 38u8, 238u8, 221u8, 240u8, 29u8, 38u8, + 107u8, 118u8, 117u8, 131u8, 115u8, 21u8, 255u8, 203u8, 81u8, 243u8, + 251u8, 91u8, 60u8, 163u8, 202u8, 125u8, 193u8, 173u8, 234u8, 166u8, + 92u8, + ], + ) + } + + #[doc = " Next epoch authorities."] + pub fn next_authorities( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec<( + runtime_types::sp_consensus_babe::app::Public, + ::core::primitive::u64, + )>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "NextAuthorities", + vec![], + [ + 201u8, 193u8, 164u8, 18u8, 155u8, 253u8, 124u8, 163u8, 143u8, 73u8, + 212u8, 20u8, 241u8, 108u8, 110u8, 5u8, 171u8, 66u8, 224u8, 208u8, 10u8, + 65u8, 148u8, 164u8, 1u8, 12u8, 216u8, 83u8, 20u8, 226u8, 254u8, 183u8, + ], + ) + } + + #[doc = " Randomness under construction."] + #[doc = ""] + #[doc = " We make a trade-off between storage accesses and list length."] + #[doc = " We store the under-construction randomness in segments of up to"] + #[doc = " `UNDER_CONSTRUCTION_SEGMENT_LENGTH`."] + #[doc = ""] + #[doc = " Once a segment reaches this length, we begin the next one."] + #[doc = " We reset all segments and return to `0` at the beginning of every"] + #[doc = " epoch."] + pub fn segment_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( + "Babe", + "SegmentIndex", + vec![], + [ + 128u8, 45u8, 87u8, 58u8, 174u8, 152u8, 241u8, 156u8, 56u8, 192u8, 19u8, + 45u8, 75u8, 160u8, 35u8, 253u8, 145u8, 11u8, 178u8, 81u8, 114u8, 117u8, + 112u8, 107u8, 163u8, 208u8, 240u8, 151u8, 102u8, 176u8, 246u8, 5u8, + ], + ) + } + + #[doc = " TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay."] + pub fn under_construction( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + [::core::primitive::u8; 32usize], + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "UnderConstruction", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 180u8, 4u8, 149u8, 245u8, 231u8, 92u8, 99u8, 170u8, 254u8, 172u8, + 182u8, 3u8, 152u8, 156u8, 132u8, 196u8, 140u8, 97u8, 7u8, 84u8, 220u8, + 89u8, 195u8, 177u8, 235u8, 51u8, 98u8, 144u8, 73u8, 238u8, 59u8, 164u8, + ], + ) + } + + #[doc = " TWOX-NOTE: `SegmentIndex` is an increasing integer, so this is okay."] + pub fn under_construction_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + [::core::primitive::u8; 32usize], + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "UnderConstruction", + Vec::new(), + [ + 180u8, 4u8, 149u8, 245u8, 231u8, 92u8, 99u8, 170u8, 254u8, 172u8, + 182u8, 3u8, 152u8, 156u8, 132u8, 196u8, 140u8, 97u8, 7u8, 84u8, 220u8, + 89u8, 195u8, 177u8, 235u8, 51u8, 98u8, 144u8, 73u8, 238u8, 59u8, 164u8, + ], + ) + } + + #[doc = " Temporary value (cleared at block finalization) which is `Some`"] + #[doc = " if per-block initialization has already been called for current block."] + pub fn initialized( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::core::option::Option<[::core::primitive::u8; 32usize]>, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "Initialized", + vec![], + [ + 48u8, 206u8, 111u8, 118u8, 149u8, 175u8, 148u8, 53u8, 233u8, 82u8, + 220u8, 57u8, 22u8, 164u8, 116u8, 228u8, 134u8, 237u8, 129u8, 195u8, + 60u8, 169u8, 1u8, 164u8, 74u8, 177u8, 145u8, 112u8, 66u8, 198u8, 53u8, + 157u8, + ], + ) + } + + #[doc = " This field should always be populated during block processing unless"] + #[doc = " secondary plain slots are enabled (which don't contain a VRF output)."] + #[doc = ""] + #[doc = " It is set in `on_initialize`, before it will contain the value from the last block."] + pub fn author_vrf_randomness( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::core::option::Option<[::core::primitive::u8; 32usize]>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "AuthorVrfRandomness", + vec![], + [ + 66u8, 235u8, 74u8, 252u8, 222u8, 135u8, 19u8, 28u8, 74u8, 191u8, 170u8, + 197u8, 207u8, 127u8, 77u8, 121u8, 138u8, 138u8, 110u8, 187u8, 34u8, + 14u8, 230u8, 43u8, 241u8, 241u8, 63u8, 163u8, 53u8, 179u8, 250u8, + 247u8, + ], + ) + } + + #[doc = " The block numbers when the last and current epoch have started, respectively `N-1` and"] + #[doc = " `N`."] + #[doc = " NOTE: We track this is in order to annotate the block number when a given pool of"] + #[doc = " entropy was fixed (i.e. it was known to chain observers). Since epochs are defined in"] + #[doc = " slots, which may be skipped, the block numbers may not line up with the slot numbers."] + pub fn epoch_start( + &self, + ) -> ::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( + "Babe", + "EpochStart", + vec![], + [ + 196u8, 39u8, 241u8, 20u8, 150u8, 180u8, 136u8, 4u8, 195u8, 205u8, + 218u8, 10u8, 130u8, 131u8, 168u8, 243u8, 207u8, 249u8, 58u8, 195u8, + 177u8, 119u8, 110u8, 243u8, 241u8, 3u8, 245u8, 56u8, 157u8, 5u8, 68u8, + 60u8, + ], + ) + } + + #[doc = " How late the current block is compared to its parent."] + #[doc = ""] + #[doc = " This entry is populated as part of block execution and is cleaned up"] + #[doc = " on block finalization. Querying this storage entry outside of block"] + #[doc = " execution context should always yield zero."] + pub fn lateness( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "Lateness", + vec![], + [ + 229u8, 230u8, 224u8, 89u8, 49u8, 213u8, 198u8, 236u8, 144u8, 56u8, + 193u8, 234u8, 62u8, 242u8, 191u8, 199u8, 105u8, 131u8, 74u8, 63u8, + 75u8, 1u8, 210u8, 49u8, 3u8, 128u8, 18u8, 77u8, 219u8, 146u8, 60u8, + 88u8, + ], + ) + } + + #[doc = " The configuration for the current epoch. Should never be `None` as it is initialized in"] + #[doc = " genesis."] + pub fn epoch_config( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_consensus_babe::BabeEpochConfiguration, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "EpochConfig", + vec![], + [ + 41u8, 118u8, 141u8, 244u8, 72u8, 17u8, 125u8, 203u8, 43u8, 153u8, + 203u8, 119u8, 117u8, 223u8, 123u8, 133u8, 73u8, 235u8, 130u8, 21u8, + 160u8, 167u8, 16u8, 173u8, 177u8, 35u8, 117u8, 97u8, 149u8, 49u8, + 220u8, 24u8, + ], + ) + } + + #[doc = " The configuration for the next epoch, `None` if the config will not change"] + #[doc = " (you can fallback to `EpochConfig` instead in that case)."] + pub fn next_epoch_config( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_consensus_babe::BabeEpochConfiguration, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Babe", + "NextEpochConfig", + vec![], + [ + 111u8, 182u8, 144u8, 180u8, 92u8, 146u8, 102u8, 249u8, 196u8, 229u8, + 226u8, 30u8, 25u8, 198u8, 133u8, 9u8, 136u8, 95u8, 11u8, 151u8, 139u8, + 156u8, 105u8, 228u8, 181u8, 12u8, 175u8, 148u8, 174u8, 33u8, 233u8, + 228u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The amount of time, in slots, that each epoch should last."] + #[doc = " NOTE: Currently it is not possible to change the epoch duration after"] + #[doc = " the chain has started. Attempting to do so will brick block production."] + pub fn epoch_duration( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new("Babe", "EpochDuration", [ + 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 expected average block time at which BABE should be creating"] + #[doc = " blocks. Since BABE is probabilistic it is not trivial to figure out"] + #[doc = " what the expected average block time should be based on the slot"] + #[doc = " duration and the security parameter `c` (where `1 - c` represents"] + #[doc = " the probability of a slot being empty)."] + pub fn expected_block_time( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new("Babe", "ExpectedBlockTime", [ + 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 = " Max number of authorities allowed"] + pub fn max_authorities( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new("Babe", "MaxAuthorities", [ + 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 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 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::da_primitives::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::da_primitives::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Authorship", + "set_uncles", + SetUncles { new_uncles }, + [ + 107u8, 16u8, 191u8, 152u8, 109u8, 147u8, 123u8, 8u8, 145u8, 25u8, + 180u8, 212u8, 83u8, 30u8, 223u8, 118u8, 20u8, 114u8, 232u8, 201u8, 1u8, + 147u8, 5u8, 138u8, 163u8, 55u8, 49u8, 36u8, 193u8, 176u8, 79u8, 255u8, + ], + ) + } + } + } + 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< + ::std::vec::Vec< + 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![], + [ + 43u8, 181u8, 75u8, 158u8, 153u8, 32u8, 210u8, 36u8, 194u8, 34u8, 146u8, + 179u8, 154u8, 141u8, 75u8, 29u8, 51u8, 116u8, 94u8, 82u8, 90u8, 74u8, + 103u8, 216u8, 86u8, 27u8, 30u8, 213u8, 174u8, 80u8, 193u8, 51u8, + ], + ) + } + + #[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 indices { + 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 :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Claim { + pub index: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Transfer { + pub new: ::subxt::ext::sp_core::crypto::AccountId32, + pub index: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Free { + pub index: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ForceTransfer { + pub new: ::subxt::ext::sp_core::crypto::AccountId32, + pub index: ::core::primitive::u32, + pub freeze: ::core::primitive::bool, + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Freeze { + pub index: ::core::primitive::u32, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Assign an previously unassigned index."] + #[doc = ""] + #[doc = "Payment: `Deposit` is reserved from the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `index`: the index to be claimed. This must not be in use."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- One reserve operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight: 1 Read/Write (Accounts)"] + #[doc = "# "] + pub fn claim( + &self, + index: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new("Indices", "claim", Claim { index }, [ + 5u8, 24u8, 11u8, 173u8, 226u8, 170u8, 0u8, 30u8, 193u8, 102u8, 214u8, 59u8, + 252u8, 32u8, 221u8, 88u8, 196u8, 189u8, 244u8, 18u8, 233u8, 37u8, 228u8, + 248u8, 76u8, 175u8, 212u8, 233u8, 238u8, 203u8, 162u8, 68u8, + ]) + } + + #[doc = "Assign an index already owned by the sender to another account. The balance reservation"] + #[doc = "is effectively transferred to the new account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `index`: the index to be re-assigned. This must be owned by the sender."] + #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- One transfer operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Reads: Indices Accounts, System Account (recipient)"] + #[doc = " - Writes: Indices Accounts, System Account (recipient)"] + #[doc = "# "] + pub fn transfer( + &self, + new: ::subxt::ext::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Indices", + "transfer", + Transfer { new, index }, + [ + 229u8, 48u8, 45u8, 2u8, 206u8, 24u8, 60u8, 43u8, 202u8, 99u8, 80u8, + 172u8, 62u8, 134u8, 224u8, 128u8, 107u8, 219u8, 57u8, 87u8, 144u8, + 220u8, 207u8, 79u8, 7u8, 89u8, 208u8, 75u8, 158u8, 75u8, 10u8, 113u8, + ], + ) + } + + #[doc = "Free up an index owned by the sender."] + #[doc = ""] + #[doc = "Payment: Any previous deposit placed for the index is unreserved in the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must own the index."] + #[doc = ""] + #[doc = "- `index`: the index to be freed. This must be owned by the sender."] + #[doc = ""] + #[doc = "Emits `IndexFreed` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- One reserve operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight: 1 Read/Write (Accounts)"] + #[doc = "# "] + pub fn free( + &self, + index: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new("Indices", "free", Free { index }, [ + 133u8, 202u8, 225u8, 127u8, 69u8, 145u8, 43u8, 13u8, 160u8, 248u8, 215u8, + 243u8, 232u8, 166u8, 74u8, 203u8, 235u8, 138u8, 255u8, 27u8, 163u8, 71u8, + 254u8, 217u8, 6u8, 208u8, 202u8, 204u8, 238u8, 70u8, 126u8, 252u8, + ]) + } + + #[doc = "Force an index to an account. This doesn't require a deposit. If the index is already"] + #[doc = "held, then any deposit is reimbursed to its current owner."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "- `index`: the index to be (re-)assigned."] + #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] + #[doc = "- `freeze`: if set to `true`, will freeze the index so it cannot be transferred."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- Up to one reserve operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Reads: Indices Accounts, System Account (original owner)"] + #[doc = " - Writes: Indices Accounts, System Account (original owner)"] + #[doc = "# "] + pub fn force_transfer( + &self, + new: ::subxt::ext::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + freeze: ::core::primitive::bool, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Indices", + "force_transfer", + ForceTransfer { new, index, freeze }, + [ + 2u8, 134u8, 200u8, 233u8, 224u8, 80u8, 237u8, 130u8, 28u8, 159u8, + 130u8, 223u8, 124u8, 205u8, 248u8, 70u8, 246u8, 77u8, 73u8, 193u8, + 78u8, 85u8, 58u8, 29u8, 191u8, 217u8, 252u8, 178u8, 113u8, 255u8, + 151u8, 49u8, + ], + ) + } + + #[doc = "Freeze an index so it will always point to the sender account. This consumes the"] + #[doc = "deposit."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must have a"] + #[doc = "non-frozen account `index`."] + #[doc = ""] + #[doc = "- `index`: the index to be frozen in place."] + #[doc = ""] + #[doc = "Emits `IndexFrozen` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- Up to one slash operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight: 1 Read/Write (Accounts)"] + #[doc = "# "] + pub fn freeze( + &self, + index: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new("Indices", "freeze", Freeze { index }, [ + 121u8, 45u8, 118u8, 2u8, 72u8, 48u8, 38u8, 7u8, 234u8, 204u8, 68u8, 20u8, + 76u8, 251u8, 205u8, 246u8, 149u8, 31u8, 168u8, 186u8, 208u8, 90u8, 40u8, + 47u8, 100u8, 228u8, 188u8, 33u8, 79u8, 220u8, 105u8, 209u8, + ]) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_indices::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A account index was assigned."] + pub struct IndexAssigned { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for IndexAssigned { + const EVENT: &'static str = "IndexAssigned"; + const PALLET: &'static str = "Indices"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A account index has been freed up (unassigned)."] + pub struct IndexFreed { + pub index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for IndexFreed { + const EVENT: &'static str = "IndexFreed"; + const PALLET: &'static str = "Indices"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A account index has been frozen to its current account ID."] + pub struct IndexFrozen { + pub index: ::core::primitive::u32, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for IndexFrozen { + const EVENT: &'static str = "IndexFrozen"; + const PALLET: &'static str = "Indices"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The lookup from index to account."] + pub fn accounts( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::bool, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Indices", + "Accounts", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 211u8, 169u8, 54u8, 254u8, 88u8, 57u8, 22u8, 223u8, 108u8, 27u8, 38u8, + 9u8, 202u8, 209u8, 111u8, 209u8, 144u8, 13u8, 211u8, 114u8, 239u8, + 127u8, 75u8, 166u8, 234u8, 222u8, 225u8, 35u8, 160u8, 163u8, 112u8, + 242u8, + ], + ) + } + + #[doc = " The lookup from index to account."] + pub fn accounts_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::bool, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Indices", + "Accounts", + Vec::new(), + [ + 211u8, 169u8, 54u8, 254u8, 88u8, 57u8, 22u8, 223u8, 108u8, 27u8, 38u8, + 9u8, 202u8, 209u8, 111u8, 209u8, 144u8, 13u8, 211u8, 114u8, 239u8, + 127u8, 75u8, 166u8, 234u8, 222u8, 225u8, 35u8, 160u8, 163u8, 112u8, + 242u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The deposit needed for reserving an index."] + pub fn deposit( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new("Indices", "Deposit", [ + 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 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, + ::core::primitive::u32, + >, + #[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, + ::core::primitive::u32, + >, + #[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, + ::core::primitive::u32, + >, + pub dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[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, + ::core::primitive::u32, + >, + #[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, + ::core::primitive::u32, + >, + 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, + ::core::primitive::u32, + >, + 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 = "It will decrease the total issuance of the system by the `TransferFee`."] + #[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, + ::core::primitive::u32, + >, + value: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "transfer", + Transfer { dest, value }, + [ + 255u8, 181u8, 144u8, 248u8, 64u8, 167u8, 5u8, 134u8, 208u8, 20u8, + 223u8, 103u8, 235u8, 35u8, 66u8, 184u8, 27u8, 94u8, 176u8, 60u8, 233u8, + 236u8, 145u8, 218u8, 44u8, 138u8, 240u8, 224u8, 16u8, 193u8, 220u8, + 95u8, + ], + ) + } + + #[doc = "Set the balances of a given account."] + #[doc = ""] + #[doc = "This will alter `FreeBalance` and `ReservedBalance` in storage. it will"] + #[doc = "also decrease the total issuance of the system (`TotalIssuance`)."] + #[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, + ::core::primitive::u32, + >, + 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, + }, + [ + 174u8, 34u8, 80u8, 252u8, 193u8, 51u8, 228u8, 236u8, 234u8, 16u8, + 173u8, 214u8, 122u8, 21u8, 254u8, 7u8, 49u8, 176u8, 18u8, 128u8, 122u8, + 68u8, 72u8, 181u8, 119u8, 90u8, 167u8, 46u8, 203u8, 220u8, 109u8, + 110u8, + ], + ) + } + + #[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, + ::core::primitive::u32, + >, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + value: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "force_transfer", + ForceTransfer { + source, + dest, + value, + }, + [ + 56u8, 80u8, 186u8, 45u8, 134u8, 147u8, 200u8, 19u8, 53u8, 221u8, 213u8, + 32u8, 13u8, 51u8, 130u8, 42u8, 244u8, 85u8, 50u8, 246u8, 189u8, 51u8, + 93u8, 1u8, 108u8, 142u8, 112u8, 245u8, 104u8, 255u8, 15u8, 62u8, + ], + ) + } + + #[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, + ::core::primitive::u32, + >, + value: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "transfer_keep_alive", + TransferKeepAlive { dest, value }, + [ + 202u8, 239u8, 204u8, 0u8, 52u8, 57u8, 158u8, 8u8, 252u8, 178u8, 91u8, + 197u8, 238u8, 186u8, 205u8, 56u8, 217u8, 250u8, 21u8, 44u8, 239u8, + 66u8, 79u8, 99u8, 25u8, 106u8, 70u8, 226u8, 50u8, 255u8, 176u8, 71u8, + ], + ) + } + + #[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, + ::core::primitive::u32, + >, + keep_alive: ::core::primitive::bool, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "transfer_all", + TransferAll { dest, keep_alive }, + [ + 118u8, 215u8, 198u8, 243u8, 4u8, 173u8, 108u8, 224u8, 113u8, 203u8, + 149u8, 23u8, 130u8, 176u8, 53u8, 205u8, 112u8, 147u8, 88u8, 167u8, + 197u8, 32u8, 104u8, 117u8, 201u8, 168u8, 144u8, 230u8, 120u8, 29u8, + 122u8, 159u8, + ], + ) + } + + #[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, + ::core::primitive::u32, + >, + amount: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Balances", + "force_unreserve", + ForceUnreserve { who, amount }, + [ + 39u8, 229u8, 111u8, 44u8, 147u8, 80u8, 7u8, 26u8, 185u8, 121u8, 149u8, + 25u8, 151u8, 37u8, 124u8, 46u8, 108u8, 136u8, 167u8, 145u8, 103u8, + 65u8, 33u8, 168u8, 36u8, 214u8, 126u8, 237u8, 180u8, 61u8, 108u8, + 110u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-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 EVENT: &'static str = "Endowed"; + const PALLET: &'static str = "Balances"; + } + #[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 EVENT: &'static str = "DustLost"; + const PALLET: &'static str = "Balances"; + } + #[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 EVENT: &'static str = "Transfer"; + const PALLET: &'static str = "Balances"; + } + #[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 EVENT: &'static str = "BalanceSet"; + const PALLET: &'static str = "Balances"; + } + #[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 EVENT: &'static str = "Reserved"; + const PALLET: &'static str = "Balances"; + } + #[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 EVENT: &'static str = "Unreserved"; + const PALLET: &'static str = "Balances"; + } + #[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 EVENT: &'static str = "ReserveRepatriated"; + const PALLET: &'static str = "Balances"; + } + #[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 EVENT: &'static str = "Deposit"; + const PALLET: &'static str = "Balances"; + } + #[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 EVENT: &'static str = "Withdraw"; + const PALLET: &'static str = "Balances"; + } + #[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 EVENT: &'static str = "Slashed"; + const PALLET: &'static str = "Balances"; + } + } + 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 balance of an account."] + #[doc = ""] + #[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 balance of an account."] + #[doc = ""] + #[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::frame_support::storage::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::frame_support::storage::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::frame_support::storage::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::frame_support::storage::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}; + 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 = " The fee to be paid for making a transaction; the per-byte portion."] + pub fn transaction_byte_fee( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "TransactionPayment", + "TransactionByteFee", + [ + 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 = " 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, + ], + ) + } + + #[doc = " The polynomial that is applied in order to derive fee from weight."] + pub fn weight_to_fee( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec< + runtime_types::frame_support::weights::WeightToFeeCoefficient< + ::core::primitive::u128, + >, + >, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "TransactionPayment", + "WeightToFee", + [ + 15u8, 119u8, 137u8, 69u8, 18u8, 105u8, 232u8, 166u8, 200u8, 253u8, + 17u8, 71u8, 185u8, 155u8, 82u8, 215u8, 166u8, 74u8, 238u8, 28u8, 61u8, + 206u8, 89u8, 133u8, 136u8, 131u8, 67u8, 243u8, 19u8, 238u8, 147u8, + 226u8, + ], + ) + } + } + } + } + pub mod election_provider_multi_phase { + 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 SubmitUnsigned { + pub raw_solution: ::std::boxed::Box< + runtime_types::pallet_election_provider_multi_phase::RawSolution< + runtime_types::da_runtime::NposSolution16, + >, + >, + pub witness: + runtime_types::pallet_election_provider_multi_phase::SolutionOrSnapshotSize, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetMinimumUntrustedScore { + pub maybe_next_score: ::core::option::Option<[::core::primitive::u128; 3usize]>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetEmergencyElectionResult { + pub supports: ::std::vec::Vec<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::sp_npos_elections::Support< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + )>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Submit { + pub raw_solution: ::std::boxed::Box< + runtime_types::pallet_election_provider_multi_phase::RawSolution< + runtime_types::da_runtime::NposSolution16, + >, + >, + pub num_signed_submissions: ::core::primitive::u32, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Submit a solution for the unsigned phase."] + #[doc = ""] + #[doc = "The dispatch origin fo this call must be __none__."] + #[doc = ""] + #[doc = "This submission is checked on the fly. Moreover, this unsigned solution is only"] + #[doc = "validated when submitted to the pool from the **local** node. Effectively, this means"] + #[doc = "that only active validators can submit this transaction when authoring a block (similar"] + #[doc = "to an inherent)."] + #[doc = ""] + #[doc = "To prevent any incorrect solution (and thus wasted time/weight), this transaction will"] + #[doc = "panic if the solution submitted by the validator is invalid in any way, effectively"] + #[doc = "putting their authoring reward at risk."] + #[doc = ""] + #[doc = "No deposit or reward is associated with this submission."] + pub fn submit_unsigned( + &self, + raw_solution: runtime_types::pallet_election_provider_multi_phase::RawSolution< + runtime_types::da_runtime::NposSolution16, + >, + witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ElectionProviderMultiPhase", + "submit_unsigned", + SubmitUnsigned { + raw_solution: ::std::boxed::Box::new(raw_solution), + witness, + }, + [ + 78u8, 88u8, 168u8, 223u8, 50u8, 163u8, 76u8, 60u8, 55u8, 60u8, 30u8, + 230u8, 169u8, 157u8, 221u8, 88u8, 178u8, 139u8, 103u8, 130u8, 219u8, + 183u8, 246u8, 213u8, 64u8, 196u8, 181u8, 151u8, 42u8, 189u8, 185u8, + 141u8, + ], + ) + } + + #[doc = "Set a new value for `MinimumUntrustedScore`."] + #[doc = ""] + #[doc = "Dispatch origin must be aligned with `T::ForceOrigin`."] + #[doc = ""] + #[doc = "This check can be turned off by setting the value to `None`."] + pub fn set_minimum_untrusted_score( + &self, + maybe_next_score: ::core::option::Option<[::core::primitive::u128; 3usize]>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ElectionProviderMultiPhase", + "set_minimum_untrusted_score", + SetMinimumUntrustedScore { maybe_next_score }, + [ + 254u8, 242u8, 51u8, 160u8, 180u8, 220u8, 142u8, 142u8, 221u8, 165u8, + 167u8, 199u8, 83u8, 49u8, 255u8, 224u8, 24u8, 197u8, 94u8, 177u8, 57u8, + 223u8, 225u8, 231u8, 33u8, 87u8, 41u8, 137u8, 203u8, 110u8, 192u8, + 54u8, + ], + ) + } + + #[doc = "Set a solution in the queue, to be handed out to the client of this pallet in the next"] + #[doc = "call to `ElectionProvider::elect`."] + #[doc = ""] + #[doc = "This can only be set by `T::ForceOrigin`, and only when the phase is `Emergency`."] + #[doc = ""] + #[doc = "The solution is not checked for any feasibility and is assumed to be trustworthy, as any"] + #[doc = "feasibility check itself can in principle cause the election process to fail (due to"] + #[doc = "memory/weight constrains)."] + pub fn set_emergency_election_result( + &self, + supports: ::std::vec::Vec<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::sp_npos_elections::Support< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + )>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ElectionProviderMultiPhase", + "set_emergency_election_result", + SetEmergencyElectionResult { supports }, + [ + 115u8, 255u8, 205u8, 58u8, 153u8, 1u8, 246u8, 8u8, 225u8, 36u8, 66u8, + 144u8, 250u8, 145u8, 70u8, 76u8, 54u8, 63u8, 251u8, 51u8, 214u8, 204u8, + 55u8, 112u8, 46u8, 228u8, 255u8, 250u8, 151u8, 5u8, 44u8, 133u8, + ], + ) + } + + #[doc = "Submit a solution for the signed phase."] + #[doc = ""] + #[doc = "The dispatch origin fo this call must be __signed__."] + #[doc = ""] + #[doc = "The solution is potentially queued, based on the claimed score and processed at the end"] + #[doc = "of the signed phase."] + #[doc = ""] + #[doc = "A deposit is reserved and recorded for the solution. Based on the outcome, the solution"] + #[doc = "might be rewarded, slashed, or get all or a part of the deposit back."] + #[doc = ""] + #[doc = "# "] + #[doc = "Queue size must be provided as witness data."] + #[doc = "# "] + pub fn submit( + &self, + raw_solution: runtime_types::pallet_election_provider_multi_phase::RawSolution< + runtime_types::da_runtime::NposSolution16, + >, + num_signed_submissions: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ElectionProviderMultiPhase", + "submit", + Submit { + raw_solution: ::std::boxed::Box::new(raw_solution), + num_signed_submissions, + }, + [ + 28u8, 241u8, 193u8, 108u8, 35u8, 165u8, 57u8, 74u8, 109u8, 80u8, 21u8, + 222u8, 189u8, 105u8, 159u8, 132u8, 223u8, 57u8, 37u8, 178u8, 7u8, 25u8, + 88u8, 234u8, 68u8, 101u8, 31u8, 243u8, 202u8, 58u8, 13u8, 27u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_election_provider_multi_phase::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A solution was stored with the given compute."] + #[doc = ""] + #[doc = "If the solution is signed, this means that it hasn't yet been processed. If the"] + #[doc = "solution is unsigned, this means that it has also been processed."] + #[doc = ""] + #[doc = "The `bool` is `true` when a previous solution was ejected to make room for this one."] + pub struct SolutionStored { + pub election_compute: + runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + pub prev_ejected: ::core::primitive::bool, + } + impl ::subxt::events::StaticEvent for SolutionStored { + const EVENT: &'static str = "SolutionStored"; + const PALLET: &'static str = "ElectionProviderMultiPhase"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The election has been finalized, with `Some` of the given computation, or else if the"] + #[doc = "election failed, `None`."] + pub struct ElectionFinalized { + pub election_compute: ::core::option::Option< + runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + >, + } + impl ::subxt::events::StaticEvent for ElectionFinalized { + const EVENT: &'static str = "ElectionFinalized"; + const PALLET: &'static str = "ElectionProviderMultiPhase"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An account has been rewarded for their signed submission being finalized."] + pub struct Rewarded { + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + pub value: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Rewarded { + const EVENT: &'static str = "Rewarded"; + const PALLET: &'static str = "ElectionProviderMultiPhase"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An account has been slashed for submitting an invalid signed submission."] + pub struct Slashed { + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + pub value: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Slashed { + const EVENT: &'static str = "Slashed"; + const PALLET: &'static str = "ElectionProviderMultiPhase"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The signed phase of the given round has started."] + pub struct SignedPhaseStarted { + pub round: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for SignedPhaseStarted { + const EVENT: &'static str = "SignedPhaseStarted"; + const PALLET: &'static str = "ElectionProviderMultiPhase"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The unsigned phase of the given round has started."] + pub struct UnsignedPhaseStarted { + pub round: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for UnsignedPhaseStarted { + const EVENT: &'static str = "UnsignedPhaseStarted"; + const PALLET: &'static str = "ElectionProviderMultiPhase"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Internal counter for the number of rounds."] + #[doc = ""] + #[doc = " This is useful for de-duplication of transactions submitted to the pool, and general"] + #[doc = " diagnostics of the pallet."] + #[doc = ""] + #[doc = " This is merely incremented once per every time that an upstream `elect` is called."] + pub fn round( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "Round", + vec![], + [ + 16u8, 49u8, 176u8, 52u8, 202u8, 111u8, 120u8, 8u8, 217u8, 96u8, 35u8, + 14u8, 233u8, 130u8, 47u8, 98u8, 34u8, 44u8, 166u8, 188u8, 199u8, 210u8, + 21u8, 19u8, 70u8, 96u8, 139u8, 8u8, 53u8, 82u8, 165u8, 239u8, + ], + ) + } + + #[doc = " Current phase."] + pub fn current_phase( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_election_provider_multi_phase::Phase< + ::core::primitive::u32, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "CurrentPhase", + vec![], + [ + 236u8, 101u8, 8u8, 52u8, 68u8, 240u8, 74u8, 159u8, 181u8, 53u8, 153u8, + 101u8, 228u8, 81u8, 96u8, 161u8, 34u8, 67u8, 35u8, 28u8, 121u8, 44u8, + 229u8, 45u8, 196u8, 87u8, 73u8, 125u8, 216u8, 245u8, 255u8, 15u8, + ], + ) + } + + #[doc = " Current best solution, signed or unsigned, queued to be returned upon `elect`."] + pub fn queued_solution( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_election_provider_multi_phase::ReadySolution< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "QueuedSolution", + vec![], + [ + 8u8, 176u8, 111u8, 220u8, 33u8, 50u8, 158u8, 87u8, 176u8, 7u8, 102u8, + 136u8, 81u8, 56u8, 45u8, 150u8, 241u8, 33u8, 81u8, 116u8, 42u8, 50u8, + 153u8, 26u8, 30u8, 72u8, 13u8, 165u8, 181u8, 97u8, 110u8, 84u8, + ], + ) + } + + #[doc = " Snapshot data of the round."] + #[doc = ""] + #[doc = " This is created at the beginning of the signed phase and cleared upon calling `elect`."] + pub fn snapshot( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_election_provider_multi_phase::RoundSnapshot< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "Snapshot", + vec![], + [ + 18u8, 60u8, 209u8, 69u8, 24u8, 23u8, 217u8, 125u8, 88u8, 104u8, 97u8, + 43u8, 56u8, 124u8, 137u8, 146u8, 53u8, 233u8, 193u8, 117u8, 14u8, + 200u8, 59u8, 125u8, 31u8, 145u8, 135u8, 59u8, 149u8, 39u8, 222u8, 18u8, + ], + ) + } + + #[doc = " Desired number of targets to elect for this round."] + #[doc = ""] + #[doc = " Only exists when [`Snapshot`] is present."] + pub fn desired_targets( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "DesiredTargets", + vec![], + [ + 16u8, 247u8, 4u8, 181u8, 93u8, 79u8, 12u8, 212u8, 146u8, 167u8, 80u8, + 58u8, 118u8, 52u8, 68u8, 87u8, 90u8, 140u8, 31u8, 210u8, 2u8, 116u8, + 220u8, 231u8, 115u8, 112u8, 118u8, 118u8, 68u8, 34u8, 151u8, 165u8, + ], + ) + } + + #[doc = " The metadata of the [`RoundSnapshot`]"] + #[doc = ""] + #[doc = " Only exists when [`Snapshot`] is present."] + pub fn snapshot_metadata( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_election_provider_multi_phase::SolutionOrSnapshotSize, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "SnapshotMetadata", + vec![], + [ + 135u8, 122u8, 60u8, 75u8, 194u8, 240u8, 187u8, 96u8, 240u8, 203u8, + 192u8, 22u8, 117u8, 148u8, 118u8, 24u8, 240u8, 213u8, 94u8, 22u8, + 194u8, 47u8, 181u8, 245u8, 77u8, 149u8, 11u8, 251u8, 117u8, 220u8, + 205u8, 78u8, + ], + ) + } + + #[doc = " The next index to be assigned to an incoming signed submission."] + #[doc = ""] + #[doc = " Every accepted submission is assigned a unique index; that index is bound to that particular"] + #[doc = " submission for the duration of the election. On election finalization, the next index is"] + #[doc = " reset to 0."] + #[doc = ""] + #[doc = " We can't just use `SignedSubmissionIndices.len()`, because that's a bounded set; past its"] + #[doc = " capacity, it will simply saturate. We can't just iterate over `SignedSubmissionsMap`,"] + #[doc = " because iteration is slow. Instead, we store the value here."] + pub fn signed_submission_next_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( + "ElectionProviderMultiPhase", + "SignedSubmissionNextIndex", + vec![], + [ + 242u8, 11u8, 157u8, 105u8, 96u8, 7u8, 31u8, 20u8, 51u8, 141u8, 182u8, + 180u8, 13u8, 172u8, 155u8, 59u8, 42u8, 238u8, 115u8, 8u8, 6u8, 137u8, + 45u8, 2u8, 123u8, 187u8, 53u8, 215u8, 19u8, 129u8, 54u8, 22u8, + ], + ) + } + + #[doc = " A sorted, bounded set of `(score, index)`, where each `index` points to a value in"] + #[doc = " `SignedSubmissions`."] + #[doc = ""] + #[doc = " We never need to process more than a single signed submission at a time. Signed submissions"] + #[doc = " can be quite large, so we're willing to pay the cost of multiple database accesses to access"] + #[doc = " them one at a time instead of reading and decoding all of them at once."] + pub fn signed_submission_indices( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::storage::bounded_btree_map::BoundedBTreeMap< + [::core::primitive::u128; 3usize], + ::core::primitive::u32, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "SignedSubmissionIndices", + vec![], + [ + 109u8, 26u8, 187u8, 45u8, 252u8, 101u8, 124u8, 47u8, 70u8, 41u8, 155u8, + 221u8, 20u8, 191u8, 227u8, 236u8, 161u8, 217u8, 234u8, 57u8, 145u8, + 53u8, 21u8, 165u8, 150u8, 48u8, 241u8, 39u8, 196u8, 171u8, 50u8, 96u8, + ], + ) + } + + #[doc = " Unchecked, signed solutions."] + #[doc = ""] + #[doc = " Together with `SubmissionIndices`, this stores a bounded set of `SignedSubmissions` while"] + #[doc = " allowing us to keep only a single one in memory at a time."] + #[doc = ""] + #[doc = " Twox note: the key of the map is an auto-incrementing index which users cannot inspect or"] + #[doc = " affect; we shouldn't need a cryptographically secure hasher."] pub fn signed_submissions_map (& self , _0 : impl :: std :: borrow :: Borrow < :: core :: primitive :: u32 > ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: ext :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 , runtime_types :: da_runtime :: NposSolution16 > > , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "SignedSubmissionsMap", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 175u8, 77u8, 57u8, 228u8, 214u8, 90u8, 192u8, 157u8, 159u8, 197u8, + 191u8, 154u8, 215u8, 141u8, 229u8, 170u8, 10u8, 249u8, 237u8, 158u8, + 215u8, 82u8, 222u8, 45u8, 23u8, 218u8, 58u8, 11u8, 11u8, 139u8, 52u8, + 233u8, + ], + ) + } + + #[doc = " Unchecked, signed solutions."] + #[doc = ""] + #[doc = " Together with `SubmissionIndices`, this stores a bounded set of `SignedSubmissions` while"] + #[doc = " allowing us to keep only a single one in memory at a time."] + #[doc = ""] + #[doc = " Twox note: the key of the map is an auto-incrementing index which users cannot inspect or"] + #[doc = " affect; we shouldn't need a cryptographically secure hasher."] pub fn signed_submissions_map_root (& self ,) -> :: subxt :: storage :: address :: StaticStorageAddress :: < :: subxt :: metadata :: DecodeStaticType < runtime_types :: pallet_election_provider_multi_phase :: signed :: SignedSubmission < :: subxt :: ext :: sp_core :: crypto :: AccountId32 , :: core :: primitive :: u128 , runtime_types :: da_runtime :: NposSolution16 > > , () , :: subxt :: storage :: address :: Yes , :: subxt :: storage :: address :: Yes >{ + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "SignedSubmissionsMap", + Vec::new(), + [ + 175u8, 77u8, 57u8, 228u8, 214u8, 90u8, 192u8, 157u8, 159u8, 197u8, + 191u8, 154u8, 215u8, 141u8, 229u8, 170u8, 10u8, 249u8, 237u8, 158u8, + 215u8, 82u8, 222u8, 45u8, 23u8, 218u8, 58u8, 11u8, 11u8, 139u8, 52u8, + 233u8, + ], + ) + } + + #[doc = " The minimum score that each 'untrusted' solution must attain in order to be considered"] + #[doc = " feasible."] + #[doc = ""] + #[doc = " Can be set via `set_minimum_untrusted_score`."] + pub fn minimum_untrusted_score( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<[::core::primitive::u128; 3usize]>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ElectionProviderMultiPhase", + "MinimumUntrustedScore", + vec![], + [ + 16u8, 168u8, 27u8, 66u8, 246u8, 15u8, 213u8, 144u8, 136u8, 38u8, 180u8, + 231u8, 79u8, 4u8, 100u8, 39u8, 189u8, 224u8, 180u8, 25u8, 3u8, 51u8, + 35u8, 27u8, 112u8, 234u8, 221u8, 18u8, 100u8, 129u8, 59u8, 185u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Duration of the unsigned phase."] + pub fn unsigned_phase( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "UnsignedPhase", + [ + 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 = " Duration of the signed phase."] + pub fn signed_phase( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "SignedPhase", + [ + 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 minimum amount of improvement to the solution score that defines a solution as"] + #[doc = " \"better\" (in any phase)."] + pub fn solution_improvement_threshold( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_arithmetic::per_things::Perbill, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "SolutionImprovementThreshold", + [ + 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 repeat threshold of the offchain worker."] + #[doc = ""] + #[doc = " For example, if it is 5, that means that at least 5 blocks will elapse between attempts"] + #[doc = " to submit the worker's solution."] + pub fn offchain_repeat( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "OffchainRepeat", + [ + 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 priority of the unsigned transaction submitted in the unsigned-phase"] + pub fn miner_tx_priority( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "MinerTxPriority", + [ + 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 = " Maximum weight that the miner should consume."] + #[doc = ""] + #[doc = " The miner will ensure that the total weight of the unsigned solution will not exceed"] + #[doc = " this value, based on [`WeightInfo::submit_unsigned`]."] + pub fn miner_max_weight( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "MinerMaxWeight", + [ + 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 = " Maximum number of signed submissions that can be queued."] + #[doc = ""] + #[doc = " It is best to avoid adjusting this during an election, as it impacts downstream data"] + #[doc = " structures. In particular, `SignedSubmissionIndices` is bounded on this value. If you"] + #[doc = " update this value during an election, you _must_ ensure that"] + #[doc = " `SignedSubmissionIndices.len()` is less than or equal to the new value. Otherwise,"] + #[doc = " attempts to submit new solutions may cause a runtime panic."] + pub fn signed_max_submissions( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "SignedMaxSubmissions", + [ + 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 weight of a signed solution."] + #[doc = ""] + #[doc = " This should probably be similar to [`Config::MinerMaxWeight`]."] + pub fn signed_max_weight( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "SignedMaxWeight", + [ + 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 = " Base reward for a signed solution"] + pub fn signed_reward_base( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "SignedRewardBase", + [ + 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 = " Base deposit for a signed solution."] + pub fn signed_deposit_base( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "SignedDepositBase", + [ + 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 = " Per-byte deposit for a signed solution."] + pub fn signed_deposit_byte( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "SignedDepositByte", + [ + 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 = " Per-weight deposit for a signed solution."] + pub fn signed_deposit_weight( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "SignedDepositWeight", + [ + 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 voters to put in the snapshot. At the moment, snapshots are only"] + #[doc = " over a single block, but once multi-block elections are introduced they will take place"] + #[doc = " over multiple blocks."] + #[doc = ""] + #[doc = " Also, note the data type: If the voters are represented by a `u32` in `type"] + #[doc = " CompactSolution`, the same `u32` is used here to ensure bounds are respected."] + pub fn voter_snapshot_per_block( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "VoterSnapshotPerBlock", + [ + 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 length (bytes) that the mined solution should consume."] + #[doc = ""] + #[doc = " The miner will ensure that the total length of the unsigned solution will not exceed"] + #[doc = " this value."] + pub fn miner_max_length( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ElectionProviderMultiPhase", + "MinerMaxLength", + [ + 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, + ::core::primitive::u32, + >, + #[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, + ::core::primitive::u32, + >, + >, + } + #[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, + ::core::primitive::u32, + >, + } + #[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, + ::core::primitive::u32, + >, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetStakingLimits { + pub min_nominator_bond: ::core::primitive::u128, + pub min_validator_bond: ::core::primitive::u128, + pub max_nominator_count: ::core::option::Option<::core::primitive::u32>, + pub max_validator_count: ::core::option::Option<::core::primitive::u32>, + pub threshold: + ::core::option::Option, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ChillOther { + pub controller: ::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, + ::core::primitive::u32, + >, + 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, + }, + [ + 140u8, 13u8, 108u8, 181u8, 212u8, 177u8, 190u8, 212u8, 163u8, 40u8, + 120u8, 232u8, 126u8, 213u8, 6u8, 181u8, 99u8, 252u8, 58u8, 54u8, 139u8, + 64u8, 67u8, 76u8, 53u8, 226u8, 11u8, 133u8, 235u8, 159u8, 103u8, 210u8, + ], + ) + } + + #[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 `MAX_UNLOCKING_CHUNKS`)"] + #[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 (MAX_NOMINATIONS)."] + #[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, + ::core::primitive::u32, + >, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "nominate", + Nominate { targets }, + [ + 249u8, 66u8, 140u8, 39u8, 26u8, 221u8, 135u8, 225u8, 98u8, 255u8, 13u8, + 54u8, 106u8, 215u8, 129u8, 156u8, 190u8, 83u8, 178u8, 170u8, 116u8, + 27u8, 8u8, 244u8, 56u8, 73u8, 164u8, 223u8, 199u8, 115u8, 168u8, 83u8, + ], + ) + } + + #[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 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 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 at the beginning of the next era."] + #[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, + ::core::primitive::u32, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "set_controller", + SetController { controller }, + [ + 154u8, 80u8, 184u8, 176u8, 74u8, 106u8, 72u8, 242u8, 64u8, 81u8, 169u8, + 157u8, 200u8, 97u8, 117u8, 192u8, 143u8, 166u8, 38u8, 235u8, 75u8, + 161u8, 177u8, 229u8, 229u8, 82u8, 95u8, 39u8, 40u8, 116u8, 9u8, 204u8, + ], + ) + } + + #[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."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(V)"] + #[doc = "- Write: Invulnerables"] + #[doc = "# "] + 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."] + #[doc = ""] + #[doc = "# "] + #[doc = "O(S) where S is the number of slashing spans to be removed"] + #[doc = "Reads: Bonded, Slashing Spans, Account, Locks"] + #[doc = "Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators,"] + #[doc = "Account, Locks Writes Each: SpanSlash * S"] + #[doc = "# "] + 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."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Weight: O(1)"] + #[doc = "- Write: ForceEra"] + #[doc = "# "] + 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."] + #[doc = ""] + #[doc = "# "] + #[doc = "Complexity: O(U + S)"] + #[doc = "with U unapplied slashes weighted with U=1000"] + #[doc = "and S is the number of slash indices to be canceled."] + #[doc = "- Read: Unapplied Slashes"] + #[doc = "- Write: Unapplied Slashes"] + #[doc = "# "] + 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 `MAX_UNLOCKING_CHUNKS`."] + #[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, + ::core::primitive::u32, + >, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new("Staking", "kick", Kick { who }, [ + 94u8, 27u8, 18u8, 16u8, 126u8, 129u8, 47u8, 169u8, 114u8, 84u8, 48u8, 95u8, + 235u8, 237u8, 33u8, 118u8, 115u8, 243u8, 166u8, 120u8, 121u8, 70u8, 227u8, + 240u8, 205u8, 240u8, 211u8, 202u8, 251u8, 232u8, 209u8, 12u8, + ]) + } + + #[doc = "Update the various staking limits this pallet."] + #[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 = ""] + #[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_limits( + &self, + min_nominator_bond: ::core::primitive::u128, + min_validator_bond: ::core::primitive::u128, + max_nominator_count: ::core::option::Option<::core::primitive::u32>, + max_validator_count: ::core::option::Option<::core::primitive::u32>, + threshold: ::core::option::Option< + runtime_types::sp_arithmetic::per_things::Percent, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Staking", + "set_staking_limits", + SetStakingLimits { + min_nominator_bond, + min_validator_bond, + max_nominator_count, + max_validator_count, + threshold, + }, + [ + 14u8, 16u8, 156u8, 44u8, 119u8, 0u8, 238u8, 48u8, 46u8, 230u8, 47u8, + 9u8, 131u8, 237u8, 139u8, 28u8, 230u8, 110u8, 194u8, 35u8, 152u8, 35u8, + 132u8, 30u8, 146u8, 180u8, 164u8, 12u8, 94u8, 80u8, 188u8, 113u8, + ], + ) + } + + #[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 = "* 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 = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-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 EVENT: &'static str = "EraPaid"; + const PALLET: &'static str = "Staking"; + } + #[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 EVENT: &'static str = "Rewarded"; + const PALLET: &'static str = "Staking"; + } + #[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 EVENT: &'static str = "Slashed"; + const PALLET: &'static str = "Staking"; + } + #[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 EVENT: &'static str = "OldSlashingReportDiscarded"; + const PALLET: &'static str = "Staking"; + } + #[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 EVENT: &'static str = "StakersElected"; + const PALLET: &'static str = "Staking"; + } + #[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 EVENT: &'static str = "Bonded"; + const PALLET: &'static str = "Staking"; + } + #[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 EVENT: &'static str = "Unbonded"; + const PALLET: &'static str = "Staking"; + } + #[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 EVENT: &'static str = "Withdrawn"; + const PALLET: &'static str = "Staking"; + } + #[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 EVENT: &'static str = "Kicked"; + const PALLET: &'static str = "Staking"; + } + #[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 EVENT: &'static str = "StakingElectionFailed"; + const PALLET: &'static str = "Staking"; + } + #[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 EVENT: &'static str = "Chilled"; + const PALLET: &'static str = "Staking"; + } + #[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 EVENT: &'static str = "PayoutStarted"; + const PALLET: &'static str = "Staking"; + } + } + 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 = " 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::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + ::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, + )], + [ + 217u8, 229u8, 36u8, 67u8, 180u8, 245u8, 222u8, 190u8, 109u8, 153u8, + 161u8, 5u8, 220u8, 160u8, 108u8, 6u8, 26u8, 140u8, 111u8, 83u8, 194u8, + 115u8, 4u8, 120u8, 209u8, 79u8, 91u8, 171u8, 201u8, 41u8, 103u8, 4u8, + ], + ) + } + + #[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::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Ledger", + Vec::new(), + [ + 217u8, 229u8, 36u8, 67u8, 180u8, 245u8, 222u8, 190u8, 109u8, 153u8, + 161u8, 5u8, 220u8, 160u8, 108u8, 6u8, 26u8, 140u8, 111u8, 83u8, 194u8, + 115u8, 4u8, 120u8, 209u8, 79u8, 91u8, 171u8, 201u8, 41u8, 103u8, 4u8, + ], + ) + } + + #[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."] + #[doc = ""] + #[doc = " When updating this storage item, you must also update the `CounterForValidators`."] + 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."] + #[doc = ""] + #[doc = " When updating this storage item, you must also update the `CounterForValidators`."] + 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 = " A tracker to keep count of the number of items in the `Validators` 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 the set of stash keys of all validators to nominate."] + #[doc = ""] + #[doc = " When updating this storage item, you must also update the `CounterForNominators`."] + pub fn nominators( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::Nominations< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + ::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, + )], + [ + 117u8, 69u8, 174u8, 73u8, 25u8, 140u8, 164u8, 237u8, 158u8, 0u8, 156u8, + 129u8, 243u8, 172u8, 225u8, 85u8, 47u8, 23u8, 162u8, 6u8, 2u8, 10u8, + 221u8, 229u8, 121u8, 132u8, 196u8, 251u8, 66u8, 134u8, 173u8, 72u8, + ], + ) + } + + #[doc = " The map from nominator stash key to the set of stash keys of all validators to nominate."] + #[doc = ""] + #[doc = " When updating this storage item, you must also update the `CounterForNominators`."] + pub fn nominators_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_staking::Nominations< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "Nominators", + Vec::new(), + [ + 117u8, 69u8, 174u8, 73u8, 25u8, 140u8, 164u8, 237u8, 158u8, 0u8, 156u8, + 129u8, 243u8, 172u8, 225u8, 85u8, 47u8, 23u8, 162u8, 6u8, 2u8, 10u8, + 221u8, 229u8, 121u8, 132u8, 196u8, 251u8, 66u8, 134u8, 173u8, 72u8, + ], + ) + } + + #[doc = " A tracker to keep count of the number of items in the `Nominators` 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 earliest era for which we have a pending, unapplied slash."] + pub fn earliest_unapplied_slash( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Staking", + "EarliestUnappliedSlash", + vec![], + [ + 2u8, 167u8, 88u8, 76u8, 113u8, 225u8, 232u8, 80u8, 183u8, 162u8, 104u8, + 28u8, 162u8, 13u8, 120u8, 45u8, 200u8, 130u8, 147u8, 124u8, 210u8, + 111u8, 30u8, 222u8, 70u8, 79u8, 125u8, 157u8, 56u8, 252u8, 237u8, + 216u8, + ], + ) + } + + #[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![], + [ + 79u8, 94u8, 168u8, 253u8, 84u8, 21u8, 48u8, 226u8, 9u8, 146u8, 92u8, + 76u8, 254u8, 101u8, 212u8, 177u8, 191u8, 127u8, 74u8, 8u8, 26u8, 204u8, + 174u8, 250u8, 62u8, 221u8, 88u8, 214u8, 16u8, 65u8, 34u8, 243u8, + ], + ) + } + + #[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 = " 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, + ], + ) + } + + 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, + ]) + } + } + } + } + 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::da_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::da_runtime::SessionKeys, + proof: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Session", + "set_keys", + SetKeys { keys, proof }, + [ + 100u8, 34u8, 3u8, 243u8, 22u8, 163u8, 244u8, 57u8, 211u8, 164u8, 55u8, + 212u8, 151u8, 91u8, 13u8, 131u8, 89u8, 95u8, 173u8, 216u8, 149u8, 70u8, + 103u8, 199u8, 216u8, 87u8, 172u8, 149u8, 28u8, 184u8, 133u8, 8u8, + ], + ) + } + + #[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/v3/runtime/events-and-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 EVENT: &'static str = "NewSession"; + const PALLET: &'static str = "Session"; + } + } + 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::da_runtime::SessionKeys, + )>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Session", + "QueuedKeys", + vec![], + [ + 90u8, 48u8, 252u8, 89u8, 147u8, 67u8, 111u8, 201u8, 74u8, 181u8, 95u8, + 53u8, 95u8, 174u8, 167u8, 83u8, 223u8, 247u8, 221u8, 177u8, 172u8, + 148u8, 110u8, 21u8, 156u8, 34u8, 124u8, 81u8, 47u8, 26u8, 98u8, 210u8, + ], + ) + } + + #[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, + )], + [ + 211u8, 170u8, 242u8, 9u8, 171u8, 174u8, 161u8, 66u8, 152u8, 134u8, + 69u8, 128u8, 194u8, 61u8, 225u8, 55u8, 230u8, 15u8, 77u8, 102u8, 95u8, + 114u8, 136u8, 204u8, 114u8, 52u8, 147u8, 252u8, 166u8, 48u8, 251u8, + 67u8, + ], + ) + } + + #[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(), + [ + 211u8, 170u8, 242u8, 9u8, 171u8, 174u8, 161u8, 66u8, 152u8, 134u8, + 69u8, 128u8, 194u8, 61u8, 225u8, 55u8, 230u8, 15u8, 77u8, 102u8, 95u8, + 114u8, 136u8, 204u8, 114u8, 52u8, 147u8, 252u8, 166u8, 48u8, 251u8, + 67u8, + ], + ) + } + + #[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 democracy { + 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 Propose { + pub proposal_hash: ::subxt::ext::sp_core::H256, + #[codec(compact)] + pub value: ::core::primitive::u128, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Second { + #[codec(compact)] + pub proposal: ::core::primitive::u32, + #[codec(compact)] + pub seconds_upper_bound: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Vote { + #[codec(compact)] + pub ref_index: ::core::primitive::u32, + pub vote: + runtime_types::pallet_democracy::vote::AccountVote<::core::primitive::u128>, + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct EmergencyCancel { + pub ref_index: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ExternalPropose { + pub proposal_hash: ::subxt::ext::sp_core::H256, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ExternalProposeMajority { + pub proposal_hash: ::subxt::ext::sp_core::H256, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ExternalProposeDefault { + pub proposal_hash: ::subxt::ext::sp_core::H256, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct FastTrack { + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub voting_period: ::core::primitive::u32, + pub delay: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct VetoExternal { + pub proposal_hash: ::subxt::ext::sp_core::H256, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CancelReferendum { + #[codec(compact)] + pub ref_index: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CancelQueued { + pub which: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Delegate { + pub to: ::subxt::ext::sp_core::crypto::AccountId32, + pub conviction: runtime_types::pallet_democracy::conviction::Conviction, + pub balance: ::core::primitive::u128, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Undelegate; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ClearPublicProposals; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct NotePreimage { + pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct NotePreimageOperational { + pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct NoteImminentPreimage { + pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct NoteImminentPreimageOperational { + pub encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ReapPreimage { + pub proposal_hash: ::subxt::ext::sp_core::H256, + #[codec(compact)] + pub proposal_len_upper_bound: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Unlock { + pub target: ::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 RemoveVote { + pub index: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RemoveOtherVote { + pub target: ::subxt::ext::sp_core::crypto::AccountId32, + pub index: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct EnactProposal { + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub index: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Blacklist { + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub maybe_ref_index: ::core::option::Option<::core::primitive::u32>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CancelProposal { + #[codec(compact)] + pub prop_index: ::core::primitive::u32, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Propose a sensitive action to be taken."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_ and the sender must"] + #[doc = "have funds to cover the deposit."] + #[doc = ""] + #[doc = "- `proposal_hash`: The hash of the proposal preimage."] + #[doc = "- `value`: The amount of deposit (must be at least `MinimumDeposit`)."] + #[doc = ""] + #[doc = "Emits `Proposed`."] + #[doc = ""] + #[doc = "Weight: `O(p)`"] + pub fn propose( + &self, + proposal_hash: ::subxt::ext::sp_core::H256, + value: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "propose", + Propose { + proposal_hash, + value, + }, + [ + 151u8, 2u8, 117u8, 57u8, 201u8, 246u8, 181u8, 198u8, 83u8, 74u8, 99u8, + 211u8, 237u8, 53u8, 90u8, 173u8, 161u8, 250u8, 139u8, 253u8, 223u8, + 251u8, 39u8, 108u8, 254u8, 192u8, 233u8, 23u8, 9u8, 99u8, 169u8, 195u8, + ], + ) + } + + #[doc = "Signals agreement with a particular proposal."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_ and the sender"] + #[doc = "must have funds to cover the deposit, equal to the original deposit."] + #[doc = ""] + #[doc = "- `proposal`: The index of the proposal to second."] + #[doc = "- `seconds_upper_bound`: an upper bound on the current number of seconds on this"] + #[doc = " proposal. Extrinsic is weighted according to this value with no refund."] + #[doc = ""] + #[doc = "Weight: `O(S)` where S is the number of seconds a proposal already has."] + pub fn second( + &self, + proposal: ::core::primitive::u32, + seconds_upper_bound: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "second", + Second { + proposal, + seconds_upper_bound, + }, + [ + 152u8, 56u8, 134u8, 181u8, 88u8, 224u8, 68u8, 238u8, 231u8, 78u8, + 237u8, 142u8, 133u8, 16u8, 93u8, 63u8, 253u8, 81u8, 96u8, 200u8, 43u8, + 21u8, 249u8, 92u8, 78u8, 24u8, 101u8, 217u8, 143u8, 16u8, 213u8, 244u8, + ], + ) + } + + #[doc = "Vote in a referendum. If `vote.is_aye()`, the vote is to enact the proposal;"] + #[doc = "otherwise it is a vote to keep the status quo."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `ref_index`: The index of the referendum to vote for."] + #[doc = "- `vote`: The vote configuration."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of referendums the voter has voted on."] + pub fn vote( + &self, + ref_index: ::core::primitive::u32, + vote: runtime_types::pallet_democracy::vote::AccountVote< + ::core::primitive::u128, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "vote", + Vote { ref_index, vote }, + [ + 138u8, 213u8, 229u8, 111u8, 1u8, 191u8, 73u8, 3u8, 145u8, 28u8, 44u8, + 88u8, 163u8, 188u8, 129u8, 188u8, 64u8, 15u8, 64u8, 103u8, 250u8, 97u8, + 234u8, 188u8, 29u8, 205u8, 51u8, 6u8, 116u8, 58u8, 156u8, 201u8, + ], + ) + } + + #[doc = "Schedule an emergency cancellation of a referendum. Cannot happen twice to the same"] + #[doc = "referendum."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `CancellationOrigin`."] + #[doc = ""] + #[doc = "-`ref_index`: The index of the referendum to cancel."] + #[doc = ""] + #[doc = "Weight: `O(1)`."] + pub fn emergency_cancel( + &self, + ref_index: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "emergency_cancel", + EmergencyCancel { ref_index }, + [ + 139u8, 213u8, 133u8, 75u8, 34u8, 206u8, 124u8, 245u8, 35u8, 237u8, + 132u8, 92u8, 49u8, 167u8, 117u8, 80u8, 188u8, 93u8, 198u8, 237u8, + 132u8, 77u8, 195u8, 65u8, 29u8, 37u8, 86u8, 74u8, 214u8, 119u8, 71u8, + 204u8, + ], + ) + } + + #[doc = "Schedule a referendum to be tabled once it is legal to schedule an external"] + #[doc = "referendum."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `ExternalOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of the proposal."] + #[doc = ""] + #[doc = "Weight: `O(V)` with V number of vetoers in the blacklist of proposal."] + #[doc = " Decoding vec of length V. Charged as maximum"] + pub fn external_propose( + &self, + proposal_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "external_propose", + ExternalPropose { proposal_hash }, + [ + 8u8, 206u8, 229u8, 218u8, 203u8, 208u8, 253u8, 113u8, 43u8, 62u8, + 110u8, 155u8, 123u8, 35u8, 187u8, 211u8, 180u8, 225u8, 41u8, 30u8, + 204u8, 110u8, 202u8, 210u8, 143u8, 84u8, 117u8, 20u8, 215u8, 110u8, + 211u8, 89u8, + ], + ) + } + + #[doc = "Schedule a majority-carries referendum to be tabled next once it is legal to schedule"] + #[doc = "an external referendum."] + #[doc = ""] + #[doc = "The dispatch of this call must be `ExternalMajorityOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of the proposal."] + #[doc = ""] + #[doc = "Unlike `external_propose`, blacklisting has no effect on this and it may replace a"] + #[doc = "pre-scheduled `external_propose` call."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn external_propose_majority( + &self, + proposal_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "external_propose_majority", + ExternalProposeMajority { proposal_hash }, + [ + 36u8, 47u8, 192u8, 177u8, 164u8, 82u8, 109u8, 215u8, 98u8, 28u8, 47u8, + 237u8, 159u8, 233u8, 53u8, 9u8, 158u8, 134u8, 232u8, 249u8, 55u8, + 189u8, 48u8, 133u8, 201u8, 46u8, 237u8, 158u8, 181u8, 163u8, 166u8, + 213u8, + ], + ) + } + + #[doc = "Schedule a negative-turnout-bias referendum to be tabled next once it is legal to"] + #[doc = "schedule an external referendum."] + #[doc = ""] + #[doc = "The dispatch of this call must be `ExternalDefaultOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of the proposal."] + #[doc = ""] + #[doc = "Unlike `external_propose`, blacklisting has no effect on this and it may replace a"] + #[doc = "pre-scheduled `external_propose` call."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn external_propose_default( + &self, + proposal_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "external_propose_default", + ExternalProposeDefault { proposal_hash }, + [ + 32u8, 100u8, 249u8, 175u8, 187u8, 77u8, 30u8, 65u8, 90u8, 103u8, 251u8, + 21u8, 21u8, 220u8, 8u8, 118u8, 97u8, 160u8, 152u8, 122u8, 71u8, 140u8, + 96u8, 8u8, 245u8, 74u8, 112u8, 164u8, 55u8, 130u8, 38u8, 14u8, + ], + ) + } + + #[doc = "Schedule the currently externally-proposed majority-carries referendum to be tabled"] + #[doc = "immediately. If there is no externally-proposed referendum currently, or if there is one"] + #[doc = "but it is not a majority-carries referendum then it fails."] + #[doc = ""] + #[doc = "The dispatch of this call must be `FastTrackOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The hash of the current external proposal."] + #[doc = "- `voting_period`: The period that is allowed for voting on this proposal. Increased to"] + #[doc = " `FastTrackVotingPeriod` if too low."] + #[doc = "- `delay`: The number of block after voting has ended in approval and this should be"] + #[doc = " enacted. This doesn't have a minimum amount."] + #[doc = ""] + #[doc = "Emits `Started`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + pub fn fast_track( + &self, + proposal_hash: ::subxt::ext::sp_core::H256, + voting_period: ::core::primitive::u32, + delay: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "fast_track", + FastTrack { + proposal_hash, + voting_period, + delay, + }, + [ + 125u8, 209u8, 107u8, 120u8, 93u8, 205u8, 129u8, 147u8, 254u8, 126u8, + 45u8, 126u8, 39u8, 0u8, 56u8, 14u8, 233u8, 49u8, 245u8, 220u8, 156u8, + 10u8, 252u8, 31u8, 102u8, 90u8, 163u8, 236u8, 178u8, 85u8, 13u8, 24u8, + ], + ) + } + + #[doc = "Veto and blacklist the external proposal hash."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `VetoOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of the proposal to veto and blacklist."] + #[doc = ""] + #[doc = "Emits `Vetoed`."] + #[doc = ""] + #[doc = "Weight: `O(V + log(V))` where V is number of `existing vetoers`"] + pub fn veto_external( + &self, + proposal_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "veto_external", + VetoExternal { proposal_hash }, + [ + 209u8, 18u8, 18u8, 103u8, 186u8, 160u8, 214u8, 124u8, 150u8, 207u8, + 112u8, 90u8, 84u8, 197u8, 95u8, 157u8, 165u8, 65u8, 109u8, 101u8, 75u8, + 201u8, 41u8, 149u8, 75u8, 154u8, 37u8, 178u8, 239u8, 121u8, 124u8, + 23u8, + ], + ) + } + + #[doc = "Remove a referendum."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Root_."] + #[doc = ""] + #[doc = "- `ref_index`: The index of the referendum to cancel."] + #[doc = ""] + #[doc = "# Weight: `O(1)`."] + pub fn cancel_referendum( + &self, + ref_index: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "cancel_referendum", + CancelReferendum { ref_index }, + [ + 51u8, 25u8, 25u8, 251u8, 236u8, 115u8, 130u8, 230u8, 72u8, 186u8, + 119u8, 71u8, 165u8, 137u8, 55u8, 167u8, 187u8, 128u8, 55u8, 8u8, 212u8, + 139u8, 245u8, 232u8, 103u8, 136u8, 229u8, 113u8, 125u8, 36u8, 1u8, + 149u8, + ], + ) + } + + #[doc = "Cancel a proposal queued for enactment."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Root_."] + #[doc = ""] + #[doc = "- `which`: The index of the referendum to cancel."] + #[doc = ""] + #[doc = "Weight: `O(D)` where `D` is the items in the dispatch queue. Weighted as `D = 10`."] + pub fn cancel_queued( + &self, + which: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "cancel_queued", + CancelQueued { which }, + [ + 6u8, 97u8, 182u8, 142u8, 165u8, 206u8, 218u8, 245u8, 206u8, 224u8, + 143u8, 164u8, 232u8, 129u8, 202u8, 141u8, 78u8, 65u8, 79u8, 206u8, 3u8, + 195u8, 151u8, 36u8, 8u8, 220u8, 184u8, 239u8, 28u8, 187u8, 208u8, + 174u8, + ], + ) + } + + #[doc = "Delegate the voting power (with some given conviction) of the sending account."] + #[doc = ""] + #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] + #[doc = "time appropriate for the conviction's lock period."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] + #[doc = " - be delegating already; or"] + #[doc = " - have no voting activity (if there is, then it will need to be removed/consolidated"] + #[doc = " through `reap_vote` or `unvote`)."] + #[doc = ""] + #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] + #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] + #[doc = " account is undelegated, the funds will be locked for the corresponding period."] + #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] + #[doc = " be more than the account's current balance."] + #[doc = ""] + #[doc = "Emits `Delegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of referendums the voter delegating to has"] + #[doc = " voted on. Weight is charged as if maximum votes."] + pub fn delegate( + &self, + to: ::subxt::ext::sp_core::crypto::AccountId32, + conviction: runtime_types::pallet_democracy::conviction::Conviction, + balance: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "delegate", + Delegate { + to, + conviction, + balance, + }, + [ + 190u8, 241u8, 243u8, 105u8, 114u8, 112u8, 169u8, 52u8, 119u8, 174u8, + 61u8, 72u8, 165u8, 161u8, 192u8, 234u8, 32u8, 144u8, 89u8, 214u8, + 178u8, 227u8, 251u8, 198u8, 129u8, 21u8, 244u8, 183u8, 135u8, 33u8, + 1u8, 224u8, + ], + ) + } + + #[doc = "Undelegate the voting power of the sending account."] + #[doc = ""] + #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] + #[doc = "of the conviction with which the delegation was issued."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] + #[doc = "currently delegating."] + #[doc = ""] + #[doc = "Emits `Undelegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of referendums the voter delegating to has"] + #[doc = " voted on. Weight is charged as if maximum votes."] + pub fn undelegate(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new("Democracy", "undelegate", Undelegate {}, [ + 165u8, 40u8, 183u8, 209u8, 57u8, 153u8, 111u8, 29u8, 114u8, 109u8, 107u8, + 235u8, 97u8, 61u8, 53u8, 155u8, 44u8, 245u8, 28u8, 220u8, 56u8, 134u8, + 43u8, 122u8, 248u8, 156u8, 191u8, 154u8, 4u8, 121u8, 152u8, 153u8, + ]) + } + + #[doc = "Clears all public proposals."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Root_."] + #[doc = ""] + #[doc = "Weight: `O(1)`."] + pub fn clear_public_proposals( + &self, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "clear_public_proposals", + ClearPublicProposals {}, + [ + 59u8, 126u8, 254u8, 223u8, 252u8, 225u8, 75u8, 185u8, 188u8, 181u8, + 42u8, 179u8, 211u8, 73u8, 12u8, 141u8, 243u8, 197u8, 46u8, 130u8, + 215u8, 196u8, 225u8, 88u8, 48u8, 199u8, 231u8, 249u8, 195u8, 53u8, + 184u8, 204u8, + ], + ) + } + + #[doc = "Register the preimage for an upcoming proposal. This doesn't require the proposal to be"] + #[doc = "in the dispatch queue but does require a deposit, returned once enacted."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `encoded_proposal`: The preimage of a proposal."] + #[doc = ""] + #[doc = "Emits `PreimageNoted`."] + #[doc = ""] + #[doc = "Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit)."] + pub fn note_preimage( + &self, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "note_preimage", + NotePreimage { encoded_proposal }, + [ + 31u8, 252u8, 248u8, 238u8, 103u8, 1u8, 82u8, 84u8, 135u8, 152u8, 246u8, + 234u8, 251u8, 124u8, 193u8, 73u8, 52u8, 255u8, 88u8, 31u8, 112u8, 99u8, + 191u8, 245u8, 251u8, 202u8, 51u8, 130u8, 136u8, 114u8, 177u8, 241u8, + ], + ) + } + + #[doc = "Same as `note_preimage` but origin is `OperationalPreimageOrigin`."] + pub fn note_preimage_operational( + &self, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "note_preimage_operational", + NotePreimageOperational { encoded_proposal }, + [ + 184u8, 81u8, 31u8, 172u8, 81u8, 113u8, 84u8, 246u8, 189u8, 219u8, + 167u8, 32u8, 191u8, 126u8, 165u8, 250u8, 147u8, 199u8, 241u8, 196u8, + 253u8, 34u8, 51u8, 158u8, 2u8, 157u8, 16u8, 122u8, 210u8, 66u8, 110u8, + 234u8, + ], + ) + } + + #[doc = "Register the preimage for an upcoming proposal. This requires the proposal to be"] + #[doc = "in the dispatch queue. No deposit is needed. When this call is successful, i.e."] + #[doc = "the preimage has not been uploaded before and matches some imminent proposal,"] + #[doc = "no fee is paid."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `encoded_proposal`: The preimage of a proposal."] + #[doc = ""] + #[doc = "Emits `PreimageNoted`."] + #[doc = ""] + #[doc = "Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit)."] + pub fn note_imminent_preimage( + &self, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "note_imminent_preimage", + NoteImminentPreimage { encoded_proposal }, + [ + 32u8, 188u8, 10u8, 215u8, 245u8, 132u8, 234u8, 124u8, 19u8, 90u8, + 225u8, 216u8, 169u8, 105u8, 95u8, 231u8, 12u8, 109u8, 16u8, 91u8, + 153u8, 134u8, 240u8, 82u8, 80u8, 254u8, 117u8, 230u8, 88u8, 203u8, + 68u8, 42u8, + ], + ) + } + + #[doc = "Same as `note_imminent_preimage` but origin is `OperationalPreimageOrigin`."] + pub fn note_imminent_preimage_operational( + &self, + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "note_imminent_preimage_operational", + NoteImminentPreimageOperational { encoded_proposal }, + [ + 7u8, 31u8, 49u8, 238u8, 155u8, 234u8, 187u8, 147u8, 123u8, 84u8, 50u8, + 98u8, 221u8, 39u8, 218u8, 204u8, 175u8, 136u8, 44u8, 93u8, 140u8, + 172u8, 73u8, 98u8, 168u8, 110u8, 31u8, 82u8, 22u8, 1u8, 205u8, 84u8, + ], + ) + } + + #[doc = "Remove an expired proposal preimage and collect the deposit."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of a proposal."] + #[doc = "- `proposal_length_upper_bound`: an upper bound on length of the proposal. Extrinsic is"] + #[doc = " weighted according to this value with no refund."] + #[doc = ""] + #[doc = "This will only work after `VotingPeriod` blocks from the time that the preimage was"] + #[doc = "noted, if it's the same account doing it. If it's a different account, then it'll only"] + #[doc = "work an additional `EnactmentPeriod` later."] + #[doc = ""] + #[doc = "Emits `PreimageReaped`."] + #[doc = ""] + #[doc = "Weight: `O(D)` where D is length of proposal."] + pub fn reap_preimage( + &self, + proposal_hash: ::subxt::ext::sp_core::H256, + proposal_len_upper_bound: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "reap_preimage", + ReapPreimage { + proposal_hash, + proposal_len_upper_bound, + }, + [ + 135u8, 43u8, 115u8, 154u8, 93u8, 121u8, 112u8, 65u8, 145u8, 141u8, + 236u8, 252u8, 203u8, 155u8, 63u8, 130u8, 120u8, 221u8, 13u8, 105u8, + 81u8, 179u8, 167u8, 254u8, 213u8, 117u8, 146u8, 232u8, 18u8, 104u8, + 196u8, 112u8, + ], + ) + } + + #[doc = "Unlock tokens that have an expired lock."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account to remove the lock on."] + #[doc = ""] + #[doc = "Weight: `O(R)` with R number of vote of target."] + pub fn unlock( + &self, + target: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new("Democracy", "unlock", Unlock { target }, [ + 137u8, 93u8, 240u8, 75u8, 142u8, 148u8, 51u8, 55u8, 88u8, 159u8, 2u8, 57u8, + 24u8, 169u8, 120u8, 121u8, 115u8, 53u8, 225u8, 176u8, 67u8, 156u8, 20u8, + 132u8, 39u8, 54u8, 125u8, 203u8, 199u8, 85u8, 60u8, 211u8, + ]) + } + + #[doc = "Remove a vote for a referendum."] + #[doc = ""] + #[doc = "If:"] + #[doc = "- the referendum was cancelled, or"] + #[doc = "- the referendum is ongoing, or"] + #[doc = "- the referendum has ended such that"] + #[doc = " - the vote of the account was in opposition to the result; or"] + #[doc = " - there was no conviction to the account's vote; or"] + #[doc = " - the account made a split vote"] + #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] + #[doc = "funds being available."] + #[doc = ""] + #[doc = "If, however, the referendum has ended and:"] + #[doc = "- it finished corresponding to the vote of the account, and"] + #[doc = "- the account made a standard vote with conviction, and"] + #[doc = "- the lock period of the conviction is not over"] + #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] + #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] + #[doc = "of both the amount locked and the time is it locked for)."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] + #[doc = "registered for referendum `index`."] + #[doc = ""] + #[doc = "- `index`: The index of referendum of the vote to be removed."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + pub fn remove_vote( + &self, + index: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "remove_vote", + RemoveVote { index }, + [ + 148u8, 120u8, 14u8, 172u8, 81u8, 152u8, 159u8, 178u8, 106u8, 244u8, + 36u8, 98u8, 120u8, 189u8, 213u8, 93u8, 119u8, 156u8, 112u8, 34u8, + 241u8, 72u8, 206u8, 113u8, 212u8, 161u8, 164u8, 126u8, 122u8, 82u8, + 160u8, 74u8, + ], + ) + } + + #[doc = "Remove a vote for a referendum."] + #[doc = ""] + #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] + #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] + #[doc = "either because the referendum was cancelled, because the voter lost the referendum or"] + #[doc = "because the conviction period is over."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account of the vote to be removed; this account must have voted for"] + #[doc = " referendum `index`."] + #[doc = "- `index`: The index of referendum of the vote to be removed."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + pub fn remove_other_vote( + &self, + target: ::subxt::ext::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "remove_other_vote", + RemoveOtherVote { target, index }, + [ + 137u8, 59u8, 51u8, 72u8, 97u8, 181u8, 74u8, 123u8, 65u8, 147u8, 63u8, + 23u8, 14u8, 6u8, 66u8, 186u8, 105u8, 72u8, 112u8, 120u8, 51u8, 229u8, + 247u8, 96u8, 218u8, 137u8, 220u8, 65u8, 95u8, 109u8, 253u8, 45u8, + ], + ) + } + + #[doc = "Enact a proposal from a referendum. For now we just make the weight be the maximum."] + pub fn enact_proposal( + &self, + proposal_hash: ::subxt::ext::sp_core::H256, + index: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "enact_proposal", + EnactProposal { + proposal_hash, + index, + }, + [ + 191u8, 244u8, 244u8, 174u8, 95u8, 86u8, 132u8, 63u8, 2u8, 94u8, 3u8, + 117u8, 96u8, 54u8, 100u8, 89u8, 124u8, 117u8, 205u8, 142u8, 214u8, + 192u8, 137u8, 141u8, 178u8, 145u8, 241u8, 167u8, 163u8, 76u8, 61u8, + 31u8, + ], + ) + } + + #[doc = "Permanently place a proposal into the blacklist. This prevents it from ever being"] + #[doc = "proposed again."] + #[doc = ""] + #[doc = "If called on a queued public or external proposal, then this will result in it being"] + #[doc = "removed. If the `ref_index` supplied is an active referendum with the proposal hash,"] + #[doc = "then it will be cancelled."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `BlacklistOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The proposal hash to blacklist permanently."] + #[doc = "- `ref_index`: An ongoing referendum whose hash is `proposal_hash`, which will be"] + #[doc = "cancelled."] + #[doc = ""] + #[doc = "Weight: `O(p)` (though as this is an high-privilege dispatch, we assume it has a"] + #[doc = " reasonable value)."] + pub fn blacklist( + &self, + proposal_hash: ::subxt::ext::sp_core::H256, + maybe_ref_index: ::core::option::Option<::core::primitive::u32>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "blacklist", + Blacklist { + proposal_hash, + maybe_ref_index, + }, + [ + 48u8, 144u8, 81u8, 164u8, 54u8, 111u8, 197u8, 134u8, 6u8, 98u8, 121u8, + 179u8, 254u8, 191u8, 204u8, 212u8, 84u8, 255u8, 86u8, 110u8, 225u8, + 130u8, 26u8, 65u8, 133u8, 56u8, 231u8, 15u8, 245u8, 137u8, 146u8, + 242u8, + ], + ) + } + + #[doc = "Remove a proposal."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `CancelProposalOrigin`."] + #[doc = ""] + #[doc = "- `prop_index`: The index of the proposal to cancel."] + #[doc = ""] + #[doc = "Weight: `O(p)` where `p = PublicProps::::decode_len()`"] + pub fn cancel_proposal( + &self, + prop_index: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Democracy", + "cancel_proposal", + CancelProposal { prop_index }, + [ + 179u8, 3u8, 198u8, 244u8, 241u8, 124u8, 205u8, 58u8, 100u8, 80u8, + 177u8, 254u8, 98u8, 220u8, 189u8, 63u8, 229u8, 60u8, 157u8, 83u8, + 142u8, 6u8, 236u8, 183u8, 193u8, 235u8, 253u8, 126u8, 153u8, 185u8, + 74u8, 117u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_democracy::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A motion has been proposed by a public account."] + pub struct Proposed { + pub proposal_index: ::core::primitive::u32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for Proposed { + const EVENT: &'static str = "Proposed"; + const PALLET: &'static str = "Democracy"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A public proposal has been tabled for referendum vote."] + pub struct Tabled { + pub proposal_index: ::core::primitive::u32, + pub deposit: ::core::primitive::u128, + pub depositors: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + } + impl ::subxt::events::StaticEvent for Tabled { + const EVENT: &'static str = "Tabled"; + const PALLET: &'static str = "Democracy"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An external proposal has been tabled."] + pub struct ExternalTabled; + impl ::subxt::events::StaticEvent for ExternalTabled { + const EVENT: &'static str = "ExternalTabled"; + const PALLET: &'static str = "Democracy"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A referendum has begun."] + pub struct Started { + pub ref_index: ::core::primitive::u32, + pub threshold: runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + } + impl ::subxt::events::StaticEvent for Started { + const EVENT: &'static str = "Started"; + const PALLET: &'static str = "Democracy"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A proposal has been approved by referendum."] + pub struct Passed { + pub ref_index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for Passed { + const EVENT: &'static str = "Passed"; + const PALLET: &'static str = "Democracy"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A proposal has been rejected by referendum."] + pub struct NotPassed { + pub ref_index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for NotPassed { + const EVENT: &'static str = "NotPassed"; + const PALLET: &'static str = "Democracy"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A referendum has been cancelled."] + pub struct Cancelled { + pub ref_index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for Cancelled { + const EVENT: &'static str = "Cancelled"; + const PALLET: &'static str = "Democracy"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A proposal has been enacted."] + pub struct Executed { + pub ref_index: ::core::primitive::u32, + pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::events::StaticEvent for Executed { + const EVENT: &'static str = "Executed"; + const PALLET: &'static str = "Democracy"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An account has delegated their vote to another account."] + pub struct Delegated { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub target: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for Delegated { + const EVENT: &'static str = "Delegated"; + const PALLET: &'static str = "Democracy"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An account has cancelled a previous delegation operation."] + pub struct Undelegated { + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for Undelegated { + const EVENT: &'static str = "Undelegated"; + const PALLET: &'static str = "Democracy"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "An external proposal has been vetoed."] + pub struct Vetoed { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub until: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for Vetoed { + const EVENT: &'static str = "Vetoed"; + const PALLET: &'static str = "Democracy"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A proposal's preimage was noted, and the deposit taken."] + pub struct PreimageNoted { + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for PreimageNoted { + const EVENT: &'static str = "PreimageNoted"; + const PALLET: &'static str = "Democracy"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A proposal preimage was removed and used (the deposit was returned)."] + pub struct PreimageUsed { + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub provider: ::subxt::ext::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for PreimageUsed { + const EVENT: &'static str = "PreimageUsed"; + const PALLET: &'static str = "Democracy"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A proposal could not be executed because its preimage was invalid."] + pub struct PreimageInvalid { + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub ref_index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for PreimageInvalid { + const EVENT: &'static str = "PreimageInvalid"; + const PALLET: &'static str = "Democracy"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A proposal could not be executed because its preimage was missing."] + pub struct PreimageMissing { + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub ref_index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for PreimageMissing { + const EVENT: &'static str = "PreimageMissing"; + const PALLET: &'static str = "Democracy"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A registered preimage was removed and the deposit collected by the reaper."] + pub struct PreimageReaped { + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub provider: ::subxt::ext::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + pub reaper: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for PreimageReaped { + const EVENT: &'static str = "PreimageReaped"; + const PALLET: &'static str = "Democracy"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A proposal_hash has been blacklisted permanently."] + pub struct Blacklisted { + pub proposal_hash: ::subxt::ext::sp_core::H256, + } + impl ::subxt::events::StaticEvent for Blacklisted { + const EVENT: &'static str = "Blacklisted"; + const PALLET: &'static str = "Democracy"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The number of (public) proposals that have been made so far."] + pub fn public_prop_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( + "Democracy", + "PublicPropCount", + vec![], + [ + 91u8, 14u8, 171u8, 94u8, 37u8, 157u8, 46u8, 157u8, 254u8, 13u8, 68u8, + 144u8, 23u8, 146u8, 128u8, 159u8, 9u8, 174u8, 74u8, 174u8, 218u8, + 197u8, 23u8, 235u8, 152u8, 226u8, 216u8, 4u8, 120u8, 121u8, 27u8, + 138u8, + ], + ) + } + + #[doc = " The public proposals. Unsorted. The second item is the proposal's hash."] + pub fn public_props( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<( + ::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( + "Democracy", + "PublicProps", + vec![], + [ + 151u8, 247u8, 196u8, 97u8, 171u8, 230u8, 55u8, 45u8, 220u8, 16u8, 12u8, + 28u8, 22u8, 58u8, 127u8, 179u8, 130u8, 192u8, 115u8, 165u8, 5u8, 173u8, + 87u8, 104u8, 7u8, 186u8, 114u8, 47u8, 162u8, 182u8, 252u8, 154u8, + ], + ) + } + + #[doc = " Those who have locked a deposit."] + #[doc = ""] + #[doc = " TWOX-NOTE: Safe, as increasing integer keys are safe."] + pub fn deposit_of( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + ::core::primitive::u128, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "DepositOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 153u8, 236u8, 152u8, 224u8, 221u8, 90u8, 204u8, 183u8, 222u8, 160u8, + 227u8, 26u8, 8u8, 110u8, 230u8, 102u8, 133u8, 186u8, 66u8, 2u8, 84u8, + 31u8, 236u8, 228u8, 202u8, 75u8, 17u8, 97u8, 133u8, 232u8, 64u8, 7u8, + ], + ) + } + + #[doc = " Those who have locked a deposit."] + #[doc = ""] + #[doc = " TWOX-NOTE: Safe, as increasing integer keys are safe."] + pub fn deposit_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + ::core::primitive::u128, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "DepositOf", + Vec::new(), + [ + 153u8, 236u8, 152u8, 224u8, 221u8, 90u8, 204u8, 183u8, 222u8, 160u8, + 227u8, 26u8, 8u8, 110u8, 230u8, 102u8, 133u8, 186u8, 66u8, 2u8, 84u8, + 31u8, 236u8, 228u8, 202u8, 75u8, 17u8, 97u8, 133u8, 232u8, 64u8, 7u8, + ], + ) + } + + #[doc = " Map of hashes to the proposal preimage, along with who registered it and their deposit."] + #[doc = " The block number is the block at which it was deposited."] + pub fn preimages( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_democracy::PreimageStatus< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "Preimages", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 206u8, 131u8, 7u8, 129u8, 172u8, 231u8, 164u8, 220u8, 129u8, 0u8, + 204u8, 227u8, 231u8, 244u8, 61u8, 145u8, 144u8, 146u8, 173u8, 215u8, + 174u8, 218u8, 192u8, 83u8, 174u8, 99u8, 87u8, 102u8, 98u8, 235u8, + 138u8, 127u8, + ], + ) + } + + #[doc = " Map of hashes to the proposal preimage, along with who registered it and their deposit."] + #[doc = " The block number is the block at which it was deposited."] + pub fn preimages_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_democracy::PreimageStatus< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "Preimages", + Vec::new(), + [ + 206u8, 131u8, 7u8, 129u8, 172u8, 231u8, 164u8, 220u8, 129u8, 0u8, + 204u8, 227u8, 231u8, 244u8, 61u8, 145u8, 144u8, 146u8, 173u8, 215u8, + 174u8, 218u8, 192u8, 83u8, 174u8, 99u8, 87u8, 102u8, 98u8, 235u8, + 138u8, 127u8, + ], + ) + } + + #[doc = " The next free referendum index, aka the number of referenda started so far."] + pub fn referendum_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( + "Democracy", + "ReferendumCount", + vec![], + [ + 153u8, 210u8, 106u8, 244u8, 156u8, 70u8, 124u8, 251u8, 123u8, 75u8, + 7u8, 189u8, 199u8, 145u8, 95u8, 119u8, 137u8, 11u8, 240u8, 160u8, + 151u8, 248u8, 229u8, 231u8, 89u8, 222u8, 18u8, 237u8, 144u8, 78u8, + 99u8, 58u8, + ], + ) + } + + #[doc = " The lowest referendum index representing an unbaked referendum. Equal to"] + #[doc = " `ReferendumCount` if there isn't a unbaked referendum."] + pub fn lowest_unbaked( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "LowestUnbaked", + vec![], + [ + 4u8, 51u8, 108u8, 11u8, 48u8, 165u8, 19u8, 251u8, 182u8, 76u8, 163u8, + 73u8, 227u8, 2u8, 212u8, 74u8, 128u8, 27u8, 165u8, 164u8, 111u8, 22u8, + 209u8, 190u8, 103u8, 7u8, 116u8, 16u8, 160u8, 144u8, 123u8, 64u8, + ], + ) + } + + #[doc = " Information concerning any given referendum."] + #[doc = ""] + #[doc = " TWOX-NOTE: SAFE as indexes are not under an attacker’s control."] + pub fn referendum_info_of( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_democracy::types::ReferendumInfo< + ::core::primitive::u32, + ::subxt::ext::sp_core::H256, + ::core::primitive::u128, + >, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "ReferendumInfoOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 132u8, 4u8, 108u8, 126u8, 91u8, 168u8, 18u8, 17u8, 86u8, 79u8, 219u8, + 222u8, 195u8, 137u8, 149u8, 177u8, 101u8, 134u8, 130u8, 41u8, 217u8, + 109u8, 18u8, 18u8, 33u8, 206u8, 117u8, 131u8, 98u8, 26u8, 51u8, 8u8, + ], + ) + } + + #[doc = " Information concerning any given referendum."] + #[doc = ""] + #[doc = " TWOX-NOTE: SAFE as indexes are not under an attacker’s control."] + pub fn referendum_info_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_democracy::types::ReferendumInfo< + ::core::primitive::u32, + ::subxt::ext::sp_core::H256, + ::core::primitive::u128, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "ReferendumInfoOf", + Vec::new(), + [ + 132u8, 4u8, 108u8, 126u8, 91u8, 168u8, 18u8, 17u8, 86u8, 79u8, 219u8, + 222u8, 195u8, 137u8, 149u8, 177u8, 101u8, 134u8, 130u8, 41u8, 217u8, + 109u8, 18u8, 18u8, 33u8, 206u8, 117u8, 131u8, 98u8, 26u8, 51u8, 8u8, + ], + ) + } + + #[doc = " All votes for a particular voter. We store the balance for the number of votes that we"] + #[doc = " have recorded. The second item is the total amount of delegations, that will be added."] + #[doc = ""] + #[doc = " TWOX-NOTE: SAFE as `AccountId`s are crypto hashes anyway."] + pub fn voting_of( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_democracy::vote::Voting< + ::core::primitive::u128, + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "VotingOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 211u8, 38u8, 232u8, 65u8, 215u8, 97u8, 157u8, 208u8, 177u8, 150u8, + 250u8, 226u8, 72u8, 185u8, 187u8, 162u8, 80u8, 67u8, 195u8, 87u8, + 190u8, 180u8, 167u8, 137u8, 253u8, 142u8, 34u8, 158u8, 249u8, 168u8, + 209u8, 18u8, + ], + ) + } + + #[doc = " All votes for a particular voter. We store the balance for the number of votes that we"] + #[doc = " have recorded. The second item is the total amount of delegations, that will be added."] + #[doc = ""] + #[doc = " TWOX-NOTE: SAFE as `AccountId`s are crypto hashes anyway."] + pub fn voting_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_democracy::vote::Voting< + ::core::primitive::u128, + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "VotingOf", + Vec::new(), + [ + 211u8, 38u8, 232u8, 65u8, 215u8, 97u8, 157u8, 208u8, 177u8, 150u8, + 250u8, 226u8, 72u8, 185u8, 187u8, 162u8, 80u8, 67u8, 195u8, 87u8, + 190u8, 180u8, 167u8, 137u8, 253u8, 142u8, 34u8, 158u8, 249u8, 168u8, + 209u8, 18u8, + ], + ) + } + + #[doc = " Accounts for which there are locks in action which may be removed at some point in the"] + #[doc = " future. The value is the block number at which the lock expires and may be removed."] + #[doc = ""] + #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] + pub fn locks( + &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( + "Democracy", + "Locks", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 115u8, 224u8, 3u8, 18u8, 7u8, 229u8, 114u8, 252u8, 184u8, 233u8, 95u8, + 3u8, 237u8, 104u8, 174u8, 21u8, 35u8, 26u8, 208u8, 8u8, 71u8, 56u8, + 1u8, 33u8, 200u8, 159u8, 187u8, 204u8, 225u8, 254u8, 227u8, 4u8, + ], + ) + } + + #[doc = " Accounts for which there are locks in action which may be removed at some point in the"] + #[doc = " future. The value is the block number at which the lock expires and may be removed."] + #[doc = ""] + #[doc = " TWOX-NOTE: OK ― `AccountId` is a secure hash."] + pub fn locks_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "Locks", + Vec::new(), + [ + 115u8, 224u8, 3u8, 18u8, 7u8, 229u8, 114u8, 252u8, 184u8, 233u8, 95u8, + 3u8, 237u8, 104u8, 174u8, 21u8, 35u8, 26u8, 208u8, 8u8, 71u8, 56u8, + 1u8, 33u8, 200u8, 159u8, 187u8, 204u8, 225u8, 254u8, 227u8, 4u8, + ], + ) + } + + #[doc = " True if the last referendum tabled was submitted externally. False if it was a public"] + #[doc = " proposal."] + pub fn last_tabled_was_external( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "LastTabledWasExternal", + vec![], + [ + 3u8, 67u8, 106u8, 1u8, 89u8, 204u8, 4u8, 145u8, 121u8, 44u8, 34u8, + 76u8, 18u8, 206u8, 65u8, 214u8, 222u8, 82u8, 31u8, 223u8, 144u8, 169u8, + 17u8, 6u8, 138u8, 36u8, 113u8, 155u8, 241u8, 106u8, 189u8, 218u8, + ], + ) + } + + #[doc = " The referendum to be tabled whenever it would be valid to table an external proposal."] + #[doc = " This happens when a referendum needs to be tabled and one of two conditions are met:"] + #[doc = " - `LastTabledWasExternal` is `false`; or"] + #[doc = " - `PublicProps` is empty."] + pub fn next_external( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::subxt::ext::sp_core::H256, + runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + )>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "NextExternal", + vec![], + [ + 123u8, 49u8, 252u8, 184u8, 75u8, 204u8, 16u8, 130u8, 43u8, 109u8, 62u8, + 113u8, 95u8, 0u8, 20u8, 163u8, 186u8, 210u8, 253u8, 33u8, 58u8, 121u8, + 36u8, 80u8, 9u8, 242u8, 180u8, 230u8, 167u8, 250u8, 32u8, 180u8, + ], + ) + } + + #[doc = " A record of who vetoed what. Maps proposal hash to a possible existent block number"] + #[doc = " (until when it may not be resubmitted) and who vetoed it."] + pub fn blacklist( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u32, + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + )>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "Blacklist", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 93u8, 165u8, 219u8, 135u8, 41u8, 114u8, 144u8, 133u8, 171u8, 83u8, + 153u8, 157u8, 79u8, 14u8, 170u8, 29u8, 179u8, 23u8, 222u8, 124u8, + 237u8, 253u8, 122u8, 21u8, 186u8, 209u8, 184u8, 89u8, 197u8, 5u8, + 178u8, 255u8, + ], + ) + } + + #[doc = " A record of who vetoed what. Maps proposal hash to a possible existent block number"] + #[doc = " (until when it may not be resubmitted) and who vetoed it."] + pub fn blacklist_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u32, + ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + )>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "Blacklist", + Vec::new(), + [ + 93u8, 165u8, 219u8, 135u8, 41u8, 114u8, 144u8, 133u8, 171u8, 83u8, + 153u8, 157u8, 79u8, 14u8, 170u8, 29u8, 179u8, 23u8, 222u8, 124u8, + 237u8, 253u8, 122u8, 21u8, 186u8, 209u8, 184u8, 89u8, 197u8, 5u8, + 178u8, 255u8, + ], + ) + } + + #[doc = " Record of all proposals that have been subject to emergency cancellation."] + pub fn cancellations( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "Cancellations", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 154u8, 36u8, 172u8, 46u8, 65u8, 218u8, 30u8, 151u8, 173u8, 186u8, + 166u8, 79u8, 35u8, 226u8, 94u8, 200u8, 67u8, 44u8, 47u8, 7u8, 17u8, + 89u8, 169u8, 166u8, 236u8, 101u8, 68u8, 54u8, 114u8, 141u8, 177u8, + 135u8, + ], + ) + } + + #[doc = " Record of all proposals that have been subject to emergency cancellation."] + pub fn cancellations_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "Cancellations", + Vec::new(), + [ + 154u8, 36u8, 172u8, 46u8, 65u8, 218u8, 30u8, 151u8, 173u8, 186u8, + 166u8, 79u8, 35u8, 226u8, 94u8, 200u8, 67u8, 44u8, 47u8, 7u8, 17u8, + 89u8, 169u8, 166u8, 236u8, 101u8, 68u8, 54u8, 114u8, 141u8, 177u8, + 135u8, + ], + ) + } + + #[doc = " Storage version of the pallet."] + #[doc = ""] + #[doc = " New networks start with last version."] + pub fn storage_version( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Democracy", + "StorageVersion", + vec![], + [ + 39u8, 219u8, 134u8, 64u8, 250u8, 96u8, 95u8, 156u8, 100u8, 236u8, 18u8, + 78u8, 59u8, 146u8, 5u8, 245u8, 113u8, 125u8, 220u8, 140u8, 125u8, 5u8, + 194u8, 134u8, 248u8, 95u8, 250u8, 108u8, 142u8, 230u8, 21u8, 120u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The period between a proposal being approved and enacted."] + #[doc = ""] + #[doc = " It should generally be a little more than the unstake period to ensure that"] + #[doc = " voting stakers have an opportunity to remove themselves from the system in the case"] + #[doc = " where they are on the losing side of a vote."] + pub fn enactment_period( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "EnactmentPeriod", + [ + 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 = " How often (in blocks) new public referenda are launched."] + pub fn launch_period( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new("Democracy", "LaunchPeriod", [ + 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 = " How often (in blocks) to check for new votes."] + pub fn voting_period( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new("Democracy", "VotingPeriod", [ + 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 minimum period of vote locking."] + #[doc = ""] + #[doc = " It should be no shorter than enactment period to ensure that in the case of an approval,"] + #[doc = " those successful voters are locked into the consequences that their votes entail."] + pub fn vote_locking_period( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "VoteLockingPeriod", + [ + 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 minimum amount to be used as a deposit for a public referendum proposal."] + pub fn minimum_deposit( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new("Democracy", "MinimumDeposit", [ + 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 = " Indicator for whether an emergency origin is even allowed to happen. Some chains may"] + #[doc = " want to set this permanently to `false`, others may want to condition it on things such"] + #[doc = " as an upgrade having happened recently."] + pub fn instant_allowed( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::bool>, + > { + ::subxt::constants::StaticConstantAddress::new("Democracy", "InstantAllowed", [ + 165u8, 28u8, 112u8, 190u8, 18u8, 129u8, 182u8, 206u8, 237u8, 1u8, 68u8, + 252u8, 125u8, 234u8, 185u8, 50u8, 149u8, 164u8, 47u8, 126u8, 134u8, 100u8, + 14u8, 86u8, 209u8, 39u8, 20u8, 4u8, 233u8, 115u8, 102u8, 131u8, + ]) + } + + #[doc = " Minimum voting period allowed for a fast-track referendum."] + pub fn fast_track_voting_period( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "FastTrackVotingPeriod", + [ + 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 = " Period in blocks where an external proposal may not be re-submitted after being vetoed."] + pub fn cooloff_period( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new("Democracy", "CooloffPeriod", [ + 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 amount of balance that must be deposited per byte of preimage stored."] + pub fn preimage_byte_deposit( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Democracy", + "PreimageByteDeposit", + [ + 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 votes for an account."] + #[doc = ""] + #[doc = " Also used to compute weight, an overly big value can"] + #[doc = " lead to extrinsic with very big weight: see `delegate` for instance."] + pub fn max_votes( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new("Democracy", "MaxVotes", [ + 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 public proposals that can exist at any time."] + pub fn max_proposals( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new("Democracy", "MaxProposals", [ + 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 council { + 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 SetMembers { + pub new_members: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + pub prime: ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + pub old_count: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Execute { + pub proposal: ::std::boxed::Box, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Propose { + #[codec(compact)] + pub threshold: ::core::primitive::u32, + pub proposal: ::std::boxed::Box, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Vote { + pub proposal: ::subxt::ext::sp_core::H256, + #[codec(compact)] + pub index: ::core::primitive::u32, + pub approve: ::core::primitive::bool, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Close { + pub proposal_hash: ::subxt::ext::sp_core::H256, + #[codec(compact)] + pub index: ::core::primitive::u32, + #[codec(compact)] + pub proposal_weight_bound: ::core::primitive::u64, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct DisapproveProposal { + pub proposal_hash: ::subxt::ext::sp_core::H256, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Set the collective's membership."] + #[doc = ""] + #[doc = "- `new_members`: The new member list. Be nice to the chain and provide it sorted."] + #[doc = "- `prime`: The prime member whose vote sets the default."] + #[doc = "- `old_count`: The upper bound for the previous number of members in storage. Used for"] + #[doc = " weight estimation."] + #[doc = ""] + #[doc = "Requires root origin."] + #[doc = ""] + #[doc = "NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but"] + #[doc = " the weight estimations rely on it to estimate dispatchable weight."] + #[doc = ""] + #[doc = "# WARNING:"] + #[doc = ""] + #[doc = "The `pallet-collective` can also be managed by logic outside of the pallet through the"] + #[doc = "implementation of the trait [`ChangeMembers`]."] + #[doc = "Any call to `set_members` must be careful that the member set doesn't get out of sync"] + #[doc = "with other logic managing the member set."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(MP + N)` where:"] + #[doc = " - `M` old-members-count (code- and governance-bounded)"] + #[doc = " - `N` new-members-count (code- and governance-bounded)"] + #[doc = " - `P` proposals-count (code-bounded)"] + #[doc = "- DB:"] + #[doc = " - 1 storage mutation (codec `O(M)` read, `O(N)` write) for reading and writing the"] + #[doc = " members"] + #[doc = " - 1 storage read (codec `O(P)`) for reading the proposals"] + #[doc = " - `P` storage mutations (codec `O(M)`) for updating the votes for each proposal"] + #[doc = " - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one"] + #[doc = "# "] + pub fn set_members( + &self, + new_members: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + prime: ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + old_count: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Council", + "set_members", + SetMembers { + new_members, + prime, + old_count, + }, + [ + 196u8, 103u8, 123u8, 125u8, 226u8, 177u8, 126u8, 37u8, 160u8, 114u8, + 34u8, 136u8, 219u8, 84u8, 199u8, 94u8, 242u8, 20u8, 126u8, 126u8, + 166u8, 190u8, 198u8, 33u8, 162u8, 113u8, 237u8, 222u8, 90u8, 1u8, 2u8, + 234u8, + ], + ) + } + + #[doc = "Dispatch a proposal from a member using the `Member` origin."] + #[doc = ""] + #[doc = "Origin must be a member of the collective."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(M + P)` where `M` members-count (code-bounded) and `P` complexity of dispatching"] + #[doc = " `proposal`"] + #[doc = "- DB: 1 read (codec `O(M)`) + DB access of `proposal`"] + #[doc = "- 1 event"] + #[doc = "# "] + pub fn execute( + &self, + proposal: runtime_types::da_runtime::Call, + length_bound: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Council", + "execute", + Execute { + proposal: ::std::boxed::Box::new(proposal), + length_bound, + }, + [ + 194u8, 57u8, 78u8, 249u8, 175u8, 56u8, 214u8, 240u8, 21u8, 83u8, 15u8, + 70u8, 78u8, 196u8, 228u8, 31u8, 2u8, 0u8, 184u8, 22u8, 44u8, 40u8, + 161u8, 188u8, 74u8, 216u8, 31u8, 29u8, 59u8, 125u8, 168u8, 129u8, + ], + ) + } + + #[doc = "Add a new proposal to either be voted on or executed directly."] + #[doc = ""] + #[doc = "Requires the sender to be member."] + #[doc = ""] + #[doc = "`threshold` determines whether `proposal` is executed directly (`threshold < 2`)"] + #[doc = "or put up for voting."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(B + M + P1)` or `O(B + M + P2)` where:"] + #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] + #[doc = " - `M` is members-count (code- and governance-bounded)"] + #[doc = " - branching is influenced by `threshold` where:"] + #[doc = " - `P1` is proposal execution complexity (`threshold < 2`)"] + #[doc = " - `P2` is proposals-count (code-bounded) (`threshold >= 2`)"] + #[doc = "- DB:"] + #[doc = " - 1 storage read `is_member` (codec `O(M)`)"] + #[doc = " - 1 storage read `ProposalOf::contains_key` (codec `O(1)`)"] + #[doc = " - DB accesses influenced by `threshold`:"] + #[doc = " - EITHER storage accesses done by `proposal` (`threshold < 2`)"] + #[doc = " - OR proposal insertion (`threshold <= 2`)"] + #[doc = " - 1 storage mutation `Proposals` (codec `O(P2)`)"] + #[doc = " - 1 storage mutation `ProposalCount` (codec `O(1)`)"] + #[doc = " - 1 storage write `ProposalOf` (codec `O(B)`)"] + #[doc = " - 1 storage write `Voting` (codec `O(M)`)"] + #[doc = " - 1 event"] + #[doc = "# "] + pub fn propose( + &self, + threshold: ::core::primitive::u32, + proposal: runtime_types::da_runtime::Call, + length_bound: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Council", + "propose", + Propose { + threshold, + proposal: ::std::boxed::Box::new(proposal), + length_bound, + }, + [ + 56u8, 153u8, 239u8, 134u8, 65u8, 98u8, 107u8, 29u8, 237u8, 143u8, + 248u8, 49u8, 115u8, 128u8, 205u8, 105u8, 199u8, 235u8, 214u8, 150u8, + 123u8, 72u8, 120u8, 104u8, 217u8, 27u8, 182u8, 210u8, 195u8, 248u8, + 68u8, 118u8, + ], + ) + } + + #[doc = "Add an aye or nay vote for the sender to the given proposal."] + #[doc = ""] + #[doc = "Requires the sender to be a member."] + #[doc = ""] + #[doc = "Transaction fees will be waived if the member is voting on any particular proposal"] + #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] + #[doc = "fee."] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(M)` where `M` is members-count (code- and governance-bounded)"] + #[doc = "- DB:"] + #[doc = " - 1 storage read `Members` (codec `O(M)`)"] + #[doc = " - 1 storage mutation `Voting` (codec `O(M)`)"] + #[doc = "- 1 event"] + #[doc = "# "] + pub fn vote( + &self, + proposal: ::subxt::ext::sp_core::H256, + index: ::core::primitive::u32, + approve: ::core::primitive::bool, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Council", + "vote", + Vote { + proposal, + index, + approve, + }, + [ + 108u8, 46u8, 180u8, 148u8, 145u8, 24u8, 173u8, 56u8, 36u8, 100u8, + 216u8, 43u8, 178u8, 202u8, 26u8, 136u8, 93u8, 84u8, 80u8, 134u8, 14u8, + 42u8, 248u8, 205u8, 68u8, 92u8, 79u8, 11u8, 113u8, 115u8, 157u8, 100u8, + ], + ) + } + + #[doc = "Close a vote that is either approved, disapproved or whose voting period has ended."] + #[doc = ""] + #[doc = "May be called by any signed account in order to finish voting and close the proposal."] + #[doc = ""] + #[doc = "If called before the end of the voting period it will only close the vote if it is"] + #[doc = "has enough votes to be approved or disapproved."] + #[doc = ""] + #[doc = "If called after the end of the voting period abstentions are counted as rejections"] + #[doc = "unless there is a prime member set and the prime member cast an approval."] + #[doc = ""] + #[doc = "If the close operation completes successfully with disapproval, the transaction fee will"] + #[doc = "be waived. Otherwise execution of the approved operation will be charged to the caller."] + #[doc = ""] + #[doc = "+ `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed"] + #[doc = "proposal."] + #[doc = "+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via"] + #[doc = "`storage::read` so it is `size_of::() == 4` larger than the pure length."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(B + M + P1 + P2)` where:"] + #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] + #[doc = " - `M` is members-count (code- and governance-bounded)"] + #[doc = " - `P1` is the complexity of `proposal` preimage."] + #[doc = " - `P2` is proposal-count (code-bounded)"] + #[doc = "- DB:"] + #[doc = " - 2 storage reads (`Members`: codec `O(M)`, `Prime`: codec `O(1)`)"] + #[doc = " - 3 mutations (`Voting`: codec `O(M)`, `ProposalOf`: codec `O(B)`, `Proposals`: codec"] + #[doc = " `O(P2)`)"] + #[doc = " - any mutations done while executing `proposal` (`P1`)"] + #[doc = "- up to 3 events"] + #[doc = "# "] + pub fn close( + &self, + proposal_hash: ::subxt::ext::sp_core::H256, + index: ::core::primitive::u32, + proposal_weight_bound: ::core::primitive::u64, + length_bound: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Council", + "close", + Close { + proposal_hash, + index, + proposal_weight_bound, + length_bound, + }, + [ + 88u8, 8u8, 33u8, 184u8, 4u8, 97u8, 120u8, 237u8, 43u8, 183u8, 130u8, + 139u8, 65u8, 74u8, 166u8, 119u8, 246u8, 65u8, 132u8, 219u8, 118u8, + 69u8, 182u8, 195u8, 111u8, 204u8, 107u8, 78u8, 152u8, 218u8, 181u8, + 208u8, + ], + ) + } + + #[doc = "Disapprove a proposal, close, and remove it from the system, regardless of its current"] + #[doc = "state."] + #[doc = ""] + #[doc = "Must be called by the Root origin."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "* `proposal_hash`: The hash of the proposal that should be disapproved."] + #[doc = ""] + #[doc = "# "] + #[doc = "Complexity: O(P) where P is the number of max proposals"] + #[doc = "DB Weight:"] + #[doc = "* Reads: Proposals"] + #[doc = "* Writes: Voting, Proposals, ProposalOf"] + #[doc = "# "] + pub fn disapprove_proposal( + &self, + proposal_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Council", + "disapprove_proposal", + DisapproveProposal { proposal_hash }, + [ + 25u8, 123u8, 1u8, 8u8, 74u8, 37u8, 3u8, 40u8, 97u8, 37u8, 175u8, 224u8, + 72u8, 155u8, 123u8, 109u8, 104u8, 43u8, 91u8, 125u8, 199u8, 51u8, 17u8, + 225u8, 133u8, 38u8, 120u8, 76u8, 164u8, 5u8, 194u8, 201u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_collective::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A motion (given hash) has been proposed (by given account) with a threshold (given"] + #[doc = "`MemberCount`)."] + pub struct Proposed { + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + pub proposal_index: ::core::primitive::u32, + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub threshold: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for Proposed { + const EVENT: &'static str = "Proposed"; + const PALLET: &'static str = "Council"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A motion (given hash) has been voted on by given account, leaving"] + #[doc = "a tally (yes votes and no votes given respectively as `MemberCount`)."] + pub struct Voted { + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub voted: ::core::primitive::bool, + pub yes: ::core::primitive::u32, + pub no: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for Voted { + const EVENT: &'static str = "Voted"; + const PALLET: &'static str = "Council"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A motion was approved by the required threshold."] + pub struct Approved { + pub proposal_hash: ::subxt::ext::sp_core::H256, + } + impl ::subxt::events::StaticEvent for Approved { + const EVENT: &'static str = "Approved"; + const PALLET: &'static str = "Council"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A motion was not approved by the required threshold."] + pub struct Disapproved { + pub proposal_hash: ::subxt::ext::sp_core::H256, + } + impl ::subxt::events::StaticEvent for Disapproved { + const EVENT: &'static str = "Disapproved"; + const PALLET: &'static str = "Council"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A motion was executed; result will be `Ok` if it returned without error."] + pub struct Executed { + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::events::StaticEvent for Executed { + const EVENT: &'static str = "Executed"; + const PALLET: &'static str = "Council"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A single member did some action; result will be `Ok` if it returned without error."] + pub struct MemberExecuted { + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::events::StaticEvent for MemberExecuted { + const EVENT: &'static str = "MemberExecuted"; + const PALLET: &'static str = "Council"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A proposal was closed because its threshold was reached or after its duration was up."] + pub struct Closed { + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub yes: ::core::primitive::u32, + pub no: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for Closed { + const EVENT: &'static str = "Closed"; + const PALLET: &'static str = "Council"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The hashes of the active proposals."] + pub fn proposals( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::ext::sp_core::H256, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Council", + "Proposals", + vec![], + [ + 10u8, 133u8, 82u8, 54u8, 193u8, 41u8, 253u8, 159u8, 56u8, 96u8, 249u8, + 148u8, 43u8, 57u8, 116u8, 43u8, 222u8, 243u8, 237u8, 231u8, 238u8, + 60u8, 26u8, 225u8, 19u8, 203u8, 213u8, 220u8, 114u8, 217u8, 100u8, + 27u8, + ], + ) + } + + #[doc = " Actual proposal for a given hash, if it's current."] + pub fn proposal_of( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Council", + "ProposalOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 196u8, 81u8, 145u8, 33u8, 105u8, 200u8, 14u8, 212u8, 127u8, 142u8, + 201u8, 45u8, 147u8, 150u8, 136u8, 251u8, 36u8, 67u8, 24u8, 42u8, 26u8, + 8u8, 81u8, 146u8, 88u8, 110u8, 104u8, 49u8, 156u8, 41u8, 223u8, 11u8, + ], + ) + } + + #[doc = " Actual proposal for a given hash, if it's current."] + pub fn proposal_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Council", + "ProposalOf", + Vec::new(), + [ + 196u8, 81u8, 145u8, 33u8, 105u8, 200u8, 14u8, 212u8, 127u8, 142u8, + 201u8, 45u8, 147u8, 150u8, 136u8, 251u8, 36u8, 67u8, 24u8, 42u8, 26u8, + 8u8, 81u8, 146u8, 88u8, 110u8, 104u8, 49u8, 156u8, 41u8, 223u8, 11u8, + ], + ) + } + + #[doc = " Votes on a given proposal, if it is ongoing."] + pub fn voting( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_collective::Votes< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Council", + "Voting", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 89u8, 108u8, 65u8, 58u8, 60u8, 116u8, 54u8, 68u8, 179u8, 73u8, 161u8, + 168u8, 78u8, 213u8, 208u8, 54u8, 244u8, 58u8, 70u8, 209u8, 170u8, + 136u8, 215u8, 3u8, 2u8, 105u8, 229u8, 217u8, 240u8, 230u8, 107u8, + 221u8, + ], + ) + } + + #[doc = " Votes on a given proposal, if it is ongoing."] + pub fn voting_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_collective::Votes< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Council", + "Voting", + Vec::new(), + [ + 89u8, 108u8, 65u8, 58u8, 60u8, 116u8, 54u8, 68u8, 179u8, 73u8, 161u8, + 168u8, 78u8, 213u8, 208u8, 54u8, 244u8, 58u8, 70u8, 209u8, 170u8, + 136u8, 215u8, 3u8, 2u8, 105u8, 229u8, 217u8, 240u8, 230u8, 107u8, + 221u8, + ], + ) + } + + #[doc = " Proposals so far."] + 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( + "Council", + "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 = " The current members of the collective. This is stored sorted (just by value)."] + pub fn members( + &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( + "Council", + "Members", + vec![], + [ + 162u8, 72u8, 174u8, 204u8, 140u8, 105u8, 205u8, 176u8, 197u8, 117u8, + 206u8, 134u8, 157u8, 110u8, 139u8, 54u8, 43u8, 233u8, 25u8, 51u8, 36u8, + 238u8, 94u8, 124u8, 221u8, 52u8, 237u8, 71u8, 125u8, 56u8, 129u8, + 222u8, + ], + ) + } + + #[doc = " The prime member that helps determine the default vote behavior in case of absentations."] + pub fn prime( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::crypto::AccountId32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Council", + "Prime", + vec![], + [ + 108u8, 118u8, 54u8, 193u8, 207u8, 227u8, 119u8, 97u8, 23u8, 239u8, + 157u8, 69u8, 56u8, 142u8, 106u8, 17u8, 215u8, 159u8, 48u8, 42u8, 185u8, + 209u8, 49u8, 159u8, 32u8, 168u8, 111u8, 158u8, 159u8, 217u8, 244u8, + 158u8, + ], + ) + } + } + } + } + pub mod technical_committee { + 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 SetMembers { + pub new_members: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + pub prime: ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + pub old_count: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Execute { + pub proposal: ::std::boxed::Box, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Propose { + #[codec(compact)] + pub threshold: ::core::primitive::u32, + pub proposal: ::std::boxed::Box, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Vote { + pub proposal: ::subxt::ext::sp_core::H256, + #[codec(compact)] + pub index: ::core::primitive::u32, + pub approve: ::core::primitive::bool, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Close { + pub proposal_hash: ::subxt::ext::sp_core::H256, + #[codec(compact)] + pub index: ::core::primitive::u32, + #[codec(compact)] + pub proposal_weight_bound: ::core::primitive::u64, + #[codec(compact)] + pub length_bound: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct DisapproveProposal { + pub proposal_hash: ::subxt::ext::sp_core::H256, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Set the collective's membership."] + #[doc = ""] + #[doc = "- `new_members`: The new member list. Be nice to the chain and provide it sorted."] + #[doc = "- `prime`: The prime member whose vote sets the default."] + #[doc = "- `old_count`: The upper bound for the previous number of members in storage. Used for"] + #[doc = " weight estimation."] + #[doc = ""] + #[doc = "Requires root origin."] + #[doc = ""] + #[doc = "NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but"] + #[doc = " the weight estimations rely on it to estimate dispatchable weight."] + #[doc = ""] + #[doc = "# WARNING:"] + #[doc = ""] + #[doc = "The `pallet-collective` can also be managed by logic outside of the pallet through the"] + #[doc = "implementation of the trait [`ChangeMembers`]."] + #[doc = "Any call to `set_members` must be careful that the member set doesn't get out of sync"] + #[doc = "with other logic managing the member set."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(MP + N)` where:"] + #[doc = " - `M` old-members-count (code- and governance-bounded)"] + #[doc = " - `N` new-members-count (code- and governance-bounded)"] + #[doc = " - `P` proposals-count (code-bounded)"] + #[doc = "- DB:"] + #[doc = " - 1 storage mutation (codec `O(M)` read, `O(N)` write) for reading and writing the"] + #[doc = " members"] + #[doc = " - 1 storage read (codec `O(P)`) for reading the proposals"] + #[doc = " - `P` storage mutations (codec `O(M)`) for updating the votes for each proposal"] + #[doc = " - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one"] + #[doc = "# "] + pub fn set_members( + &self, + new_members: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + prime: ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + old_count: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalCommittee", + "set_members", + SetMembers { + new_members, + prime, + old_count, + }, + [ + 196u8, 103u8, 123u8, 125u8, 226u8, 177u8, 126u8, 37u8, 160u8, 114u8, + 34u8, 136u8, 219u8, 84u8, 199u8, 94u8, 242u8, 20u8, 126u8, 126u8, + 166u8, 190u8, 198u8, 33u8, 162u8, 113u8, 237u8, 222u8, 90u8, 1u8, 2u8, + 234u8, + ], + ) + } + + #[doc = "Dispatch a proposal from a member using the `Member` origin."] + #[doc = ""] + #[doc = "Origin must be a member of the collective."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(M + P)` where `M` members-count (code-bounded) and `P` complexity of dispatching"] + #[doc = " `proposal`"] + #[doc = "- DB: 1 read (codec `O(M)`) + DB access of `proposal`"] + #[doc = "- 1 event"] + #[doc = "# "] + pub fn execute( + &self, + proposal: runtime_types::da_runtime::Call, + length_bound: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalCommittee", + "execute", + Execute { + proposal: ::std::boxed::Box::new(proposal), + length_bound, + }, + [ + 194u8, 57u8, 78u8, 249u8, 175u8, 56u8, 214u8, 240u8, 21u8, 83u8, 15u8, + 70u8, 78u8, 196u8, 228u8, 31u8, 2u8, 0u8, 184u8, 22u8, 44u8, 40u8, + 161u8, 188u8, 74u8, 216u8, 31u8, 29u8, 59u8, 125u8, 168u8, 129u8, + ], + ) + } + + #[doc = "Add a new proposal to either be voted on or executed directly."] + #[doc = ""] + #[doc = "Requires the sender to be member."] + #[doc = ""] + #[doc = "`threshold` determines whether `proposal` is executed directly (`threshold < 2`)"] + #[doc = "or put up for voting."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(B + M + P1)` or `O(B + M + P2)` where:"] + #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] + #[doc = " - `M` is members-count (code- and governance-bounded)"] + #[doc = " - branching is influenced by `threshold` where:"] + #[doc = " - `P1` is proposal execution complexity (`threshold < 2`)"] + #[doc = " - `P2` is proposals-count (code-bounded) (`threshold >= 2`)"] + #[doc = "- DB:"] + #[doc = " - 1 storage read `is_member` (codec `O(M)`)"] + #[doc = " - 1 storage read `ProposalOf::contains_key` (codec `O(1)`)"] + #[doc = " - DB accesses influenced by `threshold`:"] + #[doc = " - EITHER storage accesses done by `proposal` (`threshold < 2`)"] + #[doc = " - OR proposal insertion (`threshold <= 2`)"] + #[doc = " - 1 storage mutation `Proposals` (codec `O(P2)`)"] + #[doc = " - 1 storage mutation `ProposalCount` (codec `O(1)`)"] + #[doc = " - 1 storage write `ProposalOf` (codec `O(B)`)"] + #[doc = " - 1 storage write `Voting` (codec `O(M)`)"] + #[doc = " - 1 event"] + #[doc = "# "] + pub fn propose( + &self, + threshold: ::core::primitive::u32, + proposal: runtime_types::da_runtime::Call, + length_bound: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalCommittee", + "propose", + Propose { + threshold, + proposal: ::std::boxed::Box::new(proposal), + length_bound, + }, + [ + 56u8, 153u8, 239u8, 134u8, 65u8, 98u8, 107u8, 29u8, 237u8, 143u8, + 248u8, 49u8, 115u8, 128u8, 205u8, 105u8, 199u8, 235u8, 214u8, 150u8, + 123u8, 72u8, 120u8, 104u8, 217u8, 27u8, 182u8, 210u8, 195u8, 248u8, + 68u8, 118u8, + ], + ) + } + + #[doc = "Add an aye or nay vote for the sender to the given proposal."] + #[doc = ""] + #[doc = "Requires the sender to be a member."] + #[doc = ""] + #[doc = "Transaction fees will be waived if the member is voting on any particular proposal"] + #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] + #[doc = "fee."] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(M)` where `M` is members-count (code- and governance-bounded)"] + #[doc = "- DB:"] + #[doc = " - 1 storage read `Members` (codec `O(M)`)"] + #[doc = " - 1 storage mutation `Voting` (codec `O(M)`)"] + #[doc = "- 1 event"] + #[doc = "# "] + pub fn vote( + &self, + proposal: ::subxt::ext::sp_core::H256, + index: ::core::primitive::u32, + approve: ::core::primitive::bool, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalCommittee", + "vote", + Vote { + proposal, + index, + approve, + }, + [ + 108u8, 46u8, 180u8, 148u8, 145u8, 24u8, 173u8, 56u8, 36u8, 100u8, + 216u8, 43u8, 178u8, 202u8, 26u8, 136u8, 93u8, 84u8, 80u8, 134u8, 14u8, + 42u8, 248u8, 205u8, 68u8, 92u8, 79u8, 11u8, 113u8, 115u8, 157u8, 100u8, + ], + ) + } + + #[doc = "Close a vote that is either approved, disapproved or whose voting period has ended."] + #[doc = ""] + #[doc = "May be called by any signed account in order to finish voting and close the proposal."] + #[doc = ""] + #[doc = "If called before the end of the voting period it will only close the vote if it is"] + #[doc = "has enough votes to be approved or disapproved."] + #[doc = ""] + #[doc = "If called after the end of the voting period abstentions are counted as rejections"] + #[doc = "unless there is a prime member set and the prime member cast an approval."] + #[doc = ""] + #[doc = "If the close operation completes successfully with disapproval, the transaction fee will"] + #[doc = "be waived. Otherwise execution of the approved operation will be charged to the caller."] + #[doc = ""] + #[doc = "+ `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed"] + #[doc = "proposal."] + #[doc = "+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via"] + #[doc = "`storage::read` so it is `size_of::() == 4` larger than the pure length."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(B + M + P1 + P2)` where:"] + #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] + #[doc = " - `M` is members-count (code- and governance-bounded)"] + #[doc = " - `P1` is the complexity of `proposal` preimage."] + #[doc = " - `P2` is proposal-count (code-bounded)"] + #[doc = "- DB:"] + #[doc = " - 2 storage reads (`Members`: codec `O(M)`, `Prime`: codec `O(1)`)"] + #[doc = " - 3 mutations (`Voting`: codec `O(M)`, `ProposalOf`: codec `O(B)`, `Proposals`: codec"] + #[doc = " `O(P2)`)"] + #[doc = " - any mutations done while executing `proposal` (`P1`)"] + #[doc = "- up to 3 events"] + #[doc = "# "] + pub fn close( + &self, + proposal_hash: ::subxt::ext::sp_core::H256, + index: ::core::primitive::u32, + proposal_weight_bound: ::core::primitive::u64, + length_bound: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalCommittee", + "close", + Close { + proposal_hash, + index, + proposal_weight_bound, + length_bound, + }, + [ + 88u8, 8u8, 33u8, 184u8, 4u8, 97u8, 120u8, 237u8, 43u8, 183u8, 130u8, + 139u8, 65u8, 74u8, 166u8, 119u8, 246u8, 65u8, 132u8, 219u8, 118u8, + 69u8, 182u8, 195u8, 111u8, 204u8, 107u8, 78u8, 152u8, 218u8, 181u8, + 208u8, + ], + ) + } + + #[doc = "Disapprove a proposal, close, and remove it from the system, regardless of its current"] + #[doc = "state."] + #[doc = ""] + #[doc = "Must be called by the Root origin."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "* `proposal_hash`: The hash of the proposal that should be disapproved."] + #[doc = ""] + #[doc = "# "] + #[doc = "Complexity: O(P) where P is the number of max proposals"] + #[doc = "DB Weight:"] + #[doc = "* Reads: Proposals"] + #[doc = "* Writes: Voting, Proposals, ProposalOf"] + #[doc = "# "] + pub fn disapprove_proposal( + &self, + proposal_hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalCommittee", + "disapprove_proposal", + DisapproveProposal { proposal_hash }, + [ + 25u8, 123u8, 1u8, 8u8, 74u8, 37u8, 3u8, 40u8, 97u8, 37u8, 175u8, 224u8, + 72u8, 155u8, 123u8, 109u8, 104u8, 43u8, 91u8, 125u8, 199u8, 51u8, 17u8, + 225u8, 133u8, 38u8, 120u8, 76u8, 164u8, 5u8, 194u8, 201u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_collective::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A motion (given hash) has been proposed (by given account) with a threshold (given"] + #[doc = "`MemberCount`)."] + pub struct Proposed { + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + pub proposal_index: ::core::primitive::u32, + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub threshold: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for Proposed { + const EVENT: &'static str = "Proposed"; + const PALLET: &'static str = "TechnicalCommittee"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A motion (given hash) has been voted on by given account, leaving"] + #[doc = "a tally (yes votes and no votes given respectively as `MemberCount`)."] + pub struct Voted { + pub account: ::subxt::ext::sp_core::crypto::AccountId32, + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub voted: ::core::primitive::bool, + pub yes: ::core::primitive::u32, + pub no: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for Voted { + const EVENT: &'static str = "Voted"; + const PALLET: &'static str = "TechnicalCommittee"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A motion was approved by the required threshold."] + pub struct Approved { + pub proposal_hash: ::subxt::ext::sp_core::H256, + } + impl ::subxt::events::StaticEvent for Approved { + const EVENT: &'static str = "Approved"; + const PALLET: &'static str = "TechnicalCommittee"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A motion was not approved by the required threshold."] + pub struct Disapproved { + pub proposal_hash: ::subxt::ext::sp_core::H256, + } + impl ::subxt::events::StaticEvent for Disapproved { + const EVENT: &'static str = "Disapproved"; + const PALLET: &'static str = "TechnicalCommittee"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A motion was executed; result will be `Ok` if it returned without error."] + pub struct Executed { + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::events::StaticEvent for Executed { + const EVENT: &'static str = "Executed"; + const PALLET: &'static str = "TechnicalCommittee"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A single member did some action; result will be `Ok` if it returned without error."] + pub struct MemberExecuted { + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub result: ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + } + impl ::subxt::events::StaticEvent for MemberExecuted { + const EVENT: &'static str = "MemberExecuted"; + const PALLET: &'static str = "TechnicalCommittee"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A proposal was closed because its threshold was reached or after its duration was up."] + pub struct Closed { + pub proposal_hash: ::subxt::ext::sp_core::H256, + pub yes: ::core::primitive::u32, + pub no: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for Closed { + const EVENT: &'static str = "Closed"; + const PALLET: &'static str = "TechnicalCommittee"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The hashes of the active proposals."] + pub fn proposals( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::subxt::ext::sp_core::H256, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalCommittee", + "Proposals", + vec![], + [ + 10u8, 133u8, 82u8, 54u8, 193u8, 41u8, 253u8, 159u8, 56u8, 96u8, 249u8, + 148u8, 43u8, 57u8, 116u8, 43u8, 222u8, 243u8, 237u8, 231u8, 238u8, + 60u8, 26u8, 225u8, 19u8, 203u8, 213u8, 220u8, 114u8, 217u8, 100u8, + 27u8, + ], + ) + } + + #[doc = " Actual proposal for a given hash, if it's current."] + pub fn proposal_of( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalCommittee", + "ProposalOf", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 196u8, 81u8, 145u8, 33u8, 105u8, 200u8, 14u8, 212u8, 127u8, 142u8, + 201u8, 45u8, 147u8, 150u8, 136u8, 251u8, 36u8, 67u8, 24u8, 42u8, 26u8, + 8u8, 81u8, 146u8, 88u8, 110u8, 104u8, 49u8, 156u8, 41u8, 223u8, 11u8, + ], + ) + } + + #[doc = " Actual proposal for a given hash, if it's current."] + pub fn proposal_of_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalCommittee", + "ProposalOf", + Vec::new(), + [ + 196u8, 81u8, 145u8, 33u8, 105u8, 200u8, 14u8, 212u8, 127u8, 142u8, + 201u8, 45u8, 147u8, 150u8, 136u8, 251u8, 36u8, 67u8, 24u8, 42u8, 26u8, + 8u8, 81u8, 146u8, 88u8, 110u8, 104u8, 49u8, 156u8, 41u8, 223u8, 11u8, + ], + ) + } + + #[doc = " Votes on a given proposal, if it is ongoing."] + pub fn voting( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_collective::Votes< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalCommittee", + "Voting", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 89u8, 108u8, 65u8, 58u8, 60u8, 116u8, 54u8, 68u8, 179u8, 73u8, 161u8, + 168u8, 78u8, 213u8, 208u8, 54u8, 244u8, 58u8, 70u8, 209u8, 170u8, + 136u8, 215u8, 3u8, 2u8, 105u8, 229u8, 217u8, 240u8, 230u8, 107u8, + 221u8, + ], + ) + } + + #[doc = " Votes on a given proposal, if it is ongoing."] + pub fn voting_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_collective::Votes< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalCommittee", + "Voting", + Vec::new(), + [ + 89u8, 108u8, 65u8, 58u8, 60u8, 116u8, 54u8, 68u8, 179u8, 73u8, 161u8, + 168u8, 78u8, 213u8, 208u8, 54u8, 244u8, 58u8, 70u8, 209u8, 170u8, + 136u8, 215u8, 3u8, 2u8, 105u8, 229u8, 217u8, 240u8, 230u8, 107u8, + 221u8, + ], + ) + } + + #[doc = " Proposals so far."] + 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( + "TechnicalCommittee", + "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 = " The current members of the collective. This is stored sorted (just by value)."] + pub fn members( + &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( + "TechnicalCommittee", + "Members", + vec![], + [ + 162u8, 72u8, 174u8, 204u8, 140u8, 105u8, 205u8, 176u8, 197u8, 117u8, + 206u8, 134u8, 157u8, 110u8, 139u8, 54u8, 43u8, 233u8, 25u8, 51u8, 36u8, + 238u8, 94u8, 124u8, 221u8, 52u8, 237u8, 71u8, 125u8, 56u8, 129u8, + 222u8, + ], + ) + } + + #[doc = " The prime member that helps determine the default vote behavior in case of absentations."] + pub fn prime( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::crypto::AccountId32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalCommittee", + "Prime", + vec![], + [ + 108u8, 118u8, 54u8, 193u8, 207u8, 227u8, 119u8, 97u8, 23u8, 239u8, + 157u8, 69u8, 56u8, 142u8, 106u8, 17u8, 215u8, 159u8, 48u8, 42u8, 185u8, + 209u8, 49u8, 159u8, 32u8, 168u8, 111u8, 158u8, 159u8, 217u8, 244u8, + 158u8, + ], + ) + } + } + } + } + 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 Vote { + pub votes: ::std::vec::Vec<::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 RemoveVoter; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SubmitCandidacy { + #[codec(compact)] + pub candidate_count: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RenounceCandidacy { + pub renouncing: runtime_types::pallet_elections_phragmen::Renouncing, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RemoveMember { + pub who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + pub has_replacement: ::core::primitive::bool, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CleanDefunctVoters { + pub num_voters: ::core::primitive::u32, + pub num_defunct: ::core::primitive::u32, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Vote for a set of candidates for the upcoming round of election. This can be called to"] + #[doc = "set the initial votes, or update already existing votes."] + #[doc = ""] + #[doc = "Upon initial voting, `value` units of `who`'s balance is locked and a deposit amount is"] + #[doc = "reserved. The deposit is based on the number of votes and can be updated over time."] + #[doc = ""] + #[doc = "The `votes` should:"] + #[doc = " - not be empty."] + #[doc = " - be less than the number of possible candidates. Note that all current members and"] + #[doc = " runners-up are also automatically candidates for the next round."] + #[doc = ""] + #[doc = "If `value` is more than `who`'s total balance, then the maximum of the two is used."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed."] + #[doc = ""] + #[doc = "### Warning"] + #[doc = ""] + #[doc = "It is the responsibility of the caller to **NOT** place all of their balance into the"] + #[doc = "lock and keep some for further operations."] + #[doc = ""] + #[doc = "# "] + #[doc = "We assume the maximum weight among all 3 cases: vote_equal, vote_more and vote_less."] + #[doc = "# "] + pub fn vote( + &self, + votes: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + value: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new("Elections", "vote", Vote { votes, value }, [ + 71u8, 90u8, 175u8, 225u8, 51u8, 202u8, 197u8, 252u8, 183u8, 92u8, 239u8, + 83u8, 112u8, 144u8, 128u8, 211u8, 109u8, 33u8, 252u8, 6u8, 156u8, 15u8, + 91u8, 88u8, 70u8, 19u8, 32u8, 29u8, 224u8, 255u8, 26u8, 145u8, + ]) + } + + #[doc = "Remove `origin` as a voter."] + #[doc = ""] + #[doc = "This removes the lock and returns the deposit."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed and be a voter."] + pub fn remove_voter(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Elections", + "remove_voter", + RemoveVoter {}, + [ + 254u8, 46u8, 140u8, 4u8, 218u8, 45u8, 150u8, 72u8, 67u8, 131u8, 108u8, + 201u8, 46u8, 157u8, 104u8, 161u8, 53u8, 155u8, 130u8, 50u8, 88u8, + 149u8, 255u8, 12u8, 17u8, 85u8, 95u8, 69u8, 153u8, 130u8, 221u8, 1u8, + ], + ) + } + + #[doc = "Submit oneself for candidacy. A fixed amount of deposit is recorded."] + #[doc = ""] + #[doc = "All candidates are wiped at the end of the term. They either become a member/runner-up,"] + #[doc = "or leave the system while their deposit is slashed."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed."] + #[doc = ""] + #[doc = "### Warning"] + #[doc = ""] + #[doc = "Even if a candidate ends up being a member, they must call [`Call::renounce_candidacy`]"] + #[doc = "to get their deposit back. Losing the spot in an election will always lead to a slash."] + #[doc = ""] + #[doc = "# "] + #[doc = "The number of current candidates must be provided as witness data."] + #[doc = "# "] + pub fn submit_candidacy( + &self, + candidate_count: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Elections", + "submit_candidacy", + SubmitCandidacy { candidate_count }, + [ + 228u8, 63u8, 217u8, 99u8, 128u8, 104u8, 175u8, 10u8, 30u8, 35u8, 47u8, + 14u8, 254u8, 122u8, 146u8, 239u8, 61u8, 145u8, 82u8, 7u8, 181u8, 98u8, + 238u8, 208u8, 23u8, 84u8, 48u8, 255u8, 177u8, 255u8, 84u8, 83u8, + ], + ) + } + + #[doc = "Renounce one's intention to be a candidate for the next election round. 3 potential"] + #[doc = "outcomes exist:"] + #[doc = ""] + #[doc = "- `origin` is a candidate and not elected in any set. In this case, the deposit is"] + #[doc = " unreserved, returned and origin is removed as a candidate."] + #[doc = "- `origin` is a current runner-up. In this case, the deposit is unreserved, returned and"] + #[doc = " origin is removed as a runner-up."] + #[doc = "- `origin` is a current member. In this case, the deposit is unreserved and origin is"] + #[doc = " removed as a member, consequently not being a candidate for the next round anymore."] + #[doc = " Similar to [`remove_member`](Self::remove_member), if replacement runners exists, they"] + #[doc = " are immediately used. If the prime is renouncing, then no prime will exist until the"] + #[doc = " next round."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed, and have one of the above roles."] + #[doc = ""] + #[doc = "# "] + #[doc = "The type of renouncing must be provided as witness data."] + #[doc = "# "] + pub fn renounce_candidacy( + &self, + renouncing: runtime_types::pallet_elections_phragmen::Renouncing, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Elections", + "renounce_candidacy", + RenounceCandidacy { renouncing }, + [ + 70u8, 72u8, 208u8, 36u8, 80u8, 245u8, 224u8, 75u8, 60u8, 142u8, 19u8, + 49u8, 142u8, 90u8, 14u8, 69u8, 15u8, 61u8, 170u8, 235u8, 16u8, 252u8, + 86u8, 200u8, 120u8, 127u8, 36u8, 42u8, 143u8, 130u8, 217u8, 128u8, + ], + ) + } + + #[doc = "Remove a particular member from the set. This is effective immediately and the bond of"] + #[doc = "the outgoing member is slashed."] + #[doc = ""] + #[doc = "If a runner-up is available, then the best runner-up will be removed and replaces the"] + #[doc = "outgoing member. Otherwise, a new phragmen election is started."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be root."] + #[doc = ""] + #[doc = "Note that this does not affect the designated block number of the next election."] + #[doc = ""] + #[doc = "# "] + #[doc = "If we have a replacement, we use a small weight. Else, since this is a root call and"] + #[doc = "will go into phragmen, we assume full block for now."] + #[doc = "# "] + pub fn remove_member( + &self, + who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + has_replacement: ::core::primitive::bool, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Elections", + "remove_member", + RemoveMember { + who, + has_replacement, + }, + [ + 74u8, 200u8, 25u8, 213u8, 209u8, 62u8, 229u8, 203u8, 33u8, 108u8, + 202u8, 134u8, 168u8, 49u8, 135u8, 227u8, 193u8, 201u8, 238u8, 11u8, + 197u8, 213u8, 58u8, 168u8, 204u8, 125u8, 36u8, 196u8, 34u8, 12u8, 1u8, + 148u8, + ], + ) + } + + #[doc = "Clean all voters who are defunct (i.e. they do not serve any purpose at all). The"] + #[doc = "deposit of the removed voters are returned."] + #[doc = ""] + #[doc = "This is an root function to be used only for cleaning the state."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be root."] + #[doc = ""] + #[doc = "# "] + #[doc = "The total number of voters and those that are defunct must be provided as witness data."] + #[doc = "# "] + pub fn clean_defunct_voters( + &self, + num_voters: ::core::primitive::u32, + num_defunct: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Elections", + "clean_defunct_voters", + CleanDefunctVoters { + num_voters, + num_defunct, + }, + [ + 198u8, 162u8, 30u8, 249u8, 191u8, 38u8, 141u8, 123u8, 230u8, 90u8, + 213u8, 103u8, 168u8, 28u8, 5u8, 215u8, 213u8, 152u8, 46u8, 189u8, + 238u8, 209u8, 209u8, 142u8, 159u8, 222u8, 161u8, 26u8, 161u8, 250u8, + 9u8, 100u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_elections_phragmen::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 term with new_members. This indicates that enough candidates existed to run"] + #[doc = "the election, not that enough have has been elected. The inner value must be examined"] + #[doc = "for this purpose. A `NewTerm(\\[\\])` indicates that some candidates got their bond"] + #[doc = "slashed and none were elected, whilst `EmptyTerm` means that no candidates existed to"] + #[doc = "begin with."] + pub struct NewTerm { + pub new_members: ::std::vec::Vec<( + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + } + impl ::subxt::events::StaticEvent for NewTerm { + const EVENT: &'static str = "NewTerm"; + const PALLET: &'static str = "Elections"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "No (or not enough) candidates existed for this round. This is different from"] + #[doc = "`NewTerm(\\[\\])`. See the description of `NewTerm`."] + pub struct EmptyTerm; + impl ::subxt::events::StaticEvent for EmptyTerm { + const EVENT: &'static str = "EmptyTerm"; + const PALLET: &'static str = "Elections"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Internal error happened while trying to perform election."] + pub struct ElectionError; + impl ::subxt::events::StaticEvent for ElectionError { + const EVENT: &'static str = "ElectionError"; + const PALLET: &'static str = "Elections"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A member has been removed. This should always be followed by either `NewTerm` or"] + #[doc = "`EmptyTerm`."] + pub struct MemberKicked { + pub member: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for MemberKicked { + const EVENT: &'static str = "MemberKicked"; + const PALLET: &'static str = "Elections"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Someone has renounced their candidacy."] + pub struct Renounced { + pub candidate: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for Renounced { + const EVENT: &'static str = "Renounced"; + const PALLET: &'static str = "Elections"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A candidate was slashed by amount due to failing to obtain a seat as member or"] + #[doc = "runner-up."] + #[doc = ""] + #[doc = "Note that old members and runners-up are also candidates."] + pub struct CandidateSlashed { + pub candidate: ::subxt::ext::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for CandidateSlashed { + const EVENT: &'static str = "CandidateSlashed"; + const PALLET: &'static str = "Elections"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A seat holder was slashed by amount by being forcefully removed from the set."] + pub struct SeatHolderSlashed { + pub seat_holder: ::subxt::ext::sp_core::crypto::AccountId32, + pub amount: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for SeatHolderSlashed { + const EVENT: &'static str = "SeatHolderSlashed"; + const PALLET: &'static str = "Elections"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The current elected members."] + #[doc = ""] + #[doc = " Invariant: Always sorted based on account id."] + pub fn members( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec< + runtime_types::pallet_elections_phragmen::SeatHolder< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "Members", + vec![], + [ + 2u8, 182u8, 43u8, 180u8, 87u8, 185u8, 26u8, 79u8, 196u8, 55u8, 28u8, + 26u8, 174u8, 133u8, 158u8, 221u8, 101u8, 161u8, 83u8, 9u8, 221u8, + 175u8, 221u8, 220u8, 81u8, 80u8, 1u8, 236u8, 74u8, 121u8, 10u8, 82u8, + ], + ) + } + + #[doc = " The current reserved runners-up."] + #[doc = ""] + #[doc = " Invariant: Always sorted based on rank (worse to best). Upon removal of a member, the"] + #[doc = " last (i.e. _best_) runner-up will be replaced."] + pub fn runners_up( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec< + runtime_types::pallet_elections_phragmen::SeatHolder< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "RunnersUp", + vec![], + [ + 248u8, 81u8, 190u8, 53u8, 121u8, 49u8, 55u8, 69u8, 116u8, 177u8, 46u8, + 30u8, 131u8, 14u8, 32u8, 198u8, 10u8, 132u8, 73u8, 117u8, 2u8, 146u8, + 188u8, 146u8, 214u8, 227u8, 97u8, 77u8, 7u8, 131u8, 208u8, 209u8, + ], + ) + } + + #[doc = " The present candidate list. A current member or runner-up can never enter this vector"] + #[doc = " and is always implicitly assumed to be a candidate."] + #[doc = ""] + #[doc = " Second element is the deposit."] + #[doc = ""] + #[doc = " Invariant: Always sorted based on account id."] + pub fn candidates( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<( + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "Candidates", + vec![], + [ + 224u8, 107u8, 141u8, 11u8, 54u8, 86u8, 117u8, 45u8, 195u8, 252u8, + 152u8, 21u8, 165u8, 23u8, 198u8, 117u8, 5u8, 216u8, 183u8, 163u8, + 243u8, 56u8, 11u8, 102u8, 85u8, 107u8, 219u8, 250u8, 45u8, 80u8, 108u8, + 127u8, + ], + ) + } + + #[doc = " The total number of vote rounds that have happened, excluding the upcoming one."] + pub fn election_rounds( + &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", + "ElectionRounds", + vec![], + [ + 144u8, 146u8, 10u8, 32u8, 149u8, 147u8, 59u8, 205u8, 61u8, 246u8, 28u8, + 169u8, 130u8, 136u8, 143u8, 104u8, 253u8, 86u8, 228u8, 68u8, 19u8, + 184u8, 166u8, 214u8, 58u8, 103u8, 176u8, 160u8, 240u8, 249u8, 117u8, + 115u8, + ], + ) + } + + #[doc = " Votes and locked stake of a particular voter."] + #[doc = ""] + #[doc = " TWOX-NOTE: SAFE as `AccountId` is a crypto hash."] + pub fn voting( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_elections_phragmen::Voter< + ::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( + "Elections", + "Voting", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 9u8, 135u8, 76u8, 194u8, 240u8, 182u8, 111u8, 207u8, 102u8, 37u8, + 126u8, 36u8, 84u8, 112u8, 26u8, 216u8, 175u8, 5u8, 14u8, 189u8, 83u8, + 185u8, 136u8, 39u8, 171u8, 221u8, 147u8, 20u8, 168u8, 126u8, 111u8, + 137u8, + ], + ) + } + + #[doc = " Votes and locked stake of a particular voter."] + #[doc = ""] + #[doc = " TWOX-NOTE: SAFE as `AccountId` is a crypto hash."] + pub fn voting_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_elections_phragmen::Voter< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Elections", + "Voting", + Vec::new(), + [ + 9u8, 135u8, 76u8, 194u8, 240u8, 182u8, 111u8, 207u8, 102u8, 37u8, + 126u8, 36u8, 84u8, 112u8, 26u8, 216u8, 175u8, 5u8, 14u8, 189u8, 83u8, + 185u8, 136u8, 39u8, 171u8, 221u8, 147u8, 20u8, 168u8, 126u8, 111u8, + 137u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Identifier for the elections-phragmen pallet's lock"] + pub fn pallet_id( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<[::core::primitive::u8; 8usize]>, + > { + ::subxt::constants::StaticConstantAddress::new("Elections", "PalletId", [ + 224u8, 197u8, 247u8, 125u8, 62u8, 180u8, 69u8, 91u8, 226u8, 36u8, 82u8, + 148u8, 70u8, 147u8, 209u8, 40u8, 210u8, 229u8, 181u8, 191u8, 170u8, 205u8, + 138u8, 97u8, 127u8, 59u8, 124u8, 244u8, 252u8, 30u8, 213u8, 179u8, + ]) + } + + #[doc = " How much should be locked up in order to submit one's candidacy."] + pub fn candidacy_bond( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new("Elections", "CandidacyBond", [ + 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 = " Base deposit associated with voting."] + #[doc = ""] + #[doc = " This should be sensibly high to economically ensure the pallet cannot be attacked by"] + #[doc = " creating a gigantic number of votes."] + pub fn voting_bond_base( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new("Elections", "VotingBondBase", [ + 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 bond that need to be locked for each vote (32 bytes)."] + pub fn voting_bond_factor( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Elections", + "VotingBondFactor", + [ + 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 = " Number of members to elect."] + pub fn desired_members( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new("Elections", "DesiredMembers", [ + 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 runners_up to keep."] + pub fn desired_runners_up( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Elections", + "DesiredRunnersUp", + [ + 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 = " How long each seat is kept. This defines the next block number at which an election"] + #[doc = " round will happen. If set to zero, no elections are ever triggered and the module will"] + #[doc = " be in passive mode."] + pub fn term_duration( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new("Elections", "TermDuration", [ + 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 technical_membership { + 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 AddMember { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RemoveMember { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SwapMember { + pub remove: ::subxt::ext::sp_core::crypto::AccountId32, + pub add: ::subxt::ext::sp_core::crypto::AccountId32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ResetMembers { + pub members: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ChangeKey { + pub new: ::subxt::ext::sp_core::crypto::AccountId32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SetPrime { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ClearPrime; + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Add a member `who` to the set."] + #[doc = ""] + #[doc = "May only be called from `T::AddOrigin`."] + pub fn add_member( + &self, + who: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalMembership", + "add_member", + AddMember { who }, + [ + 106u8, 33u8, 171u8, 114u8, 223u8, 105u8, 71u8, 15u8, 77u8, 253u8, 40u8, + 204u8, 244u8, 142u8, 103u8, 177u8, 200u8, 243u8, 114u8, 241u8, 36u8, + 135u8, 175u8, 255u8, 124u8, 193u8, 30u8, 46u8, 186u8, 172u8, 176u8, + 98u8, + ], + ) + } + + #[doc = "Remove a member `who` from the set."] + #[doc = ""] + #[doc = "May only be called from `T::RemoveOrigin`."] + pub fn remove_member( + &self, + who: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalMembership", + "remove_member", + RemoveMember { who }, + [ + 100u8, 17u8, 75u8, 92u8, 58u8, 100u8, 34u8, 187u8, 41u8, 160u8, 137u8, + 58u8, 78u8, 166u8, 161u8, 116u8, 1u8, 67u8, 201u8, 144u8, 103u8, 84u8, + 55u8, 246u8, 133u8, 180u8, 148u8, 86u8, 175u8, 175u8, 70u8, 73u8, + ], + ) + } + + #[doc = "Swap out one member `remove` for another `add`."] + #[doc = ""] + #[doc = "May only be called from `T::SwapOrigin`."] + #[doc = ""] + #[doc = "Prime membership is *not* passed from `remove` to `add`, if extant."] + pub fn swap_member( + &self, + remove: ::subxt::ext::sp_core::crypto::AccountId32, + add: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalMembership", + "swap_member", + SwapMember { remove, add }, + [ + 66u8, 84u8, 183u8, 29u8, 104u8, 163u8, 220u8, 217u8, 103u8, 234u8, + 233u8, 138u8, 191u8, 147u8, 51u8, 98u8, 46u8, 51u8, 179u8, 200u8, 23u8, + 59u8, 112u8, 53u8, 8u8, 75u8, 135u8, 232u8, 116u8, 201u8, 60u8, 249u8, + ], + ) + } + + #[doc = "Change the membership to a new set, disregarding the existing membership. Be nice and"] + #[doc = "pass `members` pre-sorted."] + #[doc = ""] + #[doc = "May only be called from `T::ResetOrigin`."] + pub fn reset_members( + &self, + members: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalMembership", + "reset_members", + ResetMembers { members }, + [ + 9u8, 35u8, 28u8, 59u8, 158u8, 232u8, 89u8, 78u8, 101u8, 53u8, 240u8, + 98u8, 13u8, 104u8, 235u8, 161u8, 201u8, 150u8, 117u8, 32u8, 75u8, + 209u8, 166u8, 252u8, 57u8, 131u8, 96u8, 215u8, 51u8, 81u8, 42u8, 123u8, + ], + ) + } + + #[doc = "Swap out the sending member for some other key `new`."] + #[doc = ""] + #[doc = "May only be called from `Signed` origin of a current member."] + #[doc = ""] + #[doc = "Prime membership is passed from the origin account to `new`, if extant."] + pub fn change_key( + &self, + new: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalMembership", + "change_key", + ChangeKey { new }, + [ + 53u8, 60u8, 54u8, 231u8, 151u8, 0u8, 27u8, 175u8, 250u8, 80u8, 74u8, + 184u8, 184u8, 63u8, 90u8, 216u8, 186u8, 136u8, 74u8, 214u8, 111u8, + 186u8, 137u8, 140u8, 108u8, 194u8, 128u8, 97u8, 168u8, 184u8, 112u8, + 60u8, + ], + ) + } + + #[doc = "Set the prime member. Must be a current member."] + #[doc = ""] + #[doc = "May only be called from `T::PrimeOrigin`."] + pub fn set_prime( + &self, + who: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalMembership", + "set_prime", + SetPrime { who }, + [ + 123u8, 95u8, 75u8, 129u8, 19u8, 34u8, 192u8, 65u8, 169u8, 47u8, 184u8, + 246u8, 55u8, 250u8, 31u8, 158u8, 57u8, 197u8, 22u8, 112u8, 167u8, + 198u8, 136u8, 17u8, 15u8, 203u8, 101u8, 149u8, 15u8, 39u8, 16u8, 232u8, + ], + ) + } + + #[doc = "Remove the prime member if it exists."] + #[doc = ""] + #[doc = "May only be called from `T::PrimeOrigin`."] + pub fn clear_prime(&self) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "TechnicalMembership", + "clear_prime", + ClearPrime {}, + [ + 186u8, 182u8, 225u8, 90u8, 71u8, 124u8, 69u8, 100u8, 234u8, 25u8, 53u8, + 23u8, 182u8, 32u8, 176u8, 81u8, 54u8, 140u8, 235u8, 126u8, 247u8, 7u8, + 155u8, 62u8, 35u8, 135u8, 48u8, 61u8, 88u8, 160u8, 183u8, 72u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_membership::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The given member was added; see the transaction for who."] + pub struct MemberAdded; + impl ::subxt::events::StaticEvent for MemberAdded { + const EVENT: &'static str = "MemberAdded"; + const PALLET: &'static str = "TechnicalMembership"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The given member was removed; see the transaction for who."] + pub struct MemberRemoved; + impl ::subxt::events::StaticEvent for MemberRemoved { + const EVENT: &'static str = "MemberRemoved"; + const PALLET: &'static str = "TechnicalMembership"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Two members were swapped; see the transaction for who."] + pub struct MembersSwapped; + impl ::subxt::events::StaticEvent for MembersSwapped { + const EVENT: &'static str = "MembersSwapped"; + const PALLET: &'static str = "TechnicalMembership"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The membership was reset; see the transaction for who the new set is."] + pub struct MembersReset; + impl ::subxt::events::StaticEvent for MembersReset { + const EVENT: &'static str = "MembersReset"; + const PALLET: &'static str = "TechnicalMembership"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "One of the members' keys changed."] + pub struct KeyChanged; + impl ::subxt::events::StaticEvent for KeyChanged { + const EVENT: &'static str = "KeyChanged"; + const PALLET: &'static str = "TechnicalMembership"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Phantom member, never used."] + pub struct Dummy; + impl ::subxt::events::StaticEvent for Dummy { + const EVENT: &'static str = "Dummy"; + const PALLET: &'static str = "TechnicalMembership"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The current membership, stored as an ordered Vec."] + pub fn members( + &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( + "TechnicalMembership", + "Members", + vec![], + [ + 162u8, 72u8, 174u8, 204u8, 140u8, 105u8, 205u8, 176u8, 197u8, 117u8, + 206u8, 134u8, 157u8, 110u8, 139u8, 54u8, 43u8, 233u8, 25u8, 51u8, 36u8, + 238u8, 94u8, 124u8, 221u8, 52u8, 237u8, 71u8, 125u8, 56u8, 129u8, + 222u8, + ], + ) + } + + #[doc = " The current prime member, if one exists."] + pub fn prime( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::crypto::AccountId32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "TechnicalMembership", + "Prime", + vec![], + [ + 108u8, 118u8, 54u8, 193u8, 207u8, 227u8, 119u8, 97u8, 23u8, 239u8, + 157u8, 69u8, 56u8, 142u8, 106u8, 17u8, 215u8, 159u8, 48u8, 42u8, 185u8, + 209u8, 49u8, 159u8, 32u8, 168u8, 111u8, 158u8, 159u8, 217u8, 244u8, + 158u8, + ], + ) + } + } + } + } + pub mod grandpa { + 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 ReportEquivocation { + pub equivocation_proof: ::std::boxed::Box< + runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::ext::sp_core::H256, + ::core::primitive::u32, + >, + >, + pub key_owner_proof: runtime_types::sp_session::MembershipProof, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ReportEquivocationUnsigned { + pub equivocation_proof: ::std::boxed::Box< + runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::ext::sp_core::H256, + ::core::primitive::u32, + >, + >, + pub key_owner_proof: runtime_types::sp_session::MembershipProof, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct NoteStalled { + pub delay: ::core::primitive::u32, + pub best_finalized_block_number: ::core::primitive::u32, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Report voter equivocation/misbehavior. This method will verify the"] + #[doc = "equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence"] + #[doc = "will be reported."] + pub fn report_equivocation( + &self, + equivocation_proof: runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::ext::sp_core::H256, + ::core::primitive::u32, + >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Grandpa", + "report_equivocation", + ReportEquivocation { + equivocation_proof: ::std::boxed::Box::new(equivocation_proof), + key_owner_proof, + }, + [ + 156u8, 162u8, 189u8, 89u8, 60u8, 156u8, 129u8, 176u8, 62u8, 35u8, + 214u8, 7u8, 68u8, 245u8, 130u8, 117u8, 30u8, 3u8, 73u8, 218u8, 142u8, + 82u8, 13u8, 141u8, 124u8, 19u8, 53u8, 138u8, 70u8, 4u8, 40u8, 32u8, + ], + ) + } + + #[doc = "Report voter equivocation/misbehavior. This method will verify the"] + #[doc = "equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence"] + #[doc = "will be reported."] + #[doc = ""] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + pub fn report_equivocation_unsigned( + &self, + equivocation_proof: runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::ext::sp_core::H256, + ::core::primitive::u32, + >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Grandpa", + "report_equivocation_unsigned", + ReportEquivocationUnsigned { + equivocation_proof: ::std::boxed::Box::new(equivocation_proof), + key_owner_proof, + }, + [ + 166u8, 26u8, 217u8, 185u8, 215u8, 37u8, 174u8, 170u8, 137u8, 160u8, + 151u8, 43u8, 246u8, 86u8, 58u8, 18u8, 248u8, 73u8, 99u8, 161u8, 158u8, + 93u8, 212u8, 186u8, 224u8, 253u8, 234u8, 18u8, 151u8, 111u8, 227u8, + 249u8, + ], + ) + } + + #[doc = "Note that the current authority set of the GRANDPA finality gadget has"] + #[doc = "stalled. This will trigger a forced authority set change at the beginning"] + #[doc = "of the next session, to be enacted `delay` blocks after that. The delay"] + #[doc = "should be high enough to safely assume that the block signalling the"] + #[doc = "forced change will not be re-orged (e.g. 1000 blocks). The GRANDPA voters"] + #[doc = "will start the new authority set using the given finalized block as base."] + #[doc = "Only callable by root."] + pub fn note_stalled( + &self, + delay: ::core::primitive::u32, + best_finalized_block_number: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Grandpa", + "note_stalled", + NoteStalled { + delay, + best_finalized_block_number, + }, + [ + 197u8, 236u8, 137u8, 32u8, 46u8, 200u8, 144u8, 13u8, 89u8, 181u8, + 235u8, 73u8, 167u8, 131u8, 174u8, 93u8, 42u8, 136u8, 238u8, 59u8, + 129u8, 60u8, 83u8, 100u8, 5u8, 182u8, 99u8, 250u8, 145u8, 180u8, 1u8, + 199u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_grandpa::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "New authority set has been applied."] + pub struct NewAuthorities { + pub authority_set: ::std::vec::Vec<( + runtime_types::sp_finality_grandpa::app::Public, + ::core::primitive::u64, + )>, + } + impl ::subxt::events::StaticEvent for NewAuthorities { + const EVENT: &'static str = "NewAuthorities"; + const PALLET: &'static str = "Grandpa"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Current authority set has been paused."] + pub struct Paused; + impl ::subxt::events::StaticEvent for Paused { + const EVENT: &'static str = "Paused"; + const PALLET: &'static str = "Grandpa"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Current authority set has been resumed."] + pub struct Resumed; + impl ::subxt::events::StaticEvent for Resumed { + const EVENT: &'static str = "Resumed"; + const PALLET: &'static str = "Grandpa"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " State of the current authority set."] + pub fn state( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_grandpa::StoredState<::core::primitive::u32>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Grandpa", + "State", + vec![], + [ + 211u8, 149u8, 114u8, 217u8, 206u8, 194u8, 115u8, 67u8, 12u8, 218u8, + 246u8, 213u8, 208u8, 29u8, 216u8, 104u8, 2u8, 39u8, 123u8, 172u8, + 252u8, 210u8, 52u8, 129u8, 147u8, 237u8, 244u8, 68u8, 252u8, 169u8, + 97u8, 148u8, + ], + ) + } + + #[doc = " Pending change: (signaled at, scheduled change)."] + pub fn pending_change( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_grandpa::StoredPendingChange<::core::primitive::u32>, + >, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Grandpa", + "PendingChange", + vec![], + [ + 178u8, 24u8, 140u8, 7u8, 8u8, 196u8, 18u8, 58u8, 3u8, 226u8, 181u8, + 47u8, 155u8, 160u8, 70u8, 12u8, 75u8, 189u8, 38u8, 255u8, 104u8, 141u8, + 64u8, 34u8, 134u8, 201u8, 102u8, 21u8, 75u8, 81u8, 218u8, 60u8, + ], + ) + } + + #[doc = " next block number where we can force a change."] + pub fn next_forced( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Grandpa", + "NextForced", + vec![], + [ + 99u8, 43u8, 245u8, 201u8, 60u8, 9u8, 122u8, 99u8, 188u8, 29u8, 67u8, + 6u8, 193u8, 133u8, 179u8, 67u8, 202u8, 208u8, 62u8, 179u8, 19u8, 169u8, + 196u8, 119u8, 107u8, 75u8, 100u8, 3u8, 121u8, 18u8, 80u8, 156u8, + ], + ) + } + + #[doc = " `true` if we are currently stalled."] + pub fn stalled( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<( + ::core::primitive::u32, + ::core::primitive::u32, + )>, + ::subxt::storage::address::Yes, + (), + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Grandpa", + "Stalled", + vec![], + [ + 219u8, 8u8, 37u8, 78u8, 150u8, 55u8, 0u8, 57u8, 201u8, 170u8, 186u8, + 189u8, 56u8, 161u8, 44u8, 15u8, 53u8, 178u8, 224u8, 208u8, 231u8, + 109u8, 14u8, 209u8, 57u8, 205u8, 237u8, 153u8, 231u8, 156u8, 24u8, + 185u8, + ], + ) + } + + #[doc = " The number of changes (both in terms of keys and underlying economic responsibilities)"] + #[doc = " in the \"set\" of Grandpa validators from genesis."] + pub fn current_set_id( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Grandpa", + "CurrentSetId", + vec![], + [ + 129u8, 7u8, 62u8, 101u8, 199u8, 60u8, 56u8, 33u8, 54u8, 158u8, 20u8, + 178u8, 244u8, 145u8, 189u8, 197u8, 157u8, 163u8, 116u8, 36u8, 105u8, + 52u8, 149u8, 244u8, 108u8, 94u8, 109u8, 111u8, 244u8, 137u8, 7u8, + 108u8, + ], + ) + } + + #[doc = " A mapping from grandpa set ID to the index of the *most recent* session for which its"] + #[doc = " members were responsible."] + #[doc = ""] + #[doc = " TWOX-NOTE: `SetId` is not under user control."] + pub fn set_id_session( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u64>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Grandpa", + "SetIdSession", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 91u8, 175u8, 145u8, 127u8, 242u8, 81u8, 13u8, 231u8, 110u8, 11u8, + 166u8, 169u8, 103u8, 146u8, 123u8, 133u8, 157u8, 15u8, 33u8, 234u8, + 108u8, 13u8, 88u8, 115u8, 254u8, 9u8, 145u8, 199u8, 102u8, 47u8, 53u8, + 134u8, + ], + ) + } + + #[doc = " A mapping from grandpa set ID to the index of the *most recent* session for which its"] + #[doc = " members were responsible."] + #[doc = ""] + #[doc = " TWOX-NOTE: `SetId` is not under user control."] + pub fn set_id_session_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Grandpa", + "SetIdSession", + Vec::new(), + [ + 91u8, 175u8, 145u8, 127u8, 242u8, 81u8, 13u8, 231u8, 110u8, 11u8, + 166u8, 169u8, 103u8, 146u8, 123u8, 133u8, 157u8, 15u8, 33u8, 234u8, + 108u8, 13u8, 88u8, 115u8, 254u8, 9u8, 145u8, 199u8, 102u8, 47u8, 53u8, + 134u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Max Authorities in use"] + pub fn max_authorities( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new("Grandpa", "MaxAuthorities", [ + 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, + ::core::primitive::u32, + >, + } + #[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, + } + 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, + ::core::primitive::u32, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Treasury", + "propose_spend", + ProposeSpend { value, beneficiary }, + [ + 124u8, 32u8, 83u8, 127u8, 240u8, 169u8, 3u8, 190u8, 235u8, 163u8, 23u8, + 29u8, 88u8, 242u8, 238u8, 187u8, 136u8, 75u8, 193u8, 192u8, 239u8, 2u8, + 54u8, 238u8, 147u8, 42u8, 91u8, 14u8, 244u8, 175u8, 41u8, 14u8, + ], + ) + } + + #[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 = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-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. \\[proposal_index\\]"] + pub struct Proposed(pub ::core::primitive::u32); + impl ::subxt::events::StaticEvent for Proposed { + const EVENT: &'static str = "Proposed"; + const PALLET: &'static str = "Treasury"; + } + #[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. \\[budget_remaining\\]"] + pub struct Spending(pub ::core::primitive::u128); + impl ::subxt::events::StaticEvent for Spending { + const EVENT: &'static str = "Spending"; + const PALLET: &'static str = "Treasury"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Some funds have been allocated. \\[proposal_index, award, beneficiary\\]"] + pub struct Awarded( + pub ::core::primitive::u32, + pub ::core::primitive::u128, + pub ::subxt::ext::sp_core::crypto::AccountId32, + ); + impl ::subxt::events::StaticEvent for Awarded { + const EVENT: &'static str = "Awarded"; + const PALLET: &'static str = "Treasury"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A proposal was rejected; funds were slashed. \\[proposal_index, slashed\\]"] + pub struct Rejected(pub ::core::primitive::u32, pub ::core::primitive::u128); + impl ::subxt::events::StaticEvent for Rejected { + const EVENT: &'static str = "Rejected"; + const PALLET: &'static str = "Treasury"; + } + #[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. \\[burn\\]"] + pub struct Burnt(pub ::core::primitive::u128); + impl ::subxt::events::StaticEvent for Burnt { + const EVENT: &'static str = "Burnt"; + const PALLET: &'static str = "Treasury"; + } + #[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."] + #[doc = "\\[budget_remaining\\]"] + pub struct Rollover(pub ::core::primitive::u128); + impl ::subxt::events::StaticEvent for Rollover { + const EVENT: &'static str = "Rollover"; + const PALLET: &'static str = "Treasury"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Some funds have been deposited. \\[deposit\\]"] + pub struct Deposit(pub ::core::primitive::u128); + impl ::subxt::events::StaticEvent for Deposit { + const EVENT: &'static str = "Deposit"; + const PALLET: &'static str = "Treasury"; + } + } + 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::frame_support::storage::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 = " 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."] + 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 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, + ::core::primitive::u32, + >, + } + #[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, + ::core::primitive::u32, + >, + 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::da_runtime::Call, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Sudo", + "sudo", + Sudo { + call: ::std::boxed::Box::new(call), + }, + [ + 171u8, 68u8, 181u8, 132u8, 70u8, 14u8, 217u8, 20u8, 26u8, 65u8, 185u8, + 120u8, 82u8, 128u8, 237u8, 234u8, 208u8, 225u8, 99u8, 66u8, 165u8, + 55u8, 45u8, 250u8, 158u8, 215u8, 65u8, 143u8, 47u8, 205u8, 56u8, 136u8, + ], + ) + } + + #[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::da_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, + }, + [ + 183u8, 125u8, 101u8, 173u8, 153u8, 151u8, 94u8, 250u8, 7u8, 38u8, + 135u8, 115u8, 246u8, 255u8, 210u8, 51u8, 247u8, 170u8, 87u8, 139u8, + 138u8, 143u8, 7u8, 216u8, 120u8, 254u8, 171u8, 239u8, 119u8, 76u8, + 215u8, 251u8, + ], + ) + } + + #[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, + ::core::primitive::u32, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new("Sudo", "set_key", SetKey { new }, [ + 34u8, 116u8, 170u8, 18u8, 106u8, 17u8, 231u8, 159u8, 110u8, 246u8, 2u8, + 27u8, 161u8, 155u8, 163u8, 41u8, 138u8, 7u8, 81u8, 98u8, 230u8, 182u8, + 23u8, 222u8, 240u8, 117u8, 173u8, 232u8, 192u8, 55u8, 92u8, 208u8, + ]) + } + + #[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, + ::core::primitive::u32, + >, + call: runtime_types::da_runtime::Call, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Sudo", + "sudo_as", + SudoAs { + who, + call: ::std::boxed::Box::new(call), + }, + [ + 97u8, 169u8, 79u8, 164u8, 2u8, 113u8, 142u8, 119u8, 166u8, 223u8, 32u8, + 194u8, 181u8, 121u8, 90u8, 38u8, 102u8, 25u8, 186u8, 119u8, 254u8, + 175u8, 3u8, 26u8, 238u8, 152u8, 206u8, 10u8, 30u8, 12u8, 1u8, 70u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-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 EVENT: &'static str = "Sudid"; + const PALLET: &'static str = "Sudo"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "The \\[sudoer\\] just switched identity; the old key is supplied."] + pub struct KeyChanged { + pub new_sudoer: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for KeyChanged { + const EVENT: &'static str = "KeyChanged"; + const PALLET: &'static str = "Sudo"; + } + #[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 EVENT: &'static str = "SudoAsDone"; + const PALLET: &'static str = "Sudo"; + } + } + 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::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new("Sudo", "Key", vec![], [ + 49u8, 130u8, 254u8, 227u8, 6u8, 58u8, 236u8, 207u8, 61u8, 99u8, 56u8, + 133u8, 92u8, 32u8, 156u8, 7u8, 153u8, 47u8, 57u8, 8u8, 92u8, 108u8, 86u8, + 196u8, 135u8, 191u8, 67u8, 102u8, 187u8, 191u8, 182u8, 153u8, + ]) + } + } + } + } + pub mod im_online { + 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 Heartbeat { + pub heartbeat: runtime_types::pallet_im_online::Heartbeat<::core::primitive::u32>, + pub signature: runtime_types::pallet_im_online::sr25519::app_sr25519::Signature, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "# "] + #[doc = "- Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len) and E is"] + #[doc = " length of `heartbeat.network_state.external_address`"] + #[doc = " - `O(K)`: decoding of length `K`"] + #[doc = " - `O(E)`: decoding/encoding of length `E`"] + #[doc = "- DbReads: pallet_session `Validators`, pallet_session `CurrentIndex`, `Keys`,"] + #[doc = " `ReceivedHeartbeats`"] + #[doc = "- DbWrites: `ReceivedHeartbeats`"] + #[doc = "# "] + pub fn heartbeat( + &self, + heartbeat: runtime_types::pallet_im_online::Heartbeat<::core::primitive::u32>, + signature: runtime_types::pallet_im_online::sr25519::app_sr25519::Signature, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "ImOnline", + "heartbeat", + Heartbeat { + heartbeat, + signature, + }, + [ + 212u8, 23u8, 174u8, 246u8, 60u8, 220u8, 178u8, 137u8, 53u8, 146u8, + 165u8, 225u8, 179u8, 209u8, 233u8, 152u8, 129u8, 210u8, 126u8, 32u8, + 216u8, 22u8, 76u8, 196u8, 255u8, 128u8, 246u8, 161u8, 30u8, 186u8, + 249u8, 34u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_im_online::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 heartbeat was received from `AuthorityId`."] + pub struct HeartbeatReceived { + pub authority_id: runtime_types::pallet_im_online::sr25519::app_sr25519::Public, + } + impl ::subxt::events::StaticEvent for HeartbeatReceived { + const EVENT: &'static str = "HeartbeatReceived"; + const PALLET: &'static str = "ImOnline"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "At the end of the session, no offence was committed."] + pub struct AllGood; + impl ::subxt::events::StaticEvent for AllGood { + const EVENT: &'static str = "AllGood"; + const PALLET: &'static str = "ImOnline"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "At the end of the session, at least one validator was found to be offline."] + pub struct SomeOffline { + pub offline: ::std::vec::Vec<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + )>, + } + impl ::subxt::events::StaticEvent for SomeOffline { + const EVENT: &'static str = "SomeOffline"; + const PALLET: &'static str = "ImOnline"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The block number after which it's ok to send heartbeats in the current"] + #[doc = " session."] + #[doc = ""] + #[doc = " At the beginning of each session we set this to a value that should fall"] + #[doc = " roughly in the middle of the session duration. The idea is to first wait for"] + #[doc = " the validators to produce a block in the current session, so that the"] + #[doc = " heartbeat later on will not be necessary."] + #[doc = ""] + #[doc = " This value will only be used as a fallback if we fail to get a proper session"] + #[doc = " progress estimate from `NextSessionRotation`, as those estimates should be"] + #[doc = " more accurate then the value we calculate for `HeartbeatAfter`."] + pub fn heartbeat_after( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ImOnline", + "HeartbeatAfter", + vec![], + [ + 108u8, 100u8, 85u8, 198u8, 226u8, 122u8, 94u8, 225u8, 97u8, 154u8, + 135u8, 95u8, 106u8, 28u8, 185u8, 78u8, 192u8, 196u8, 35u8, 191u8, 12u8, + 19u8, 163u8, 46u8, 232u8, 235u8, 193u8, 81u8, 126u8, 204u8, 25u8, + 228u8, + ], + ) + } + + #[doc = " The current set of keys that may issue a heartbeat."] + pub fn keys( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< + runtime_types::pallet_im_online::sr25519::app_sr25519::Public, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ImOnline", + "Keys", + vec![], + [ + 6u8, 198u8, 221u8, 58u8, 14u8, 166u8, 245u8, 103u8, 191u8, 20u8, 69u8, + 233u8, 147u8, 245u8, 24u8, 64u8, 207u8, 180u8, 39u8, 208u8, 252u8, + 236u8, 247u8, 112u8, 187u8, 97u8, 70u8, 11u8, 248u8, 148u8, 208u8, + 106u8, + ], + ) + } + + #[doc = " For each session index, we keep a mapping of `SessionIndex` and `AuthIndex` to"] + #[doc = " `WrapperOpaque`."] + pub fn received_heartbeats( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + _1: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::traits::misc::WrapperOpaque< + runtime_types::pallet_im_online::BoundedOpaqueNetworkState, + >, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ImOnline", + "ReceivedHeartbeats", + 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, + ), + ], + [ + 233u8, 128u8, 140u8, 233u8, 55u8, 146u8, 172u8, 54u8, 54u8, 57u8, + 141u8, 106u8, 168u8, 59u8, 147u8, 253u8, 119u8, 48u8, 50u8, 251u8, + 242u8, 109u8, 251u8, 2u8, 136u8, 80u8, 146u8, 121u8, 180u8, 219u8, + 245u8, 37u8, + ], + ) + } + + #[doc = " For each session index, we keep a mapping of `SessionIndex` and `AuthIndex` to"] + #[doc = " `WrapperOpaque`."] + pub fn received_heartbeats_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::traits::misc::WrapperOpaque< + runtime_types::pallet_im_online::BoundedOpaqueNetworkState, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ImOnline", + "ReceivedHeartbeats", + Vec::new(), + [ + 233u8, 128u8, 140u8, 233u8, 55u8, 146u8, 172u8, 54u8, 54u8, 57u8, + 141u8, 106u8, 168u8, 59u8, 147u8, 253u8, 119u8, 48u8, 50u8, 251u8, + 242u8, 109u8, 251u8, 2u8, 136u8, 80u8, 146u8, 121u8, 180u8, 219u8, + 245u8, 37u8, + ], + ) + } + + #[doc = " For each session index, we keep a mapping of `ValidatorId` to the"] + #[doc = " number of blocks authored by the given authority."] + pub fn authored_blocks( + &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::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "ImOnline", + "AuthoredBlocks", + 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, + ), + ], + [ + 50u8, 4u8, 242u8, 240u8, 247u8, 184u8, 114u8, 245u8, 233u8, 170u8, + 24u8, 197u8, 18u8, 245u8, 8u8, 28u8, 33u8, 115u8, 166u8, 245u8, 221u8, + 223u8, 56u8, 144u8, 33u8, 139u8, 10u8, 227u8, 228u8, 223u8, 103u8, + 151u8, + ], + ) + } + + #[doc = " For each session index, we keep a mapping of `ValidatorId` to the"] + #[doc = " number of blocks authored by the given authority."] + pub fn authored_blocks_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( + "ImOnline", + "AuthoredBlocks", + Vec::new(), + [ + 50u8, 4u8, 242u8, 240u8, 247u8, 184u8, 114u8, 245u8, 233u8, 170u8, + 24u8, 197u8, 18u8, 245u8, 8u8, 28u8, 33u8, 115u8, 166u8, 245u8, 221u8, + 223u8, 56u8, 144u8, 33u8, 139u8, 10u8, 227u8, 228u8, 223u8, 103u8, + 151u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " A configuration for base priority of unsigned transactions."] + #[doc = ""] + #[doc = " This is exposed so that it can be tuned for particular runtime, when"] + #[doc = " multiple pallets send unsigned transactions."] + pub fn unsigned_priority( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + > { + ::subxt::constants::StaticConstantAddress::new( + "ImOnline", + "UnsignedPriority", + [ + 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 authority_discovery { + use super::{root_mod, runtime_types}; + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Keys of the current authority set."] + pub fn keys( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< + runtime_types::sp_authority_discovery::app::Public, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "AuthorityDiscovery", + "Keys", + vec![], + [ + 6u8, 198u8, 221u8, 58u8, 14u8, 166u8, 245u8, 103u8, 191u8, 20u8, 69u8, + 233u8, 147u8, 245u8, 24u8, 64u8, 207u8, 180u8, 39u8, 208u8, 252u8, + 236u8, 247u8, 112u8, 187u8, 97u8, 70u8, 11u8, 248u8, 148u8, 208u8, + 106u8, + ], + ) + } + + #[doc = " Keys of the next authority set."] + pub fn next_keys( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< + runtime_types::sp_authority_discovery::app::Public, + >, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "AuthorityDiscovery", + "NextKeys", + vec![], + [ + 213u8, 94u8, 49u8, 159u8, 135u8, 1u8, 13u8, 150u8, 28u8, 15u8, 105u8, + 130u8, 90u8, 15u8, 130u8, 138u8, 186u8, 118u8, 10u8, 238u8, 173u8, + 229u8, 8u8, 144u8, 206u8, 121u8, 90u8, 203u8, 125u8, 106u8, 145u8, + 144u8, + ], + ) + } + } + } + } + pub mod offences { + use super::{root_mod, runtime_types}; + #[doc = "Events type."] + pub type Event = runtime_types::pallet_offences::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "There is an offence reported of the given `kind` happened at the `session_index` and"] + #[doc = "(kind-specific) time slot. This event is not deposited for duplicate slashes."] + #[doc = "\\[kind, timeslot\\]."] + pub struct Offence { + pub kind: [::core::primitive::u8; 16usize], + pub timeslot: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::events::StaticEvent for Offence { + const EVENT: &'static str = "Offence"; + const PALLET: &'static str = "Offences"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " The primary structure that holds all offence records keyed by report identifiers."] + pub fn reports( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_staking::offence::OffenceDetails< + ::subxt::ext::sp_core::crypto::AccountId32, + ( + ::subxt::ext::sp_core::crypto::AccountId32, + 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( + "Offences", + "Reports", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 144u8, 30u8, 66u8, 199u8, 102u8, 236u8, 175u8, 201u8, 206u8, 170u8, + 55u8, 162u8, 137u8, 120u8, 220u8, 213u8, 57u8, 252u8, 0u8, 88u8, 210u8, + 68u8, 5u8, 25u8, 77u8, 114u8, 204u8, 23u8, 190u8, 32u8, 211u8, 30u8, + ], + ) + } + + #[doc = " The primary structure that holds all offence records keyed by report identifiers."] + pub fn reports_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_staking::offence::OffenceDetails< + ::subxt::ext::sp_core::crypto::AccountId32, + ( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + ), + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Offences", + "Reports", + Vec::new(), + [ + 144u8, 30u8, 66u8, 199u8, 102u8, 236u8, 175u8, 201u8, 206u8, 170u8, + 55u8, 162u8, 137u8, 120u8, 220u8, 213u8, 57u8, 252u8, 0u8, 88u8, 210u8, + 68u8, 5u8, 25u8, 77u8, 114u8, 204u8, 23u8, 190u8, 32u8, 211u8, 30u8, + ], + ) + } + + #[doc = " A vector of reports of the same kind that happened at the same time slot."] + pub fn concurrent_reports_index( + &self, + _0: impl ::std::borrow::Borrow<[::core::primitive::u8; 16usize]>, + _1: impl ::std::borrow::Borrow<[::core::primitive::u8]>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::subxt::ext::sp_core::H256>, + >, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Offences", + "ConcurrentReportsIndex", + 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, + ), + ], + [ + 106u8, 21u8, 104u8, 5u8, 4u8, 66u8, 28u8, 70u8, 161u8, 195u8, 238u8, + 28u8, 69u8, 241u8, 221u8, 113u8, 140u8, 103u8, 181u8, 143u8, 60u8, + 177u8, 13u8, 129u8, 224u8, 149u8, 77u8, 32u8, 75u8, 74u8, 101u8, 65u8, + ], + ) + } + + #[doc = " A vector of reports of the same kind that happened at the same time slot."] + pub fn concurrent_reports_index_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + ::std::vec::Vec<::subxt::ext::sp_core::H256>, + >, + (), + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Offences", + "ConcurrentReportsIndex", + Vec::new(), + [ + 106u8, 21u8, 104u8, 5u8, 4u8, 66u8, 28u8, 70u8, 161u8, 195u8, 238u8, + 28u8, 69u8, 241u8, 221u8, 113u8, 140u8, 103u8, 181u8, 143u8, 60u8, + 177u8, 13u8, 129u8, 224u8, 149u8, 77u8, 32u8, 75u8, 74u8, 101u8, 65u8, + ], + ) + } + + #[doc = " Enumerates all reports of a kind along with the time they happened."] + #[doc = ""] + #[doc = " All reports are sorted by the time of offence."] + #[doc = ""] + #[doc = " Note that the actual type of this mapping is `Vec`, this is because values of"] + #[doc = " different types are not supported at the moment so we are doing the manual serialization."] + pub fn reports_by_kind_index( + &self, + _0: impl ::std::borrow::Borrow<[::core::primitive::u8; 16usize]>, + ) -> ::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( + "Offences", + "ReportsByKindIndex", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 162u8, 66u8, 131u8, 48u8, 250u8, 237u8, 179u8, 214u8, 36u8, 137u8, + 226u8, 136u8, 120u8, 61u8, 215u8, 43u8, 164u8, 50u8, 91u8, 164u8, 20u8, + 96u8, 189u8, 100u8, 242u8, 106u8, 21u8, 136u8, 98u8, 215u8, 180u8, + 145u8, + ], + ) + } + + #[doc = " Enumerates all reports of a kind along with the time they happened."] + #[doc = ""] + #[doc = " All reports are sorted by the time of offence."] + #[doc = ""] + #[doc = " Note that the actual type of this mapping is `Vec`, this is because values of"] + #[doc = " different types are not supported at the moment so we are doing the manual serialization."] + pub fn reports_by_kind_index_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( + "Offences", + "ReportsByKindIndex", + Vec::new(), + [ + 162u8, 66u8, 131u8, 48u8, 250u8, 237u8, 179u8, 214u8, 36u8, 137u8, + 226u8, 136u8, 120u8, 61u8, 215u8, 43u8, 164u8, 50u8, 91u8, 164u8, 20u8, + 96u8, 189u8, 100u8, 242u8, 106u8, 21u8, 136u8, 98u8, 215u8, 180u8, + 145u8, + ], + ) + } + } + } + } + pub mod historical { + 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( + "Historical", + "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( + "Historical", + "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( + "Historical", + "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 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, + } + #[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, + } + #[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, + } + #[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, + } + 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::da_runtime::Call, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Scheduler", + "schedule", + Schedule { + when, + maybe_periodic, + priority, + call: ::std::boxed::Box::new(call), + }, + [ + 113u8, 150u8, 229u8, 7u8, 128u8, 203u8, 213u8, 88u8, 164u8, 19u8, 51u8, + 11u8, 97u8, 181u8, 165u8, 251u8, 232u8, 32u8, 15u8, 28u8, 220u8, 126u8, + 28u8, 49u8, 146u8, 89u8, 63u8, 79u8, 86u8, 101u8, 49u8, 218u8, + ], + ) + } + + #[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::da_runtime::Call, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Scheduler", + "schedule_named", + ScheduleNamed { + id, + when, + maybe_periodic, + priority, + call: ::std::boxed::Box::new(call), + }, + [ + 63u8, 175u8, 81u8, 116u8, 29u8, 49u8, 99u8, 92u8, 85u8, 2u8, 157u8, + 178u8, 17u8, 161u8, 208u8, 9u8, 55u8, 241u8, 234u8, 31u8, 15u8, 188u8, + 103u8, 57u8, 172u8, 212u8, 200u8, 220u8, 82u8, 132u8, 177u8, 88u8, + ], + ) + } + + #[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::da_runtime::Call, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Scheduler", + "schedule_after", + ScheduleAfter { + after, + maybe_periodic, + priority, + call: ::std::boxed::Box::new(call), + }, + [ + 169u8, 95u8, 7u8, 84u8, 167u8, 126u8, 80u8, 87u8, 150u8, 12u8, 48u8, + 204u8, 132u8, 40u8, 106u8, 225u8, 130u8, 53u8, 191u8, 230u8, 1u8, + 244u8, 240u8, 159u8, 117u8, 6u8, 101u8, 110u8, 93u8, 62u8, 105u8, 16u8, + ], + ) + } + + #[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::da_runtime::Call, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Scheduler", + "schedule_named_after", + ScheduleNamedAfter { + id, + after, + maybe_periodic, + priority, + call: ::std::boxed::Box::new(call), + }, + [ + 148u8, 77u8, 1u8, 187u8, 47u8, 64u8, 166u8, 15u8, 199u8, 133u8, 64u8, + 1u8, 187u8, 63u8, 242u8, 251u8, 4u8, 169u8, 100u8, 169u8, 230u8, 114u8, + 225u8, 200u8, 3u8, 164u8, 28u8, 99u8, 123u8, 246u8, 236u8, 197u8, + ], + ) + } + } + } + #[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. \\[when, index\\]"] + pub struct Scheduled(pub ::core::primitive::u32, pub ::core::primitive::u32); + impl ::subxt::events::StaticEvent for Scheduled { + const EVENT: &'static str = "Scheduled"; + const PALLET: &'static str = "Scheduler"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Canceled some task. \\[when, index\\]"] + pub struct Canceled(pub ::core::primitive::u32, pub ::core::primitive::u32); + impl ::subxt::events::StaticEvent for Canceled { + const EVENT: &'static str = "Canceled"; + const PALLET: &'static str = "Scheduler"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Dispatched some task. \\[task, id, result\\]"] + pub struct Dispatched( + pub (::core::primitive::u32, ::core::primitive::u32), + pub ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + pub ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + ); + impl ::subxt::events::StaticEvent for Dispatched { + const EVENT: &'static str = "Dispatched"; + const PALLET: &'static str = "Scheduler"; + } + } + 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::ScheduledV2< + runtime_types::da_runtime::Call, + ::core::primitive::u32, + runtime_types::da_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, + )], + [ + 58u8, 200u8, 120u8, 255u8, 24u8, 226u8, 20u8, 181u8, 8u8, 227u8, 145u8, + 86u8, 232u8, 8u8, 208u8, 205u8, 170u8, 131u8, 237u8, 238u8, 168u8, + 163u8, 69u8, 174u8, 215u8, 22u8, 9u8, 123u8, 59u8, 120u8, 99u8, 33u8, + ], + ) + } + + #[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::ScheduledV2< + runtime_types::da_runtime::Call, + ::core::primitive::u32, + runtime_types::da_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(), + [ + 58u8, 200u8, 120u8, 255u8, 24u8, 226u8, 20u8, 181u8, 8u8, 227u8, 145u8, + 86u8, 232u8, 8u8, 208u8, 205u8, 170u8, 131u8, 237u8, 238u8, 168u8, + 163u8, 69u8, 174u8, 215u8, 22u8, 9u8, 123u8, 59u8, 120u8, 99u8, 33u8, + ], + ) + } + + #[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, + ], + ) + } + + #[doc = " Storage version of the pallet."] + #[doc = ""] + #[doc = " New networks start with last version."] + 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( + "Scheduler", + "StorageVersion", + vec![], + [ + 181u8, 185u8, 153u8, 214u8, 175u8, 17u8, 111u8, 241u8, 124u8, 242u8, + 171u8, 99u8, 193u8, 23u8, 251u8, 248u8, 150u8, 241u8, 249u8, 142u8, + 234u8, 209u8, 246u8, 39u8, 232u8, 192u8, 44u8, 121u8, 63u8, 14u8, + 245u8, 110u8, + ], + ) + } + } + } + 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 bounties { + 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 ProposeBounty { + #[codec(compact)] + pub value: ::core::primitive::u128, + pub description: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ApproveBounty { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ProposeCurator { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + pub curator: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + ::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 UnassignCurator { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct AcceptCurator { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct AwardBounty { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + pub beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ClaimBounty { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CloseBounty { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ExtendBountyExpiry { + #[codec(compact)] + pub bounty_id: ::core::primitive::u32, + pub remark: ::std::vec::Vec<::core::primitive::u8>, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Propose a new bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Payment: `TipReportDepositBase` will be reserved from the origin account, as well as"] + #[doc = "`DataDepositPerByte` for each byte in `reason`. It will be unreserved upon approval,"] + #[doc = "or slashed when rejected."] + #[doc = ""] + #[doc = "- `curator`: The curator account whom will manage this bounty."] + #[doc = "- `fee`: The curator fee."] + #[doc = "- `value`: The total payment amount of this bounty, curator fee included."] + #[doc = "- `description`: The description of this bounty."] + pub fn propose_bounty( + &self, + value: ::core::primitive::u128, + description: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "propose_bounty", + ProposeBounty { value, description }, + [ + 99u8, 160u8, 94u8, 74u8, 105u8, 161u8, 123u8, 239u8, 241u8, 117u8, + 97u8, 99u8, 84u8, 101u8, 87u8, 3u8, 88u8, 175u8, 75u8, 59u8, 114u8, + 87u8, 18u8, 113u8, 126u8, 26u8, 42u8, 104u8, 201u8, 128u8, 102u8, + 219u8, + ], + ) + } + + #[doc = "Approve a bounty proposal. At a later time, the bounty will be funded and become active"] + #[doc = "and the original deposit will be returned."] + #[doc = ""] + #[doc = "May only be called from `T::ApproveOrigin`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn approve_bounty( + &self, + bounty_id: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "approve_bounty", + ApproveBounty { bounty_id }, + [ + 82u8, 228u8, 232u8, 103u8, 198u8, 173u8, 190u8, 148u8, 159u8, 86u8, + 48u8, 4u8, 32u8, 169u8, 1u8, 129u8, 96u8, 145u8, 235u8, 68u8, 48u8, + 34u8, 5u8, 1u8, 76u8, 26u8, 100u8, 228u8, 92u8, 198u8, 183u8, 173u8, + ], + ) + } + + #[doc = "Assign a curator to a funded bounty."] + #[doc = ""] + #[doc = "May only be called from `T::ApproveOrigin`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn propose_curator( + &self, + bounty_id: ::core::primitive::u32, + curator: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + fee: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "propose_curator", + ProposeCurator { + bounty_id, + curator, + fee, + }, + [ + 85u8, 186u8, 206u8, 137u8, 98u8, 87u8, 202u8, 71u8, 89u8, 241u8, 56u8, + 212u8, 89u8, 215u8, 65u8, 97u8, 202u8, 139u8, 78u8, 66u8, 92u8, 177u8, + 163u8, 111u8, 212u8, 244u8, 41u8, 153u8, 104u8, 129u8, 112u8, 237u8, + ], + ) + } + + #[doc = "Unassign curator from a bounty."] + #[doc = ""] + #[doc = "This function can only be called by the `RejectOrigin` a signed origin."] + #[doc = ""] + #[doc = "If this function is called by the `RejectOrigin`, we assume that the curator is"] + #[doc = "malicious or inactive. As a result, we will slash the curator when possible."] + #[doc = ""] + #[doc = "If the origin is the curator, we take this as a sign they are unable to do their job and"] + #[doc = "they willingly give up. We could slash them, but for now we allow them to recover their"] + #[doc = "deposit and exit without issue. (We may want to change this if it is abused.)"] + #[doc = ""] + #[doc = "Finally, the origin can be anyone if and only if the curator is \"inactive\". This allows"] + #[doc = "anyone in the community to call out that a curator is not doing their due diligence, and"] + #[doc = "we should pick a new curator. In this case the curator should also be slashed."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn unassign_curator( + &self, + bounty_id: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "unassign_curator", + UnassignCurator { bounty_id }, + [ + 218u8, 241u8, 247u8, 89u8, 95u8, 120u8, 93u8, 18u8, 85u8, 114u8, 158u8, + 254u8, 68u8, 77u8, 230u8, 186u8, 230u8, 201u8, 63u8, 223u8, 28u8, + 173u8, 244u8, 82u8, 113u8, 177u8, 99u8, 27u8, 207u8, 247u8, 207u8, + 213u8, + ], + ) + } + + #[doc = "Accept the curator role for a bounty."] + #[doc = "A deposit will be reserved from curator and refund upon successful payout."] + #[doc = ""] + #[doc = "May only be called from the curator."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn accept_curator( + &self, + bounty_id: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "accept_curator", + AcceptCurator { bounty_id }, + [ + 106u8, 96u8, 22u8, 67u8, 52u8, 109u8, 180u8, 225u8, 122u8, 253u8, + 209u8, 214u8, 132u8, 131u8, 247u8, 131u8, 162u8, 51u8, 144u8, 30u8, + 12u8, 126u8, 50u8, 152u8, 229u8, 119u8, 54u8, 116u8, 112u8, 235u8, + 34u8, 166u8, + ], + ) + } + + #[doc = "Award bounty to a beneficiary account. The beneficiary will be able to claim the funds"] + #[doc = "after a delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to award."] + #[doc = "- `beneficiary`: The beneficiary account whom will receive the payout."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn award_bounty( + &self, + bounty_id: ::core::primitive::u32, + beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "award_bounty", + AwardBounty { + bounty_id, + beneficiary, + }, + [ + 7u8, 205u8, 73u8, 45u8, 57u8, 8u8, 24u8, 135u8, 89u8, 157u8, 35u8, + 176u8, 224u8, 106u8, 167u8, 232u8, 230u8, 153u8, 239u8, 45u8, 210u8, + 61u8, 17u8, 106u8, 220u8, 131u8, 105u8, 136u8, 232u8, 194u8, 243u8, + 48u8, + ], + ) + } + + #[doc = "Claim the payout from an awarded bounty after payout delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the beneficiary of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to claim."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn claim_bounty( + &self, + bounty_id: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "claim_bounty", + ClaimBounty { bounty_id }, + [ + 102u8, 95u8, 8u8, 89u8, 4u8, 126u8, 189u8, 28u8, 241u8, 16u8, 125u8, + 218u8, 42u8, 92u8, 177u8, 91u8, 8u8, 235u8, 33u8, 48u8, 64u8, 115u8, + 177u8, 95u8, 242u8, 97u8, 181u8, 50u8, 68u8, 37u8, 59u8, 85u8, + ], + ) + } + + #[doc = "Cancel a proposed or active bounty. All the funds will be sent to treasury and"] + #[doc = "the curator deposit will be unreserved if possible."] + #[doc = ""] + #[doc = "Only `T::RejectOrigin` is able to cancel a bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to cancel."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn close_bounty( + &self, + bounty_id: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "close_bounty", + CloseBounty { bounty_id }, + [ + 64u8, 113u8, 151u8, 228u8, 90u8, 55u8, 251u8, 63u8, 27u8, 211u8, 119u8, + 229u8, 137u8, 137u8, 183u8, 240u8, 241u8, 146u8, 69u8, 169u8, 124u8, + 220u8, 236u8, 111u8, 98u8, 188u8, 100u8, 52u8, 127u8, 245u8, 244u8, + 92u8, + ], + ) + } + + #[doc = "Extend the expiry time of an active bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to extend."] + #[doc = "- `remark`: additional information."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + pub fn extend_bounty_expiry( + &self, + bounty_id: ::core::primitive::u32, + remark: ::std::vec::Vec<::core::primitive::u8>, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Bounties", + "extend_bounty_expiry", + ExtendBountyExpiry { bounty_id, remark }, + [ + 97u8, 69u8, 157u8, 39u8, 59u8, 72u8, 79u8, 88u8, 104u8, 119u8, 91u8, + 26u8, 73u8, 216u8, 174u8, 95u8, 254u8, 214u8, 63u8, 138u8, 100u8, + 112u8, 185u8, 81u8, 159u8, 247u8, 221u8, 60u8, 87u8, 40u8, 80u8, 202u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_bounties::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 bounty proposal."] + pub struct BountyProposed { + pub index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for BountyProposed { + const EVENT: &'static str = "BountyProposed"; + const PALLET: &'static str = "Bounties"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A bounty proposal was rejected; funds were slashed."] + pub struct BountyRejected { + pub index: ::core::primitive::u32, + pub bond: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for BountyRejected { + const EVENT: &'static str = "BountyRejected"; + const PALLET: &'static str = "Bounties"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A bounty proposal is funded and became active."] + pub struct BountyBecameActive { + pub index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for BountyBecameActive { + const EVENT: &'static str = "BountyBecameActive"; + const PALLET: &'static str = "Bounties"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A bounty is awarded to a beneficiary."] + pub struct BountyAwarded { + pub index: ::core::primitive::u32, + pub beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for BountyAwarded { + const EVENT: &'static str = "BountyAwarded"; + const PALLET: &'static str = "Bounties"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A bounty is claimed by beneficiary."] + pub struct BountyClaimed { + pub index: ::core::primitive::u32, + pub payout: ::core::primitive::u128, + pub beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for BountyClaimed { + const EVENT: &'static str = "BountyClaimed"; + const PALLET: &'static str = "Bounties"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A bounty is cancelled."] + pub struct BountyCanceled { + pub index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for BountyCanceled { + const EVENT: &'static str = "BountyCanceled"; + const PALLET: &'static str = "Bounties"; + } + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A bounty expiry is extended."] + pub struct BountyExtended { + pub index: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for BountyExtended { + const EVENT: &'static str = "BountyExtended"; + const PALLET: &'static str = "Bounties"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Number of bounty proposals that have been made."] + pub fn bounty_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( + "Bounties", + "BountyCount", + vec![], + [ + 5u8, 188u8, 134u8, 220u8, 64u8, 49u8, 188u8, 98u8, 185u8, 186u8, 230u8, + 65u8, 247u8, 199u8, 28u8, 178u8, 202u8, 193u8, 41u8, 83u8, 115u8, + 253u8, 182u8, 123u8, 92u8, 138u8, 12u8, 31u8, 31u8, 213u8, 23u8, 118u8, + ], + ) + } + + #[doc = " Bounties that have been made."] + pub fn bounties( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_bounties::Bounty< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Bounties", + "Bounties", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 111u8, 149u8, 33u8, 54u8, 172u8, 143u8, 41u8, 231u8, 184u8, 255u8, + 238u8, 206u8, 87u8, 142u8, 84u8, 10u8, 236u8, 141u8, 190u8, 193u8, + 72u8, 170u8, 19u8, 110u8, 135u8, 136u8, 220u8, 11u8, 99u8, 126u8, + 225u8, 208u8, + ], + ) + } + + #[doc = " Bounties that have been made."] + pub fn bounties_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_bounties::Bounty< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Bounties", + "Bounties", + Vec::new(), + [ + 111u8, 149u8, 33u8, 54u8, 172u8, 143u8, 41u8, 231u8, 184u8, 255u8, + 238u8, 206u8, 87u8, 142u8, 84u8, 10u8, 236u8, 141u8, 190u8, 193u8, + 72u8, 170u8, 19u8, 110u8, 135u8, 136u8, 220u8, 11u8, 99u8, 126u8, + 225u8, 208u8, + ], + ) + } + + #[doc = " The description of each bounty."] + pub fn bounty_descriptions( + &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::StaticStorageAddress::new( + "Bounties", + "BountyDescriptions", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 123u8, 119u8, 5u8, 212u8, 136u8, 112u8, 152u8, 50u8, 214u8, 158u8, + 239u8, 234u8, 41u8, 16u8, 175u8, 63u8, 0u8, 131u8, 155u8, 33u8, 161u8, + 83u8, 59u8, 132u8, 125u8, 29u8, 254u8, 25u8, 249u8, 43u8, 213u8, 118u8, + ], + ) + } + + #[doc = " The description of each bounty."] + pub fn bounty_descriptions_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::std::vec::Vec<::core::primitive::u8>>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Bounties", + "BountyDescriptions", + Vec::new(), + [ + 123u8, 119u8, 5u8, 212u8, 136u8, 112u8, 152u8, 50u8, 214u8, 158u8, + 239u8, 234u8, 41u8, 16u8, 175u8, 63u8, 0u8, 131u8, 155u8, 33u8, 161u8, + 83u8, 59u8, 132u8, 125u8, 29u8, 254u8, 25u8, 249u8, 43u8, 213u8, 118u8, + ], + ) + } + + #[doc = " Bounty indices that have been approved but not yet funded."] + pub fn bounty_approvals( + &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( + "Bounties", + "BountyApprovals", + vec![], + [ + 107u8, 39u8, 251u8, 45u8, 14u8, 33u8, 113u8, 234u8, 247u8, 75u8, 86u8, + 5u8, 215u8, 20u8, 119u8, 179u8, 221u8, 175u8, 110u8, 123u8, 240u8, + 212u8, 57u8, 238u8, 173u8, 172u8, 234u8, 88u8, 80u8, 209u8, 23u8, + 141u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The amount held on deposit for placing a bounty proposal."] + pub fn bounty_deposit_base( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Bounties", + "BountyDepositBase", + [ + 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 delay period for which a bounty beneficiary need to wait before claim the payout."] + pub fn bounty_deposit_payout_delay( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Bounties", + "BountyDepositPayoutDelay", + [ + 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 = " Bounty duration in blocks."] + pub fn bounty_update_period( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Bounties", + "BountyUpdatePeriod", + [ + 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 the curator fee that will be reserved upfront as deposit for bounty"] + #[doc = " curator."] + pub fn bounty_curator_deposit( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_arithmetic::per_things::Permill, + >, + > { + ::subxt::constants::StaticConstantAddress::new( + "Bounties", + "BountyCuratorDeposit", + [ + 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 value for a bounty."] + pub fn bounty_value_minimum( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Bounties", + "BountyValueMinimum", + [ + 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 byte within the tip report reason or bounty description."] + pub fn data_deposit_per_byte( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Bounties", + "DataDepositPerByte", + [ + 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 acceptable reason length."] + pub fn maximum_reason_length( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Bounties", + "MaximumReasonLength", + [ + 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 tips { + 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 ReportAwesome { + pub reason: ::std::vec::Vec<::core::primitive::u8>, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RetractTip { + pub hash: ::subxt::ext::sp_core::H256, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct TipNew { + pub reason: ::std::vec::Vec<::core::primitive::u8>, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + #[codec(compact)] + pub tip_value: ::core::primitive::u128, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Tip { + pub hash: ::subxt::ext::sp_core::H256, + #[codec(compact)] + pub tip_value: ::core::primitive::u128, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CloseTip { + pub hash: ::subxt::ext::sp_core::H256, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SlashTip { + pub hash: ::subxt::ext::sp_core::H256, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Report something `reason` that deserves a tip and claim any eventual the finder's fee."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Payment: `TipReportDepositBase` will be reserved from the origin account, as well as"] + #[doc = "`DataDepositPerByte` for each byte in `reason`."] + #[doc = ""] + #[doc = "- `reason`: The reason for, or the thing that deserves, the tip; generally this will be"] + #[doc = " a UTF-8-encoded URL."] + #[doc = "- `who`: The account which should be credited for the tip."] + #[doc = ""] + #[doc = "Emits `NewTip` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(R)` where `R` length of `reason`."] + #[doc = " - encoding and hashing of 'reason'"] + #[doc = "- DbReads: `Reasons`, `Tips`"] + #[doc = "- DbWrites: `Reasons`, `Tips`"] + #[doc = "# "] + pub fn report_awesome( + &self, + reason: ::std::vec::Vec<::core::primitive::u8>, + who: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Tips", + "report_awesome", + ReportAwesome { reason, who }, + [ + 43u8, 6u8, 185u8, 209u8, 110u8, 99u8, 94u8, 100u8, 33u8, 5u8, 27u8, + 199u8, 67u8, 255u8, 252u8, 26u8, 104u8, 192u8, 55u8, 122u8, 106u8, + 129u8, 249u8, 181u8, 246u8, 205u8, 213u8, 175u8, 241u8, 59u8, 151u8, + 197u8, + ], + ) + } + + #[doc = "Retract a prior tip-report from `report_awesome`, and cancel the process of tipping."] + #[doc = ""] + #[doc = "If successful, the original deposit will be unreserved."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the tip identified by `hash`"] + #[doc = "must have been reported by the signing account through `report_awesome` (and not"] + #[doc = "through `tip_new`)."] + #[doc = ""] + #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] + #[doc = " as the hash of the tuple of the original tip `reason` and the beneficiary account ID."] + #[doc = ""] + #[doc = "Emits `TipRetracted` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(1)`"] + #[doc = " - Depends on the length of `T::Hash` which is fixed."] + #[doc = "- DbReads: `Tips`, `origin account`"] + #[doc = "- DbWrites: `Reasons`, `Tips`, `origin account`"] + #[doc = "# "] + pub fn retract_tip( + &self, + hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new("Tips", "retract_tip", RetractTip { hash }, [ + 137u8, 42u8, 229u8, 188u8, 157u8, 195u8, 184u8, 176u8, 64u8, 142u8, 67u8, + 175u8, 185u8, 207u8, 214u8, 71u8, 165u8, 29u8, 137u8, 227u8, 132u8, 195u8, + 255u8, 66u8, 186u8, 57u8, 34u8, 184u8, 187u8, 65u8, 129u8, 131u8, + ]) + } + + #[doc = "Give a tip for something new; no finder's fee will be taken."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must be a"] + #[doc = "member of the `Tippers` set."] + #[doc = ""] + #[doc = "- `reason`: The reason for, or the thing that deserves, the tip; generally this will be"] + #[doc = " a UTF-8-encoded URL."] + #[doc = "- `who`: The account which should be credited for the tip."] + #[doc = "- `tip_value`: The amount of tip that the sender would like to give. The median tip"] + #[doc = " value of active tippers will be given to the `who`."] + #[doc = ""] + #[doc = "Emits `NewTip` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(R + T)` where `R` length of `reason`, `T` is the number of tippers."] + #[doc = " - `O(T)`: decoding `Tipper` vec of length `T`. `T` is charged as upper bound given by"] + #[doc = " `ContainsLengthBound`. The actual cost depends on the implementation of"] + #[doc = " `T::Tippers`."] + #[doc = " - `O(R)`: hashing and encoding of reason of length `R`"] + #[doc = "- DbReads: `Tippers`, `Reasons`"] + #[doc = "- DbWrites: `Reasons`, `Tips`"] + #[doc = "# "] + pub fn tip_new( + &self, + reason: ::std::vec::Vec<::core::primitive::u8>, + who: ::subxt::ext::sp_core::crypto::AccountId32, + tip_value: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "Tips", + "tip_new", + TipNew { + reason, + who, + tip_value, + }, + [ + 146u8, 216u8, 159u8, 132u8, 163u8, 180u8, 42u8, 203u8, 181u8, 76u8, + 217u8, 120u8, 75u8, 32u8, 165u8, 41u8, 250u8, 222u8, 204u8, 63u8, 61u8, + 218u8, 161u8, 37u8, 172u8, 10u8, 66u8, 218u8, 14u8, 130u8, 160u8, + 126u8, + ], + ) + } + + #[doc = "Declare a tip value for an already-open tip."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must be a"] + #[doc = "member of the `Tippers` set."] + #[doc = ""] + #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] + #[doc = " as the hash of the tuple of the hash of the original tip `reason` and the beneficiary"] + #[doc = " account ID."] + #[doc = "- `tip_value`: The amount of tip that the sender would like to give. The median tip"] + #[doc = " value of active tippers will be given to the `who`."] + #[doc = ""] + #[doc = "Emits `TipClosing` if the threshold of tippers has been reached and the countdown period"] + #[doc = "has started."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(T)` where `T` is the number of tippers. decoding `Tipper` vec of length"] + #[doc = " `T`, insert tip and check closing, `T` is charged as upper bound given by"] + #[doc = " `ContainsLengthBound`. The actual cost depends on the implementation of `T::Tippers`."] + #[doc = ""] + #[doc = " Actually weight could be lower as it depends on how many tips are in `OpenTip` but it"] + #[doc = " is weighted as if almost full i.e of length `T-1`."] + #[doc = "- DbReads: `Tippers`, `Tips`"] + #[doc = "- DbWrites: `Tips`"] + #[doc = "# "] + pub fn tip( + &self, + hash: ::subxt::ext::sp_core::H256, + tip_value: ::core::primitive::u128, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new("Tips", "tip", Tip { hash, tip_value }, [ + 133u8, 52u8, 131u8, 14u8, 71u8, 232u8, 254u8, 31u8, 33u8, 206u8, 50u8, + 76u8, 56u8, 167u8, 228u8, 202u8, 195u8, 0u8, 164u8, 107u8, 170u8, 98u8, + 192u8, 37u8, 209u8, 199u8, 130u8, 15u8, 168u8, 63u8, 181u8, 134u8, + ]) + } + + #[doc = "Close and payout a tip."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "The tip identified by `hash` must have finished its countdown period."] + #[doc = ""] + #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] + #[doc = " as the hash of the tuple of the original tip `reason` and the beneficiary account ID."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(T)` where `T` is the number of tippers. decoding `Tipper` vec of length"] + #[doc = " `T`. `T` is charged as upper bound given by `ContainsLengthBound`. The actual cost"] + #[doc = " depends on the implementation of `T::Tippers`."] + #[doc = "- DbReads: `Tips`, `Tippers`, `tip finder`"] + #[doc = "- DbWrites: `Reasons`, `Tips`, `Tippers`, `tip finder`"] + #[doc = "# "] + pub fn close_tip( + &self, + hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new("Tips", "close_tip", CloseTip { hash }, [ + 32u8, 53u8, 0u8, 222u8, 45u8, 157u8, 107u8, 174u8, 203u8, 50u8, 81u8, + 230u8, 6u8, 111u8, 79u8, 55u8, 49u8, 151u8, 107u8, 114u8, 81u8, 200u8, + 144u8, 175u8, 29u8, 142u8, 115u8, 184u8, 102u8, 116u8, 156u8, 173u8, + ]) + } + + #[doc = "Remove and slash an already-open tip."] + #[doc = ""] + #[doc = "May only be called from `T::RejectOrigin`."] + #[doc = ""] + #[doc = "As a result, the finder is slashed and the deposits are lost."] + #[doc = ""] + #[doc = "Emits `TipSlashed` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = " `T` is charged as upper bound given by `ContainsLengthBound`."] + #[doc = " The actual cost depends on the implementation of `T::Tippers`."] + #[doc = "# "] + pub fn slash_tip( + &self, + hash: ::subxt::ext::sp_core::H256, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new("Tips", "slash_tip", SlashTip { hash }, [ + 222u8, 209u8, 22u8, 47u8, 114u8, 230u8, 81u8, 200u8, 131u8, 0u8, 209u8, + 54u8, 17u8, 200u8, 175u8, 125u8, 100u8, 254u8, 41u8, 178u8, 20u8, 27u8, + 9u8, 184u8, 79u8, 93u8, 208u8, 148u8, 27u8, 190u8, 176u8, 169u8, + ]) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_tips::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 tip suggestion has been opened."] + pub struct NewTip { + pub tip_hash: ::subxt::ext::sp_core::H256, + } + impl ::subxt::events::StaticEvent for NewTip { + const EVENT: &'static str = "NewTip"; + const PALLET: &'static str = "Tips"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A tip suggestion has reached threshold and is closing."] + pub struct TipClosing { + pub tip_hash: ::subxt::ext::sp_core::H256, + } + impl ::subxt::events::StaticEvent for TipClosing { + const EVENT: &'static str = "TipClosing"; + const PALLET: &'static str = "Tips"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A tip suggestion has been closed."] + pub struct TipClosed { + pub tip_hash: ::subxt::ext::sp_core::H256, + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub payout: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for TipClosed { + const EVENT: &'static str = "TipClosed"; + const PALLET: &'static str = "Tips"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A tip suggestion has been retracted."] + pub struct TipRetracted { + pub tip_hash: ::subxt::ext::sp_core::H256, + } + impl ::subxt::events::StaticEvent for TipRetracted { + const EVENT: &'static str = "TipRetracted"; + const PALLET: &'static str = "Tips"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "A tip suggestion has been slashed."] + pub struct TipSlashed { + pub tip_hash: ::subxt::ext::sp_core::H256, + pub finder: ::subxt::ext::sp_core::crypto::AccountId32, + pub deposit: ::core::primitive::u128, + } + impl ::subxt::events::StaticEvent for TipSlashed { + const EVENT: &'static str = "TipSlashed"; + const PALLET: &'static str = "Tips"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " TipsMap that are not yet completed. Keyed by the hash of `(reason, who)` from the value."] + #[doc = " This has the insecure enumerable hash function since the key itself is already"] + #[doc = " guaranteed to be a secure hash."] + pub fn tips( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_tips::OpenTip< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + ::subxt::ext::sp_core::H256, + >, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Tips", + "Tips", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 241u8, 196u8, 105u8, 248u8, 29u8, 66u8, 86u8, 98u8, 6u8, 159u8, 191u8, + 0u8, 227u8, 232u8, 147u8, 248u8, 173u8, 20u8, 225u8, 12u8, 232u8, 5u8, + 93u8, 78u8, 18u8, 154u8, 130u8, 38u8, 142u8, 36u8, 66u8, 0u8, + ], + ) + } + + #[doc = " TipsMap that are not yet completed. Keyed by the hash of `(reason, who)` from the value."] + #[doc = " This has the insecure enumerable hash function since the key itself is already"] + #[doc = " guaranteed to be a secure hash."] + pub fn tips_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_tips::OpenTip< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + ::core::primitive::u32, + ::subxt::ext::sp_core::H256, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Tips", + "Tips", + Vec::new(), + [ + 241u8, 196u8, 105u8, 248u8, 29u8, 66u8, 86u8, 98u8, 6u8, 159u8, 191u8, + 0u8, 227u8, 232u8, 147u8, 248u8, 173u8, 20u8, 225u8, 12u8, 232u8, 5u8, + 93u8, 78u8, 18u8, 154u8, 130u8, 38u8, 142u8, 36u8, 66u8, 0u8, + ], + ) + } + + #[doc = " Simple preimage lookup from the reason's hash to the original data. Again, has an"] + #[doc = " insecure enumerable hash since the key is guaranteed to be the result of a secure hash."] + pub fn reasons( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::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( + "Tips", + "Reasons", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 202u8, 191u8, 36u8, 162u8, 156u8, 102u8, 115u8, 10u8, 203u8, 35u8, + 201u8, 70u8, 195u8, 151u8, 89u8, 82u8, 202u8, 35u8, 210u8, 176u8, 82u8, + 1u8, 77u8, 94u8, 31u8, 70u8, 252u8, 194u8, 166u8, 91u8, 189u8, 134u8, + ], + ) + } + + #[doc = " Simple preimage lookup from the reason's hash to the original data. Again, has an"] + #[doc = " insecure enumerable hash since the key is guaranteed to be the result of a secure hash."] + pub fn reasons_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::std::vec::Vec<::core::primitive::u8>>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Tips", + "Reasons", + Vec::new(), + [ + 202u8, 191u8, 36u8, 162u8, 156u8, 102u8, 115u8, 10u8, 203u8, 35u8, + 201u8, 70u8, 195u8, 151u8, 89u8, 82u8, 202u8, 35u8, 210u8, 176u8, 82u8, + 1u8, 77u8, 94u8, 31u8, 70u8, 252u8, 194u8, 166u8, 91u8, 189u8, 134u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Maximum acceptable reason length."] + pub fn maximum_reason_length( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new("Tips", "MaximumReasonLength", [ + 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 amount held on deposit per byte within the tip report reason or bounty description."] + pub fn data_deposit_per_byte( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new("Tips", "DataDepositPerByte", [ + 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 period for which a tip remains open after is has achieved threshold tippers."] + pub fn tip_countdown( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new("Tips", "TipCountdown", [ + 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 percent of the final tip which goes to the original reporter of the tip."] + pub fn tip_finders_fee( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::sp_arithmetic::per_things::Percent, + >, + > { + ::subxt::constants::StaticConstantAddress::new("Tips", "TipFindersFee", [ + 99u8, 121u8, 176u8, 172u8, 235u8, 159u8, 116u8, 114u8, 179u8, 91u8, 129u8, + 117u8, 204u8, 135u8, 53u8, 7u8, 151u8, 26u8, 124u8, 151u8, 202u8, 171u8, + 171u8, 207u8, 183u8, 177u8, 24u8, 53u8, 109u8, 185u8, 71u8, 183u8, + ]) + } + + #[doc = " The amount held on deposit for placing a tip report."] + pub fn tip_report_deposit_base( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u128>, + > { + ::subxt::constants::StaticConstantAddress::new( + "Tips", + "TipReportDepositBase", + [ + 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 mmr { + use super::{root_mod, runtime_types}; + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Latest MMR Root hash."] + pub fn root_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( + "Mmr", + "RootHash", + vec![], + [ + 182u8, 163u8, 37u8, 44u8, 2u8, 163u8, 57u8, 184u8, 97u8, 55u8, 1u8, + 116u8, 55u8, 169u8, 23u8, 221u8, 182u8, 5u8, 174u8, 217u8, 111u8, 55u8, + 180u8, 161u8, 69u8, 120u8, 212u8, 73u8, 2u8, 1u8, 39u8, 224u8, + ], + ) + } + + #[doc = " Current size of the MMR (number of leaves)."] + pub fn number_of_leaves( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u64>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Mmr", + "NumberOfLeaves", + vec![], + [ + 138u8, 124u8, 23u8, 186u8, 255u8, 231u8, 187u8, 122u8, 213u8, 160u8, + 29u8, 24u8, 88u8, 98u8, 171u8, 36u8, 195u8, 216u8, 27u8, 190u8, 192u8, + 152u8, 8u8, 13u8, 210u8, 232u8, 45u8, 184u8, 240u8, 255u8, 156u8, + 204u8, + ], + ) + } + + #[doc = " Hashes of the nodes in the MMR."] + #[doc = ""] + #[doc = " Note this collection only contains MMR peaks, the inner nodes (and leaves)"] + #[doc = " are pruned and only stored in the Offchain DB."] + pub fn nodes( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u64>, + ) -> ::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( + "Mmr", + "Nodes", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Identity, + )], + [ + 188u8, 148u8, 126u8, 226u8, 142u8, 91u8, 61u8, 52u8, 213u8, 36u8, + 120u8, 232u8, 20u8, 11u8, 61u8, 1u8, 130u8, 155u8, 81u8, 34u8, 153u8, + 149u8, 210u8, 232u8, 113u8, 242u8, 249u8, 8u8, 61u8, 51u8, 148u8, 98u8, + ], + ) + } + + #[doc = " Hashes of the nodes in the MMR."] + #[doc = ""] + #[doc = " Note this collection only contains MMR peaks, the inner nodes (and leaves)"] + #[doc = " are pruned and only stored in the Offchain DB."] + pub fn nodes_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::H256>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "Mmr", + "Nodes", + Vec::new(), + [ + 188u8, 148u8, 126u8, 226u8, 142u8, 91u8, 61u8, 52u8, 213u8, 36u8, + 120u8, 232u8, 20u8, 11u8, 61u8, 1u8, 130u8, 155u8, 81u8, 34u8, 153u8, + 149u8, 210u8, 232u8, 113u8, 242u8, 249u8, 8u8, 61u8, 51u8, 148u8, 98u8, + ], + ) + } + } + } + } + pub mod bags_list { + 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 Rebag { + pub dislocated: ::subxt::ext::sp_core::crypto::AccountId32, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Declare that some `dislocated` account has, through rewards or penalties, sufficiently"] + #[doc = "changed its weight that it should properly fall into a different bag than its current"] + #[doc = "one."] + #[doc = ""] + #[doc = "Anyone can call this function about any potentially dislocated account."] + #[doc = ""] + #[doc = "Will never return an error; if `dislocated` does not exist or doesn't need a rebag, then"] + #[doc = "it is a noop and fees are still collected from `origin`."] + pub fn rebag( + &self, + dislocated: ::subxt::ext::sp_core::crypto::AccountId32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new("BagsList", "rebag", Rebag { dislocated }, [ + 8u8, 182u8, 221u8, 221u8, 242u8, 48u8, 178u8, 182u8, 236u8, 54u8, 188u8, + 107u8, 32u8, 24u8, 90u8, 76u8, 28u8, 67u8, 8u8, 231u8, 6u8, 162u8, 169u8, + 77u8, 246u8, 88u8, 156u8, 189u8, 248u8, 19u8, 235u8, 236u8, + ]) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::pallet_bags_list::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Moved an account from one bag to another."] + pub struct Rebagged { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub from: ::core::primitive::u64, + pub to: ::core::primitive::u64, + } + impl ::subxt::events::StaticEvent for Rebagged { + const EVENT: &'static str = "Rebagged"; + const PALLET: &'static str = "BagsList"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " A single node, within some bag."] + #[doc = ""] + #[doc = " Nodes store links forward and back within their respective bags."] + pub fn list_nodes( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::crypto::AccountId32>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_bags_list::list::Node, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "BagsList", + "ListNodes", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 88u8, 95u8, 226u8, 81u8, 86u8, 125u8, 195u8, 19u8, 147u8, 16u8, 211u8, + 169u8, 178u8, 91u8, 135u8, 35u8, 14u8, 201u8, 48u8, 198u8, 233u8, 57u8, + 33u8, 155u8, 127u8, 223u8, 35u8, 128u8, 167u8, 102u8, 105u8, 68u8, + ], + ) + } + + #[doc = " A single node, within some bag."] + #[doc = ""] + #[doc = " Nodes store links forward and back within their respective bags."] + pub fn list_nodes_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::pallet_bags_list::list::Node, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "BagsList", + "ListNodes", + Vec::new(), + [ + 88u8, 95u8, 226u8, 81u8, 86u8, 125u8, 195u8, 19u8, 147u8, 16u8, 211u8, + 169u8, 178u8, 91u8, 135u8, 35u8, 14u8, 201u8, 48u8, 198u8, 233u8, 57u8, + 33u8, 155u8, 127u8, 223u8, 35u8, 128u8, 167u8, 102u8, 105u8, 68u8, + ], + ) + } + + #[doc = "Counter for the related counted storage map"] + pub fn counter_for_list_nodes( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "BagsList", + "CounterForListNodes", + vec![], + [ + 156u8, 168u8, 97u8, 33u8, 84u8, 117u8, 220u8, 89u8, 62u8, 182u8, 24u8, + 88u8, 231u8, 244u8, 41u8, 19u8, 210u8, 131u8, 87u8, 0u8, 241u8, 230u8, + 160u8, 142u8, 128u8, 153u8, 83u8, 36u8, 88u8, 247u8, 70u8, 130u8, + ], + ) + } + + #[doc = " A bag stored in storage."] + #[doc = ""] + #[doc = " Stores a `Bag` struct, which stores head and tail pointers to itself."] + pub fn list_bags( + &self, + _0: impl ::std::borrow::Borrow<::core::primitive::u64>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "BagsList", + "ListBags", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 38u8, 86u8, 63u8, 92u8, 85u8, 59u8, 225u8, 244u8, 14u8, 155u8, 76u8, + 249u8, 153u8, 140u8, 179u8, 7u8, 96u8, 170u8, 236u8, 179u8, 4u8, 18u8, + 232u8, 146u8, 216u8, 51u8, 135u8, 116u8, 196u8, 117u8, 143u8, 153u8, + ], + ) + } + + #[doc = " A bag stored in storage."] + #[doc = ""] + #[doc = " Stores a `Bag` struct, which stores head and tail pointers to itself."] + pub fn list_bags_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "BagsList", + "ListBags", + Vec::new(), + [ + 38u8, 86u8, 63u8, 92u8, 85u8, 59u8, 225u8, 244u8, 14u8, 155u8, 76u8, + 249u8, 153u8, 140u8, 179u8, 7u8, 96u8, 170u8, 236u8, 179u8, 4u8, 18u8, + 232u8, 146u8, 216u8, 51u8, 135u8, 116u8, 196u8, 117u8, 143u8, 153u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The list of thresholds separating the various bags."] + #[doc = ""] + #[doc = " Ids are separated into unsorted bags according to their vote weight. This specifies the"] + #[doc = " thresholds separating the bags. An id's bag is the largest bag for which the id's weight"] + #[doc = " is less than or equal to its upper threshold."] + #[doc = ""] + #[doc = " When ids are iterated, higher bags are iterated completely before lower bags. This means"] + #[doc = " that iteration is _semi-sorted_: ids of higher weight tend to come before ids of lower"] + #[doc = " weight, but peer ids within a particular bag are sorted in insertion order."] + #[doc = ""] + #[doc = " # Expressing the constant"] + #[doc = ""] + #[doc = " This constant must be sorted in strictly increasing order. Duplicate items are not"] + #[doc = " permitted."] + #[doc = ""] + #[doc = " There is an implied upper limit of `VoteWeight::MAX`; that value does not need to be"] + #[doc = " specified within the bag. For any two threshold lists, if one ends with"] + #[doc = " `VoteWeight::MAX`, the other one does not, and they are otherwise equal, the two lists"] + #[doc = " will behave identically."] + #[doc = ""] + #[doc = " # Calculation"] + #[doc = ""] + #[doc = " It is recommended to generate the set of thresholds in a geometric series, such that"] + #[doc = " there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *"] + #[doc = " constant_ratio).max(threshold[k] + 1)` for all `k`."] + #[doc = ""] + #[doc = " The helpers in the `/utils/frame/generate-bags` module can simplify this calculation."] + #[doc = ""] + #[doc = " # Examples"] + #[doc = ""] + #[doc = " - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and"] + #[doc = " iteration is strictly in insertion order."] + #[doc = " - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to"] + #[doc = " the procedure given above, then the constant ratio is equal to 2."] + #[doc = " - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to"] + #[doc = " the procedure given above, then the constant ratio is approximately equal to 1.248."] + #[doc = " - If the threshold list begins `[1, 2, 3, ...]`, then an id with weight 0 or 1 will fall"] + #[doc = " into bag 0, an id with weight 2 will fall into bag 1, etc."] + #[doc = ""] + #[doc = " # Migration"] + #[doc = ""] + #[doc = " In the event that this list ever changes, a copy of the old bags list must be retained."] + #[doc = " With that `List::migrate` can be called, which will perform the appropriate migration."] + pub fn bag_thresholds( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::std::vec::Vec<::core::primitive::u64>>, + > { + ::subxt::constants::StaticConstantAddress::new("BagsList", "BagThresholds", [ + 103u8, 102u8, 255u8, 165u8, 124u8, 54u8, 5u8, 172u8, 112u8, 234u8, 25u8, + 175u8, 178u8, 19u8, 251u8, 73u8, 91u8, 192u8, 227u8, 81u8, 249u8, 45u8, + 126u8, 116u8, 7u8, 37u8, 9u8, 200u8, 167u8, 182u8, 12u8, 131u8, + ]) + } + } + } + } + pub mod data_availability { + 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 CreateApplicationKey { + pub key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SubmitData { + pub data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SubmitBlockLengthProposal { + pub rows: ::core::primitive::u32, + pub cols: ::core::primitive::u32, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Creates an application key if `key` does not exist yet."] + pub fn create_application_key( + &self, + key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "DataAvailability", + "create_application_key", + CreateApplicationKey { key }, + [ + 72u8, 173u8, 240u8, 89u8, 218u8, 104u8, 43u8, 227u8, 167u8, 173u8, + 58u8, 254u8, 243u8, 117u8, 221u8, 121u8, 163u8, 205u8, 31u8, 35u8, + 239u8, 53u8, 148u8, 250u8, 48u8, 81u8, 46u8, 121u8, 72u8, 23u8, 236u8, + 6u8, + ], + ) + } + + pub fn submit_data( + &self, + data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "DataAvailability", + "submit_data", + SubmitData { data }, + [ + 154u8, 109u8, 83u8, 128u8, 67u8, 33u8, 87u8, 165u8, 135u8, 119u8, + 223u8, 220u8, 107u8, 18u8, 81u8, 65u8, 241u8, 213u8, 198u8, 110u8, + 175u8, 25u8, 6u8, 188u8, 157u8, 85u8, 213u8, 133u8, 235u8, 240u8, 32u8, + 76u8, + ], + ) + } + + pub fn submit_block_length_proposal( + &self, + rows: ::core::primitive::u32, + cols: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "DataAvailability", + "submit_block_length_proposal", + SubmitBlockLengthProposal { rows, cols }, + [ + 97u8, 1u8, 244u8, 28u8, 180u8, 49u8, 28u8, 9u8, 9u8, 215u8, 184u8, + 200u8, 14u8, 77u8, 21u8, 190u8, 176u8, 8u8, 12u8, 83u8, 176u8, 95u8, + 149u8, 84u8, 129u8, 111u8, 181u8, 236u8, 77u8, 62u8, 115u8, 153u8, + ], + ) + } + } + } + #[doc = "Event for the pallet."] + pub type Event = runtime_types::da_control::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 application key was created."] + pub struct ApplicationKeyCreated { + pub key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + pub owner: ::subxt::ext::sp_core::crypto::AccountId32, + pub id: runtime_types::da_primitives::asdr::AppId, + } + impl ::subxt::events::StaticEvent for ApplicationKeyCreated { + const EVENT: &'static str = "ApplicationKeyCreated"; + const PALLET: &'static str = "DataAvailability"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct DataSubmitted { + pub who: ::subxt::ext::sp_core::crypto::AccountId32, + pub data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + } + impl ::subxt::events::StaticEvent for DataSubmitted { + const EVENT: &'static str = "DataSubmitted"; + const PALLET: &'static str = "DataAvailability"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BlockLengthProposalSubmitted { + pub rows: ::core::primitive::u32, + pub cols: ::core::primitive::u32, + } + impl ::subxt::events::StaticEvent for BlockLengthProposalSubmitted { + const EVENT: &'static str = "BlockLengthProposalSubmitted"; + const PALLET: &'static str = "DataAvailability"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + #[doc = " Last application ID"] + pub fn next_app_id( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "DataAvailability", + "NextAppId", + vec![], + [ + 21u8, 88u8, 250u8, 59u8, 123u8, 113u8, 217u8, 137u8, 130u8, 207u8, + 168u8, 182u8, 200u8, 84u8, 110u8, 250u8, 109u8, 163u8, 72u8, 199u8, + 88u8, 145u8, 217u8, 67u8, 49u8, 107u8, 26u8, 52u8, 76u8, 69u8, 4u8, + 63u8, + ], + ) + } + + #[doc = " Last block length proposal."] + #[doc = " # TODO"] + #[doc = " - It is not used, could we removed it?"] + pub fn last_block_len_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( + "DataAvailability", + "LastBlockLenId", + vec![], + [ + 51u8, 88u8, 3u8, 49u8, 185u8, 211u8, 12u8, 141u8, 53u8, 34u8, 47u8, + 67u8, 163u8, 215u8, 249u8, 135u8, 80u8, 9u8, 236u8, 177u8, 219u8, 94u8, + 56u8, 168u8, 176u8, 149u8, 104u8, 19u8, 20u8, 189u8, 124u8, 213u8, + ], + ) + } + + #[doc = " Store all application keys."] + pub fn app_keys( + &self, + _0: impl ::std::borrow::Borrow< + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + >, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::da_control::pallet::AppKeyInfo< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "DataAvailability", + "AppKeys", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Blake2_128Concat, + )], + [ + 167u8, 153u8, 205u8, 126u8, 104u8, 82u8, 243u8, 1u8, 106u8, 10u8, 85u8, + 118u8, 236u8, 46u8, 81u8, 144u8, 229u8, 68u8, 89u8, 82u8, 98u8, 91u8, + 0u8, 66u8, 102u8, 96u8, 163u8, 244u8, 47u8, 169u8, 237u8, 250u8, + ], + ) + } + + #[doc = " Store all application keys."] + pub fn app_keys_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType< + runtime_types::da_control::pallet::AppKeyInfo< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + >, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "DataAvailability", + "AppKeys", + Vec::new(), + [ + 167u8, 153u8, 205u8, 126u8, 104u8, 82u8, 243u8, 1u8, 106u8, 10u8, 85u8, + 118u8, 236u8, 46u8, 81u8, 144u8, 229u8, 68u8, 89u8, 82u8, 98u8, 91u8, + 0u8, 66u8, 102u8, 96u8, 163u8, 244u8, 47u8, 169u8, 237u8, 250u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " The max length of application key."] + pub fn max_app_key_length( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "DataAvailability", + "MaxAppKeyLength", + [ + 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 max length of app data."] + pub fn max_app_data_length( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "DataAvailability", + "MaxAppDataLength", + [ + 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 = " Minimum number of rows in a block."] + pub fn min_block_rows( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "DataAvailability", + "MinBlockRows", + [ + 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 rows in a block."] + pub fn max_block_rows( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "DataAvailability", + "MaxBlockRows", + [ + 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 = " Minimum number of cols in a block."] + pub fn min_block_cols( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "DataAvailability", + "MinBlockCols", + [ + 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 cols in a block."] + pub fn max_block_cols( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "DataAvailability", + "MaxBlockCols", + [ + 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 updater_manager { + 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; + pub struct TransactionApi; + impl TransactionApi {} + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::updater_manager::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct NewUpdater { + pub old_updater: ::subxt::ext::sp_core::H160, + pub new_updater: ::subxt::ext::sp_core::H160, + } + impl ::subxt::events::StaticEvent for NewUpdater { + const EVENT: &'static str = "NewUpdater"; + const PALLET: &'static str = "UpdaterManager"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct FakeSlashed { + pub reporter: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for FakeSlashed { + const EVENT: &'static str = "FakeSlashed"; + const PALLET: &'static str = "UpdaterManager"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + pub fn updater( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::H160>, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "UpdaterManager", + "Updater", + vec![], + [ + 133u8, 141u8, 193u8, 158u8, 124u8, 101u8, 100u8, 156u8, 48u8, 193u8, + 106u8, 83u8, 240u8, 237u8, 242u8, 44u8, 26u8, 206u8, 213u8, 106u8, + 159u8, 239u8, 185u8, 213u8, 142u8, 26u8, 244u8, 234u8, 130u8, 187u8, + 104u8, 154u8, + ], + ) + } + } + } + } + pub mod nomad_home { + 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 Dispatch { + #[codec(compact)] + pub destination_domain: ::core::primitive::u32, + pub recipient_address: ::subxt::ext::sp_core::H256, + pub message_body: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Update { + pub signed_update: runtime_types::nomad_core::update::SignedUpdate, + #[codec(compact)] + pub max_index: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ImproperUpdate { + pub signed_update: runtime_types::nomad_core::update::SignedUpdate, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Dispatch a message to the destination domain and recipient address."] + pub fn dispatch( + &self, + destination_domain: ::core::primitive::u32, + recipient_address: ::subxt::ext::sp_core::H256, + message_body: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NomadHome", + "dispatch", + Dispatch { + destination_domain, + recipient_address, + message_body, + }, + [ + 254u8, 10u8, 145u8, 46u8, 242u8, 218u8, 11u8, 43u8, 209u8, 67u8, 34u8, + 219u8, 211u8, 119u8, 183u8, 61u8, 181u8, 163u8, 136u8, 92u8, 23u8, + 24u8, 247u8, 142u8, 146u8, 138u8, 115u8, 150u8, 55u8, 121u8, 55u8, + 75u8, + ], + ) + } + + #[doc = "Verify/submit signed update."] + pub fn update( + &self, + signed_update: runtime_types::nomad_core::update::SignedUpdate, + max_index: ::core::primitive::u32, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NomadHome", + "update", + Update { + signed_update, + max_index, + }, + [ + 114u8, 14u8, 19u8, 186u8, 185u8, 155u8, 190u8, 199u8, 108u8, 207u8, + 138u8, 45u8, 149u8, 190u8, 241u8, 86u8, 73u8, 152u8, 118u8, 97u8, 45u8, + 68u8, 190u8, 141u8, 191u8, 24u8, 86u8, 147u8, 133u8, 160u8, 129u8, + 175u8, + ], + ) + } + + #[doc = "Verify/slash updater for improper update."] + pub fn improper_update( + &self, + signed_update: runtime_types::nomad_core::update::SignedUpdate, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "NomadHome", + "improper_update", + ImproperUpdate { signed_update }, + [ + 235u8, 105u8, 81u8, 68u8, 152u8, 117u8, 164u8, 91u8, 92u8, 240u8, + 134u8, 122u8, 79u8, 100u8, 163u8, 221u8, 80u8, 144u8, 193u8, 112u8, + 141u8, 202u8, 228u8, 227u8, 136u8, 4u8, 233u8, 100u8, 181u8, 22u8, + 154u8, 54u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::nomad_home::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Dispatch { + pub message_hash: ::subxt::ext::sp_core::H256, + pub leaf_index: ::core::primitive::u32, + pub destination_and_nonce: ::core::primitive::u64, + pub committed_root: ::subxt::ext::sp_core::H256, + pub message: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::events::StaticEvent for Dispatch { + const EVENT: &'static str = "Dispatch"; + const PALLET: &'static str = "NomadHome"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Update { + pub home_domain: ::core::primitive::u32, + pub previous_root: ::subxt::ext::sp_core::H256, + pub new_root: ::subxt::ext::sp_core::H256, + pub signature: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::events::StaticEvent for Update { + const EVENT: &'static str = "Update"; + const PALLET: &'static str = "NomadHome"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ImproperUpdate { + pub previous_root: ::subxt::ext::sp_core::H256, + pub new_root: ::subxt::ext::sp_core::H256, + pub signature: ::std::vec::Vec<::core::primitive::u8>, + } + impl ::subxt::events::StaticEvent for ImproperUpdate { + const EVENT: &'static str = "ImproperUpdate"; + const PALLET: &'static str = "NomadHome"; + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct UpdaterSlashed { + pub updater: ::subxt::ext::sp_core::H160, + pub reporter: ::subxt::ext::sp_core::crypto::AccountId32, + } + impl ::subxt::events::StaticEvent for UpdaterSlashed { + const EVENT: &'static str = "UpdaterSlashed"; + const PALLET: &'static str = "NomadHome"; + } + } + pub mod storage { + use super::runtime_types; + pub struct StorageApi; + impl StorageApi { + pub fn base( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NomadHome", + "Base", + vec![], + [ + 205u8, 101u8, 115u8, 25u8, 58u8, 208u8, 131u8, 248u8, 249u8, 168u8, + 248u8, 25u8, 217u8, 233u8, 102u8, 189u8, 222u8, 72u8, 63u8, 92u8, + 134u8, 136u8, 22u8, 12u8, 184u8, 242u8, 183u8, 52u8, 154u8, 87u8, 15u8, + 52u8, + ], + ) + } + + pub fn tree( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType, + ::subxt::storage::address::Yes, + ::subxt::storage::address::Yes, + (), + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NomadHome", + "Tree", + vec![], + [ + 22u8, 207u8, 157u8, 183u8, 36u8, 47u8, 192u8, 247u8, 85u8, 143u8, 23u8, + 21u8, 189u8, 221u8, 230u8, 215u8, 141u8, 38u8, 233u8, 65u8, 165u8, + 57u8, 14u8, 252u8, 185u8, 140u8, 204u8, 186u8, 205u8, 195u8, 214u8, + 235u8, + ], + ) + } + + pub fn nonces( + &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::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NomadHome", + "Nonces", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 225u8, 196u8, 0u8, 213u8, 118u8, 3u8, 219u8, 130u8, 21u8, 64u8, 253u8, + 206u8, 79u8, 103u8, 199u8, 75u8, 182u8, 43u8, 13u8, 130u8, 169u8, 67u8, + 174u8, 208u8, 72u8, 111u8, 50u8, 68u8, 110u8, 138u8, 5u8, 67u8, + ], + ) + } + + pub fn nonces_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( + "NomadHome", + "Nonces", + Vec::new(), + [ + 225u8, 196u8, 0u8, 213u8, 118u8, 3u8, 219u8, 130u8, 21u8, 64u8, 253u8, + 206u8, 79u8, 103u8, 199u8, 75u8, 182u8, 43u8, 13u8, 130u8, 169u8, 67u8, + 174u8, 208u8, 72u8, 111u8, 50u8, 68u8, 110u8, 138u8, 5u8, 67u8, + ], + ) + } + + pub fn index_to_root( + &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::StaticStorageAddress::new( + "NomadHome", + "IndexToRoot", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 55u8, 53u8, 87u8, 227u8, 177u8, 25u8, 61u8, 107u8, 134u8, 232u8, 131u8, + 188u8, 144u8, 138u8, 45u8, 113u8, 17u8, 164u8, 100u8, 233u8, 226u8, + 9u8, 186u8, 184u8, 147u8, 164u8, 34u8, 80u8, 28u8, 212u8, 253u8, 16u8, + ], + ) + } + + pub fn index_to_root_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::H256>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NomadHome", + "IndexToRoot", + Vec::new(), + [ + 55u8, 53u8, 87u8, 227u8, 177u8, 25u8, 61u8, 107u8, 134u8, 232u8, 131u8, + 188u8, 144u8, 138u8, 45u8, 113u8, 17u8, 164u8, 100u8, 233u8, 226u8, + 9u8, 186u8, 184u8, 147u8, 164u8, 34u8, 80u8, 28u8, 212u8, 253u8, 16u8, + ], + ) + } + + pub fn root_to_index( + &self, + _0: impl ::std::borrow::Borrow<::subxt::ext::sp_core::H256>, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + ::subxt::storage::address::Yes, + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NomadHome", + "RootToIndex", + vec![::subxt::storage::address::StorageMapKey::new( + _0.borrow(), + ::subxt::storage::address::StorageHasher::Twox64Concat, + )], + [ + 72u8, 228u8, 165u8, 136u8, 129u8, 151u8, 17u8, 28u8, 141u8, 139u8, 7u8, + 133u8, 237u8, 63u8, 219u8, 86u8, 163u8, 26u8, 194u8, 28u8, 112u8, + 111u8, 195u8, 50u8, 122u8, 33u8, 32u8, 193u8, 192u8, 210u8, 233u8, + 91u8, + ], + ) + } + + pub fn root_to_index_root( + &self, + ) -> ::subxt::storage::address::StaticStorageAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + (), + (), + ::subxt::storage::address::Yes, + > { + ::subxt::storage::address::StaticStorageAddress::new( + "NomadHome", + "RootToIndex", + Vec::new(), + [ + 72u8, 228u8, 165u8, 136u8, 129u8, 151u8, 17u8, 28u8, 141u8, 139u8, 7u8, + 133u8, 237u8, 63u8, 219u8, 86u8, 163u8, 26u8, 194u8, 28u8, 112u8, + 111u8, 195u8, 50u8, 122u8, 33u8, 32u8, 193u8, 192u8, 210u8, 233u8, + 91u8, + ], + ) + } + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + #[doc = " Max allowed message body size"] + pub fn max_message_body_bytes( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::core::primitive::u32>, + > { + ::subxt::constants::StaticConstantAddress::new( + "NomadHome", + "MaxMessageBodyBytes", + [ + 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 da_bridge { + 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 TryDispatchDataRoot { + #[codec(compact)] + pub destination_domain: ::core::primitive::u32, + pub recipient_address: ::subxt::ext::sp_core::H256, + pub header: runtime_types::da_primitives::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + } + pub struct TransactionApi; + impl TransactionApi { + #[doc = "Dispatch a data root message to the home if the header is valid."] + pub fn try_dispatch_data_root( + &self, + destination_domain: ::core::primitive::u32, + recipient_address: ::subxt::ext::sp_core::H256, + header: runtime_types::da_primitives::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + ) -> ::subxt::tx::StaticTxPayload { + ::subxt::tx::StaticTxPayload::new( + "DABridge", + "try_dispatch_data_root", + TryDispatchDataRoot { + destination_domain, + recipient_address, + header, + }, + [ + 132u8, 48u8, 32u8, 77u8, 255u8, 172u8, 85u8, 111u8, 151u8, 3u8, 234u8, + 150u8, 17u8, 172u8, 88u8, 252u8, 112u8, 62u8, 63u8, 77u8, 1u8, 100u8, + 221u8, 161u8, 44u8, 172u8, 130u8, 194u8, 73u8, 222u8, 215u8, 242u8, + ], + ) + } + } + } + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub type Event = runtime_types::da_bridge::pallet::Event; + pub mod events { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct DataRootDispatched { + pub destination_domain: ::core::primitive::u32, + pub recipient_address: ::subxt::ext::sp_core::H256, + pub block_number: ::core::primitive::u32, + pub data_root: ::subxt::ext::sp_core::H256, + } + impl ::subxt::events::StaticEvent for DataRootDispatched { + const EVENT: &'static str = "DataRootDispatched"; + const PALLET: &'static str = "DABridge"; + } + } + pub mod constants { + use super::runtime_types; + pub struct ConstantsApi; + impl ConstantsApi { + pub fn da_bridge_pallet_id( + &self, + ) -> ::subxt::constants::StaticConstantAddress< + ::subxt::metadata::DecodeStaticType<::subxt::ext::sp_core::H256>, + > { + ::subxt::constants::StaticConstantAddress::new( + "DABridge", + "DABridgePalletId", + [ + 167u8, 71u8, 0u8, 47u8, 217u8, 107u8, 29u8, 163u8, 157u8, 187u8, 110u8, + 219u8, 88u8, 213u8, 82u8, 107u8, 46u8, 199u8, 41u8, 110u8, 102u8, + 187u8, 45u8, 201u8, 247u8, 66u8, 33u8, 228u8, 33u8, 99u8, 242u8, 80u8, + ], + ) + } + } + } + } + pub mod runtime_types { + use super::runtime_types; + pub mod da_bridge { + 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 = "Dispatch a data root message to the home if the header is valid."] + try_dispatch_data_root { + #[codec(compact)] + destination_domain: ::core::primitive::u32, + recipient_address: ::subxt::ext::sp_core::H256, + header: runtime_types::da_primitives::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/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + InitializationError, + #[codec(index = 1)] + HashOfBlockNotMatchBlockNumber, + #[codec(index = 2)] + DABridgeMessageExceedsMaxMessageSize, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + DataRootDispatched { + destination_domain: ::core::primitive::u32, + recipient_address: ::subxt::ext::sp_core::H256, + block_number: ::core::primitive::u32, + data_root: ::subxt::ext::sp_core::H256, + }, + } + } + } + pub mod da_control { + use super::runtime_types; + pub mod extensions { + use super::runtime_types; + pub mod check_app_id { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct CheckAppId(pub runtime_types::da_primitives::asdr::AppId); + } + } + pub mod pallet { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct AppKeyInfo<_0> { + pub owner: _0, + pub id: runtime_types::da_primitives::asdr::AppId, + } + #[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 = "Creates an application key if `key` does not exist yet."] + create_application_key { + key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + }, + #[codec(index = 1)] + submit_data { + data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + }, + #[codec(index = 2)] + submit_block_length_proposal { + rows: ::core::primitive::u32, + cols: ::core::primitive::u32, + }, + } + #[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 application key already exists."] + AppKeyAlreadyExists, + #[codec(index = 1)] + #[doc = "The last application ID overflowed."] + LastAppIdOverflowed, + #[codec(index = 2)] + #[doc = "The last block length proposal Id overflowed."] + LastBlockLenProposalIdOverflowed, + #[codec(index = 3)] + BlockDimensionsOutOfBounds, + #[codec(index = 4)] + BlockDimensionsTooSmall, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Event for the pallet."] + pub enum Event { + #[codec(index = 0)] + #[doc = "A new application key was created."] + ApplicationKeyCreated { + key: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + owner: ::subxt::ext::sp_core::crypto::AccountId32, + id: runtime_types::da_primitives::asdr::AppId, + }, + #[codec(index = 1)] + DataSubmitted { + who: ::subxt::ext::sp_core::crypto::AccountId32, + data: runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + }, + #[codec(index = 2)] + BlockLengthProposalSubmitted { + rows: ::core::primitive::u32, + cols: ::core::primitive::u32, + }, + } + } + } + pub mod da_primitives { + use super::runtime_types; + pub mod asdr { + use super::runtime_types; + pub mod app_unchecked_extrinsic { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct AppUncheckedExtrinsic<_0, _1, _2, _3>( + pub ::std::vec::Vec<::core::primitive::u8>, + #[codec(skip)] pub ::core::marker::PhantomData<(_1, _0, _2, _3)>, + ); + } + pub mod data_lookup { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Default, + Eq, + PartialEq, + serde :: Deserialize, + serde :: Serialize, + )] + pub struct DataLookup { + #[codec(compact)] + pub size: ::core::primitive::u32, + pub index: ::std::vec::Vec< + runtime_types::da_primitives::asdr::data_lookup::DataLookupIndexItem, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + serde :: Deserialize, + serde :: Serialize, + )] + pub struct DataLookupIndexItem { + pub app_id: runtime_types::da_primitives::asdr::AppId, + #[codec(compact)] + pub start: ::core::primitive::u32, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct AppExtrinsic { + pub app_id: runtime_types::da_primitives::asdr::AppId, + pub data: ::std::vec::Vec<::core::primitive::u8>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Copy, + Debug, + Default, + Eq, + PartialEq, + derive_more :: From, + serde :: Deserialize, + serde :: Serialize, + )] + pub struct AppId(#[codec(compact)] pub ::core::primitive::u32); + } + pub mod header { + use super::runtime_types; + pub mod extension { + use super::runtime_types; + pub mod v1 { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Default, + Eq, + PartialEq, + serde :: Deserialize, + serde :: Serialize, + )] + pub struct HeaderExtension { + pub commitment: + runtime_types::da_primitives::kate_commitment::KateCommitment, + pub app_lookup: + runtime_types::da_primitives::asdr::data_lookup::DataLookup, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + serde :: Deserialize, + serde :: Serialize, + )] + pub enum HeaderExtension { + #[codec(index = 0)] + V1(runtime_types::da_primitives::header::extension::v1::HeaderExtension), + } + } + #[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, + pub extension: runtime_types::da_primitives::header::extension::HeaderExtension, + #[codec(skip)] + pub __subxt_unused_type_params: ::core::marker::PhantomData<_1>, + } + } + pub mod kate_commitment { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Default, + Eq, + PartialEq, + serde :: Deserialize, + serde :: Serialize, + )] + #[serde(rename_all = "camelCase")] + pub struct KateCommitment { + #[codec(compact)] + pub rows: ::core::primitive::u16, + #[codec(compact)] + pub cols: ::core::primitive::u16, + pub data_root: ::subxt::ext::sp_core::H256, + pub commitment: ::std::vec::Vec<::core::primitive::u8>, + } + } + } + pub mod da_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 = 1)] + Utility(runtime_types::pallet_utility::pallet::Call), + #[codec(index = 2)] + Babe(runtime_types::pallet_babe::pallet::Call), + #[codec(index = 3)] + Timestamp(runtime_types::pallet_timestamp::pallet::Call), + #[codec(index = 4)] + Authorship(runtime_types::pallet_authorship::pallet::Call), + #[codec(index = 5)] + Indices(runtime_types::pallet_indices::pallet::Call), + #[codec(index = 6)] + Balances(runtime_types::pallet_balances::pallet::Call), + #[codec(index = 9)] + ElectionProviderMultiPhase( + runtime_types::pallet_election_provider_multi_phase::pallet::Call, + ), + #[codec(index = 10)] + Staking(runtime_types::pallet_staking::pallet::pallet::Call), + #[codec(index = 11)] + Session(runtime_types::pallet_session::pallet::Call), + #[codec(index = 12)] + Democracy(runtime_types::pallet_democracy::pallet::Call), + #[codec(index = 13)] + Council(runtime_types::pallet_collective::pallet::Call), + #[codec(index = 14)] + TechnicalCommittee(runtime_types::pallet_collective::pallet::Call), + #[codec(index = 15)] + Elections(runtime_types::pallet_elections_phragmen::pallet::Call), + #[codec(index = 16)] + TechnicalMembership(runtime_types::pallet_membership::pallet::Call), + #[codec(index = 17)] + Grandpa(runtime_types::pallet_grandpa::pallet::Call), + #[codec(index = 18)] + Treasury(runtime_types::pallet_treasury::pallet::Call), + #[codec(index = 19)] + Sudo(runtime_types::pallet_sudo::pallet::Call), + #[codec(index = 20)] + ImOnline(runtime_types::pallet_im_online::pallet::Call), + #[codec(index = 24)] + Scheduler(runtime_types::pallet_scheduler::pallet::Call), + #[codec(index = 25)] + Bounties(runtime_types::pallet_bounties::pallet::Call), + #[codec(index = 26)] + Tips(runtime_types::pallet_tips::pallet::Call), + #[codec(index = 28)] + BagsList(runtime_types::pallet_bags_list::pallet::Call), + #[codec(index = 29)] + DataAvailability(runtime_types::da_control::pallet::Call), + #[codec(index = 30)] + UpdaterManager(runtime_types::updater_manager::pallet::Call), + #[codec(index = 31)] + NomadHome(runtime_types::nomad_home::pallet::Call), + #[codec(index = 32)] + DABridge(runtime_types::da_bridge::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 = 1)] + Utility(runtime_types::pallet_utility::pallet::Event), + #[codec(index = 5)] + Indices(runtime_types::pallet_indices::pallet::Event), + #[codec(index = 6)] + Balances(runtime_types::pallet_balances::pallet::Event), + #[codec(index = 9)] + ElectionProviderMultiPhase( + runtime_types::pallet_election_provider_multi_phase::pallet::Event, + ), + #[codec(index = 10)] + Staking(runtime_types::pallet_staking::pallet::pallet::Event), + #[codec(index = 11)] + Session(runtime_types::pallet_session::pallet::Event), + #[codec(index = 12)] + Democracy(runtime_types::pallet_democracy::pallet::Event), + #[codec(index = 13)] + Council(runtime_types::pallet_collective::pallet::Event), + #[codec(index = 14)] + TechnicalCommittee(runtime_types::pallet_collective::pallet::Event), + #[codec(index = 15)] + Elections(runtime_types::pallet_elections_phragmen::pallet::Event), + #[codec(index = 16)] + TechnicalMembership(runtime_types::pallet_membership::pallet::Event), + #[codec(index = 17)] + Grandpa(runtime_types::pallet_grandpa::pallet::Event), + #[codec(index = 18)] + Treasury(runtime_types::pallet_treasury::pallet::Event), + #[codec(index = 19)] + Sudo(runtime_types::pallet_sudo::pallet::Event), + #[codec(index = 20)] + ImOnline(runtime_types::pallet_im_online::pallet::Event), + #[codec(index = 22)] + Offences(runtime_types::pallet_offences::pallet::Event), + #[codec(index = 24)] + Scheduler(runtime_types::pallet_scheduler::pallet::Event), + #[codec(index = 25)] + Bounties(runtime_types::pallet_bounties::pallet::Event), + #[codec(index = 26)] + Tips(runtime_types::pallet_tips::pallet::Event), + #[codec(index = 28)] + BagsList(runtime_types::pallet_bags_list::pallet::Event), + #[codec(index = 29)] + DataAvailability(runtime_types::da_control::pallet::Event), + #[codec(index = 30)] + UpdaterManager(runtime_types::updater_manager::pallet::Event), + #[codec(index = 31)] + NomadHome(runtime_types::nomad_home::pallet::Event), + #[codec(index = 32)] + DABridge(runtime_types::da_bridge::pallet::Event), + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct NposSolution16 { + pub votes1: ::std::vec::Vec<( + ::subxt::ext::codec::Compact<::core::primitive::u32>, + ::subxt::ext::codec::Compact<::core::primitive::u16>, + )>, + pub votes2: ::std::vec::Vec<( + ::subxt::ext::codec::Compact<::core::primitive::u32>, + ( + ::subxt::ext::codec::Compact<::core::primitive::u16>, + ::subxt::ext::codec::Compact< + runtime_types::sp_arithmetic::per_things::PerU16, + >, + ), + ::subxt::ext::codec::Compact<::core::primitive::u16>, + )>, + pub votes3: ::std::vec::Vec<( + ::subxt::ext::codec::Compact<::core::primitive::u32>, + [( + ::subxt::ext::codec::Compact<::core::primitive::u16>, + ::subxt::ext::codec::Compact< + runtime_types::sp_arithmetic::per_things::PerU16, + >, + ); 2usize], + ::subxt::ext::codec::Compact<::core::primitive::u16>, + )>, + pub votes4: ::std::vec::Vec<( + ::subxt::ext::codec::Compact<::core::primitive::u32>, + [( + ::subxt::ext::codec::Compact<::core::primitive::u16>, + ::subxt::ext::codec::Compact< + runtime_types::sp_arithmetic::per_things::PerU16, + >, + ); 3usize], + ::subxt::ext::codec::Compact<::core::primitive::u16>, + )>, + pub votes5: ::std::vec::Vec<( + ::subxt::ext::codec::Compact<::core::primitive::u32>, + [( + ::subxt::ext::codec::Compact<::core::primitive::u16>, + ::subxt::ext::codec::Compact< + runtime_types::sp_arithmetic::per_things::PerU16, + >, + ); 4usize], + ::subxt::ext::codec::Compact<::core::primitive::u16>, + )>, + pub votes6: ::std::vec::Vec<( + ::subxt::ext::codec::Compact<::core::primitive::u32>, + [( + ::subxt::ext::codec::Compact<::core::primitive::u16>, + ::subxt::ext::codec::Compact< + runtime_types::sp_arithmetic::per_things::PerU16, + >, + ); 5usize], + ::subxt::ext::codec::Compact<::core::primitive::u16>, + )>, + pub votes7: ::std::vec::Vec<( + ::subxt::ext::codec::Compact<::core::primitive::u32>, + [( + ::subxt::ext::codec::Compact<::core::primitive::u16>, + ::subxt::ext::codec::Compact< + runtime_types::sp_arithmetic::per_things::PerU16, + >, + ); 6usize], + ::subxt::ext::codec::Compact<::core::primitive::u16>, + )>, + pub votes8: ::std::vec::Vec<( + ::subxt::ext::codec::Compact<::core::primitive::u32>, + [( + ::subxt::ext::codec::Compact<::core::primitive::u16>, + ::subxt::ext::codec::Compact< + runtime_types::sp_arithmetic::per_things::PerU16, + >, + ); 7usize], + ::subxt::ext::codec::Compact<::core::primitive::u16>, + )>, + pub votes9: ::std::vec::Vec<( + ::subxt::ext::codec::Compact<::core::primitive::u32>, + [( + ::subxt::ext::codec::Compact<::core::primitive::u16>, + ::subxt::ext::codec::Compact< + runtime_types::sp_arithmetic::per_things::PerU16, + >, + ); 8usize], + ::subxt::ext::codec::Compact<::core::primitive::u16>, + )>, + pub votes10: ::std::vec::Vec<( + ::subxt::ext::codec::Compact<::core::primitive::u32>, + [( + ::subxt::ext::codec::Compact<::core::primitive::u16>, + ::subxt::ext::codec::Compact< + runtime_types::sp_arithmetic::per_things::PerU16, + >, + ); 9usize], + ::subxt::ext::codec::Compact<::core::primitive::u16>, + )>, + pub votes11: ::std::vec::Vec<( + ::subxt::ext::codec::Compact<::core::primitive::u32>, + [( + ::subxt::ext::codec::Compact<::core::primitive::u16>, + ::subxt::ext::codec::Compact< + runtime_types::sp_arithmetic::per_things::PerU16, + >, + ); 10usize], + ::subxt::ext::codec::Compact<::core::primitive::u16>, + )>, + pub votes12: ::std::vec::Vec<( + ::subxt::ext::codec::Compact<::core::primitive::u32>, + [( + ::subxt::ext::codec::Compact<::core::primitive::u16>, + ::subxt::ext::codec::Compact< + runtime_types::sp_arithmetic::per_things::PerU16, + >, + ); 11usize], + ::subxt::ext::codec::Compact<::core::primitive::u16>, + )>, + pub votes13: ::std::vec::Vec<( + ::subxt::ext::codec::Compact<::core::primitive::u32>, + [( + ::subxt::ext::codec::Compact<::core::primitive::u16>, + ::subxt::ext::codec::Compact< + runtime_types::sp_arithmetic::per_things::PerU16, + >, + ); 12usize], + ::subxt::ext::codec::Compact<::core::primitive::u16>, + )>, + pub votes14: ::std::vec::Vec<( + ::subxt::ext::codec::Compact<::core::primitive::u32>, + [( + ::subxt::ext::codec::Compact<::core::primitive::u16>, + ::subxt::ext::codec::Compact< + runtime_types::sp_arithmetic::per_things::PerU16, + >, + ); 13usize], + ::subxt::ext::codec::Compact<::core::primitive::u16>, + )>, + pub votes15: ::std::vec::Vec<( + ::subxt::ext::codec::Compact<::core::primitive::u32>, + [( + ::subxt::ext::codec::Compact<::core::primitive::u16>, + ::subxt::ext::codec::Compact< + runtime_types::sp_arithmetic::per_things::PerU16, + >, + ); 14usize], + ::subxt::ext::codec::Compact<::core::primitive::u16>, + )>, + pub votes16: ::std::vec::Vec<( + ::subxt::ext::codec::Compact<::core::primitive::u32>, + [( + ::subxt::ext::codec::Compact<::core::primitive::u16>, + ::subxt::ext::codec::Compact< + runtime_types::sp_arithmetic::per_things::PerU16, + >, + ); 15usize], + ::subxt::ext::codec::Compact<::core::primitive::u16>, + )>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum OriginCaller { + #[codec(index = 0)] + system( + runtime_types::frame_system::RawOrigin< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ), + #[codec(index = 13)] + Council( + runtime_types::pallet_collective::RawOrigin< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ), + #[codec(index = 14)] + TechnicalCommittee( + runtime_types::pallet_collective::RawOrigin< + ::subxt::ext::sp_core::crypto::AccountId32, + >, + ), + #[codec(index = 3)] + 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 babe: runtime_types::sp_consensus_babe::app::Public, + pub grandpa: runtime_types::sp_finality_grandpa::app::Public, + pub im_online: runtime_types::pallet_im_online::sr25519::app_sr25519::Public, + pub authority_discovery: runtime_types::sp_authority_discovery::app::Public, + } + } + pub mod finality_grandpa { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Equivocation<_0, _1, _2> { + pub round_number: ::core::primitive::u64, + pub identity: _0, + pub first: (_1, _2), + pub second: (_1, _2), + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Precommit<_0, _1> { + pub target_hash: _0, + pub target_number: _1, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Prevote<_0, _1> { + pub target_hash: _0, + pub target_number: _1, + } + } + pub mod frame_support { + use super::runtime_types; + pub mod storage { + 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 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 WrapperOpaque<_0>( + #[codec(compact)] pub ::core::primitive::u32, + pub _0, + ); + } + 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 WeightToFeeCoefficient<_0> { + pub coeff_integer: _0, + pub coeff_frac: runtime_types::sp_arithmetic::per_things::Perbill, + pub negative: ::core::primitive::bool, + pub degree: ::core::primitive::u8, + } + } + #[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, + >, + #[codec(compact)] + pub cols: ::core::primitive::u32, + #[codec(compact)] + pub rows: ::core::primitive::u32, + #[codec(compact)] + pub chunk_size: ::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 expensive."] + #[doc = "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 block."] + #[doc = "# "] + 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."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(b)` where b is the length of the remark."] + #[doc = "- 1 event."] + #[doc = "# "] + 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. \\[info\\]"] + ExtrinsicSuccess(runtime_types::frame_support::weights::DispatchInfo), + #[codec(index = 1)] + #[doc = "An extrinsic failed. \\[error, info\\]"] + ExtrinsicFailed( + runtime_types::sp_runtime::DispatchError, + runtime_types::frame_support::weights::DispatchInfo, + ), + #[codec(index = 2)] + #[doc = "`:code` was updated."] + CodeUpdated, + #[codec(index = 3)] + #[doc = "A new \\[account\\] was created."] + NewAccount(::subxt::ext::sp_core::crypto::AccountId32), + #[codec(index = 4)] + #[doc = "An \\[account\\] was reaped."] + KilledAccount(::subxt::ext::sp_core::crypto::AccountId32), + #[codec(index = 5)] + #[doc = "On on-chain remark happened. \\[origin, remark_hash\\]"] + Remarked( + ::subxt::ext::sp_core::crypto::AccountId32, + ::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 ExtrinsicLen { + pub raw: ::core::primitive::u32, + pub padded: ::core::primitive::u32, + } + #[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, + } + #[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 merkle { + use super::runtime_types; + pub mod light { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct LightMerkle { + pub branch: [::subxt::ext::sp_core::H256; 32usize], + pub count: ::core::primitive::u32, + } + } + } + pub mod nomad_base { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct NomadBase { + pub state: runtime_types::nomad_core::state::NomadState, + pub local_domain: ::core::primitive::u32, + pub committed_root: ::subxt::ext::sp_core::H256, + pub updater: ::subxt::ext::sp_core::H160, + } + } + pub mod nomad_core { + use super::runtime_types; + pub mod state { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum NomadState { + #[codec(index = 0)] + Active, + #[codec(index = 1)] + Failed, + } + } + pub mod update { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SignedUpdate { + pub update: runtime_types::nomad_core::update::Update, + pub signature: runtime_types::signature::signature::Signature, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Update { + pub home_domain: ::core::primitive::u32, + pub previous_root: ::subxt::ext::sp_core::H256, + pub new_root: ::subxt::ext::sp_core::H256, + } + } + } + pub mod nomad_home { + 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 = "Dispatch a message to the destination domain and recipient address."] + dispatch { + #[codec(compact)] + destination_domain: ::core::primitive::u32, + recipient_address: ::subxt::ext::sp_core::H256, + message_body: + runtime_types::frame_support::storage::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + }, + #[codec(index = 1)] + #[doc = "Verify/submit signed update."] + update { + signed_update: runtime_types::nomad_core::update::SignedUpdate, + #[codec(compact)] + max_index: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Verify/slash updater for improper update."] + improper_update { + signed_update: runtime_types::nomad_core::update::SignedUpdate, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + InitializationError, + #[codec(index = 1)] + IngestionError, + #[codec(index = 2)] + SignatureRecoveryError, + #[codec(index = 3)] + MessageTooLarge, + #[codec(index = 4)] + InvalidUpdaterSignature, + #[codec(index = 5)] + CommittedRootNotMatchUpdatePrevious, + #[codec(index = 6)] + RootForIndexNotFound, + #[codec(index = 7)] + IndexForRootNotFound, + #[codec(index = 8)] + FailedState, + #[codec(index = 9)] + MaxIndexWitnessExhausted, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + Dispatch { + message_hash: ::subxt::ext::sp_core::H256, + leaf_index: ::core::primitive::u32, + destination_and_nonce: ::core::primitive::u64, + committed_root: ::subxt::ext::sp_core::H256, + message: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 1)] + Update { + home_domain: ::core::primitive::u32, + previous_root: ::subxt::ext::sp_core::H256, + new_root: ::subxt::ext::sp_core::H256, + signature: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 2)] + ImproperUpdate { + previous_root: ::subxt::ext::sp_core::H256, + new_root: ::subxt::ext::sp_core::H256, + signature: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 3)] + UpdaterSlashed { + updater: ::subxt::ext::sp_core::H160, + reporter: ::subxt::ext::sp_core::crypto::AccountId32, + }, + } + } + } + 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::da_primitives::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/v3/runtime/events-and-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_babe { + 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 = "Report authority equivocation/misbehavior. This method will verify"] + #[doc = "the equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence will"] + #[doc = "be reported."] + report_equivocation { + equivocation_proof: ::std::boxed::Box< + runtime_types::sp_consensus_slots::EquivocationProof< + runtime_types::da_primitives::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + runtime_types::sp_consensus_babe::app::Public, + >, + >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + }, + #[codec(index = 1)] + #[doc = "Report authority equivocation/misbehavior. This method will verify"] + #[doc = "the equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence will"] + #[doc = "be reported."] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + report_equivocation_unsigned { + equivocation_proof: ::std::boxed::Box< + runtime_types::sp_consensus_slots::EquivocationProof< + runtime_types::da_primitives::header::Header< + ::core::primitive::u32, + runtime_types::sp_runtime::traits::BlakeTwo256, + >, + runtime_types::sp_consensus_babe::app::Public, + >, + >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + }, + #[codec(index = 2)] + #[doc = "Plan an epoch config change. The epoch config change is recorded and will be enacted on"] + #[doc = "the next call to `enact_epoch_change`. The config will be activated one epoch after."] + #[doc = "Multiple calls to this method will replace any existing planned config change that had"] + #[doc = "not been enacted yet."] + plan_config_change { + config: runtime_types::sp_consensus_babe::digests::NextConfigDescriptor, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "An equivocation proof provided as part of an equivocation report is invalid."] + InvalidEquivocationProof, + #[codec(index = 1)] + #[doc = "A key ownership proof provided as part of an equivocation report is invalid."] + InvalidKeyOwnershipProof, + #[codec(index = 2)] + #[doc = "A given equivocation report is valid but already previously reported."] + DuplicateOffenceReport, + } + } + } + pub mod pallet_bags_list { + use super::runtime_types; + pub mod list { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Bag { + pub head: ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + pub tail: ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Node { + pub id: ::subxt::ext::sp_core::crypto::AccountId32, + pub prev: ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + pub next: ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + pub bag_upper: ::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 = "Declare that some `dislocated` account has, through rewards or penalties, sufficiently"] + #[doc = "changed its weight that it should properly fall into a different bag than its current"] + #[doc = "one."] + #[doc = ""] + #[doc = "Anyone can call this function about any potentially dislocated account."] + #[doc = ""] + #[doc = "Will never return an error; if `dislocated` does not exist or doesn't need a rebag, then"] + #[doc = "it is a noop and fees are still collected from `origin`."] + rebag { + dislocated: ::subxt::ext::sp_core::crypto::AccountId32, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "Moved an account from one bag to another."] + Rebagged { + who: ::subxt::ext::sp_core::crypto::AccountId32, + from: ::core::primitive::u64, + to: ::core::primitive::u64, + }, + } + } + } + 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 = "It will decrease the total issuance of the system by the `TransferFee`."] + #[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, + ::core::primitive::u32, + >, + #[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 decrease the total issuance of the system (`TotalIssuance`)."] + #[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, + ::core::primitive::u32, + >, + #[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, + ::core::primitive::u32, + >, + dest: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[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, + ::core::primitive::u32, + >, + #[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, + ::core::primitive::u32, + >, + 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, + ::core::primitive::u32, + >, + 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/v3/runtime/events-and-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/v3/runtime/events-and-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_bounties { + 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 = "Propose a new bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Payment: `TipReportDepositBase` will be reserved from the origin account, as well as"] + #[doc = "`DataDepositPerByte` for each byte in `reason`. It will be unreserved upon approval,"] + #[doc = "or slashed when rejected."] + #[doc = ""] + #[doc = "- `curator`: The curator account whom will manage this bounty."] + #[doc = "- `fee`: The curator fee."] + #[doc = "- `value`: The total payment amount of this bounty, curator fee included."] + #[doc = "- `description`: The description of this bounty."] + propose_bounty { + #[codec(compact)] + value: ::core::primitive::u128, + description: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 1)] + #[doc = "Approve a bounty proposal. At a later time, the bounty will be funded and become active"] + #[doc = "and the original deposit will be returned."] + #[doc = ""] + #[doc = "May only be called from `T::ApproveOrigin`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + approve_bounty { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Assign a curator to a funded bounty."] + #[doc = ""] + #[doc = "May only be called from `T::ApproveOrigin`."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + propose_curator { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + curator: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + #[codec(compact)] + fee: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "Unassign curator from a bounty."] + #[doc = ""] + #[doc = "This function can only be called by the `RejectOrigin` a signed origin."] + #[doc = ""] + #[doc = "If this function is called by the `RejectOrigin`, we assume that the curator is"] + #[doc = "malicious or inactive. As a result, we will slash the curator when possible."] + #[doc = ""] + #[doc = "If the origin is the curator, we take this as a sign they are unable to do their job and"] + #[doc = "they willingly give up. We could slash them, but for now we allow them to recover their"] + #[doc = "deposit and exit without issue. (We may want to change this if it is abused.)"] + #[doc = ""] + #[doc = "Finally, the origin can be anyone if and only if the curator is \"inactive\". This allows"] + #[doc = "anyone in the community to call out that a curator is not doing their due diligence, and"] + #[doc = "we should pick a new curator. In this case the curator should also be slashed."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + unassign_curator { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + #[codec(index = 4)] + #[doc = "Accept the curator role for a bounty."] + #[doc = "A deposit will be reserved from curator and refund upon successful payout."] + #[doc = ""] + #[doc = "May only be called from the curator."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + accept_curator { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + #[codec(index = 5)] + #[doc = "Award bounty to a beneficiary account. The beneficiary will be able to claim the funds"] + #[doc = "after a delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to award."] + #[doc = "- `beneficiary`: The beneficiary account whom will receive the payout."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + award_bounty { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + beneficiary: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + }, + #[codec(index = 6)] + #[doc = "Claim the payout from an awarded bounty after payout delay."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the beneficiary of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to claim."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + claim_bounty { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + #[codec(index = 7)] + #[doc = "Cancel a proposed or active bounty. All the funds will be sent to treasury and"] + #[doc = "the curator deposit will be unreserved if possible."] + #[doc = ""] + #[doc = "Only `T::RejectOrigin` is able to cancel a bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to cancel."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + close_bounty { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + }, + #[codec(index = 8)] + #[doc = "Extend the expiry time of an active bounty."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be the curator of this bounty."] + #[doc = ""] + #[doc = "- `bounty_id`: Bounty ID to extend."] + #[doc = "- `remark`: additional information."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(1)."] + #[doc = "# "] + extend_bounty_expiry { + #[codec(compact)] + bounty_id: ::core::primitive::u32, + remark: ::std::vec::Vec<::core::primitive::u8>, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] + 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 = "The reason given is just too big."] + ReasonTooBig, + #[codec(index = 3)] + #[doc = "The bounty status is unexpected."] + UnexpectedStatus, + #[codec(index = 4)] + #[doc = "Require bounty curator."] + RequireCurator, + #[codec(index = 5)] + #[doc = "Invalid bounty value."] + InvalidValue, + #[codec(index = 6)] + #[doc = "Invalid bounty fee."] + InvalidFee, + #[codec(index = 7)] + #[doc = "A bounty payout is pending."] + #[doc = "To cancel the bounty, you must unassign and slash the curator."] + PendingPayout, + #[codec(index = 8)] + #[doc = "The bounties cannot be claimed/closed because it's still in the countdown period."] + Premature, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "New bounty proposal."] + BountyProposed { index: ::core::primitive::u32 }, + #[codec(index = 1)] + #[doc = "A bounty proposal was rejected; funds were slashed."] + BountyRejected { + index: ::core::primitive::u32, + bond: ::core::primitive::u128, + }, + #[codec(index = 2)] + #[doc = "A bounty proposal is funded and became active."] + BountyBecameActive { index: ::core::primitive::u32 }, + #[codec(index = 3)] + #[doc = "A bounty is awarded to a beneficiary."] + BountyAwarded { + index: ::core::primitive::u32, + beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 4)] + #[doc = "A bounty is claimed by beneficiary."] + BountyClaimed { + index: ::core::primitive::u32, + payout: ::core::primitive::u128, + beneficiary: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 5)] + #[doc = "A bounty is cancelled."] + BountyCanceled { index: ::core::primitive::u32 }, + #[codec(index = 6)] + #[doc = "A bounty expiry is extended."] + BountyExtended { index: ::core::primitive::u32 }, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Bounty<_0, _1, _2> { + pub proposer: _0, + pub value: _1, + pub fee: _1, + pub curator_deposit: _1, + pub bond: _1, + pub status: runtime_types::pallet_bounties::BountyStatus<_0, _2>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum BountyStatus<_0, _1> { + #[codec(index = 0)] + Proposed, + #[codec(index = 1)] + Approved, + #[codec(index = 2)] + Funded, + #[codec(index = 3)] + CuratorProposed { curator: _0 }, + #[codec(index = 4)] + Active { curator: _0, update_due: _1 }, + #[codec(index = 5)] + PendingPayout { + curator: _0, + beneficiary: _0, + unlock_at: _1, + }, + } + } + pub mod pallet_collective { + 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 collective's membership."] + #[doc = ""] + #[doc = "- `new_members`: The new member list. Be nice to the chain and provide it sorted."] + #[doc = "- `prime`: The prime member whose vote sets the default."] + #[doc = "- `old_count`: The upper bound for the previous number of members in storage. Used for"] + #[doc = " weight estimation."] + #[doc = ""] + #[doc = "Requires root origin."] + #[doc = ""] + #[doc = "NOTE: Does not enforce the expected `MaxMembers` limit on the amount of members, but"] + #[doc = " the weight estimations rely on it to estimate dispatchable weight."] + #[doc = ""] + #[doc = "# WARNING:"] + #[doc = ""] + #[doc = "The `pallet-collective` can also be managed by logic outside of the pallet through the"] + #[doc = "implementation of the trait [`ChangeMembers`]."] + #[doc = "Any call to `set_members` must be careful that the member set doesn't get out of sync"] + #[doc = "with other logic managing the member set."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(MP + N)` where:"] + #[doc = " - `M` old-members-count (code- and governance-bounded)"] + #[doc = " - `N` new-members-count (code- and governance-bounded)"] + #[doc = " - `P` proposals-count (code-bounded)"] + #[doc = "- DB:"] + #[doc = " - 1 storage mutation (codec `O(M)` read, `O(N)` write) for reading and writing the"] + #[doc = " members"] + #[doc = " - 1 storage read (codec `O(P)`) for reading the proposals"] + #[doc = " - `P` storage mutations (codec `O(M)`) for updating the votes for each proposal"] + #[doc = " - 1 storage write (codec `O(1)`) for deleting the old `prime` and setting the new one"] + #[doc = "# "] + set_members { + new_members: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + prime: ::core::option::Option<::subxt::ext::sp_core::crypto::AccountId32>, + old_count: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "Dispatch a proposal from a member using the `Member` origin."] + #[doc = ""] + #[doc = "Origin must be a member of the collective."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(M + P)` where `M` members-count (code-bounded) and `P` complexity of dispatching"] + #[doc = " `proposal`"] + #[doc = "- DB: 1 read (codec `O(M)`) + DB access of `proposal`"] + #[doc = "- 1 event"] + #[doc = "# "] + execute { + proposal: ::std::boxed::Box, + #[codec(compact)] + length_bound: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Add a new proposal to either be voted on or executed directly."] + #[doc = ""] + #[doc = "Requires the sender to be member."] + #[doc = ""] + #[doc = "`threshold` determines whether `proposal` is executed directly (`threshold < 2`)"] + #[doc = "or put up for voting."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(B + M + P1)` or `O(B + M + P2)` where:"] + #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] + #[doc = " - `M` is members-count (code- and governance-bounded)"] + #[doc = " - branching is influenced by `threshold` where:"] + #[doc = " - `P1` is proposal execution complexity (`threshold < 2`)"] + #[doc = " - `P2` is proposals-count (code-bounded) (`threshold >= 2`)"] + #[doc = "- DB:"] + #[doc = " - 1 storage read `is_member` (codec `O(M)`)"] + #[doc = " - 1 storage read `ProposalOf::contains_key` (codec `O(1)`)"] + #[doc = " - DB accesses influenced by `threshold`:"] + #[doc = " - EITHER storage accesses done by `proposal` (`threshold < 2`)"] + #[doc = " - OR proposal insertion (`threshold <= 2`)"] + #[doc = " - 1 storage mutation `Proposals` (codec `O(P2)`)"] + #[doc = " - 1 storage mutation `ProposalCount` (codec `O(1)`)"] + #[doc = " - 1 storage write `ProposalOf` (codec `O(B)`)"] + #[doc = " - 1 storage write `Voting` (codec `O(M)`)"] + #[doc = " - 1 event"] + #[doc = "# "] + propose { + #[codec(compact)] + threshold: ::core::primitive::u32, + proposal: ::std::boxed::Box, + #[codec(compact)] + length_bound: ::core::primitive::u32, + }, + #[codec(index = 3)] + #[doc = "Add an aye or nay vote for the sender to the given proposal."] + #[doc = ""] + #[doc = "Requires the sender to be a member."] + #[doc = ""] + #[doc = "Transaction fees will be waived if the member is voting on any particular proposal"] + #[doc = "for the first time and the call is successful. Subsequent vote changes will charge a"] + #[doc = "fee."] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(M)` where `M` is members-count (code- and governance-bounded)"] + #[doc = "- DB:"] + #[doc = " - 1 storage read `Members` (codec `O(M)`)"] + #[doc = " - 1 storage mutation `Voting` (codec `O(M)`)"] + #[doc = "- 1 event"] + #[doc = "# "] + vote { + proposal: ::subxt::ext::sp_core::H256, + #[codec(compact)] + index: ::core::primitive::u32, + approve: ::core::primitive::bool, + }, + #[codec(index = 4)] + #[doc = "Close a vote that is either approved, disapproved or whose voting period has ended."] + #[doc = ""] + #[doc = "May be called by any signed account in order to finish voting and close the proposal."] + #[doc = ""] + #[doc = "If called before the end of the voting period it will only close the vote if it is"] + #[doc = "has enough votes to be approved or disapproved."] + #[doc = ""] + #[doc = "If called after the end of the voting period abstentions are counted as rejections"] + #[doc = "unless there is a prime member set and the prime member cast an approval."] + #[doc = ""] + #[doc = "If the close operation completes successfully with disapproval, the transaction fee will"] + #[doc = "be waived. Otherwise execution of the approved operation will be charged to the caller."] + #[doc = ""] + #[doc = "+ `proposal_weight_bound`: The maximum amount of weight consumed by executing the closed"] + #[doc = "proposal."] + #[doc = "+ `length_bound`: The upper bound for the length of the proposal in storage. Checked via"] + #[doc = "`storage::read` so it is `size_of::() == 4` larger than the pure length."] + #[doc = ""] + #[doc = "# "] + #[doc = "## Weight"] + #[doc = "- `O(B + M + P1 + P2)` where:"] + #[doc = " - `B` is `proposal` size in bytes (length-fee-bounded)"] + #[doc = " - `M` is members-count (code- and governance-bounded)"] + #[doc = " - `P1` is the complexity of `proposal` preimage."] + #[doc = " - `P2` is proposal-count (code-bounded)"] + #[doc = "- DB:"] + #[doc = " - 2 storage reads (`Members`: codec `O(M)`, `Prime`: codec `O(1)`)"] + #[doc = " - 3 mutations (`Voting`: codec `O(M)`, `ProposalOf`: codec `O(B)`, `Proposals`: codec"] + #[doc = " `O(P2)`)"] + #[doc = " - any mutations done while executing `proposal` (`P1`)"] + #[doc = "- up to 3 events"] + #[doc = "# "] + close { + proposal_hash: ::subxt::ext::sp_core::H256, + #[codec(compact)] + index: ::core::primitive::u32, + #[codec(compact)] + proposal_weight_bound: ::core::primitive::u64, + #[codec(compact)] + length_bound: ::core::primitive::u32, + }, + #[codec(index = 5)] + #[doc = "Disapprove a proposal, close, and remove it from the system, regardless of its current"] + #[doc = "state."] + #[doc = ""] + #[doc = "Must be called by the Root origin."] + #[doc = ""] + #[doc = "Parameters:"] + #[doc = "* `proposal_hash`: The hash of the proposal that should be disapproved."] + #[doc = ""] + #[doc = "# "] + #[doc = "Complexity: O(P) where P is the number of max proposals"] + #[doc = "DB Weight:"] + #[doc = "* Reads: Proposals"] + #[doc = "* Writes: Voting, Proposals, ProposalOf"] + #[doc = "# "] + disapprove_proposal { + proposal_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/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "Account is not a member"] + NotMember, + #[codec(index = 1)] + #[doc = "Duplicate proposals not allowed"] + DuplicateProposal, + #[codec(index = 2)] + #[doc = "Proposal must exist"] + ProposalMissing, + #[codec(index = 3)] + #[doc = "Mismatched index"] + WrongIndex, + #[codec(index = 4)] + #[doc = "Duplicate vote ignored"] + DuplicateVote, + #[codec(index = 5)] + #[doc = "Members are already initialized!"] + AlreadyInitialized, + #[codec(index = 6)] + #[doc = "The close call was made too early, before the end of the voting."] + TooEarly, + #[codec(index = 7)] + #[doc = "There can only be a maximum of `MaxProposals` active proposals."] + TooManyProposals, + #[codec(index = 8)] + #[doc = "The given weight bound for the proposal was too low."] + WrongProposalWeight, + #[codec(index = 9)] + #[doc = "The given length bound for the proposal was too low."] + WrongProposalLength, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A motion (given hash) has been proposed (by given account) with a threshold (given"] + #[doc = "`MemberCount`)."] + Proposed { + account: ::subxt::ext::sp_core::crypto::AccountId32, + proposal_index: ::core::primitive::u32, + proposal_hash: ::subxt::ext::sp_core::H256, + threshold: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "A motion (given hash) has been voted on by given account, leaving"] + #[doc = "a tally (yes votes and no votes given respectively as `MemberCount`)."] + Voted { + account: ::subxt::ext::sp_core::crypto::AccountId32, + proposal_hash: ::subxt::ext::sp_core::H256, + voted: ::core::primitive::bool, + yes: ::core::primitive::u32, + no: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "A motion was approved by the required threshold."] + Approved { + proposal_hash: ::subxt::ext::sp_core::H256, + }, + #[codec(index = 3)] + #[doc = "A motion was not approved by the required threshold."] + Disapproved { + proposal_hash: ::subxt::ext::sp_core::H256, + }, + #[codec(index = 4)] + #[doc = "A motion was executed; result will be `Ok` if it returned without error."] + Executed { + proposal_hash: ::subxt::ext::sp_core::H256, + result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + }, + #[codec(index = 5)] + #[doc = "A single member did some action; result will be `Ok` if it returned without error."] + MemberExecuted { + proposal_hash: ::subxt::ext::sp_core::H256, + result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + }, + #[codec(index = 6)] + #[doc = "A proposal was closed because its threshold was reached or after its duration was up."] + Closed { + proposal_hash: ::subxt::ext::sp_core::H256, + yes: ::core::primitive::u32, + no: ::core::primitive::u32, + }, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum RawOrigin<_0> { + #[codec(index = 0)] + Members(::core::primitive::u32, ::core::primitive::u32), + #[codec(index = 1)] + Member(_0), + #[codec(index = 2)] + _Phantom, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Votes<_0, _1> { + pub index: _1, + pub threshold: _1, + pub ayes: ::std::vec::Vec<_0>, + pub nays: ::std::vec::Vec<_0>, + pub end: _1, + } + } + pub mod pallet_democracy { + use super::runtime_types; + pub mod conviction { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Conviction { + #[codec(index = 0)] + None, + #[codec(index = 1)] + Locked1x, + #[codec(index = 2)] + Locked2x, + #[codec(index = 3)] + Locked3x, + #[codec(index = 4)] + Locked4x, + #[codec(index = 5)] + Locked5x, + #[codec(index = 6)] + Locked6x, + } + } + 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 = "Propose a sensitive action to be taken."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_ and the sender must"] + #[doc = "have funds to cover the deposit."] + #[doc = ""] + #[doc = "- `proposal_hash`: The hash of the proposal preimage."] + #[doc = "- `value`: The amount of deposit (must be at least `MinimumDeposit`)."] + #[doc = ""] + #[doc = "Emits `Proposed`."] + #[doc = ""] + #[doc = "Weight: `O(p)`"] + propose { + proposal_hash: ::subxt::ext::sp_core::H256, + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 1)] + #[doc = "Signals agreement with a particular proposal."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_ and the sender"] + #[doc = "must have funds to cover the deposit, equal to the original deposit."] + #[doc = ""] + #[doc = "- `proposal`: The index of the proposal to second."] + #[doc = "- `seconds_upper_bound`: an upper bound on the current number of seconds on this"] + #[doc = " proposal. Extrinsic is weighted according to this value with no refund."] + #[doc = ""] + #[doc = "Weight: `O(S)` where S is the number of seconds a proposal already has."] + second { + #[codec(compact)] + proposal: ::core::primitive::u32, + #[codec(compact)] + seconds_upper_bound: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Vote in a referendum. If `vote.is_aye()`, the vote is to enact the proposal;"] + #[doc = "otherwise it is a vote to keep the status quo."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `ref_index`: The index of the referendum to vote for."] + #[doc = "- `vote`: The vote configuration."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of referendums the voter has voted on."] + vote { + #[codec(compact)] + ref_index: ::core::primitive::u32, + vote: runtime_types::pallet_democracy::vote::AccountVote< + ::core::primitive::u128, + >, + }, + #[codec(index = 3)] + #[doc = "Schedule an emergency cancellation of a referendum. Cannot happen twice to the same"] + #[doc = "referendum."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `CancellationOrigin`."] + #[doc = ""] + #[doc = "-`ref_index`: The index of the referendum to cancel."] + #[doc = ""] + #[doc = "Weight: `O(1)`."] + emergency_cancel { ref_index: ::core::primitive::u32 }, + #[codec(index = 4)] + #[doc = "Schedule a referendum to be tabled once it is legal to schedule an external"] + #[doc = "referendum."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `ExternalOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of the proposal."] + #[doc = ""] + #[doc = "Weight: `O(V)` with V number of vetoers in the blacklist of proposal."] + #[doc = " Decoding vec of length V. Charged as maximum"] + external_propose { + proposal_hash: ::subxt::ext::sp_core::H256, + }, + #[codec(index = 5)] + #[doc = "Schedule a majority-carries referendum to be tabled next once it is legal to schedule"] + #[doc = "an external referendum."] + #[doc = ""] + #[doc = "The dispatch of this call must be `ExternalMajorityOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of the proposal."] + #[doc = ""] + #[doc = "Unlike `external_propose`, blacklisting has no effect on this and it may replace a"] + #[doc = "pre-scheduled `external_propose` call."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + external_propose_majority { + proposal_hash: ::subxt::ext::sp_core::H256, + }, + #[codec(index = 6)] + #[doc = "Schedule a negative-turnout-bias referendum to be tabled next once it is legal to"] + #[doc = "schedule an external referendum."] + #[doc = ""] + #[doc = "The dispatch of this call must be `ExternalDefaultOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of the proposal."] + #[doc = ""] + #[doc = "Unlike `external_propose`, blacklisting has no effect on this and it may replace a"] + #[doc = "pre-scheduled `external_propose` call."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + external_propose_default { + proposal_hash: ::subxt::ext::sp_core::H256, + }, + #[codec(index = 7)] + #[doc = "Schedule the currently externally-proposed majority-carries referendum to be tabled"] + #[doc = "immediately. If there is no externally-proposed referendum currently, or if there is one"] + #[doc = "but it is not a majority-carries referendum then it fails."] + #[doc = ""] + #[doc = "The dispatch of this call must be `FastTrackOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The hash of the current external proposal."] + #[doc = "- `voting_period`: The period that is allowed for voting on this proposal. Increased to"] + #[doc = " `FastTrackVotingPeriod` if too low."] + #[doc = "- `delay`: The number of block after voting has ended in approval and this should be"] + #[doc = " enacted. This doesn't have a minimum amount."] + #[doc = ""] + #[doc = "Emits `Started`."] + #[doc = ""] + #[doc = "Weight: `O(1)`"] + fast_track { + proposal_hash: ::subxt::ext::sp_core::H256, + voting_period: ::core::primitive::u32, + delay: ::core::primitive::u32, + }, + #[codec(index = 8)] + #[doc = "Veto and blacklist the external proposal hash."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `VetoOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of the proposal to veto and blacklist."] + #[doc = ""] + #[doc = "Emits `Vetoed`."] + #[doc = ""] + #[doc = "Weight: `O(V + log(V))` where V is number of `existing vetoers`"] + veto_external { + proposal_hash: ::subxt::ext::sp_core::H256, + }, + #[codec(index = 9)] + #[doc = "Remove a referendum."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Root_."] + #[doc = ""] + #[doc = "- `ref_index`: The index of the referendum to cancel."] + #[doc = ""] + #[doc = "# Weight: `O(1)`."] + cancel_referendum { + #[codec(compact)] + ref_index: ::core::primitive::u32, + }, + #[codec(index = 10)] + #[doc = "Cancel a proposal queued for enactment."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Root_."] + #[doc = ""] + #[doc = "- `which`: The index of the referendum to cancel."] + #[doc = ""] + #[doc = "Weight: `O(D)` where `D` is the items in the dispatch queue. Weighted as `D = 10`."] + cancel_queued { which: ::core::primitive::u32 }, + #[codec(index = 11)] + #[doc = "Delegate the voting power (with some given conviction) of the sending account."] + #[doc = ""] + #[doc = "The balance delegated is locked for as long as it's delegated, and thereafter for the"] + #[doc = "time appropriate for the conviction's lock period."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_, and the signing account must either:"] + #[doc = " - be delegating already; or"] + #[doc = " - have no voting activity (if there is, then it will need to be removed/consolidated"] + #[doc = " through `reap_vote` or `unvote`)."] + #[doc = ""] + #[doc = "- `to`: The account whose voting the `target` account's voting power will follow."] + #[doc = "- `conviction`: The conviction that will be attached to the delegated votes. When the"] + #[doc = " account is undelegated, the funds will be locked for the corresponding period."] + #[doc = "- `balance`: The amount of the account's balance to be used in delegating. This must not"] + #[doc = " be more than the account's current balance."] + #[doc = ""] + #[doc = "Emits `Delegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of referendums the voter delegating to has"] + #[doc = " voted on. Weight is charged as if maximum votes."] + delegate { + to: ::subxt::ext::sp_core::crypto::AccountId32, + conviction: runtime_types::pallet_democracy::conviction::Conviction, + balance: ::core::primitive::u128, + }, + #[codec(index = 12)] + #[doc = "Undelegate the voting power of the sending account."] + #[doc = ""] + #[doc = "Tokens may be unlocked following once an amount of time consistent with the lock period"] + #[doc = "of the conviction with which the delegation was issued."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_ and the signing account must be"] + #[doc = "currently delegating."] + #[doc = ""] + #[doc = "Emits `Undelegated`."] + #[doc = ""] + #[doc = "Weight: `O(R)` where R is the number of referendums the voter delegating to has"] + #[doc = " voted on. Weight is charged as if maximum votes."] + undelegate, + #[codec(index = 13)] + #[doc = "Clears all public proposals."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Root_."] + #[doc = ""] + #[doc = "Weight: `O(1)`."] + clear_public_proposals, + #[codec(index = 14)] + #[doc = "Register the preimage for an upcoming proposal. This doesn't require the proposal to be"] + #[doc = "in the dispatch queue but does require a deposit, returned once enacted."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `encoded_proposal`: The preimage of a proposal."] + #[doc = ""] + #[doc = "Emits `PreimageNoted`."] + #[doc = ""] + #[doc = "Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit)."] + note_preimage { + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 15)] + #[doc = "Same as `note_preimage` but origin is `OperationalPreimageOrigin`."] + note_preimage_operational { + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 16)] + #[doc = "Register the preimage for an upcoming proposal. This requires the proposal to be"] + #[doc = "in the dispatch queue. No deposit is needed. When this call is successful, i.e."] + #[doc = "the preimage has not been uploaded before and matches some imminent proposal,"] + #[doc = "no fee is paid."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `encoded_proposal`: The preimage of a proposal."] + #[doc = ""] + #[doc = "Emits `PreimageNoted`."] + #[doc = ""] + #[doc = "Weight: `O(E)` with E size of `encoded_proposal` (protected by a required deposit)."] + note_imminent_preimage { + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 17)] + #[doc = "Same as `note_imminent_preimage` but origin is `OperationalPreimageOrigin`."] + note_imminent_preimage_operational { + encoded_proposal: ::std::vec::Vec<::core::primitive::u8>, + }, + #[codec(index = 18)] + #[doc = "Remove an expired proposal preimage and collect the deposit."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `proposal_hash`: The preimage hash of a proposal."] + #[doc = "- `proposal_length_upper_bound`: an upper bound on length of the proposal. Extrinsic is"] + #[doc = " weighted according to this value with no refund."] + #[doc = ""] + #[doc = "This will only work after `VotingPeriod` blocks from the time that the preimage was"] + #[doc = "noted, if it's the same account doing it. If it's a different account, then it'll only"] + #[doc = "work an additional `EnactmentPeriod` later."] + #[doc = ""] + #[doc = "Emits `PreimageReaped`."] + #[doc = ""] + #[doc = "Weight: `O(D)` where D is length of proposal."] + reap_preimage { + proposal_hash: ::subxt::ext::sp_core::H256, + #[codec(compact)] + proposal_len_upper_bound: ::core::primitive::u32, + }, + #[codec(index = 19)] + #[doc = "Unlock tokens that have an expired lock."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account to remove the lock on."] + #[doc = ""] + #[doc = "Weight: `O(R)` with R number of vote of target."] + unlock { + target: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 20)] + #[doc = "Remove a vote for a referendum."] + #[doc = ""] + #[doc = "If:"] + #[doc = "- the referendum was cancelled, or"] + #[doc = "- the referendum is ongoing, or"] + #[doc = "- the referendum has ended such that"] + #[doc = " - the vote of the account was in opposition to the result; or"] + #[doc = " - there was no conviction to the account's vote; or"] + #[doc = " - the account made a split vote"] + #[doc = "...then the vote is removed cleanly and a following call to `unlock` may result in more"] + #[doc = "funds being available."] + #[doc = ""] + #[doc = "If, however, the referendum has ended and:"] + #[doc = "- it finished corresponding to the vote of the account, and"] + #[doc = "- the account made a standard vote with conviction, and"] + #[doc = "- the lock period of the conviction is not over"] + #[doc = "...then the lock will be aggregated into the overall account's lock, which may involve"] + #[doc = "*overlocking* (where the two locks are combined into a single lock that is the maximum"] + #[doc = "of both the amount locked and the time is it locked for)."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_, and the signer must have a vote"] + #[doc = "registered for referendum `index`."] + #[doc = ""] + #[doc = "- `index`: The index of referendum of the vote to be removed."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + remove_vote { index: ::core::primitive::u32 }, + #[codec(index = 21)] + #[doc = "Remove a vote for a referendum."] + #[doc = ""] + #[doc = "If the `target` is equal to the signer, then this function is exactly equivalent to"] + #[doc = "`remove_vote`. If not equal to the signer, then the vote must have expired,"] + #[doc = "either because the referendum was cancelled, because the voter lost the referendum or"] + #[doc = "because the conviction period is over."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be _Signed_."] + #[doc = ""] + #[doc = "- `target`: The account of the vote to be removed; this account must have voted for"] + #[doc = " referendum `index`."] + #[doc = "- `index`: The index of referendum of the vote to be removed."] + #[doc = ""] + #[doc = "Weight: `O(R + log R)` where R is the number of referenda that `target` has voted on."] + #[doc = " Weight is calculated for the maximum number of vote."] + remove_other_vote { + target: ::subxt::ext::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + }, + #[codec(index = 22)] + #[doc = "Enact a proposal from a referendum. For now we just make the weight be the maximum."] + enact_proposal { + proposal_hash: ::subxt::ext::sp_core::H256, + index: ::core::primitive::u32, + }, + #[codec(index = 23)] + #[doc = "Permanently place a proposal into the blacklist. This prevents it from ever being"] + #[doc = "proposed again."] + #[doc = ""] + #[doc = "If called on a queued public or external proposal, then this will result in it being"] + #[doc = "removed. If the `ref_index` supplied is an active referendum with the proposal hash,"] + #[doc = "then it will be cancelled."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `BlacklistOrigin`."] + #[doc = ""] + #[doc = "- `proposal_hash`: The proposal hash to blacklist permanently."] + #[doc = "- `ref_index`: An ongoing referendum whose hash is `proposal_hash`, which will be"] + #[doc = "cancelled."] + #[doc = ""] + #[doc = "Weight: `O(p)` (though as this is an high-privilege dispatch, we assume it has a"] + #[doc = " reasonable value)."] + blacklist { + proposal_hash: ::subxt::ext::sp_core::H256, + maybe_ref_index: ::core::option::Option<::core::primitive::u32>, + }, + #[codec(index = 24)] + #[doc = "Remove a proposal."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be `CancelProposalOrigin`."] + #[doc = ""] + #[doc = "- `prop_index`: The index of the proposal to cancel."] + #[doc = ""] + #[doc = "Weight: `O(p)` where `p = PublicProps::::decode_len()`"] + cancel_proposal { + #[codec(compact)] + prop_index: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "Value too low"] + ValueLow, + #[codec(index = 1)] + #[doc = "Proposal does not exist"] + ProposalMissing, + #[codec(index = 2)] + #[doc = "Cannot cancel the same proposal twice"] + AlreadyCanceled, + #[codec(index = 3)] + #[doc = "Proposal already made"] + DuplicateProposal, + #[codec(index = 4)] + #[doc = "Proposal still blacklisted"] + ProposalBlacklisted, + #[codec(index = 5)] + #[doc = "Next external proposal not simple majority"] + NotSimpleMajority, + #[codec(index = 6)] + #[doc = "Invalid hash"] + InvalidHash, + #[codec(index = 7)] + #[doc = "No external proposal"] + NoProposal, + #[codec(index = 8)] + #[doc = "Identity may not veto a proposal twice"] + AlreadyVetoed, + #[codec(index = 9)] + #[doc = "Preimage already noted"] + DuplicatePreimage, + #[codec(index = 10)] + #[doc = "Not imminent"] + NotImminent, + #[codec(index = 11)] + #[doc = "Too early"] + TooEarly, + #[codec(index = 12)] + #[doc = "Imminent"] + Imminent, + #[codec(index = 13)] + #[doc = "Preimage not found"] + PreimageMissing, + #[codec(index = 14)] + #[doc = "Vote given for invalid referendum"] + ReferendumInvalid, + #[codec(index = 15)] + #[doc = "Invalid preimage"] + PreimageInvalid, + #[codec(index = 16)] + #[doc = "No proposals waiting"] + NoneWaiting, + #[codec(index = 17)] + #[doc = "The given account did not vote on the referendum."] + NotVoter, + #[codec(index = 18)] + #[doc = "The actor has no permission to conduct the action."] + NoPermission, + #[codec(index = 19)] + #[doc = "The account is already delegating."] + AlreadyDelegating, + #[codec(index = 20)] + #[doc = "Too high a balance was provided that the account cannot afford."] + InsufficientFunds, + #[codec(index = 21)] + #[doc = "The account is not currently delegating."] + NotDelegating, + #[codec(index = 22)] + #[doc = "The account currently has votes attached to it and the operation cannot succeed until"] + #[doc = "these are removed, either through `unvote` or `reap_vote`."] + VotesExist, + #[codec(index = 23)] + #[doc = "The instant referendum origin is currently disallowed."] + InstantNotAllowed, + #[codec(index = 24)] + #[doc = "Delegation to oneself makes no sense."] + Nonsense, + #[codec(index = 25)] + #[doc = "Invalid upper bound."] + WrongUpperBound, + #[codec(index = 26)] + #[doc = "Maximum number of votes reached."] + MaxVotesReached, + #[codec(index = 27)] + #[doc = "Maximum number of proposals reached."] + TooManyProposals, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A motion has been proposed by a public account."] + Proposed { + proposal_index: ::core::primitive::u32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 1)] + #[doc = "A public proposal has been tabled for referendum vote."] + Tabled { + proposal_index: ::core::primitive::u32, + deposit: ::core::primitive::u128, + depositors: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + }, + #[codec(index = 2)] + #[doc = "An external proposal has been tabled."] + ExternalTabled, + #[codec(index = 3)] + #[doc = "A referendum has begun."] + Started { + ref_index: ::core::primitive::u32, + threshold: runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + }, + #[codec(index = 4)] + #[doc = "A proposal has been approved by referendum."] + Passed { ref_index: ::core::primitive::u32 }, + #[codec(index = 5)] + #[doc = "A proposal has been rejected by referendum."] + NotPassed { ref_index: ::core::primitive::u32 }, + #[codec(index = 6)] + #[doc = "A referendum has been cancelled."] + Cancelled { ref_index: ::core::primitive::u32 }, + #[codec(index = 7)] + #[doc = "A proposal has been enacted."] + Executed { + ref_index: ::core::primitive::u32, + result: + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + }, + #[codec(index = 8)] + #[doc = "An account has delegated their vote to another account."] + Delegated { + who: ::subxt::ext::sp_core::crypto::AccountId32, + target: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 9)] + #[doc = "An account has cancelled a previous delegation operation."] + Undelegated { + account: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 10)] + #[doc = "An external proposal has been vetoed."] + Vetoed { + who: ::subxt::ext::sp_core::crypto::AccountId32, + proposal_hash: ::subxt::ext::sp_core::H256, + until: ::core::primitive::u32, + }, + #[codec(index = 11)] + #[doc = "A proposal's preimage was noted, and the deposit taken."] + PreimageNoted { + proposal_hash: ::subxt::ext::sp_core::H256, + who: ::subxt::ext::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 12)] + #[doc = "A proposal preimage was removed and used (the deposit was returned)."] + PreimageUsed { + proposal_hash: ::subxt::ext::sp_core::H256, + provider: ::subxt::ext::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 13)] + #[doc = "A proposal could not be executed because its preimage was invalid."] + PreimageInvalid { + proposal_hash: ::subxt::ext::sp_core::H256, + ref_index: ::core::primitive::u32, + }, + #[codec(index = 14)] + #[doc = "A proposal could not be executed because its preimage was missing."] + PreimageMissing { + proposal_hash: ::subxt::ext::sp_core::H256, + ref_index: ::core::primitive::u32, + }, + #[codec(index = 15)] + #[doc = "A registered preimage was removed and the deposit collected by the reaper."] + PreimageReaped { + proposal_hash: ::subxt::ext::sp_core::H256, + provider: ::subxt::ext::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + reaper: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 16)] + #[doc = "A proposal_hash has been blacklisted permanently."] + Blacklisted { + proposal_hash: ::subxt::ext::sp_core::H256, + }, + } + } + pub mod types { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Delegations<_0> { + pub votes: _0, + pub capital: _0, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum ReferendumInfo<_0, _1, _2> { + #[codec(index = 0)] + Ongoing(runtime_types::pallet_democracy::types::ReferendumStatus<_0, _1, _2>), + #[codec(index = 1)] + Finished { + approved: ::core::primitive::bool, + end: _0, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ReferendumStatus<_0, _1, _2> { + pub end: _0, + pub proposal_hash: _1, + pub threshold: runtime_types::pallet_democracy::vote_threshold::VoteThreshold, + pub delay: _0, + pub tally: runtime_types::pallet_democracy::types::Tally<_2>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Tally<_0> { + pub ayes: _0, + pub nays: _0, + pub turnout: _0, + } + } + pub mod vote { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum AccountVote<_0> { + #[codec(index = 0)] + Standard { + vote: runtime_types::pallet_democracy::vote::Vote, + balance: _0, + }, + #[codec(index = 1)] + Split { aye: _0, nay: _0 }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct PriorLock<_0, _1>(pub _0, pub _1); + #[derive( + :: subxt :: ext :: codec :: CompactAs, + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Vote(pub ::core::primitive::u8); + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Voting<_0, _1, _2> { + #[codec(index = 0)] + Direct { + votes: ::std::vec::Vec<( + _2, + runtime_types::pallet_democracy::vote::AccountVote<_0>, + )>, + delegations: runtime_types::pallet_democracy::types::Delegations<_0>, + prior: runtime_types::pallet_democracy::vote::PriorLock<_2, _0>, + }, + #[codec(index = 1)] + Delegating { + balance: _0, + target: _1, + conviction: runtime_types::pallet_democracy::conviction::Conviction, + delegations: runtime_types::pallet_democracy::types::Delegations<_0>, + prior: runtime_types::pallet_democracy::vote::PriorLock<_2, _0>, + }, + } + } + pub mod vote_threshold { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum VoteThreshold { + #[codec(index = 0)] + SuperMajorityApprove, + #[codec(index = 1)] + SuperMajorityAgainst, + #[codec(index = 2)] + SimpleMajority, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum PreimageStatus<_0, _1, _2> { + #[codec(index = 0)] + Missing(_2), + #[codec(index = 1)] + Available { + data: ::std::vec::Vec<::core::primitive::u8>, + provider: _0, + deposit: _1, + since: _2, + expiry: ::core::option::Option<_2>, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Releases { + #[codec(index = 0)] + V1, + } + } + pub mod pallet_election_provider_multi_phase { + 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 = "Submit a solution for the unsigned phase."] # [doc = ""] # [doc = "The dispatch origin fo this call must be __none__."] # [doc = ""] # [doc = "This submission is checked on the fly. Moreover, this unsigned solution is only"] # [doc = "validated when submitted to the pool from the **local** node. Effectively, this means"] # [doc = "that only active validators can submit this transaction when authoring a block (similar"] # [doc = "to an inherent)."] # [doc = ""] # [doc = "To prevent any incorrect solution (and thus wasted time/weight), this transaction will"] # [doc = "panic if the solution submitted by the validator is invalid in any way, effectively"] # [doc = "putting their authoring reward at risk."] # [doc = ""] # [doc = "No deposit or reward is associated with this submission."] submit_unsigned { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: da_runtime :: NposSolution16 > > , witness : runtime_types :: pallet_election_provider_multi_phase :: SolutionOrSnapshotSize , } , # [codec (index = 1)] # [doc = "Set a new value for `MinimumUntrustedScore`."] # [doc = ""] # [doc = "Dispatch origin must be aligned with `T::ForceOrigin`."] # [doc = ""] # [doc = "This check can be turned off by setting the value to `None`."] set_minimum_untrusted_score { maybe_next_score : :: core :: option :: Option < [:: core :: primitive :: u128 ; 3usize] > , } , # [codec (index = 2)] # [doc = "Set a solution in the queue, to be handed out to the client of this pallet in the next"] # [doc = "call to `ElectionProvider::elect`."] # [doc = ""] # [doc = "This can only be set by `T::ForceOrigin`, and only when the phase is `Emergency`."] # [doc = ""] # [doc = "The solution is not checked for any feasibility and is assumed to be trustworthy, as any"] # [doc = "feasibility check itself can in principle cause the election process to fail (due to"] # [doc = "memory/weight constrains)."] set_emergency_election_result { supports : :: std :: vec :: Vec < (:: subxt :: ext :: sp_core :: crypto :: AccountId32 , runtime_types :: sp_npos_elections :: Support < :: subxt :: ext :: sp_core :: crypto :: AccountId32 > ,) > , } , # [codec (index = 3)] # [doc = "Submit a solution for the signed phase."] # [doc = ""] # [doc = "The dispatch origin fo this call must be __signed__."] # [doc = ""] # [doc = "The solution is potentially queued, based on the claimed score and processed at the end"] # [doc = "of the signed phase."] # [doc = ""] # [doc = "A deposit is reserved and recorded for the solution. Based on the outcome, the solution"] # [doc = "might be rewarded, slashed, or get all or a part of the deposit back."] # [doc = ""] # [doc = "# "] # [doc = "Queue size must be provided as witness data."] # [doc = "# "] submit { raw_solution : :: std :: boxed :: Box < runtime_types :: pallet_election_provider_multi_phase :: RawSolution < runtime_types :: da_runtime :: NposSolution16 > > , num_signed_submissions : :: core :: primitive :: u32 , } , } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "Error of the pallet that can be returned in response to dispatches."] + pub enum Error { + #[codec(index = 0)] + #[doc = "Submission was too early."] + PreDispatchEarlySubmission, + #[codec(index = 1)] + #[doc = "Wrong number of winners presented."] + PreDispatchWrongWinnerCount, + #[codec(index = 2)] + #[doc = "Submission was too weak, score-wise."] + PreDispatchWeakSubmission, + #[codec(index = 3)] + #[doc = "The queue was full, and the solution was not better than any of the existing ones."] + SignedQueueFull, + #[codec(index = 4)] + #[doc = "The origin failed to pay the deposit."] + SignedCannotPayDeposit, + #[codec(index = 5)] + #[doc = "Witness data to dispatchable is invalid."] + SignedInvalidWitness, + #[codec(index = 6)] + #[doc = "The signed submission consumes too much weight"] + SignedTooMuchWeight, + #[codec(index = 7)] + #[doc = "OCW submitted solution for wrong round"] + OcwCallWrongEra, + #[codec(index = 8)] + #[doc = "Snapshot metadata should exist but didn't."] + MissingSnapshotMetadata, + #[codec(index = 9)] + #[doc = "`Self::insert_submission` returned an invalid index."] + InvalidSubmissionIndex, + #[codec(index = 10)] + #[doc = "The call is not allowed at this point."] + CallNotAllowed, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A solution was stored with the given compute."] + #[doc = ""] + #[doc = "If the solution is signed, this means that it hasn't yet been processed. If the"] + #[doc = "solution is unsigned, this means that it has also been processed."] + #[doc = ""] + #[doc = "The `bool` is `true` when a previous solution was ejected to make room for this one."] + SolutionStored { + election_compute: + runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + prev_ejected: ::core::primitive::bool, + }, + #[codec(index = 1)] + #[doc = "The election has been finalized, with `Some` of the given computation, or else if the"] + #[doc = "election failed, `None`."] + ElectionFinalized { + election_compute: ::core::option::Option< + runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + >, + }, + #[codec(index = 2)] + #[doc = "An account has been rewarded for their signed submission being finalized."] + Rewarded { + account: ::subxt::ext::sp_core::crypto::AccountId32, + value: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "An account has been slashed for submitting an invalid signed submission."] + Slashed { + account: ::subxt::ext::sp_core::crypto::AccountId32, + value: ::core::primitive::u128, + }, + #[codec(index = 4)] + #[doc = "The signed phase of the given round has started."] + SignedPhaseStarted { round: ::core::primitive::u32 }, + #[codec(index = 5)] + #[doc = "The unsigned phase of the given round has started."] + UnsignedPhaseStarted { round: ::core::primitive::u32 }, + } + } + pub mod signed { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SignedSubmission<_0, _1, _2> { + pub who: _0, + pub deposit: _1, + pub raw_solution: + runtime_types::pallet_election_provider_multi_phase::RawSolution<_2>, + pub reward: _1, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum ElectionCompute { + #[codec(index = 0)] + OnChain, + #[codec(index = 1)] + Signed, + #[codec(index = 2)] + Unsigned, + #[codec(index = 3)] + Fallback, + #[codec(index = 4)] + Emergency, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Phase<_0> { + #[codec(index = 0)] + Off, + #[codec(index = 1)] + Signed, + #[codec(index = 2)] + Unsigned((::core::primitive::bool, _0)), + #[codec(index = 3)] + Emergency, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RawSolution<_0> { + pub solution: _0, + pub score: [::core::primitive::u128; 3usize], + pub round: ::core::primitive::u32, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ReadySolution<_0> { + pub supports: ::std::vec::Vec<(_0, runtime_types::sp_npos_elections::Support<_0>)>, + pub score: [::core::primitive::u128; 3usize], + pub compute: runtime_types::pallet_election_provider_multi_phase::ElectionCompute, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct RoundSnapshot<_0> { + pub voters: ::std::vec::Vec<(_0, ::core::primitive::u64, ::std::vec::Vec<_0>)>, + pub targets: ::std::vec::Vec<_0>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SolutionOrSnapshotSize { + #[codec(compact)] + pub voters: ::core::primitive::u32, + #[codec(compact)] + pub targets: ::core::primitive::u32, + } + } + pub mod pallet_elections_phragmen { + 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 = "Vote for a set of candidates for the upcoming round of election. This can be called to"] + #[doc = "set the initial votes, or update already existing votes."] + #[doc = ""] + #[doc = "Upon initial voting, `value` units of `who`'s balance is locked and a deposit amount is"] + #[doc = "reserved. The deposit is based on the number of votes and can be updated over time."] + #[doc = ""] + #[doc = "The `votes` should:"] + #[doc = " - not be empty."] + #[doc = " - be less than the number of possible candidates. Note that all current members and"] + #[doc = " runners-up are also automatically candidates for the next round."] + #[doc = ""] + #[doc = "If `value` is more than `who`'s total balance, then the maximum of the two is used."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed."] + #[doc = ""] + #[doc = "### Warning"] + #[doc = ""] + #[doc = "It is the responsibility of the caller to **NOT** place all of their balance into the"] + #[doc = "lock and keep some for further operations."] + #[doc = ""] + #[doc = "# "] + #[doc = "We assume the maximum weight among all 3 cases: vote_equal, vote_more and vote_less."] + #[doc = "# "] + vote { + votes: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + #[codec(compact)] + value: ::core::primitive::u128, + }, + #[codec(index = 1)] + #[doc = "Remove `origin` as a voter."] + #[doc = ""] + #[doc = "This removes the lock and returns the deposit."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed and be a voter."] + remove_voter, + #[codec(index = 2)] + #[doc = "Submit oneself for candidacy. A fixed amount of deposit is recorded."] + #[doc = ""] + #[doc = "All candidates are wiped at the end of the term. They either become a member/runner-up,"] + #[doc = "or leave the system while their deposit is slashed."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed."] + #[doc = ""] + #[doc = "### Warning"] + #[doc = ""] + #[doc = "Even if a candidate ends up being a member, they must call [`Call::renounce_candidacy`]"] + #[doc = "to get their deposit back. Losing the spot in an election will always lead to a slash."] + #[doc = ""] + #[doc = "# "] + #[doc = "The number of current candidates must be provided as witness data."] + #[doc = "# "] + submit_candidacy { + #[codec(compact)] + candidate_count: ::core::primitive::u32, + }, + #[codec(index = 3)] + #[doc = "Renounce one's intention to be a candidate for the next election round. 3 potential"] + #[doc = "outcomes exist:"] + #[doc = ""] + #[doc = "- `origin` is a candidate and not elected in any set. In this case, the deposit is"] + #[doc = " unreserved, returned and origin is removed as a candidate."] + #[doc = "- `origin` is a current runner-up. In this case, the deposit is unreserved, returned and"] + #[doc = " origin is removed as a runner-up."] + #[doc = "- `origin` is a current member. In this case, the deposit is unreserved and origin is"] + #[doc = " removed as a member, consequently not being a candidate for the next round anymore."] + #[doc = " Similar to [`remove_member`](Self::remove_member), if replacement runners exists, they"] + #[doc = " are immediately used. If the prime is renouncing, then no prime will exist until the"] + #[doc = " next round."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be signed, and have one of the above roles."] + #[doc = ""] + #[doc = "# "] + #[doc = "The type of renouncing must be provided as witness data."] + #[doc = "# "] + renounce_candidacy { + renouncing: runtime_types::pallet_elections_phragmen::Renouncing, + }, + #[codec(index = 4)] + #[doc = "Remove a particular member from the set. This is effective immediately and the bond of"] + #[doc = "the outgoing member is slashed."] + #[doc = ""] + #[doc = "If a runner-up is available, then the best runner-up will be removed and replaces the"] + #[doc = "outgoing member. Otherwise, a new phragmen election is started."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be root."] + #[doc = ""] + #[doc = "Note that this does not affect the designated block number of the next election."] + #[doc = ""] + #[doc = "# "] + #[doc = "If we have a replacement, we use a small weight. Else, since this is a root call and"] + #[doc = "will go into phragmen, we assume full block for now."] + #[doc = "# "] + remove_member { + who: ::subxt::ext::sp_runtime::MultiAddress< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u32, + >, + has_replacement: ::core::primitive::bool, + }, + #[codec(index = 5)] + #[doc = "Clean all voters who are defunct (i.e. they do not serve any purpose at all). The"] + #[doc = "deposit of the removed voters are returned."] + #[doc = ""] + #[doc = "This is an root function to be used only for cleaning the state."] + #[doc = ""] + #[doc = "The dispatch origin of this call must be root."] + #[doc = ""] + #[doc = "# "] + #[doc = "The total number of voters and those that are defunct must be provided as witness data."] + #[doc = "# "] + clean_defunct_voters { + num_voters: ::core::primitive::u32, + num_defunct: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "Cannot vote when no candidates or members exist."] + UnableToVote, + #[codec(index = 1)] + #[doc = "Must vote for at least one candidate."] + NoVotes, + #[codec(index = 2)] + #[doc = "Cannot vote more than candidates."] + TooManyVotes, + #[codec(index = 3)] + #[doc = "Cannot vote more than maximum allowed."] + MaximumVotesExceeded, + #[codec(index = 4)] + #[doc = "Cannot vote with stake less than minimum balance."] + LowBalance, + #[codec(index = 5)] + #[doc = "Voter can not pay voting bond."] + UnableToPayBond, + #[codec(index = 6)] + #[doc = "Must be a voter."] + MustBeVoter, + #[codec(index = 7)] + #[doc = "Cannot report self."] + ReportSelf, + #[codec(index = 8)] + #[doc = "Duplicated candidate submission."] + DuplicatedCandidate, + #[codec(index = 9)] + #[doc = "Member cannot re-submit candidacy."] + MemberSubmit, + #[codec(index = 10)] + #[doc = "Runner cannot re-submit candidacy."] + RunnerUpSubmit, + #[codec(index = 11)] + #[doc = "Candidate does not have enough funds."] + InsufficientCandidateFunds, + #[codec(index = 12)] + #[doc = "Not a member."] + NotMember, + #[codec(index = 13)] + #[doc = "The provided count of number of candidates is incorrect."] + InvalidWitnessData, + #[codec(index = 14)] + #[doc = "The provided count of number of votes is incorrect."] + InvalidVoteCount, + #[codec(index = 15)] + #[doc = "The renouncing origin presented a wrong `Renouncing` parameter."] + InvalidRenouncing, + #[codec(index = 16)] + #[doc = "Prediction regarding replacement after member removal is wrong."] + InvalidReplacement, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A new term with new_members. This indicates that enough candidates existed to run"] + #[doc = "the election, not that enough have has been elected. The inner value must be examined"] + #[doc = "for this purpose. A `NewTerm(\\[\\])` indicates that some candidates got their bond"] + #[doc = "slashed and none were elected, whilst `EmptyTerm` means that no candidates existed to"] + #[doc = "begin with."] + NewTerm { + new_members: ::std::vec::Vec<( + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + )>, + }, + #[codec(index = 1)] + #[doc = "No (or not enough) candidates existed for this round. This is different from"] + #[doc = "`NewTerm(\\[\\])`. See the description of `NewTerm`."] + EmptyTerm, + #[codec(index = 2)] + #[doc = "Internal error happened while trying to perform election."] + ElectionError, + #[codec(index = 3)] + #[doc = "A member has been removed. This should always be followed by either `NewTerm` or"] + #[doc = "`EmptyTerm`."] + MemberKicked { + member: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 4)] + #[doc = "Someone has renounced their candidacy."] + Renounced { + candidate: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 5)] + #[doc = "A candidate was slashed by amount due to failing to obtain a seat as member or"] + #[doc = "runner-up."] + #[doc = ""] + #[doc = "Note that old members and runners-up are also candidates."] + CandidateSlashed { + candidate: ::subxt::ext::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, + #[codec(index = 6)] + #[doc = "A seat holder was slashed by amount by being forcefully removed from the set."] + SeatHolderSlashed { + seat_holder: ::subxt::ext::sp_core::crypto::AccountId32, + amount: ::core::primitive::u128, + }, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Renouncing { + #[codec(index = 0)] + Member, + #[codec(index = 1)] + RunnerUp, + #[codec(index = 2)] + Candidate(#[codec(compact)] ::core::primitive::u32), + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct SeatHolder<_0, _1> { + pub who: _0, + pub stake: _1, + pub deposit: _1, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Voter<_0, _1> { + pub votes: ::std::vec::Vec<_0>, + pub stake: _1, + pub deposit: _1, + } + } + pub mod pallet_grandpa { + 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 = "Report voter equivocation/misbehavior. This method will verify the"] + #[doc = "equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence"] + #[doc = "will be reported."] + report_equivocation { + equivocation_proof: ::std::boxed::Box< + runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::ext::sp_core::H256, + ::core::primitive::u32, + >, + >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + }, + #[codec(index = 1)] + #[doc = "Report voter equivocation/misbehavior. This method will verify the"] + #[doc = "equivocation proof and validate the given key ownership proof"] + #[doc = "against the extracted offender. If both are valid, the offence"] + #[doc = "will be reported."] + #[doc = ""] + #[doc = "This extrinsic must be called unsigned and it is expected that only"] + #[doc = "block authors will call it (validated in `ValidateUnsigned`), as such"] + #[doc = "if the block author is defined it will be defined as the equivocation"] + #[doc = "reporter."] + report_equivocation_unsigned { + equivocation_proof: ::std::boxed::Box< + runtime_types::sp_finality_grandpa::EquivocationProof< + ::subxt::ext::sp_core::H256, + ::core::primitive::u32, + >, + >, + key_owner_proof: runtime_types::sp_session::MembershipProof, + }, + #[codec(index = 2)] + #[doc = "Note that the current authority set of the GRANDPA finality gadget has"] + #[doc = "stalled. This will trigger a forced authority set change at the beginning"] + #[doc = "of the next session, to be enacted `delay` blocks after that. The delay"] + #[doc = "should be high enough to safely assume that the block signalling the"] + #[doc = "forced change will not be re-orged (e.g. 1000 blocks). The GRANDPA voters"] + #[doc = "will start the new authority set using the given finalized block as base."] + #[doc = "Only callable by root."] + note_stalled { + delay: ::core::primitive::u32, + best_finalized_block_number: ::core::primitive::u32, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "Attempt to signal GRANDPA pause when the authority set isn't live"] + #[doc = "(either paused or already pending pause)."] + PauseFailed, + #[codec(index = 1)] + #[doc = "Attempt to signal GRANDPA resume when the authority set isn't paused"] + #[doc = "(either live or already pending resume)."] + ResumeFailed, + #[codec(index = 2)] + #[doc = "Attempt to signal GRANDPA change with one already pending."] + ChangePending, + #[codec(index = 3)] + #[doc = "Cannot signal forced change so soon after last."] + TooSoon, + #[codec(index = 4)] + #[doc = "A key ownership proof provided as part of an equivocation report is invalid."] + InvalidKeyOwnershipProof, + #[codec(index = 5)] + #[doc = "An equivocation proof provided as part of an equivocation report is invalid."] + InvalidEquivocationProof, + #[codec(index = 6)] + #[doc = "A given equivocation report is valid but already previously reported."] + DuplicateOffenceReport, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "New authority set has been applied."] + NewAuthorities { + authority_set: ::std::vec::Vec<( + runtime_types::sp_finality_grandpa::app::Public, + ::core::primitive::u64, + )>, + }, + #[codec(index = 1)] + #[doc = "Current authority set has been paused."] + Paused, + #[codec(index = 2)] + #[doc = "Current authority set has been resumed."] + Resumed, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct StoredPendingChange<_0> { + pub scheduled_at: _0, + pub delay: _0, + pub next_authorities: + runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec<( + runtime_types::sp_finality_grandpa::app::Public, + ::core::primitive::u64, + )>, + pub forced: ::core::option::Option<_0>, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum StoredState<_0> { + #[codec(index = 0)] + Live, + #[codec(index = 1)] + PendingPause { scheduled_at: _0, delay: _0 }, + #[codec(index = 2)] + Paused, + #[codec(index = 3)] + PendingResume { scheduled_at: _0, delay: _0 }, + } + } + pub mod pallet_im_online { + 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 = "# "] + #[doc = "- Complexity: `O(K + E)` where K is length of `Keys` (heartbeat.validators_len) and E is"] + #[doc = " length of `heartbeat.network_state.external_address`"] + #[doc = " - `O(K)`: decoding of length `K`"] + #[doc = " - `O(E)`: decoding/encoding of length `E`"] + #[doc = "- DbReads: pallet_session `Validators`, pallet_session `CurrentIndex`, `Keys`,"] + #[doc = " `ReceivedHeartbeats`"] + #[doc = "- DbWrites: `ReceivedHeartbeats`"] + #[doc = "# "] + heartbeat { + heartbeat: + runtime_types::pallet_im_online::Heartbeat<::core::primitive::u32>, + signature: runtime_types::pallet_im_online::sr25519::app_sr25519::Signature, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "Non existent public key."] + InvalidKey, + #[codec(index = 1)] + #[doc = "Duplicated heartbeat."] + DuplicatedHeartbeat, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A new heartbeat was received from `AuthorityId`."] + HeartbeatReceived { + authority_id: runtime_types::pallet_im_online::sr25519::app_sr25519::Public, + }, + #[codec(index = 1)] + #[doc = "At the end of the session, no offence was committed."] + AllGood, + #[codec(index = 2)] + #[doc = "At the end of the session, at least one validator was found to be offline."] + SomeOffline { + offline: ::std::vec::Vec<( + ::subxt::ext::sp_core::crypto::AccountId32, + runtime_types::pallet_staking::Exposure< + ::subxt::ext::sp_core::crypto::AccountId32, + ::core::primitive::u128, + >, + )>, + }, + } + } + 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); + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Signature(pub runtime_types::sp_core::sr25519::Signature); + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BoundedOpaqueNetworkState { + pub peer_id: + runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< + ::core::primitive::u8, + >, + pub external_addresses: + runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< + runtime_types::frame_support::storage::weak_bounded_vec::WeakBoundedVec< + ::core::primitive::u8, + >, + >, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Heartbeat<_0> { + pub block_number: _0, + pub network_state: runtime_types::sp_core::offchain::OpaqueNetworkState, + pub session_index: _0, + pub authority_index: _0, + pub validators_len: _0, + } + } + pub mod pallet_indices { + 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 = "Assign an previously unassigned index."] + #[doc = ""] + #[doc = "Payment: `Deposit` is reserved from the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `index`: the index to be claimed. This must not be in use."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- One reserve operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight: 1 Read/Write (Accounts)"] + #[doc = "# "] + claim { index: ::core::primitive::u32 }, + #[codec(index = 1)] + #[doc = "Assign an index already owned by the sender to another account. The balance reservation"] + #[doc = "is effectively transferred to the new account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "- `index`: the index to be re-assigned. This must be owned by the sender."] + #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- One transfer operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Reads: Indices Accounts, System Account (recipient)"] + #[doc = " - Writes: Indices Accounts, System Account (recipient)"] + #[doc = "# "] + transfer { + new: ::subxt::ext::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + }, + #[codec(index = 2)] + #[doc = "Free up an index owned by the sender."] + #[doc = ""] + #[doc = "Payment: Any previous deposit placed for the index is unreserved in the sender account."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the sender must own the index."] + #[doc = ""] + #[doc = "- `index`: the index to be freed. This must be owned by the sender."] + #[doc = ""] + #[doc = "Emits `IndexFreed` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- One reserve operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight: 1 Read/Write (Accounts)"] + #[doc = "# "] + free { index: ::core::primitive::u32 }, + #[codec(index = 3)] + #[doc = "Force an index to an account. This doesn't require a deposit. If the index is already"] + #[doc = "held, then any deposit is reimbursed to its current owner."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Root_."] + #[doc = ""] + #[doc = "- `index`: the index to be (re-)assigned."] + #[doc = "- `new`: the new owner of the index. This function is a no-op if it is equal to sender."] + #[doc = "- `freeze`: if set to `true`, will freeze the index so it cannot be transferred."] + #[doc = ""] + #[doc = "Emits `IndexAssigned` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- Up to one reserve operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight:"] + #[doc = " - Reads: Indices Accounts, System Account (original owner)"] + #[doc = " - Writes: Indices Accounts, System Account (original owner)"] + #[doc = "# "] + force_transfer { + new: ::subxt::ext::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + freeze: ::core::primitive::bool, + }, + #[codec(index = 4)] + #[doc = "Freeze an index so it will always point to the sender account. This consumes the"] + #[doc = "deposit."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must have a"] + #[doc = "non-frozen account `index`."] + #[doc = ""] + #[doc = "- `index`: the index to be frozen in place."] + #[doc = ""] + #[doc = "Emits `IndexFrozen` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- `O(1)`."] + #[doc = "- One storage mutation (codec `O(1)`)."] + #[doc = "- Up to one slash operation."] + #[doc = "- One event."] + #[doc = "-------------------"] + #[doc = "- DB Weight: 1 Read/Write (Accounts)"] + #[doc = "# "] + freeze { index: ::core::primitive::u32 }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "The index was not already assigned."] + NotAssigned, + #[codec(index = 1)] + #[doc = "The index is assigned to another account."] + NotOwner, + #[codec(index = 2)] + #[doc = "The index was not available."] + InUse, + #[codec(index = 3)] + #[doc = "The source and destination accounts are identical."] + NotTransfer, + #[codec(index = 4)] + #[doc = "The index is permanent and may not be freed/changed."] + Permanent, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A account index was assigned."] + IndexAssigned { + who: ::subxt::ext::sp_core::crypto::AccountId32, + index: ::core::primitive::u32, + }, + #[codec(index = 1)] + #[doc = "A account index has been freed up (unassigned)."] + IndexFreed { index: ::core::primitive::u32 }, + #[codec(index = 2)] + #[doc = "A account index has been frozen to its current account ID."] + IndexFrozen { + index: ::core::primitive::u32, + who: ::subxt::ext::sp_core::crypto::AccountId32, + }, + } + } + } + pub mod pallet_membership { + 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 = "Add a member `who` to the set."] + #[doc = ""] + #[doc = "May only be called from `T::AddOrigin`."] + add_member { + who: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 1)] + #[doc = "Remove a member `who` from the set."] + #[doc = ""] + #[doc = "May only be called from `T::RemoveOrigin`."] + remove_member { + who: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 2)] + #[doc = "Swap out one member `remove` for another `add`."] + #[doc = ""] + #[doc = "May only be called from `T::SwapOrigin`."] + #[doc = ""] + #[doc = "Prime membership is *not* passed from `remove` to `add`, if extant."] + swap_member { + remove: ::subxt::ext::sp_core::crypto::AccountId32, + add: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 3)] + #[doc = "Change the membership to a new set, disregarding the existing membership. Be nice and"] + #[doc = "pass `members` pre-sorted."] + #[doc = ""] + #[doc = "May only be called from `T::ResetOrigin`."] + reset_members { + members: ::std::vec::Vec<::subxt::ext::sp_core::crypto::AccountId32>, + }, + #[codec(index = 4)] + #[doc = "Swap out the sending member for some other key `new`."] + #[doc = ""] + #[doc = "May only be called from `Signed` origin of a current member."] + #[doc = ""] + #[doc = "Prime membership is passed from the origin account to `new`, if extant."] + change_key { + new: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 5)] + #[doc = "Set the prime member. Must be a current member."] + #[doc = ""] + #[doc = "May only be called from `T::PrimeOrigin`."] + set_prime { + who: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 6)] + #[doc = "Remove the prime member if it exists."] + #[doc = ""] + #[doc = "May only be called from `T::PrimeOrigin`."] + clear_prime, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "Already a member."] + AlreadyMember, + #[codec(index = 1)] + #[doc = "Not a member."] + NotMember, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "The given member was added; see the transaction for who."] + MemberAdded, + #[codec(index = 1)] + #[doc = "The given member was removed; see the transaction for who."] + MemberRemoved, + #[codec(index = 2)] + #[doc = "Two members were swapped; see the transaction for who."] + MembersSwapped, + #[codec(index = 3)] + #[doc = "The membership was reset; see the transaction for who the new set is."] + MembersReset, + #[codec(index = 4)] + #[doc = "One of the members' keys changed."] + KeyChanged, + #[codec(index = 5)] + #[doc = "Phantom member, never used."] + Dummy, + } + } + } + pub mod pallet_offences { + 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 = "Events type."] + pub enum Event { + #[codec(index = 0)] + #[doc = "There is an offence reported of the given `kind` happened at the `session_index` and"] + #[doc = "(kind-specific) time slot. This event is not deposited for duplicate slashes."] + #[doc = "\\[kind, timeslot\\]."] + Offence { + kind: [::core::primitive::u8; 16usize], + timeslot: ::std::vec::Vec<::core::primitive::u8>, + }, + } + } + } + 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, + }, + #[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, + }, + #[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, + }, + #[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, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-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. \\[when, index\\]"] + Scheduled(::core::primitive::u32, ::core::primitive::u32), + #[codec(index = 1)] + #[doc = "Canceled some task. \\[when, index\\]"] + Canceled(::core::primitive::u32, ::core::primitive::u32), + #[codec(index = 2)] + #[doc = "Dispatched some task. \\[task, id, result\\]"] + Dispatched( + (::core::primitive::u32, ::core::primitive::u32), + ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + ), + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Releases { + #[codec(index = 0)] + V1, + #[codec(index = 1)] + V2, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct ScheduledV2<_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::da_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/v3/runtime/events-and-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, + ::core::primitive::u32, + >, + #[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 `MAX_UNLOCKING_CHUNKS`)"] + #[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 (MAX_NOMINATIONS)."] + #[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, + ::core::primitive::u32, + >, + >, + }, + #[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 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 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 at the beginning of the next era."] + #[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, + ::core::primitive::u32, + >, + }, + #[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."] + #[doc = ""] + #[doc = "# "] + #[doc = "- O(V)"] + #[doc = "- Write: Invulnerables"] + #[doc = "# "] + 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."] + #[doc = ""] + #[doc = "# "] + #[doc = "O(S) where S is the number of slashing spans to be removed"] + #[doc = "Reads: Bonded, Slashing Spans, Account, Locks"] + #[doc = "Writes: Bonded, Slashing Spans (if S > 0), Ledger, Payee, Validators, Nominators,"] + #[doc = "Account, Locks Writes Each: SpanSlash * S"] + #[doc = "# "] + 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."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Weight: O(1)"] + #[doc = "- Write: ForceEra"] + #[doc = "# "] + 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."] + #[doc = ""] + #[doc = "# "] + #[doc = "Complexity: O(U + S)"] + #[doc = "with U unapplied slashes weighted with U=1000"] + #[doc = "and S is the number of slash indices to be canceled."] + #[doc = "- Read: Unapplied Slashes"] + #[doc = "- Write: Unapplied Slashes"] + #[doc = "# "] + 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 `MAX_UNLOCKING_CHUNKS`."] + #[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, + ::core::primitive::u32, + >, + >, + }, + #[codec(index = 23)] + #[doc = "Update the various staking limits this pallet."] + #[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 = ""] + #[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_limits { + min_nominator_bond: ::core::primitive::u128, + min_validator_bond: ::core::primitive::u128, + max_nominator_count: ::core::option::Option<::core::primitive::u32>, + max_validator_count: ::core::option::Option<::core::primitive::u32>, + threshold: ::core::option::Option< + runtime_types::sp_arithmetic::per_things::Percent, + >, + }, + #[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 = "* 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, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-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, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-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, + ), + } + } + } + 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<_0> { + pub targets: ::std::vec::Vec<_0>, + 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, + } + #[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<_0, _1> { + pub stash: _0, + #[codec(compact)] + pub total: _1, + #[codec(compact)] + pub active: _1, + pub unlocking: ::std::vec::Vec>, + 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, + ::core::primitive::u32, + >, + }, + #[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, + ::core::primitive::u32, + >, + 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/v3/runtime/events-and-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."] + KeyChanged { + new_sudoer: ::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_tips { + 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 = "Report something `reason` that deserves a tip and claim any eventual the finder's fee."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "Payment: `TipReportDepositBase` will be reserved from the origin account, as well as"] + #[doc = "`DataDepositPerByte` for each byte in `reason`."] + #[doc = ""] + #[doc = "- `reason`: The reason for, or the thing that deserves, the tip; generally this will be"] + #[doc = " a UTF-8-encoded URL."] + #[doc = "- `who`: The account which should be credited for the tip."] + #[doc = ""] + #[doc = "Emits `NewTip` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(R)` where `R` length of `reason`."] + #[doc = " - encoding and hashing of 'reason'"] + #[doc = "- DbReads: `Reasons`, `Tips`"] + #[doc = "- DbWrites: `Reasons`, `Tips`"] + #[doc = "# "] + report_awesome { + reason: ::std::vec::Vec<::core::primitive::u8>, + who: ::subxt::ext::sp_core::crypto::AccountId32, + }, + #[codec(index = 1)] + #[doc = "Retract a prior tip-report from `report_awesome`, and cancel the process of tipping."] + #[doc = ""] + #[doc = "If successful, the original deposit will be unreserved."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the tip identified by `hash`"] + #[doc = "must have been reported by the signing account through `report_awesome` (and not"] + #[doc = "through `tip_new`)."] + #[doc = ""] + #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] + #[doc = " as the hash of the tuple of the original tip `reason` and the beneficiary account ID."] + #[doc = ""] + #[doc = "Emits `TipRetracted` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(1)`"] + #[doc = " - Depends on the length of `T::Hash` which is fixed."] + #[doc = "- DbReads: `Tips`, `origin account`"] + #[doc = "- DbWrites: `Reasons`, `Tips`, `origin account`"] + #[doc = "# "] + retract_tip { hash: ::subxt::ext::sp_core::H256 }, + #[codec(index = 2)] + #[doc = "Give a tip for something new; no finder's fee will be taken."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must be a"] + #[doc = "member of the `Tippers` set."] + #[doc = ""] + #[doc = "- `reason`: The reason for, or the thing that deserves, the tip; generally this will be"] + #[doc = " a UTF-8-encoded URL."] + #[doc = "- `who`: The account which should be credited for the tip."] + #[doc = "- `tip_value`: The amount of tip that the sender would like to give. The median tip"] + #[doc = " value of active tippers will be given to the `who`."] + #[doc = ""] + #[doc = "Emits `NewTip` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(R + T)` where `R` length of `reason`, `T` is the number of tippers."] + #[doc = " - `O(T)`: decoding `Tipper` vec of length `T`. `T` is charged as upper bound given by"] + #[doc = " `ContainsLengthBound`. The actual cost depends on the implementation of"] + #[doc = " `T::Tippers`."] + #[doc = " - `O(R)`: hashing and encoding of reason of length `R`"] + #[doc = "- DbReads: `Tippers`, `Reasons`"] + #[doc = "- DbWrites: `Reasons`, `Tips`"] + #[doc = "# "] + tip_new { + reason: ::std::vec::Vec<::core::primitive::u8>, + who: ::subxt::ext::sp_core::crypto::AccountId32, + #[codec(compact)] + tip_value: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "Declare a tip value for an already-open tip."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_ and the signing account must be a"] + #[doc = "member of the `Tippers` set."] + #[doc = ""] + #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] + #[doc = " as the hash of the tuple of the hash of the original tip `reason` and the beneficiary"] + #[doc = " account ID."] + #[doc = "- `tip_value`: The amount of tip that the sender would like to give. The median tip"] + #[doc = " value of active tippers will be given to the `who`."] + #[doc = ""] + #[doc = "Emits `TipClosing` if the threshold of tippers has been reached and the countdown period"] + #[doc = "has started."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(T)` where `T` is the number of tippers. decoding `Tipper` vec of length"] + #[doc = " `T`, insert tip and check closing, `T` is charged as upper bound given by"] + #[doc = " `ContainsLengthBound`. The actual cost depends on the implementation of `T::Tippers`."] + #[doc = ""] + #[doc = " Actually weight could be lower as it depends on how many tips are in `OpenTip` but it"] + #[doc = " is weighted as if almost full i.e of length `T-1`."] + #[doc = "- DbReads: `Tippers`, `Tips`"] + #[doc = "- DbWrites: `Tips`"] + #[doc = "# "] + tip { + hash: ::subxt::ext::sp_core::H256, + #[codec(compact)] + tip_value: ::core::primitive::u128, + }, + #[codec(index = 4)] + #[doc = "Close and payout a tip."] + #[doc = ""] + #[doc = "The dispatch origin for this call must be _Signed_."] + #[doc = ""] + #[doc = "The tip identified by `hash` must have finished its countdown period."] + #[doc = ""] + #[doc = "- `hash`: The identity of the open tip for which a tip value is declared. This is formed"] + #[doc = " as the hash of the tuple of the original tip `reason` and the beneficiary account ID."] + #[doc = ""] + #[doc = "# "] + #[doc = "- Complexity: `O(T)` where `T` is the number of tippers. decoding `Tipper` vec of length"] + #[doc = " `T`. `T` is charged as upper bound given by `ContainsLengthBound`. The actual cost"] + #[doc = " depends on the implementation of `T::Tippers`."] + #[doc = "- DbReads: `Tips`, `Tippers`, `tip finder`"] + #[doc = "- DbWrites: `Reasons`, `Tips`, `Tippers`, `tip finder`"] + #[doc = "# "] + close_tip { hash: ::subxt::ext::sp_core::H256 }, + #[codec(index = 5)] + #[doc = "Remove and slash an already-open tip."] + #[doc = ""] + #[doc = "May only be called from `T::RejectOrigin`."] + #[doc = ""] + #[doc = "As a result, the finder is slashed and the deposits are lost."] + #[doc = ""] + #[doc = "Emits `TipSlashed` if successful."] + #[doc = ""] + #[doc = "# "] + #[doc = " `T` is charged as upper bound given by `ContainsLengthBound`."] + #[doc = " The actual cost depends on the implementation of `T::Tippers`."] + #[doc = "# "] + slash_tip { 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/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + #[doc = "The reason given is just too big."] + ReasonTooBig, + #[codec(index = 1)] + #[doc = "The tip was already found/started."] + AlreadyKnown, + #[codec(index = 2)] + #[doc = "The tip hash is unknown."] + UnknownTip, + #[codec(index = 3)] + #[doc = "The account attempting to retract the tip is not the finder of the tip."] + NotFinder, + #[codec(index = 4)] + #[doc = "The tip cannot be claimed/closed because there are not enough tippers yet."] + StillOpen, + #[codec(index = 5)] + #[doc = "The tip cannot be claimed/closed because it's still in the countdown period."] + Premature, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "A new tip suggestion has been opened."] + NewTip { + tip_hash: ::subxt::ext::sp_core::H256, + }, + #[codec(index = 1)] + #[doc = "A tip suggestion has reached threshold and is closing."] + TipClosing { + tip_hash: ::subxt::ext::sp_core::H256, + }, + #[codec(index = 2)] + #[doc = "A tip suggestion has been closed."] + TipClosed { + tip_hash: ::subxt::ext::sp_core::H256, + who: ::subxt::ext::sp_core::crypto::AccountId32, + payout: ::core::primitive::u128, + }, + #[codec(index = 3)] + #[doc = "A tip suggestion has been retracted."] + TipRetracted { + tip_hash: ::subxt::ext::sp_core::H256, + }, + #[codec(index = 4)] + #[doc = "A tip suggestion has been slashed."] + TipSlashed { + tip_hash: ::subxt::ext::sp_core::H256, + finder: ::subxt::ext::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct OpenTip<_0, _1, _2, _3> { + pub reason: _3, + pub who: _0, + pub finder: _0, + pub deposit: _1, + pub closes: ::core::option::Option<_2>, + pub tips: ::std::vec::Vec<(_0, _1)>, + pub finders_fee: ::core::primitive::bool, + } + } + pub mod pallet_transaction_payment { + use super::runtime_types; + #[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, + ::core::primitive::u32, + >, + }, + #[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, + }, + } + #[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, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + #[doc = "New proposal. \\[proposal_index\\]"] + Proposed(::core::primitive::u32), + #[codec(index = 1)] + #[doc = "We have ended a spend period and will now allocate funds. \\[budget_remaining\\]"] + Spending(::core::primitive::u128), + #[codec(index = 2)] + #[doc = "Some funds have been allocated. \\[proposal_index, award, beneficiary\\]"] + Awarded( + ::core::primitive::u32, + ::core::primitive::u128, + ::subxt::ext::sp_core::crypto::AccountId32, + ), + #[codec(index = 3)] + #[doc = "A proposal was rejected; funds were slashed. \\[proposal_index, slashed\\]"] + Rejected(::core::primitive::u32, ::core::primitive::u128), + #[codec(index = 4)] + #[doc = "Some of our funds have been burnt. \\[burn\\]"] + Burnt(::core::primitive::u128), + #[codec(index = 5)] + #[doc = "Spending has finished; this is the amount that rolls over until next spend."] + #[doc = "\\[budget_remaining\\]"] + Rollover(::core::primitive::u128), + #[codec(index = 6)] + #[doc = "Some funds have been deposited. \\[deposit\\]"] + Deposit(::core::primitive::u128), + } + } + #[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, + }, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-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/v3/runtime/events-and-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 = "A single item within a Batch of dispatches has completed with no error."] + ItemCompleted, + #[codec(index = 3)] + #[doc = "A call was dispatched. \\[result\\]"] + DispatchedAs( + ::core::result::Result<(), runtime_types::sp_runtime::DispatchError>, + ), + } + } + } + pub mod primitive_types { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct H160(pub [::core::primitive::u8; 20usize]); + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct H256(pub [::core::primitive::u8; 32usize]); + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct U256(pub [::core::primitive::u64; 4usize]); + } + pub mod signature { + use super::runtime_types; + pub mod signature { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Signature { + pub r: runtime_types::primitive_types::U256, + pub s: runtime_types::primitive_types::U256, + pub v: ::core::primitive::u64, + } + } + } + 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 PerU16(pub ::core::primitive::u16); + #[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_authority_discovery { + 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::sr25519::Public); + } + } + pub mod sp_consensus_babe { + 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::sr25519::Public); + } + pub mod digests { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum NextConfigDescriptor { + #[codec(index = 1)] + V1 { + c: (::core::primitive::u64, ::core::primitive::u64), + allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, + }, + } + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum AllowedSlots { + #[codec(index = 0)] + PrimarySlots, + #[codec(index = 1)] + PrimaryAndSecondaryPlainSlots, + #[codec(index = 2)] + PrimaryAndSecondaryVRFSlots, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct BabeEpochConfiguration { + pub c: (::core::primitive::u64, ::core::primitive::u64), + pub allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, + } + } + pub mod sp_consensus_slots { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct EquivocationProof<_0, _1> { + pub offender: _1, + pub slot: runtime_types::sp_consensus_slots::Slot, + pub first_header: _0, + pub second_header: _0, + } + #[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 offchain { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct OpaqueMultiaddr(pub ::std::vec::Vec<::core::primitive::u8>); + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct OpaqueNetworkState { + pub peer_id: runtime_types::sp_core::OpaquePeerId, + pub external_addresses: + ::std::vec::Vec, + } + } + 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 struct OpaquePeerId(pub ::std::vec::Vec<::core::primitive::u8>); + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Void {} + } + pub mod sp_finality_grandpa { + 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 Signature(pub runtime_types::sp_core::ed25519::Signature); + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub enum Equivocation<_0, _1> { + #[codec(index = 0)] + Prevote( + runtime_types::finality_grandpa::Equivocation< + runtime_types::sp_finality_grandpa::app::Public, + runtime_types::finality_grandpa::Prevote<_0, _1>, + runtime_types::sp_finality_grandpa::app::Signature, + >, + ), + #[codec(index = 1)] + Precommit( + runtime_types::finality_grandpa::Equivocation< + runtime_types::sp_finality_grandpa::app::Public, + runtime_types::finality_grandpa::Precommit<_0, _1>, + runtime_types::sp_finality_grandpa::app::Signature, + >, + ), + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct EquivocationProof<_0, _1> { + pub set_id: ::core::primitive::u64, + pub equivocation: runtime_types::sp_finality_grandpa::Equivocation<_0, _1>, + } + } + pub mod sp_npos_elections { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct Support<_0> { + pub total: ::core::primitive::u128, + pub voters: ::std::vec::Vec<(_0, ::core::primitive::u128)>, + } + } + pub mod sp_runtime { + use super::runtime_types; + 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 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 { + index: ::core::primitive::u8, + error: ::core::primitive::u8, + }, + #[codec(index = 4)] + ConsumerRemaining, + #[codec(index = 5)] + NoProviders, + #[codec(index = 6)] + Token(runtime_types::sp_runtime::TokenError), + #[codec(index = 7)] + Arithmetic(runtime_types::sp_runtime::ArithmeticError), + } + #[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, + } + } + pub mod sp_session { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct MembershipProof { + pub session: ::core::primitive::u32, + pub trie_nodes: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, + pub validator_count: ::core::primitive::u32, + } + } + pub mod sp_staking { + use super::runtime_types; + pub mod offence { + use super::runtime_types; + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + pub struct OffenceDetails<_0, _1> { + pub offender: _1, + pub reporters: ::std::vec::Vec<_0>, + } + } + } + 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 mod updater_manager { + 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 {} + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tCustom [dispatch errors](https://docs.substrate.io/v3/runtime/events-and-errors)\n\t\t\tof this pallet.\n\t\t\t"] + pub enum Error { + #[codec(index = 0)] + InitializationError, + } + #[derive( + :: subxt :: ext :: codec :: Decode, + :: subxt :: ext :: codec :: Encode, + Clone, + Debug, + Eq, + PartialEq, + )] + #[doc = "\n\t\t\tThe [event](https://docs.substrate.io/v3/runtime/events-and-errors) emitted\n\t\t\tby this pallet.\n\t\t\t"] + pub enum Event { + #[codec(index = 0)] + NewUpdater { + old_updater: ::subxt::ext::sp_core::H160, + new_updater: ::subxt::ext::sp_core::H160, + }, + #[codec(index = 1)] + FakeSlashed { + reporter: ::subxt::ext::sp_core::crypto::AccountId32, + }, + } + } + } + } + #[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 utility(&self) -> utility::constants::ConstantsApi { + utility::constants::ConstantsApi + } + + pub fn babe(&self) -> babe::constants::ConstantsApi { babe::constants::ConstantsApi } + + pub fn timestamp(&self) -> timestamp::constants::ConstantsApi { + timestamp::constants::ConstantsApi + } + + pub fn authorship(&self) -> authorship::constants::ConstantsApi { + authorship::constants::ConstantsApi + } + + pub fn indices(&self) -> indices::constants::ConstantsApi { + indices::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 election_provider_multi_phase( + &self, + ) -> election_provider_multi_phase::constants::ConstantsApi { + election_provider_multi_phase::constants::ConstantsApi + } + + pub fn staking(&self) -> staking::constants::ConstantsApi { + staking::constants::ConstantsApi + } + + pub fn democracy(&self) -> democracy::constants::ConstantsApi { + democracy::constants::ConstantsApi + } + + pub fn elections(&self) -> elections::constants::ConstantsApi { + elections::constants::ConstantsApi + } + + pub fn grandpa(&self) -> grandpa::constants::ConstantsApi { + grandpa::constants::ConstantsApi + } + + pub fn treasury(&self) -> treasury::constants::ConstantsApi { + treasury::constants::ConstantsApi + } + + pub fn im_online(&self) -> im_online::constants::ConstantsApi { + im_online::constants::ConstantsApi + } + + pub fn scheduler(&self) -> scheduler::constants::ConstantsApi { + scheduler::constants::ConstantsApi + } + + pub fn bounties(&self) -> bounties::constants::ConstantsApi { + bounties::constants::ConstantsApi + } + + pub fn tips(&self) -> tips::constants::ConstantsApi { tips::constants::ConstantsApi } + + pub fn bags_list(&self) -> bags_list::constants::ConstantsApi { + bags_list::constants::ConstantsApi + } + + pub fn data_availability(&self) -> data_availability::constants::ConstantsApi { + data_availability::constants::ConstantsApi + } + + pub fn nomad_home(&self) -> nomad_home::constants::ConstantsApi { + nomad_home::constants::ConstantsApi + } + + pub fn da_bridge(&self) -> da_bridge::constants::ConstantsApi { + da_bridge::constants::ConstantsApi + } + } + pub struct StorageApi; + impl StorageApi { + pub fn system(&self) -> system::storage::StorageApi { system::storage::StorageApi } + + pub fn babe(&self) -> babe::storage::StorageApi { babe::storage::StorageApi } + + pub fn timestamp(&self) -> timestamp::storage::StorageApi { timestamp::storage::StorageApi } + + pub fn authorship(&self) -> authorship::storage::StorageApi { + authorship::storage::StorageApi + } + + pub fn indices(&self) -> indices::storage::StorageApi { indices::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 election_provider_multi_phase( + &self, + ) -> election_provider_multi_phase::storage::StorageApi { + election_provider_multi_phase::storage::StorageApi + } + + pub fn staking(&self) -> staking::storage::StorageApi { staking::storage::StorageApi } + + pub fn session(&self) -> session::storage::StorageApi { session::storage::StorageApi } + + pub fn democracy(&self) -> democracy::storage::StorageApi { democracy::storage::StorageApi } + + pub fn council(&self) -> council::storage::StorageApi { council::storage::StorageApi } + + pub fn technical_committee(&self) -> technical_committee::storage::StorageApi { + technical_committee::storage::StorageApi + } + + pub fn elections(&self) -> elections::storage::StorageApi { elections::storage::StorageApi } + + pub fn technical_membership(&self) -> technical_membership::storage::StorageApi { + technical_membership::storage::StorageApi + } + + pub fn grandpa(&self) -> grandpa::storage::StorageApi { grandpa::storage::StorageApi } + + pub fn treasury(&self) -> treasury::storage::StorageApi { treasury::storage::StorageApi } + + pub fn sudo(&self) -> sudo::storage::StorageApi { sudo::storage::StorageApi } + + pub fn im_online(&self) -> im_online::storage::StorageApi { im_online::storage::StorageApi } + + pub fn authority_discovery(&self) -> authority_discovery::storage::StorageApi { + authority_discovery::storage::StorageApi + } + + pub fn offences(&self) -> offences::storage::StorageApi { offences::storage::StorageApi } + + pub fn historical(&self) -> historical::storage::StorageApi { + historical::storage::StorageApi + } + + pub fn scheduler(&self) -> scheduler::storage::StorageApi { scheduler::storage::StorageApi } + + pub fn bounties(&self) -> bounties::storage::StorageApi { bounties::storage::StorageApi } + + pub fn tips(&self) -> tips::storage::StorageApi { tips::storage::StorageApi } + + pub fn mmr(&self) -> mmr::storage::StorageApi { mmr::storage::StorageApi } + + pub fn bags_list(&self) -> bags_list::storage::StorageApi { bags_list::storage::StorageApi } + + pub fn data_availability(&self) -> data_availability::storage::StorageApi { + data_availability::storage::StorageApi + } + + pub fn updater_manager(&self) -> updater_manager::storage::StorageApi { + updater_manager::storage::StorageApi + } + + pub fn nomad_home(&self) -> nomad_home::storage::StorageApi { + nomad_home::storage::StorageApi + } + } + pub struct TransactionApi; + impl TransactionApi { + pub fn system(&self) -> system::calls::TransactionApi { system::calls::TransactionApi } + + pub fn utility(&self) -> utility::calls::TransactionApi { utility::calls::TransactionApi } + + pub fn babe(&self) -> babe::calls::TransactionApi { babe::calls::TransactionApi } + + pub fn timestamp(&self) -> timestamp::calls::TransactionApi { + timestamp::calls::TransactionApi + } + + pub fn authorship(&self) -> authorship::calls::TransactionApi { + authorship::calls::TransactionApi + } + + pub fn indices(&self) -> indices::calls::TransactionApi { indices::calls::TransactionApi } + + pub fn balances(&self) -> balances::calls::TransactionApi { + balances::calls::TransactionApi + } + + pub fn election_provider_multi_phase( + &self, + ) -> election_provider_multi_phase::calls::TransactionApi { + election_provider_multi_phase::calls::TransactionApi + } + + pub fn staking(&self) -> staking::calls::TransactionApi { staking::calls::TransactionApi } + + pub fn session(&self) -> session::calls::TransactionApi { session::calls::TransactionApi } + + pub fn democracy(&self) -> democracy::calls::TransactionApi { + democracy::calls::TransactionApi + } + + pub fn council(&self) -> council::calls::TransactionApi { council::calls::TransactionApi } + + pub fn technical_committee(&self) -> technical_committee::calls::TransactionApi { + technical_committee::calls::TransactionApi + } + + pub fn elections(&self) -> elections::calls::TransactionApi { + elections::calls::TransactionApi + } + + pub fn technical_membership(&self) -> technical_membership::calls::TransactionApi { + technical_membership::calls::TransactionApi + } + + pub fn grandpa(&self) -> grandpa::calls::TransactionApi { grandpa::calls::TransactionApi } + + pub fn treasury(&self) -> treasury::calls::TransactionApi { + treasury::calls::TransactionApi + } + + pub fn sudo(&self) -> sudo::calls::TransactionApi { sudo::calls::TransactionApi } + + pub fn im_online(&self) -> im_online::calls::TransactionApi { + im_online::calls::TransactionApi + } + + pub fn scheduler(&self) -> scheduler::calls::TransactionApi { + scheduler::calls::TransactionApi + } + + pub fn bounties(&self) -> bounties::calls::TransactionApi { + bounties::calls::TransactionApi + } + + pub fn tips(&self) -> tips::calls::TransactionApi { tips::calls::TransactionApi } + + pub fn bags_list(&self) -> bags_list::calls::TransactionApi { + bags_list::calls::TransactionApi + } + + pub fn data_availability(&self) -> data_availability::calls::TransactionApi { + data_availability::calls::TransactionApi + } + + pub fn updater_manager(&self) -> updater_manager::calls::TransactionApi { + updater_manager::calls::TransactionApi + } + + pub fn nomad_home(&self) -> nomad_home::calls::TransactionApi { + nomad_home::calls::TransactionApi + } + + pub fn da_bridge(&self) -> da_bridge::calls::TransactionApi { + da_bridge::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 + != [ + 127u8, 27u8, 160u8, 192u8, 160u8, 243u8, 224u8, 64u8, 42u8, 161u8, 227u8, 35u8, + 148u8, 233u8, 171u8, 124u8, 33u8, 107u8, 66u8, 128u8, 225u8, 6u8, 146u8, 177u8, + 106u8, 174u8, 22u8, 58u8, 202u8, 41u8, 84u8, 103u8, + ] { + Err(::subxt::error::MetadataError::IncompatibleMetadata) + } else { + Ok(()) + } + } +} diff --git a/avail-subxt/src/e2e.rs b/avail-subxt/src/e2e.rs new file mode 100644 index 000000000..8b3e13ffe --- /dev/null +++ b/avail-subxt/src/e2e.rs @@ -0,0 +1,136 @@ +#![feature(async_closure)] + +use std::{process::Stdio, str, time::Duration}; + +use anyhow::{anyhow, ensure, Result}; +use jsonrpsee::ws_client::WsClientBuilder; +use structopt::StructOpt; +use tokio::{ + fs::remove_dir_all, + process::{Child, Command}, + time::sleep, +}; + +pub mod rpc; +use rpc::*; + +#[derive(Debug, StructOpt)] +pub struct E2EOpts { + /// Chain spec for tests + #[structopt(long, default_value = "dev")] + pub chain: String, + /// Path to avail-data binary + #[structopt(long, default_value = "../target/release/data-avail")] + pub avail_path: String, + /// Base path for node storage + #[structopt(long, default_value = "base/alice")] + pub base_path: String, + /// RPC port + #[structopt(long, default_value = "9933")] + pub rpc_port: u16, + /// The WebSocket address of the target the Avail Node, + #[structopt(name = "ws_uri", long, default_value = "ws://127.0.0.1:9944")] + pub ws: String, +} + +#[tokio::main] +async fn main() -> Result<()> { + let args = E2EOpts::from_args(); + + // Clean storage & previous chain. + clean_environment(&args).await?; + + // Run the node as Alice. + let mut alice_proc = run_alice_node(&args).await?; + + // Run examples using the running node. + let examples = fetch_all_examples().await?; + for example in examples.into_iter() { + println!("E2E Running example {}", example); + run_example(example, &args).await?; + } + + // Kill alice and wait for finish. + println!("Stopping Avail Node"); + alice_proc.kill().await?; + alice_proc.wait().await?; + println!("Stopped Avail Node"); + Ok(()) +} + +async fn run_example(example: impl AsRef, _opts: &E2EOpts) -> Result<()> { + let status = Command::new("cargo") + .args(["run", "--release", "--example", example.as_ref()]) + .kill_on_drop(true) + .spawn()? + .wait() + .await?; + + ensure!( + status.success(), + anyhow!("Example {} failed", example.as_ref()) + ); + Ok(()) +} + +async fn fetch_all_examples() -> Result> { + let cmd = Command::new("cargo") + .args(["run", "--release", "--example"]) + .kill_on_drop(true) + .stderr(Stdio::piped()) + .spawn()?; + let output = cmd.wait_with_output().await?; + + // Extract examples from stderr. + let lines = str::from_utf8(&output.stderr)? + .lines() + .skip(2) + .map(str::trim) + .filter(|line| !line.is_empty()) + .map(str::to_string) + .collect::>(); + Ok(lines) +} + +/// Clean alice storage. +async fn clean_environment(opts: &E2EOpts) -> Result<()> { + let _ = remove_dir_all(&opts.base_path).await; + Ok(()) +} + +/// Run alice node for `dev`. +async fn run_alice_node(opts: &E2EOpts) -> Result { + let args = [ + "--chain", + opts.chain.as_ref(), + "--base-path=base/alice", + "--execution=NativeElseWasm", + "--alice", + "--port=30333", + "--ws-port=9944", + "--rpc-port=9933", + "--validator", + "--rpc-cors=all", + ]; + let child = Command::new(opts.avail_path.clone()) + .args(args) + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .kill_on_drop(true) + .spawn()?; + + // Wait until node is ready up to 5 secs. + for i in 1..=5 { + if let Ok(client) = WsClientBuilder::default().build(opts.ws.clone()).await { + if let Ok(health) = client.health().await { + println!("Client Health: {:?}", health); + break; + } + } + + ensure!(i != 5, anyhow!("Client cannot connect to `{}`", opts.ws)); + sleep(Duration::from_secs(1)).await; + } + + Ok(child) +} diff --git a/avail-subxt/src/lib.rs b/avail-subxt/src/lib.rs index f2266f859..eb145b741 100644 --- a/avail-subxt/src/lib.rs +++ b/avail-subxt/src/lib.rs @@ -1,417 +1,82 @@ -use std::fmt::Debug; - -use codec::{Codec, Compact, Decode, Encode, EncodeLike, Error as DecodeError, Input}; -use parity_util_mem::MallocSizeOf; -use scale_info::TypeInfo; -use serde::{Deserialize, Deserializer, Serialize}; +use anyhow::Result; +use structopt::StructOpt; use subxt::{ ext::{ sp_core::H256, - sp_runtime::{ - traits::{BlakeTwo256, Extrinsic, Hash, Header}, - AccountId32, Digest, MultiAddress, MultiSignature, - }, + sp_runtime::{traits::BlakeTwo256, AccountId32, MultiAddress, MultiSignature}, }, - tx::{Era, ExtrinsicParams, PlainTip}, - Config, + Config, OnlineClient, }; -#[subxt::subxt(runtime_metadata_path = "avail.metadata.scale")] -pub mod avail {} +pub mod primitives; +use primitives::{AppUncheckedExtrinsic, AvailExtrinsicParams, Header}; #[derive(Clone, Debug, Default)] pub struct AvailConfig; +pub type Signature = MultiSignature; +pub type AccountId = AccountId32; +pub type AccountIndex = u32; +pub type Address = MultiAddress; +pub type Call = api::runtime_types::da_runtime::Call; +pub type SignaturePayload = (Address, Signature, AvailExtrinsicParams); + +/// Avail Blockchain configuration impl Config for AvailConfig { - type AccountId = AccountId32; - type Address = MultiAddress; + type AccountId = AccountId; + type Address = Address; type BlockNumber = u32; - type Extrinsic = AvailExtrinsic; + // type Extrinsic = AvailExtrinsic; + // type Extrinsic = Vec; + type Extrinsic = AppUncheckedExtrinsic; type ExtrinsicParams = AvailExtrinsicParams; type Hash = H256; type Hashing = BlakeTwo256; - type Header = DaHeader; + type Header = Header; type Index = u32; - type Signature = MultiSignature; -} - -#[derive(Serialize, Debug, Clone)] -pub enum AvailExtrinsic { - AvailDataExtrinsic { - signature: MultiSignature, - data: Vec, - #[serde(skip_serializing)] - address: MultiAddress, - #[serde(skip_serializing)] - extra_params: AvailExtrinsicParams, - }, - RawExtrinsic { - encoded_data: Vec, - }, -} -impl Eq for AvailExtrinsic {} - -impl PartialEq for AvailExtrinsic { - fn eq(&self, other: &Self) -> bool { - match (self, other) { - ( - Self::AvailDataExtrinsic { - signature: l_signature, - data: l_data, - address: l_address, - extra_params: l_extra_params, - }, - Self::AvailDataExtrinsic { - signature: r_signature, - data: r_data, - address: r_address, - extra_params: r_extra_params, - }, - ) => { - l_signature == r_signature - && l_data == r_data && l_address == r_address - && l_extra_params.app_id == r_extra_params.app_id - }, - ( - Self::RawExtrinsic { - encoded_data: l_encoded_data, - }, - Self::RawExtrinsic { - encoded_data: r_encoded_data, - }, - ) => l_encoded_data == r_encoded_data, - _ => false, - } - } -} - -const EXTRINSIC_VERSION: u8 = 4; -impl Decode for AvailExtrinsic { - fn decode(input: &mut I) -> Result { - // This is a little more complicated than usual since the binary format must be compatible - // with substrate's generic `Vec` type. Basically this just means accepting that there - // will be a prefix of vector length (we don't need - // to use this). - let _length_do_not_remove_me_see_above: Compact = Decode::decode(input)?; - - let version = input.read_byte()?; - - let is_signed = version & 0b1000_0000 != 0; - let version = version & 0b0111_1111; - if version != EXTRINSIC_VERSION { - return Err("Invalid transaction version".into()); - } - let (signature, address, extra) = if is_signed { - let address = >::decode(input)?; - let sig = MultiSignature::decode(input)?; - let (mortality, nonce, tip, app_id) = - <(Era, Compact, Compact, u32)>::decode(input)?; - let extra = AvailExtrinsicParams { - nonce: nonce.0, - tip: PlainTip::new(tip.0), - app_id, - mortality, - ..Default::default() - }; - (sig, address, extra) - } else { - return Err("NOTE: Not signed".into()); - }; - - let section: u8 = Decode::decode(input)?; - let method: u8 = Decode::decode(input)?; - - let data: Vec = match (section, method) { - (29, 1) => Decode::decode(input)?, - (_a, _b) => { - return Err("NOTE: Not Avail Data extrinsic".into()); - }, - }; - - Ok(Self::AvailDataExtrinsic { - signature, - data, - address, - extra_params: extra, - }) - } -} - -impl Encode for AvailExtrinsic { - fn encode(&self) -> Vec { - match self { - AvailExtrinsic::AvailDataExtrinsic { - signature, - data, - address, - extra_params, - } => { - let mut tmp = Vec::new(); - - tmp.push(EXTRINSIC_VERSION | 0b1000_0000); - address.encode_to(&mut tmp); - signature.encode_to(&mut tmp); - extra_params.encode_extra_to(&mut tmp); - (29u8, 1u8).encode_to(&mut tmp); - data.encode_to(&mut tmp); - let compact_len = codec::Compact::(tmp.len() as u32); - let mut output = Vec::with_capacity(compact_len.size_hint() + tmp.len()); - compact_len.encode_to(&mut output); - output.extend(tmp); - output - }, - AvailExtrinsic::RawExtrinsic { encoded_data } => encoded_data.clone(), - } - } -} - -impl EncodeLike for AvailExtrinsic {} - -impl<'a> Deserialize<'a> for AvailExtrinsic { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'a>, - { - let r = subxt::ext::sp_core::bytes::deserialize(deserializer)?; - match Decode::decode(&mut &r[..]) { - Ok(xt) => Ok(xt), - Err(e) => { - if e.to_string().contains("NOTE") { - Ok(AvailExtrinsic::RawExtrinsic { encoded_data: r }) - } else { - Err(serde::de::Error::custom(format!("Decode error: {}", e))) - } - }, - } - } -} - -impl Extrinsic for AvailExtrinsic { - type Call = (); - type SignaturePayload = (); - - fn is_signed(&self) -> Option { - if let Self::AvailDataExtrinsic { - signature: _, - data: _, - address: _, - extra_params: _, - } = self - { - Some(true) - } else { - None - } - } - - fn new(_call: Self::Call, _signed_data: Option) -> Option { None } -} - -impl MallocSizeOf for AvailExtrinsic { - fn size_of(&self, _ops: &mut parity_util_mem::MallocSizeOfOps) -> usize { - // self.app_id.size_of(ops) - // Implement this if necessary - todo!() - } -} - -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Encode, Decode)] -pub struct KateCommitment { - /// The merkle root of the extrinsics. - pub hash: H256, - /// Plonk commitment. - pub commitment: Vec, - /// Rows - pub rows: u16, - /// Cols - pub cols: u16, - /// The merkle root of the data submissions - #[serde(rename = "dataRoot")] - pub data_root: H256, + type Signature = Signature; } -impl MallocSizeOf for KateCommitment { - fn size_of(&self, ops: &mut parity_util_mem::MallocSizeOfOps) -> usize { - self.hash.size_of(ops) - + self.commitment.size_of(ops) - + self.rows.size_of(ops) - + self.cols.size_of(ops) - + self.data_root.size_of(ops) - } -} - -pub type AppId = u32; - -#[derive( - Debug, PartialEq, Eq, Clone, Encode, Decode, Default, TypeInfo, Serialize, Deserialize, -)] -pub struct DataLookup { - pub size: u32, - pub index: Vec<(AppId, u32)>, -} +#[cfg(feature = "api-dev")] +mod api_dev; +#[cfg(feature = "api-dev")] +pub use api_dev::api; -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Encode, Decode)] -#[serde(rename_all = "camelCase")] -pub struct DaHeader { - pub parent_hash: H256, - #[serde(deserialize_with = "number_from_hex")] - pub number: u32, - pub state_root: H256, - pub extrinsics_root: KateCommitment, - pub digest: Digest, - pub app_data_lookup: DataLookup, +#[allow(dead_code)] +#[derive(Debug, StructOpt)] +pub struct Opts { + /// The WebSocket address of the target the Avail Node, + #[structopt(name = "ws_uri", long, default_value = "ws://127.0.0.1:9944")] + pub ws: String, } -fn number_from_hex<'de, D>(deserializer: D) -> Result -where - D: Deserializer<'de>, -{ - let buf = String::deserialize(deserializer)?; - let without_prefix = buf.trim_start_matches("0x"); - Ok(u32::from_str_radix(without_prefix, 16).unwrap()) -} - -pub trait Parameter: Codec + EncodeLike + Clone + Eq + Debug {} -impl Parameter for T where T: Codec + EncodeLike + Clone + Eq + Debug {} - -impl MallocSizeOf for DaHeader { - fn size_of(&self, ops: &mut parity_util_mem::MallocSizeOfOps) -> usize { - self.parent_hash.size_of(ops) - + self.number.size_of(ops) - + self.state_root.size_of(ops) - + self.extrinsics_root.size_of(ops) - + self.digest.size_of(ops) - } +/// Creates a client and validate the code generation. +pub async fn build_client>(url: U) -> Result> { + let api = OnlineClient::::from_url(url).await?; + api::validate_codegen(&api)?; + Ok(api) } -impl Header for DaHeader { - type Hash = H256; - type Hashing = BlakeTwo256; - type Number = u32; - - fn new( - number: Self::Number, - extrinsics_root: Self::Hash, - state_root: Self::Hash, - parent_hash: Self::Hash, - digest: Digest, - ) -> Self { - Self { - parent_hash, - number, - state_root, - extrinsics_root: KateCommitment { - hash: extrinsics_root, - commitment: vec![], - rows: 0, - cols: 0, - data_root: H256([0; 32]), - }, - digest, - app_data_lookup: DataLookup { - size: 0, - index: vec![], - }, - } - } - - fn number(&self) -> &Self::Number { &self.number } - - fn set_number(&mut self, number: Self::Number) { self.number = number as u32; } - - fn extrinsics_root(&self) -> &Self::Hash { &self.extrinsics_root.hash } - - fn set_extrinsics_root(&mut self, root: Self::Hash) { self.extrinsics_root.hash = root; } - - fn state_root(&self) -> &Self::Hash { &self.state_root } +#[cfg(test)] +mod test { + use codec::{Decode as _, Error}; + use hex_literal::hex; + use test_case::test_case; - fn set_state_root(&mut self, root: Self::Hash) { self.state_root = root; } + use super::{ + api::runtime_types::pallet_timestamp::pallet::Call as TimestampCall, AppUncheckedExtrinsic, + Call, + }; - fn parent_hash(&self) -> &Self::Hash { &self.parent_hash } - - fn set_parent_hash(&mut self, hash: Self::Hash) { self.parent_hash = hash; } - - fn digest(&self) -> &Digest { &self.digest } - - fn digest_mut(&mut self) -> &mut Digest { &mut self.digest } - - fn hash(&self) -> Self::Hash { ::hash_of(self) } -} -#[derive(Debug, Clone)] -pub struct AvailExtrinsicParams { - pub spec_version: u32, - pub tx_version: u32, - pub nonce: u32, - pub mortality: Era, - pub genesis_hash: H256, - pub tip: PlainTip, - pub app_id: u32, -} - -impl ExtrinsicParams for AvailExtrinsicParams { - type OtherParams = AvailExtrinsicParams; - - fn new( - spec_version: u32, - tx_version: u32, - nonce: u32, - genesis_hash: H256, - other_params: Self::OtherParams, - ) -> Self { - Self { - spec_version, - tx_version, - nonce, - mortality: other_params.mortality, - genesis_hash, - tip: other_params.tip, - app_id: other_params.app_id, - } - } - - fn encode_extra_to(&self, v: &mut Vec) { - (self.mortality, Compact(self.nonce), self.tip, self.app_id).encode_to(v); - } - - fn encode_additional_to(&self, v: &mut Vec) { - ( - self.spec_version, - self.tx_version, - self.genesis_hash, - self.genesis_hash, - ) - .encode_to(v); - } -} - -impl Default for AvailExtrinsicParams { - fn default() -> Self { - Self { - spec_version: Default::default(), - tx_version: Default::default(), - nonce: Default::default(), - mortality: Era::Immortal, - genesis_hash: Default::default(), - tip: Default::default(), - app_id: Default::default(), - } - } -} -impl AvailExtrinsicParams { - /// Create params with the addition of tip and app_id - pub fn new_with_tip_and_app_id(tip: u128, app_id: u32) -> Self { - Self { - tip: PlainTip::new(tip), - app_id, - ..Default::default() - } + const TIMESTAMP_1: &[u8] = &hex!("280403000b804aa9518401"); + fn timestamp_1_call() -> Result { + Ok(Call::Timestamp(TimestampCall::set { + now: 1_667_817_360_000, + })) } - /// Create params with the addition of app_id - pub fn new_with_app_id(app_id: u32) -> Self { - Self { - app_id, - ..Default::default() - } + #[test_case( TIMESTAMP_1.to_vec() => timestamp_1_call(); "Timestamp 16678173600000" )] + fn decode_extrinsic(encoded_ext: Vec) -> Result { + ::decode(&mut encoded_ext.as_slice()).map(|ext| ext.function) } } diff --git a/avail-subxt/src/primitives.rs b/avail-subxt/src/primitives.rs new file mode 100644 index 000000000..24b2cfcf3 --- /dev/null +++ b/avail-subxt/src/primitives.rs @@ -0,0 +1,8 @@ +pub mod extrinsic_params; +pub use extrinsic_params::AvailExtrinsicParams; + +pub mod header; +pub use header::Header; + +pub mod app_unchecked_extrinsic; +pub use app_unchecked_extrinsic::AppUncheckedExtrinsic; diff --git a/avail-subxt/src/primitives/app_unchecked_extrinsic.rs b/avail-subxt/src/primitives/app_unchecked_extrinsic.rs new file mode 100644 index 000000000..bc53896e9 --- /dev/null +++ b/avail-subxt/src/primitives/app_unchecked_extrinsic.rs @@ -0,0 +1,114 @@ +use std::mem::size_of; + +use codec::{Compact, Decode, Encode, EncodeLike, Error, Input}; +use parity_util_mem::MallocSizeOf; +use serde::{de::Error as _, Deserialize, Deserializer, Serialize, Serializer}; +use subxt::ext::{sp_core::bytes, sp_runtime::traits::Extrinsic}; + +use crate::{Call, SignaturePayload}; +/// Current version of the [`AppUncheckedExtrinsic`] format. +const EXTRINSIC_VERSION: u8 = 4; + +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct AppUncheckedExtrinsic { + /// The signature, address, number of extrinsics have come before from + /// the same signer and an era describing the longevity of this transaction, + /// if this is a signed extrinsic. + pub signature: Option, + /// The function that should be called. + pub function: Call, +} + +impl Decode for AppUncheckedExtrinsic { + fn decode(input: &mut I) -> Result { + // This is a little more complicated than usual since the binary format must be compatible + // with substrate's generic `Vec` type. Basically this just means accepting that there + // will be a prefix of vector length (we don't need + // to use this). + let _length_do_not_remove_me_see_above: Compact = Decode::decode(input)?; + + let version = input.read_byte()?; + + let is_signed = version & 0b1000_0000 != 0; + let version = version & 0b0111_1111; + if version != EXTRINSIC_VERSION { + return Err("Invalid transaction version".into()); + } + + let signature = if is_signed { + Some(SignaturePayload::decode(input)?) + } else { + None + }; + let function = Decode::decode(input)?; + + Ok(Self { + signature, + function, + }) + } +} + +impl Encode for AppUncheckedExtrinsic { + fn encode(&self) -> Vec { + let mut tmp = Vec::with_capacity(size_of::()); + + // 1 byte version id. + match self.signature.as_ref() { + Some(s) => { + tmp.push(EXTRINSIC_VERSION | 0b1000_0000); + s.encode_to(&mut tmp); + }, + None => { + tmp.push(EXTRINSIC_VERSION & 0b0111_1111); + }, + } + self.function.encode_to(&mut tmp); + + let compact_len = codec::Compact::(tmp.len() as u32); + + // Allocate the output buffer with the correct length + let mut output = Vec::with_capacity(compact_len.size_hint() + tmp.len()); + + compact_len.encode_to(&mut output); + output.extend(tmp); + + output + } +} + +impl EncodeLike for AppUncheckedExtrinsic {} + +impl<'a> Deserialize<'a> for AppUncheckedExtrinsic { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'a>, + { + let encoded = bytes::deserialize(deserializer)?; + AppUncheckedExtrinsic::decode(&mut &encoded[..]) + .map_err(|codec_err| D::Error::custom(format!("Invalid decoding: {:?}", codec_err))) + } +} + +impl Serialize for AppUncheckedExtrinsic { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + let encoded = self.encode(); + bytes::serialize(&encoded, serializer) + } +} + +impl Extrinsic for AppUncheckedExtrinsic { + type Call = Call; + type SignaturePayload = SignaturePayload; + + fn is_signed(&self) -> Option { Some(self.signature.is_some()) } +} + +impl MallocSizeOf for AppUncheckedExtrinsic { + fn size_of(&self, _ops: &mut parity_util_mem::MallocSizeOfOps) -> usize { + size_of::() + size_of::() + } +} diff --git a/avail-subxt/src/primitives/extrinsic_params.rs b/avail-subxt/src/primitives/extrinsic_params.rs new file mode 100644 index 000000000..4aebe290c --- /dev/null +++ b/avail-subxt/src/primitives/extrinsic_params.rs @@ -0,0 +1,108 @@ +use codec::{Compact, Decode, Encode, Error, Input, Output}; +use serde::{Deserialize, Serialize}; +use subxt::{ + ext::sp_core::H256, + tx::{Era, ExtrinsicParams}, +}; + +use crate::api::runtime_types::da_primitives::asdr::AppId; + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct AvailExtrinsicParams { + pub spec_version: u32, + pub tx_version: u32, + pub nonce: Compact, + pub mortality: Era, + pub genesis_hash: H256, + pub tip: Compact, + pub app_id: AppId, +} + +impl ExtrinsicParams for AvailExtrinsicParams { + type OtherParams = AvailExtrinsicParams; + + fn new( + spec_version: u32, + tx_version: u32, + nonce: u32, + genesis_hash: H256, + other_params: Self::OtherParams, + ) -> Self { + Self { + spec_version, + tx_version, + nonce: nonce.into(), + mortality: other_params.mortality, + genesis_hash, + tip: other_params.tip, + app_id: other_params.app_id, + } + } + + fn encode_extra_to(&self, v: &mut Vec) { + (self.mortality, self.nonce, self.tip, self.app_id).encode_to(v); + } + + fn encode_additional_to(&self, v: &mut Vec) { + ( + self.spec_version, + self.tx_version, + self.genesis_hash, + self.genesis_hash, + ) + .encode_to(v); + } +} + +impl Default for AvailExtrinsicParams { + fn default() -> Self { + Self { + spec_version: Default::default(), + tx_version: Default::default(), + nonce: 0u32.into(), + mortality: Era::Immortal, + genesis_hash: Default::default(), + tip: 0u128.into(), + app_id: Default::default(), + } + } +} +impl AvailExtrinsicParams { + /// Create params with the addition of tip and app_id + pub fn new_with_tip_and_app_id(tip: u128, app_id: AppId) -> Self { + Self { + tip: tip.into(), + app_id, + ..Default::default() + } + } + + /// Create params with the addition of app_id + pub fn new_with_app_id(app_id: AppId) -> Self { + Self { + app_id, + ..Default::default() + } + } +} + +impl Encode for AvailExtrinsicParams { + fn encode_to(&self, dest: &mut T) { + // CheckMortality, CheckNonce, ChargeTransationPayment, CheckAppId + (self.mortality, self.nonce, self.tip, self.app_id).encode_to(dest); + } +} + +impl Decode for AvailExtrinsicParams { + fn decode(input: &mut I) -> Result { + let (mortality, nonce, tip, app_id) = + <(Era, Compact, Compact, AppId)>::decode(input)?; + Ok(Self { + mortality, + nonce, + tip, + app_id, + ..Default::default() + }) + } +} diff --git a/avail-subxt/src/primitives/header.rs b/avail-subxt/src/primitives/header.rs new file mode 100644 index 000000000..5eebf207b --- /dev/null +++ b/avail-subxt/src/primitives/header.rs @@ -0,0 +1,142 @@ +use core::marker::PhantomData; + +use codec::{Decode, Encode}; +use parity_util_mem::MallocSizeOf; +use serde::{Deserialize, Deserializer, Serialize}; +use subxt::ext::{ + sp_core::H256, + sp_runtime::{ + traits::{BlakeTwo256, Hash, Header as SPHeader}, + Digest as XtDigest, DigestItem as XtDigestItem, + }, +}; + +use crate::api::runtime_types::{ + da_primitives::header::{extension::HeaderExtension, Header as ApiHeader}, + sp_runtime::generic::digest::{Digest as ApiDigest, DigestItem as ApiDigestItem}, +}; + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Encode, Decode)] +#[serde(rename_all = "camelCase")] +pub struct Header { + pub parent_hash: H256, + #[serde(deserialize_with = "number_from_hex")] + #[codec(compact)] + pub number: u32, + pub state_root: H256, + pub extrinsics_root: H256, + pub digest: XtDigest, + pub extension: HeaderExtension, +} + +impl Header { + pub fn data_root(&self) -> H256 { + match &self.extension { + HeaderExtension::V1(ext) => ext.commitment.data_root, + } + } +} + +impl MallocSizeOf for Header { + fn size_of(&self, ops: &mut parity_util_mem::MallocSizeOfOps) -> usize { + self.parent_hash.size_of(ops) + + self.number.size_of(ops) + + self.state_root.size_of(ops) + + self.extrinsics_root.size_of(ops) + + self.digest.size_of(ops) + } +} + +impl SPHeader for Header { + type Hash = H256; + type Hashing = BlakeTwo256; + type Number = u32; + + fn new( + number: Self::Number, + extrinsics_root: Self::Hash, + state_root: Self::Hash, + parent_hash: Self::Hash, + digest: XtDigest, + ) -> Self { + Self { + parent_hash, + number, + state_root, + extrinsics_root, + digest, + extension: HeaderExtension::V1(Default::default()), + } + } + + fn number(&self) -> &Self::Number { &self.number } + + fn set_number(&mut self, number: Self::Number) { self.number = number; } + + fn extrinsics_root(&self) -> &Self::Hash { &self.extrinsics_root } + + fn set_extrinsics_root(&mut self, root: Self::Hash) { self.extrinsics_root = root; } + + fn state_root(&self) -> &Self::Hash { &self.state_root } + + fn set_state_root(&mut self, root: Self::Hash) { self.state_root = root; } + + fn parent_hash(&self) -> &Self::Hash { &self.parent_hash } + + fn set_parent_hash(&mut self, hash: Self::Hash) { self.parent_hash = hash; } + + fn digest(&self) -> &XtDigest { &self.digest } + + fn digest_mut(&mut self) -> &mut XtDigest { &mut self.digest } + + fn hash(&self) -> Self::Hash { ::hash_of(self) } +} + +fn number_from_hex<'de, D>(deserializer: D) -> Result +where + D: Deserializer<'de>, +{ + let buf = String::deserialize(deserializer)?; + let without_prefix = buf.trim_start_matches("0x"); + Ok(u32::from_str_radix(without_prefix, 16).unwrap()) +} + +impl From
for ApiHeader +where + B: From, +{ + fn from(h: Header) -> Self { + Self { + parent_hash: h.parent_hash, + number: h.number.into(), + state_root: h.state_root, + extrinsics_root: h.extrinsics_root, + digest: h.digest.into(), + extension: h.extension, + __subxt_unused_type_params: PhantomData::default(), + } + } +} + +impl From for ApiDigest { + fn from(d: XtDigest) -> Self { + let logs = d + .logs + .into_iter() + .map(|xt_item| xt_item.into()) + .collect::>(); + Self { logs } + } +} + +impl From for ApiDigestItem { + fn from(di: XtDigestItem) -> Self { + match di { + XtDigestItem::PreRuntime(id, data) => ApiDigestItem::PreRuntime(id, data), + XtDigestItem::Consensus(id, data) => ApiDigestItem::Consensus(id, data), + XtDigestItem::Seal(id, data) => ApiDigestItem::Seal(id, data), + XtDigestItem::Other(data) => ApiDigestItem::Other(data), + XtDigestItem::RuntimeEnvironmentUpdated => ApiDigestItem::RuntimeEnvironmentUpdated, + } + } +} diff --git a/avail-subxt/src/rpc.rs b/avail-subxt/src/rpc.rs new file mode 100644 index 000000000..2ce764929 --- /dev/null +++ b/avail-subxt/src/rpc.rs @@ -0,0 +1,16 @@ +use jsonrpsee::{core::Error, proc_macros::rpc}; +use serde::Deserialize; + +#[derive(Deserialize, Debug)] +#[serde(rename_all = "camelCase")] +pub struct Health { + pub is_syncing: bool, + pub peers: u32, + pub should_have_peers: bool, +} + +#[rpc(client, namespace = "system")] +pub trait Rpc { + #[method(name = "health")] + async fn health(&self) -> Result; +} diff --git a/fuzzing/Cargo.toml b/fuzzing/Cargo.toml index f12243444..7ea0b4b6e 100644 --- a/fuzzing/Cargo.toml +++ b/fuzzing/Cargo.toml @@ -7,9 +7,9 @@ edition = "2021" [dependencies] afl = "*" -kate-recovery = {path = "../kate/recovery"} -kate = {path = "../kate"} -da-primitives = { path = "../primitives/avail", default-features = false } +kate-recovery = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2" } +kate = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2" } +da-primitives = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } hex-literal = "0.3.1" [[bin]] diff --git a/kate/Cargo.toml b/kate/Cargo.toml deleted file mode 100644 index cf81364e9..000000000 --- a/kate/Cargo.toml +++ /dev/null @@ -1,75 +0,0 @@ -[package] -name = "kate" -version = "0.1.0" -authors = ["Denis Ermolin "] -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -da-primitives = { path = "../primitives/avail", default-features = false } - -# Others -dusk-plonk = { git = "https://github.com/maticnetwork/plonk.git", branch = "v0.8.2-polygon-5", optional = true } -dusk-bytes = { version = "0.1.5", default-features = false, optional = true } -bls12_381 = { version = "0.3.1", optional = true } -getrandom = { version = "0.2", features = ["js"], optional = true } -rand = { version = "0.8.4", default-features = false, optional = true } -rand_core = {version="0.5", default-features=false} -rand_chacha = { version = "0.3", default-features = false, optional = true } -log = { version = "0.4.8", optional = true } -rayon = { version = "1.5.0", optional = true } -num_cpus = { version = "1.13.0", optional = true } -serde = { version = "1.0.121", optional = true, features = ["derive"] } -hex = { version = "0.4", default-features = false } -once_cell = { version = "1.9.0", default-features = false } -static_assertions = "1.1.0" - -# Substrate -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -sp-std = { version = "4.0.0-dev", default-features = false } -sp-core = { version = "4.0.0-dev", default-features = false } -frame-support = { version = "4.0.0-dev", default-features = false } - -[dev-dependencies] -test-case = "1.2.3" -proptest = "1.0.0" -kate-recovery = { path = "recovery", default-features = false } -kate-proof = { path = "proof", default-features = false } -hex-literal = "0.3.4" -criterion = "0.3.5" -itertools = "0.10.3" - - -[features] -default = ["std"] -alloc = ["dusk-plonk/alloc"] - -std = [ - "hex/std", - "codec/std", - "alloc", - "serde", - "num_cpus", - "rayon", - "bls12_381", - "getrandom", - "rand", - "rand_chacha/std", - "log", - "dusk-plonk/std", - "dusk-bytes", - "sp-std/std", - "sp-core/std", - "getrandom/std", - "rand_core/std", - "frame-support/std", - "da-primitives/std", -] -extended-columns = [] -maximum-block-size = [] - - -[[bench]] -name = "kzg" -harness = false diff --git a/kate/benches/kzg.rs b/kate/benches/kzg.rs deleted file mode 100644 index a049378c1..000000000 --- a/kate/benches/kzg.rs +++ /dev/null @@ -1,190 +0,0 @@ -use criterion::{black_box, criterion_group, criterion_main, Criterion}; -use da_primitives::asdr::AppExtrinsic; -use itertools::Itertools; -use kate::{ - com::{build_proof, par_build_commitments, Cell}, - config::DATA_CHUNK_SIZE, - testnet, -}; -use kate_proof::kc_verify_proof; -use rand::prelude::*; -use rand_chacha::ChaCha20Rng; - -fn variate_rc(rows: usize, cols: usize) -> Vec<(usize, usize)> { - assert_eq!(rows >= 64, true); - assert_eq!(cols >= 64, true); - - let mut dims = Vec::new(); - - let mut i = 64; - while i <= rows { - dims.push((i, cols * (rows / i))); - i <<= 1; - } - - let mut i = 64; - while i < cols { - dims.push((rows * (cols / i), i)); - i <<= 1; - } - - dims -} - -fn generate_matrix_dimensions() -> Vec<(usize, usize)> { - const MIN_ROWS: usize = 256; - const MAX_ROWS: usize = 2048; - - const MIN_COLS: usize = 256; - const MAX_COLS: usize = 2048; - - let mut dims = Vec::new(); - - let mut r = MIN_ROWS; - while r <= MAX_ROWS { - let mut c = MIN_COLS; - while c <= MAX_COLS { - dims.extend(&variate_rc(r, c)); - c <<= 1; - } - r <<= 1; - } - - dims.into_iter().unique().collect::>() -} - -// Commitment builder routine candidate -fn bench_par_build_commitments(c: &mut Criterion) { - let mut rng = ChaCha20Rng::from_entropy(); - - const CHUNK: usize = DATA_CHUNK_SIZE as usize + 1; - let dims = generate_matrix_dimensions(); - - for dim in dims { - let dlen = dim.0 * dim.1 * (CHUNK - 2); - - let mut seed = [0u8; 32]; - let mut data = vec![0u8; dlen]; - - rng.fill_bytes(&mut seed); - rng.fill_bytes(&mut data); - - let tx = AppExtrinsic::from(data.to_vec()); - let txs = [tx]; - - c.bench_function( - &format!( - "par_build_commitments/{}x{}/{} MB", - dim.0, - dim.1, - (dim.0 * dim.1 * CHUNK) >> 20 - ), - |b| { - b.iter(|| { - let (_, _, _, _) = par_build_commitments( - black_box(dim.0), - black_box(dim.1), - black_box(CHUNK), - black_box(&txs), - black_box(seed), - ) - .unwrap(); - }); - }, - ); - } -} - -fn bench_build_proof(c: &mut Criterion) { - let mut rng = ChaCha20Rng::from_entropy(); - - const CHUNK: usize = DATA_CHUNK_SIZE as usize + 1; - let mdims = generate_matrix_dimensions(); - - for dim in mdims { - let dlen = dim.0 * dim.1 * (CHUNK - 2); - - let mut seed = [0u8; 32]; - let mut data = vec![0u8; dlen]; - - rng.fill_bytes(&mut seed); - rng.fill_bytes(&mut data); - - let tx = AppExtrinsic::from(data.to_vec()); - let txs = [tx]; - - let public_params = crate::testnet::public_params(dim.1); - - let (_, _, dims, mat) = par_build_commitments(dim.0, dim.1, CHUNK, &txs, seed).unwrap(); - - c.bench_function( - &format!( - "build_proof/{}x{}/ {} MB", - dim.0, - dim.1, - (dim.0 * dim.1 * CHUNK) >> 20 - ), - |b| { - b.iter(|| { - let cell = Cell { - row: rng.next_u32() % dims.rows as u32, - col: rng.next_u32() % dims.cols as u32, - }; - - let proof = build_proof(&public_params, dims, &mat, &[cell]).unwrap(); - assert_eq!(proof.len(), 80); - }); - }, - ); - } -} - -fn bench_verify_proof(c: &mut Criterion) { - let mut rng = ChaCha20Rng::from_entropy(); - - const CHUNK: usize = DATA_CHUNK_SIZE as usize + 1; - let mdims = generate_matrix_dimensions(); - - for dim in mdims { - let dlen = dim.0 * dim.1 * (CHUNK - 2); - - let mut seed = [0u8; 32]; - let mut data = vec![0u8; dlen]; - - rng.fill_bytes(&mut seed); - rng.fill_bytes(&mut data); - - let tx = AppExtrinsic::from(data.to_vec()); - let txs = [tx]; - - let pp = crate::testnet::public_params(dim.1); - - let (_, comms, dims, mat) = par_build_commitments(dim.0, dim.1, CHUNK, &txs, seed).unwrap(); - - let row = rng.next_u32() % dims.rows as u32; - let col = rng.next_u32() % dims.cols as u32; - - let proof = build_proof(&pp, dims, &mat, &[Cell { row, col }]).unwrap(); - assert_eq!(proof.len(), 80); - - c.bench_function( - &format!( - "verify_proof/{}x{}/ {} MB", - dim.0, - dim.1, - (dim.0 * dim.1 * CHUNK) >> 20 - ), - |b| { - b.iter(|| { - let comm = &comms[row as usize * 48..(row as usize + 1) * 48]; - let flg = kc_verify_proof(col, &proof, comm, dims.rows, dims.cols, &pp); - - assert_eq!(flg.unwrap(), true); - }); - }, - ); - } -} - -criterion_group! {name = kzg; config = Criterion::default().sample_size(10); targets = bench_par_build_commitments, bench_build_proof, bench_verify_proof} -criterion_main!(kzg); diff --git a/kate/proof/Cargo.toml b/kate/proof/Cargo.toml deleted file mode 100644 index f829d1d3f..000000000 --- a/kate/proof/Cargo.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -name = "kate-proof" -version = "0.1.0" -edition = "2021" - -[dependencies] -anyhow = "1.0.41" -dusk-plonk = { git = "https://github.com/maticnetwork/plonk.git", branch = "v0.8.2-polygon-5" } -dusk-bytes = { version = "0.1.5" } -rand = "0.8.4" -rand_chacha = "0.3" -merlin = {version = "3.0"} diff --git a/kate/proof/src/lib.rs b/kate/proof/src/lib.rs deleted file mode 100644 index 05fcfc952..000000000 --- a/kate/proof/src/lib.rs +++ /dev/null @@ -1,70 +0,0 @@ -use std::convert::TryInto; - -use anyhow::{anyhow, Context}; -use dusk_bytes::Serializable; -use dusk_plonk::{ - bls12_381::G1Affine, - commitment_scheme::kzg10::{commitment::Commitment, proof::Proof, PublicParameters}, - fft::EvaluationDomain, -}; - -pub mod testnet { - use dusk_plonk::commitment_scheme::kzg10::PublicParameters; - use rand::SeedableRng; - use rand_chacha::ChaChaRng; - - pub fn public_params(max_degree: usize) -> PublicParameters { - let mut rng = ChaChaRng::seed_from_u64(42); - PublicParameters::setup(max_degree, &mut rng).unwrap() - } -} - -// code for light client to verify incoming kate proofs -// args - now - column number, response (witness + evaluation_point = 48 + 32 bytes), commitment (as bytes) -// args - in future - multiple sets of these -pub fn kc_verify_proof( - col_num: u32, // column identifier index ( 0 -based ) - response: &[u8], // witness ( 48B ) + evaluation point ( 32B ) = proof ( 80B ) - commitment: &[u8], // commitment generated by prover ( 48B ) - _total_rows: usize, // # -of rows in data matrix against which proof/ commitment are generated - total_cols: usize, // # -of cols in data matrix against which proof/ commitment are generated - pp: &PublicParameters, // public parameters with max degree >= total_cols [ensure this] -) -> anyhow::Result { - let (_, verifier_key) = pp.trim(total_cols).context("trimming failed")?; - - let row_eval_domain = EvaluationDomain::new(total_cols).unwrap(); - let mut row_dom_x_pts = Vec::with_capacity(row_eval_domain.size()); - row_dom_x_pts.extend(row_eval_domain.elements()); - - let (witness, eval) = response.split_at(48); - - let commitment_point = G1Affine::from_bytes( - commitment - .try_into() - .context("commitment slice with incorrect length")?, - ) - .expect("Invalid commitment point"); - let eval_point = dusk_plonk::prelude::BlsScalar::from_bytes( - eval.try_into() - .context("evaluation point slice with incorrect length")?, - ) - .unwrap(); - let witness_point = G1Affine::from_bytes( - witness - .try_into() - .context("witness slice with incorrect length")?, - ) - .map_err(|_| anyhow!("Invalid witness point"))?; - // Discarding error due to unimplemented traits which prevents us to use context - - let proof = Proof { - commitment_to_witness: Commitment::from(witness_point), - evaluated_point: eval_point, - commitment_to_polynomial: Commitment::from(commitment_point), - }; - - let point = row_dom_x_pts[col_num as usize]; - let status = verifier_key.check(point, proof); - - Ok(status) -} diff --git a/kate/recovery/Cargo.toml b/kate/recovery/Cargo.toml deleted file mode 100644 index 262c5f67b..000000000 --- a/kate/recovery/Cargo.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -name = "kate-recovery" -version = "0.1.0" -authors = ["Denis Ermolin "] -edition = "2018" - -[dependencies] -thiserror = "1.0" -dusk-plonk = { git = "https://github.com/maticnetwork/plonk.git", branch = "v0.8.2-polygon-5" } -dusk-bytes = { version = "0.1.5" } -getrandom = { version = "0.2", features = ["js"] } -codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } -serde = { version = "1.0", features = ["derive"] } - -[dev-dependencies] -rand = "0.8.4" -rand_chacha = "0.3" diff --git a/kate/recovery/src/com.rs b/kate/recovery/src/com.rs deleted file mode 100644 index ac3c3e227..000000000 --- a/kate/recovery/src/com.rs +++ /dev/null @@ -1,1207 +0,0 @@ -use std::{ - collections::HashMap, - convert::{TryFrom, TryInto}, - iter::once, - ops::Range, -}; - -use codec::Decode; -use dusk_bytes::Serializable; -use dusk_plonk::{fft::EvaluationDomain, prelude::BlsScalar}; -use serde::{Deserialize, Serialize}; -use thiserror::Error; - -// TODO: Constants are copy from kate crate, we should move them to common place -pub const CHUNK_SIZE: usize = 32; -pub const DATA_CHUNK_SIZE: usize = 31; -const PADDING_TAIL_VALUE: u8 = 0x80; - -pub struct ExtendedMatrixDimensions { - pub rows: usize, - pub cols: usize, -} - -impl ExtendedMatrixDimensions { - fn contains(&self, position: &Position) -> bool { - (position.row as usize) < self.rows && (position.col as usize) < self.cols - } -} - -#[derive(Error, Debug)] -pub enum ReconstructionError { - #[error("Missing cell (col {}, row {})", .position.col, .position.row)] - MissingCell { position: Position }, - #[error("Invalid cell (col {}, row {})", .position.col, .position.row)] - InvalidCell { position: Position }, - #[error("Duplicate cell found")] - DuplicateCellFound, - #[error("Column {0} contains less than half rows")] - InvalidColumn(u16), - #[error("Cannot reconstruct column: {0}")] - ColumnReconstructionError(String), - #[error("Cannot decode data: {0}")] - DataDecodingError(String), -} - -/// Creates hash map of columns, each being hash map of cells, from vector of cells. -/// Intention is to be able to find duplicates and to group cells by column. -fn map_cells( - dimensions: &ExtendedMatrixDimensions, - cells: Vec, -) -> Result>, ReconstructionError> { - let mut result: HashMap> = HashMap::new(); - for cell in cells { - let position = cell.position.clone(); - if !dimensions.contains(&position) { - return Err(ReconstructionError::InvalidCell { position }); - } - let cells = result.entry(position.col).or_insert_with(HashMap::new); - if cells.insert(position.row, cell).is_some() { - return Err(ReconstructionError::DuplicateCellFound); - } - } - Ok(result) -} - -/// Generates empty cell positions in extended data matrix, -/// for data related to specified application ID. -/// Function returns `None` if there are no cells for given application ID. -/// When fetched, cells can be used to decode application related data. -/// -/// # Arguments -/// -/// * `index` - Application data index -/// * `dimensions` - Extended matrix dimensions -/// * `app_id` - Application ID -pub fn app_specific_cells( - index: &AppDataIndex, - dimensions: &ExtendedMatrixDimensions, - app_id: u32, -) -> Option> { - let ranges = index.cell_ranges(); - - let (_, range) = ranges.into_iter().find(|&(id, _)| app_id == id)?; - - let result = range - .map(|cell_number| Position { - col: (cell_number * 2 / dimensions.rows) as u16, - row: (cell_number * 2 % dimensions.rows) as u16, - }) - .collect::>(); - - Some(result) -} - -/// Generates cell positions of columns related to specified application ID. -/// Function returns `None` if there are no cells for given application ID. -/// -/// # Arguments -/// -/// * `index` - Application data index -/// * `dimensions` - Extended matrix dimensions -/// * `app_id` - Application ID -pub fn app_specific_column_cells( - index: &AppDataIndex, - dimensions: &ExtendedMatrixDimensions, - app_id: u32, -) -> Option> { - let ranges = index.data_ranges(); - - let (_, range) = ranges.iter().find(|&&(id, _)| app_id == id)?; - - let row_size = dimensions.rows * CHUNK_SIZE; - - let column_start = (range.start * 2 / row_size) as u16; - let mut column_end = (range.end * 2 / row_size) as u16; - if range.end * 2 % row_size > 0 { - column_end += 1; - } - - Some( - (column_start..column_end) - .flat_map(|col| (0..dimensions.rows as u16).map(move |row| Position { col, row })) - .collect::>(), - ) -} - -/// Reconstructs app extrinsics from extrinsics layout and data. -/// Only related extrinsics are reconstructed. -/// Only related data cells needs to be in matrix (unrelated columns can be empty). -/// -/// # Arguments -/// -/// * `index` - Application data index -/// * `dimensions` - Extended matrix dimensions -/// * `cells` - Cells from required columns, at least 50% cells per column -/// * `app_id` - Application ID -pub fn reconstruct_app_extrinsics( - index: &AppDataIndex, - dimensions: &ExtendedMatrixDimensions, - cells: Vec, - app_id: u32, -) -> Result>, ReconstructionError> { - let data = reconstruct_available(dimensions, cells)?; - let ranges = index - .data_ranges() - .into_iter() - .filter(|&(id, _)| app_id == id) - .collect::>(); - - Ok(unflatten_padded_data(ranges, data, CHUNK_SIZE) - .map_err(ReconstructionError::DataDecodingError)? - .into_iter() - .flat_map(|(_, xts)| xts) - .collect::>()) -} - -/// Reconstructs all extrinsics from extrinsics layout and data. -/// -/// # Arguments -/// -/// * `index` - Application data index -/// * `dimensions` - Extended matrix dimensions -/// * `cells` - Cells from required columns, at least 50% cells per column -pub fn reconstruct_extrinsics( - index: &AppDataIndex, - dimensions: &ExtendedMatrixDimensions, - cells: Vec, -) -> Result>)>, ReconstructionError> { - let data = reconstruct_available(dimensions, cells)?; - let ranges = index.data_ranges(); - unflatten_padded_data(ranges, data, CHUNK_SIZE).map_err(ReconstructionError::DataDecodingError) -} - -fn reconstruct_available( - dimensions: &ExtendedMatrixDimensions, - cells: Vec, -) -> Result, ReconstructionError> { - let mut column_numbers: Vec = vec![]; - let mut data: Vec = vec![]; - let cells_map = map_cells(dimensions, cells)?; - for column_number in 0..dimensions.cols as u16 { - match cells_map.get(&column_number) { - None => data.extend(vec![0; dimensions.rows / 2 * CHUNK_SIZE]), - Some(column_cells) => { - if column_cells.len() < dimensions.rows / 2 { - return Err(ReconstructionError::InvalidColumn(column_number)); - } - let cells = column_cells.values().cloned().collect::>(); - let scalars = reconstruct_column(dimensions.rows, &cells) - .map_err(ReconstructionError::ColumnReconstructionError)?; - let column_data = scalars.iter().flat_map(|e| e.to_bytes()); - column_numbers.push(column_number); - data.extend(column_data); - }, - } - } - Ok(data) -} - -/// Decode app extrinsics from extrinsics layout and data cells. -/// Only related data cells are needed, without erasure coded data. -/// -/// # Arguments -/// -/// * `index` - Application data index -/// * `dimensions` - Extended matrix dimensions -/// * `cells` - Application specific data cells in extended matrix, without erasure coded data. -/// * `app_id` - Application ID -pub fn decode_app_extrinsics( - index: &AppDataIndex, - dimensions: &ExtendedMatrixDimensions, - cells: Vec, - app_id: u32, -) -> Result>, ReconstructionError> { - let positions = app_specific_cells(index, dimensions, app_id).unwrap_or_default(); - if positions.is_empty() { - return Ok(vec![]); - } - let cells_map = map_cells(dimensions, cells)?; - - for position in positions { - cells_map - .get(&position.col) - .and_then(|column| column.get(&position.row)) - .filter(|cell| !cell.data.is_empty()) - .ok_or(ReconstructionError::MissingCell { position })?; - } - - let mut app_data: Vec = vec![]; - for col_number in 0..dimensions.cols as u16 { - for row_number in 0..dimensions.rows as u16 { - if row_number % 2 > 0 { - continue; - } - match cells_map - .get(&col_number) - .and_then(|column| column.get(&row_number)) - .filter(|cell| !cell.data.is_empty()) - { - None => app_data.extend(vec![0; CHUNK_SIZE]), - Some(cell) => app_data.extend(&cell.data), - } - } - } - let ranges = index - .data_ranges() - .into_iter() - .filter(|(id, _)| *id == app_id) - .collect::>(); - - Ok(unflatten_padded_data(ranges, app_data, CHUNK_SIZE) - .map_err(ReconstructionError::DataDecodingError)? - .into_iter() - .flat_map(|(_, data)| data) - .collect::>()) -} - -// Removes both extrinsics and block padding (iec_9797 and seeded random data) -pub fn unflatten_padded_data( - ranges: Vec<(u32, Range)>, - data: Vec, - chunk_size: usize, -) -> Result>)>, String> { - if data.len() % chunk_size > 0 { - return Err("Invalid data size".to_string()); - } - - fn trim_to_data_chunks(range_data: &[u8]) -> Result, String> { - range_data - .chunks_exact(CHUNK_SIZE) - .map(|chunk| chunk.get(0..DATA_CHUNK_SIZE)) - .collect::>>() - .map(|data_chunks| data_chunks.concat()) - .ok_or_else(|| format!("Chunk data size less than {DATA_CHUNK_SIZE}")) - } - - fn trim_padding(mut data: Vec) -> Result, String> { - while data.last() == Some(&0) { - data.pop(); - } - - match data.pop() { - None => Err("Cannot trim padding on empty data".to_string()), - Some(PADDING_TAIL_VALUE) => Ok(data), - Some(_) => Err("Invalid padding tail value".to_string()), - } - } - - fn decode_extrinsics(data: Vec) -> Result>, String> { - >>::decode(&mut data.as_slice()) - .map_err(|err| format!("Cannot decode data: {err}")) - } - - ranges - .into_iter() - .map(|(app_id, range)| { - trim_to_data_chunks(&data[range]) - .and_then(trim_padding) - .and_then(decode_extrinsics) - .map(|data| (app_id, data)) - }) - .collect::>)>, String>>() -} - -// This module is taken from https://gist.github.com/itzmeanjan/4acf9338d9233e79cfbee5d311e7a0b4 -// which I wrote few months back when exploring polynomial based erasure coding technique ! - -fn reconstruct_poly( - // domain I'm working with - // all (i)ffts to be performed on it - eval_domain: EvaluationDomain, - // subset of available data - subset: Vec>, -) -> Result, String> { - let missing_indices = subset - .iter() - .enumerate() - .filter(|e| e.1.is_none()) - .map(|(i, _)| i as u64) - .collect::>(); - let (mut zero_poly, zero_eval) = - zero_poly_fn(eval_domain, missing_indices.as_slice(), subset.len() as u64); - for i in 0..subset.len() { - if subset[i].is_none() && zero_eval[i] != BlsScalar::zero() { - return Err("bad zero poly evaluation !".to_owned()); - } - } - let mut poly_evals_with_zero: Vec = Vec::new(); - for i in 0..subset.len() { - if let Some(v) = subset[i] { - poly_evals_with_zero.push(v * zero_eval[i]); - } else { - poly_evals_with_zero.push(BlsScalar::zero()); - } - } - let mut poly_with_zero = eval_domain.ifft(&poly_evals_with_zero[..]); - shift_poly(&mut poly_with_zero[..]); - shift_poly(&mut zero_poly[..]); - let mut eval_shifted_poly_with_zero = eval_domain.fft(&poly_with_zero[..]); - let eval_shifted_zero_poly = eval_domain.fft(&zero_poly[..]); - for i in 0..eval_shifted_poly_with_zero.len() { - eval_shifted_poly_with_zero[i] *= eval_shifted_zero_poly[i].invert().unwrap(); - } - - let mut shifted_reconstructed_poly = eval_domain.ifft(&eval_shifted_poly_with_zero[..]); - unshift_poly(&mut shifted_reconstructed_poly[..]); - - let short_domain = EvaluationDomain::new(eval_domain.size() / 2).unwrap(); - - let reconstructed_data = short_domain.fft(&shifted_reconstructed_poly[..]); - Ok(reconstructed_data) -} - -fn expand_root_of_unity(eval_domain: EvaluationDomain) -> Vec { - let root_of_unity = eval_domain.group_gen; - let mut roots: Vec = vec![BlsScalar::one(), root_of_unity]; - let mut i = 1; - while roots[i] != BlsScalar::one() { - roots.push(roots[i] * root_of_unity); - i += 1; - } - roots -} - -fn zero_poly_fn( - eval_domain: EvaluationDomain, - missing_indices: &[u64], - length: u64, -) -> (Vec, Vec) { - let expanded_r_o_u = expand_root_of_unity(eval_domain); - let domain_stride = eval_domain.size() as u64 / length; - let mut zero_poly: Vec = Vec::with_capacity(length as usize); - let mut sub: BlsScalar; - for i in 0..missing_indices.len() { - let v = missing_indices[i as usize]; - sub = BlsScalar::zero() - expanded_r_o_u[(v * domain_stride) as usize]; - zero_poly.push(sub); - if i > 0 { - zero_poly[i] = zero_poly[i] + zero_poly[i - 1]; - for j in (1..i).rev() { - zero_poly[j] *= sub; - zero_poly[j] = zero_poly[j] + zero_poly[j - 1]; - } - zero_poly[0] *= sub - } - } - zero_poly.push(BlsScalar::one()); - for _ in zero_poly.len()..zero_poly.capacity() { - zero_poly.push(BlsScalar::zero()); - } - let zero_eval = eval_domain.fft(&zero_poly[..]); - (zero_poly, zero_eval) -} - -// in-place shifting -fn shift_poly(poly: &mut [BlsScalar]) { - // primitive root of unity - let shift_factor = BlsScalar::from(5); - let mut factor_power = BlsScalar::one(); - // hoping it won't panic, though it should be handled properly - // - // this is actually 1/ shift_factor --- multiplicative inverse - let inv_factor = shift_factor.invert().unwrap(); - - for coef in poly { - *coef *= factor_power; - factor_power *= inv_factor; - } -} - -// in-place unshifting -fn unshift_poly(poly: &mut [BlsScalar]) { - // primitive root of unity - let shift_factor = BlsScalar::from(5); - let mut factor_power = BlsScalar::one(); - - for coef in poly { - *coef *= factor_power; - factor_power *= shift_factor; - } -} - -#[derive(Serialize, Deserialize, Debug, Clone)] -pub struct AppDataIndex { - pub size: u32, - pub index: Vec<(u32, u32)>, -} - -impl AppDataIndex { - /// Calculates cell range per application from extrinsic offsets. - /// Range is from start index to end index in matrix. - fn cell_ranges(&self) -> Vec<(u32, Range)> { - // Case if first app_id in index is zero is ignored - // since it should be asserted elsewhere - let prepend = self.index.get(0).map_or(vec![(0, 0)], |&(_, offset)| { - if offset == 0 { - vec![] - } else { - vec![(0, 0)] - } - }); - - let starts = prepend.iter().chain(self.index.iter()); - - let ends = self - .index - .iter() - .skip_while(|&&(_, offset)| offset == 0) - .map(|&(_, offset)| offset) - .chain(once(self.size)); - - starts - .zip(ends) - .map(|(&(app_id, start), end)| (app_id, start as usize, end as usize)) - .map(|(app_id, start, end)| (app_id, Range { start, end })) - .collect::>() - } - - /// Calculates data range per application from extrinsics layout. - /// Range is from start index to end index in matrix flattened as byte array. - pub fn data_ranges(&self) -> Vec<(u32, Range)> { - self.cell_ranges() - .into_iter() - .map(|(app_id, range)| { - (app_id, Range { - start: range.start * CHUNK_SIZE, - end: range.end * CHUNK_SIZE, - }) - }) - .collect::>() - } -} - -#[derive(PartialEq, Debug)] -pub enum AppDataIndexError { - SizeOverflow, - UnsortedLayout, -} - -impl TryFrom<&Vec<(u32, u32)>> for AppDataIndex { - type Error = AppDataIndexError; - - fn try_from(layout: &Vec<(u32, u32)>) -> Result { - let mut index = Vec::new(); - // transactions are ordered by application id - // skip transactions with 0 application id - it's not a data txs - let mut size = 0u32; - let mut prev_app_id = 0u32; - - for &(app_id, data_len) in layout { - if app_id != 0 && prev_app_id != app_id { - index.push((app_id, size)); - } - - size = size - .checked_add(data_len) - .ok_or(Self::Error::SizeOverflow)?; - if prev_app_id > app_id { - return Err(Self::Error::UnsortedLayout); - } - prev_app_id = app_id; - } - - Ok(AppDataIndex { size, index }) - } -} - -/// Position in a data matrix -#[derive(Default, Debug, Clone, Hash, Eq, PartialEq)] -pub struct Position { - pub row: u16, - pub col: u16, -} - -impl Position { - /// Refrence in format `block_number:column_number:row_number` - pub fn reference(&self, block_number: u64) -> String { - format!("{}:{}:{}", block_number, self.col, self.row) - } -} - -/// Position and data of a cell in extended matrix -#[derive(Default, Debug, Clone)] -pub struct DataCell { - /// Cell's position - pub position: Position, - /// Cell's data - pub data: [u8; 32], -} - -/// Position and content of a cell in extended matrix -#[derive(Debug, Clone)] -pub struct Cell { - /// Cell's position - pub position: Position, - /// Cell's data - pub content: [u8; 80], -} - -impl Cell { - pub fn reference(&self, block: u64) -> String { self.position.reference(block) } - - pub fn data(&self) -> [u8; 32] { self.content[48..].try_into().expect("content is 80 bytes") } - - pub fn proof(&self) -> [u8; 48] { self.content[..48].try_into().expect("content is 80 bytes") } -} - -impl From for DataCell { - fn from(cell: Cell) -> Self { - DataCell { - position: cell.position.clone(), - data: cell.data(), - } - } -} - -// use this function for reconstructing back all cells of certain column -// when at least 50% of them are available -// -// if everything goes fine, returned vector in case of success should have -// `row_count`-many cells of some specific column, in coded form -// -// performing one round of ifft should reveal original data which were -// coded together -pub fn reconstruct_column(row_count: usize, cells: &[DataCell]) -> Result, String> { - // just ensures all rows are from same column ! - // it's required as that's how it's erasure coded during - // construction in validator node - fn check_cells(cells: &[DataCell]) { - assert!(!cells.is_empty()); - let first_col = cells[0].position.col; - assert!(cells.iter().all(|c| c.position.col == first_col)); - } - - // given row index in column of interest, finds it if present - // and returns back wrapped in `Some`, otherwise returns `None` - fn find_row_by_index(idx: usize, cells: &[DataCell]) -> Option { - for cell in cells { - if cell.position.row == idx as u16 { - return Some( - BlsScalar::from_bytes( - &cell.data[..] - .try_into() - .expect("didn't find u8 array of length 32"), - ) - .unwrap(), - ); - } - } - None - } - - // row count of data matrix must be power of two ! - assert!(row_count & (row_count - 1) == 0); - assert!(cells.len() >= row_count / 2 && cells.len() <= row_count); - check_cells(cells); - - let eval_domain = EvaluationDomain::new(row_count).unwrap(); - let mut subset: Vec> = Vec::with_capacity(row_count); - - // fill up vector in ordered fashion - // @note the way it's done should be improved - for i in 0..row_count { - subset.push(find_row_by_index(i, cells)); - } - - reconstruct_poly(eval_domain, subset) -} - -#[cfg(test)] -mod tests { - use std::convert::TryInto; - - use dusk_bytes::Serializable; - use rand::{Rng, SeedableRng}; - use rand_chacha::ChaChaRng; - - use super::*; - - #[test] - fn app_data_index_cell_ranges() { - let cases = vec![ - ( - AppDataIndex { - size: 8, - index: vec![], - }, - vec![(0, Range { start: 0, end: 8 })], - ), - ( - AppDataIndex { - size: 4, - index: vec![(1, 0), (2, 2)], - }, - vec![ - (1, Range { start: 0, end: 2 }), - (2, Range { start: 2, end: 4 }), - ], - ), - ( - AppDataIndex { - size: 15, - index: vec![(1, 3), (12, 8)], - }, - vec![ - (0, Range { start: 0, end: 3 }), - (1, Range { start: 3, end: 8 }), - (12, Range { start: 8, end: 15 }), - ], - ), - ]; - - for (index, result) in cases { - assert_eq!(index.cell_ranges(), result); - } - } - - #[test] - fn app_data_index_data_ranges() { - let cases = vec![ - ( - AppDataIndex { - size: 8, - index: vec![], - }, - vec![(0, Range { start: 0, end: 256 })], - ), - ( - AppDataIndex { - size: 4, - index: vec![(1, 0), (2, 2)], - }, - vec![ - (1, Range { start: 0, end: 64 }), - (2, Range { - start: 64, - end: 128, - }), - ], - ), - ( - AppDataIndex { - size: 15, - index: vec![(1, 3), (12, 8)], - }, - vec![ - (0, Range { start: 0, end: 96 }), - (1, Range { - start: 96, - end: 256, - }), - (12, Range { - start: 256, - end: 480, - }), - ], - ), - ]; - - for (index, result) in cases { - assert_eq!(index.data_ranges(), result); - } - } - - #[test] - fn test_app_specific_cells() { - let index = AppDataIndex { - size: 8, - index: vec![(1, 5)], - }; - let dimensions = ExtendedMatrixDimensions { rows: 4, cols: 4 }; - - let expected_0 = vec![(0, 0), (0, 2), (1, 0), (1, 2), (2, 0)]; - let result_0 = app_specific_cells(&index, &dimensions, 0).unwrap(); - - assert_eq!(expected_0.len(), result_0.len()); - result_0.iter().zip(expected_0).for_each(|(a, (col, row))| { - assert_eq!(a.col, col); - assert_eq!(a.row, row); - }); - - let expected_1 = vec![(2, 2), (3, 0), (3, 2)]; - let result_1 = app_specific_cells(&index, &dimensions, 1).unwrap(); - - assert_eq!(expected_1.len(), result_1.len()); - result_1.iter().zip(expected_1).for_each(|(a, (col, row))| { - assert_eq!(a.col, col); - assert_eq!(a.row, row); - }); - - assert!(app_specific_cells(&index, &dimensions, 2).is_none()); - } - - #[test] - fn test_app_specific_column_cells() { - let index = AppDataIndex { - size: 8, - index: vec![(1, 5)], - }; - let dimensions = ExtendedMatrixDimensions { rows: 4, cols: 4 }; - - let expected_0 = (0..=2).flat_map(|c| (0..=3).map(move |r| (c, r))); - let result_0 = app_specific_column_cells(&index, &dimensions, 0).unwrap(); - - assert_eq!(expected_0.clone().count(), result_0.len()); - result_0.iter().zip(expected_0).for_each(|(a, (col, row))| { - assert_eq!(a.col, col); - assert_eq!(a.row, row); - }); - - let expected_1 = (2..=3).flat_map(|c| (0..=3).map(move |r| (c, r))); - let result_1 = app_specific_column_cells(&index, &dimensions, 1).unwrap(); - - assert_eq!(expected_1.clone().count(), result_1.len()); - result_1.iter().zip(expected_1).for_each(|(a, (col, row))| { - assert_eq!(a.col, col); - assert_eq!(a.row, row); - }); - - assert!(app_specific_column_cells(&index, &dimensions, 2).is_none()); - } - - #[test] - fn test_app_specific_column_cells_gt_chunk_size() { - let index = AppDataIndex { - size: 90, - index: vec![(1, 1)], - }; - let dimensions = ExtendedMatrixDimensions { rows: 2, cols: 128 }; - let expected = (1..=89).flat_map(|col| (0..=1).map(move |row| (col, row))); - - let result = app_specific_column_cells(&index, &dimensions, 1).unwrap(); - - assert_eq!(expected.clone().count(), result.len()); - result.iter().zip(expected).for_each(|(a, (col, row))| { - assert_eq!(a.col, col); - assert_eq!(a.row, row); - }); - } - - #[test] - fn data_reconstruction_success() { - let domain_size = 1usize << 4; - let half_eval_domain = EvaluationDomain::new(domain_size).unwrap(); - let eval_domain = EvaluationDomain::new(domain_size * 2).unwrap(); - - // some dummy source data I care about - let mut src: Vec = Vec::with_capacity(domain_size * 2); - for i in 0..domain_size { - src.push(BlsScalar::from(1 << (i + 1))); - } - // fill extended portion of vector with zeros - for _ in domain_size..(2 * domain_size) { - src.push(BlsScalar::zero()); - } - - // erasure code it - let temp = half_eval_domain.ifft(&src[0..domain_size]); - let coded_src = eval_domain.fft(&temp); - - // choose random subset of it ( >= 50% ) - let (coded_src_subset, _) = random_subset(&coded_src, [42u8; 32]); - // reconstruct 100% values from random coded subset - let coded_recovered = reconstruct_poly(eval_domain, coded_src_subset).unwrap(); - - for i in 0..domain_size { - assert_eq!(src[i], coded_recovered[i]); - } - } - - #[test] - fn data_reconstruction_failure_0() { - let domain_size = 1usize << 4; - let half_eval_domain = EvaluationDomain::new(domain_size).unwrap(); - let eval_domain = EvaluationDomain::new(domain_size * 2).unwrap(); - - let mut src: Vec = Vec::with_capacity(domain_size * 2); - for i in 0..domain_size { - src.push(BlsScalar::from(1 << (i + 1))); - } - for _ in domain_size..(2 * domain_size) { - src.push(BlsScalar::zero()); - } - - let temp = half_eval_domain.ifft(&src[0..domain_size]); - let coded_src = eval_domain.fft(&temp); - - let (mut coded_src_subset, available) = random_subset(&coded_src, [42u8; 32]); - // intentionally drop a few coded elements such that - // < 50% is available - drop_few(&mut coded_src_subset, available); - - // attempt to reconstruct 100% data from <50 % coded data - // I've available - let recovered = reconstruct_poly(eval_domain, coded_src_subset).unwrap(); - - let mut mismatch_count = 0; - for i in 0..domain_size { - if coded_src[i] != recovered[i] { - mismatch_count += 1; - } - } - - assert!(mismatch_count > 0); - } - - // Context behind following two test cases, where one failure condition - // along with one possible solution, is demonstrated - // - // Need for writing these test cases originates in a conversation - // with Prabal where we were discussing - // how to ensure input byte chunks to dusk-plonk's `BlsScalar::from_bytes()` - // is always lesser than prime field modulus ( 255 bits wide ), because - // we'll get data bytes from arbitrary sources which will be concatenated into - // single large byte array & finally (multiple) field elements to be produced by chunking contiguous bytes, - // splitting bytearray into smaller chunks, each of size 32 bytes. - // - // Now imagine we got a 32-bytes wide chunk with content like [0xff; 32] --- all 256 -bits are set - // - // When that's attempted to be converted into field element it should be wrapped - // around and original value will be lost - // - // We want to specify a way for `how a large byte string can be splitted into field elements - // such that no values are required to be wrapped around due to modular division i.e. all - // values must be lesser than 255-bit prime before they are attempted to be converted to BLS scalar ?` - // - // One natural way to think about solving this problem is grouping large byte array into 254-bits - // chunks, then we should not encounter that problem as value is always lesser than - // prime number which is 255 -bits. But that requires indexing within a byte i.e. not at byte boundary. - // - // **Solution** So we decided to chunk contiguous 31 bytes from large input byte array and - // append zero byte(s) to each chunk for making 32 -bytes wide before inputting - // 256 -bit integer to `BlsScalar::from_bytes( ... )` function - // - // Note, this means, for each field element of 256 -bits, we've 6 -bits free to use - // and at this moment that's just set to zeros ! - // Other 2 -bits of MSB will always be 0 for avoiding modular division related issue. - // - // Is there a way to make use of 6 -bits of most significant byte, in every field element ? - // - // Test `data_reconstruction_failure_1` shows how chunking with 32 contiguous bytes - // results into error where data is lost due to modular division - // - // While `data_reconstruction_failure_2` shows how chunking 31 bytes together - // makes it work smoothly without any data loss encountered ! - #[test] - fn data_reconstruction_failure_1() { - // Test code is removed but test case remains, - // along with test description, for historical purposes. - - let mut data = [0xffu8; 32]; - assert_eq!( - BlsScalar::from_bytes(&data), - Err(dusk_bytes::Error::InvalidData) - ); - - data[31] = 0x3f; - assert!(BlsScalar::from_bytes(&data).is_ok()); - } - - #[test] - fn data_reconstruction_failure_2() { - const GROUP_TOGETHER: usize = 31; // bytes - - let input = [0xffu8; 32 << 4]; - - let domain_size = ((input.len() as f64) / GROUP_TOGETHER as f64).ceil() as usize; - let half_eval_domain = EvaluationDomain::new(domain_size).unwrap(); - let eval_domain = EvaluationDomain::new(domain_size * 2).unwrap(); - - let mut input_wide: Vec<[u8; 32]> = Vec::with_capacity(domain_size); - - for chunk in input.chunks(GROUP_TOGETHER) { - let widened: [u8; 32] = { - let mut v = chunk.to_vec(); - // pad last chunk with required -many zeros - v.resize(GROUP_TOGETHER, 0u8); - v.push(0u8); // v is now 32 -bytes - v.try_into().unwrap() - }; - - input_wide.push(widened); - } - - let src = input_wide - .iter() - .map(|e| BlsScalar::from_bytes(e).unwrap()) - .chain(vec![BlsScalar::zero(); domain_size].into_iter()) - .collect::>(); - - // erasure code it - let temp = half_eval_domain.ifft(&src[0..domain_size]); - let coded_src = eval_domain.fft(&temp); - - // choose random subset of it ( >= 50% ) - let (coded_src_subset, _) = random_subset(&coded_src, [42u8; 32]); - // reconstruct 100% values from random coded subset - let recovered = reconstruct_poly(eval_domain, coded_src_subset).unwrap(); - - for i in 0..(domain_size) { - assert_eq!(src[i], recovered[i]); - } - - for i in 0..domain_size { - let chunk_0 = if (i + 1) * GROUP_TOGETHER >= input.len() { - &input[i * GROUP_TOGETHER..] - } else { - &input[i * GROUP_TOGETHER..(i + 1) * GROUP_TOGETHER] - }; - let chunk_1 = &recovered[i].to_bytes()[..chunk_0.len()]; - - assert_eq!(chunk_0, chunk_1, "at i = {}", i); - } - } - - fn drop_few(data: &mut [Option], mut available: usize) { - assert!(available <= data.len()); - - let mut idx = 0; - while available >= data.len() / 2 { - if data[idx].is_some() { - data[idx] = None; - available -= 1; - } - idx += 1; - } - } - - // select a random subset of coded data to be used for - // reconstruction purpose - // - // @note this is just a helper function for writing test case - fn random_subset(data: &[BlsScalar], seed: [u8; 32]) -> (Vec>, usize) { - let mut rng = ChaChaRng::from_seed(seed); - let mut subset: Vec> = Vec::with_capacity(data.len()); - let mut available = 0; - for item in data { - if rng.gen::() % 2 == 0 { - subset.push(Some(*item)); - available += 1; - } else { - subset.push(None); - } - } - - // already we've >=50% data available - // so just return & attempt to reconstruct back - if available >= data.len() / 2 { - (subset, available) - } else { - for i in 0..data.len() { - if subset[i].is_none() { - // enough data added, >=50% needs - // to be present - if available >= data.len() / 2 { - break; - } - - subset[i] = Some(data[i]); - available += 1; - } - } - (subset, available) - } - } - - // Following test cases attempt to figure out any loop holes - // I might be leaving, when reconstructing whole column of data - // matrix when >= 50% of those cells along a certain column - // are available - - #[test] - fn reconstruct_column_success_0() { - // This is fairly standard test - // - // In general it should be the way how this - // function should be used - - let domain_size = 1usize << 2; - let row_count = 2 * domain_size; - let eval_domain = EvaluationDomain::new(domain_size).unwrap(); - - let mut src: Vec = Vec::with_capacity(row_count); - for i in 0..domain_size { - src.push(BlsScalar::from(1 << (i + 1))); - } - eval_domain.ifft_slice(src.as_mut_slice()); - for _ in domain_size..row_count { - src.push(BlsScalar::zero()); - } - - // erasure coded all data - let eval_domain = EvaluationDomain::new(row_count).unwrap(); - let coded = eval_domain.fft(&src); - assert!(coded.len() == row_count); - - let cells = vec![ - DataCell { - position: Position { row: 0, col: 0 }, - data: coded[0].to_bytes(), - }, - DataCell { - position: Position { row: 4, col: 0 }, - data: coded[4].to_bytes(), - }, - DataCell { - position: Position { row: 6, col: 0 }, - data: coded[6].to_bytes(), - }, - DataCell { - position: Position { row: 2, col: 0 }, - data: coded[2].to_bytes(), - }, - ]; - - let reconstructed = reconstruct_column(row_count, &cells[..]).unwrap(); - for i in 0..domain_size { - assert_eq!(coded[i * 2], reconstructed[i], "{} elem doesn't match", i); - } - } - - #[test] - #[should_panic] - fn reconstruct_column_failure_0() { - // Notice how I attempt to construct `cells` - // vector, I'm intentionally keeping duplicate data - // so it must fail to reconstruct back [ will panic !] - - let domain_size = 1usize << 2; - let row_count = 2 * domain_size; - let eval_domain = EvaluationDomain::new(domain_size).unwrap(); - - let mut src: Vec = Vec::with_capacity(row_count); - for i in 0..domain_size { - src.push(BlsScalar::from(1 << (i + 1))); - } - eval_domain.ifft_slice(src.as_mut_slice()); - for _ in domain_size..row_count { - src.push(BlsScalar::zero()); - } - - // erasure coded all data - let eval_domain = EvaluationDomain::new(row_count).unwrap(); - let coded = eval_domain.fft(&src); - assert!(coded.len() == row_count); - - let cells = vec![ - DataCell { - position: Position { row: 0, col: 0 }, - data: coded[0].to_bytes(), - }, - DataCell { - position: Position { row: 0, col: 0 }, - data: coded[0].to_bytes(), - }, - DataCell { - position: Position { row: 6, col: 0 }, - data: coded[6].to_bytes(), - }, - DataCell { - position: Position { row: 2, col: 0 }, - data: coded[2].to_bytes(), - }, - ]; - - let reconstructed = reconstruct_column(row_count, &cells[..]).unwrap(); - for i in 0..domain_size { - assert_eq!(coded[i * 2], reconstructed[i]); - } - } - - #[test] - #[should_panic] - fn reconstruct_column_failure_1() { - // Again notice how I'm constructing `cells` - // vector, it must have at least 50% data available - // to be able to reconstruct whole data back properly - - let domain_size = 1usize << 2; - let row_count = 2 * domain_size; - let eval_domain = EvaluationDomain::new(domain_size).unwrap(); - - let mut src: Vec = Vec::with_capacity(row_count); - for i in 0..domain_size { - src.push(BlsScalar::from(1 << (i + 1))); - } - eval_domain.ifft_slice(src.as_mut_slice()); - for _ in domain_size..row_count { - src.push(BlsScalar::zero()); - } - - // erasure coded all data - let eval_domain = EvaluationDomain::new(row_count).unwrap(); - let coded = eval_domain.fft(&src); - assert!(coded.len() == row_count); - - let cells = vec![ - DataCell { - position: Position { row: 4, col: 0 }, - data: coded[4].to_bytes(), - }, - DataCell { - position: Position { row: 6, col: 0 }, - data: coded[6].to_bytes(), - }, - DataCell { - position: Position { row: 2, col: 0 }, - data: coded[2].to_bytes(), - }, - ]; - - let reconstructed = reconstruct_column(row_count, &cells[..]).unwrap(); - for i in 0..domain_size { - assert_eq!(coded[i * 2], reconstructed[i]); - } - } - - #[test] - #[should_panic] - fn reconstruct_column_failure_2() { - // Again check how I construct `cells` vector - // where I put wrong row's data in place of wrong - // row index [ will panic !] - - let domain_size = 1usize << 2; - let row_count = 2 * domain_size; - let eval_domain = EvaluationDomain::new(domain_size).unwrap(); - - let mut src: Vec = Vec::with_capacity(row_count); - for i in 0..domain_size { - src.push(BlsScalar::from(1 << (i + 1))); - } - eval_domain.ifft_slice(src.as_mut_slice()); - for _ in domain_size..row_count { - src.push(BlsScalar::zero()); - } - - // erasure coded all data - let eval_domain = EvaluationDomain::new(row_count).unwrap(); - let coded = eval_domain.fft(&src); - assert!(coded.len() == row_count); - - let cells = vec![ - DataCell { - position: Position { row: 0, col: 0 }, - data: coded[0].to_bytes(), - }, - DataCell { - position: Position { row: 5, col: 0 }, - data: coded[4].to_bytes(), - }, - DataCell { - position: Position { row: 6, col: 0 }, - data: coded[6].to_bytes(), - }, - DataCell { - position: Position { row: 2, col: 0 }, - data: coded[2].to_bytes(), - }, - ]; - - let reconstructed = reconstruct_column(row_count, &cells[..]).unwrap(); - for i in 0..domain_size { - assert_eq!(coded[i * 2], reconstructed[i]); - } - } -} diff --git a/kate/recovery/src/lib.rs b/kate/recovery/src/lib.rs deleted file mode 100644 index 1f0edcea8..000000000 --- a/kate/recovery/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod com; diff --git a/kate/src/com.rs b/kate/src/com.rs deleted file mode 100644 index a20b07e21..000000000 --- a/kate/src/com.rs +++ /dev/null @@ -1,938 +0,0 @@ -use std::{ - convert::{TryFrom, TryInto}, - mem::size_of, - time::Instant, -}; - -use codec::Encode; -use da_primitives::asdr::AppExtrinsic; -use dusk_bytes::Serializable; -use dusk_plonk::{ - commitment_scheme::kzg10, - error::Error as PlonkError, - fft::{EvaluationDomain, Evaluations}, - prelude::BlsScalar, -}; -use frame_support::ensure; -use log::info; -use rand::{Rng, SeedableRng}; -use rand_chacha::ChaChaRng; -use rayon::prelude::*; -use serde::{Deserialize, Serialize}; -use static_assertions::const_assert_eq; - -#[cfg(feature = "std")] -use crate::testnet; -use crate::{ - config::{ - DATA_CHUNK_SIZE, EXTENSION_FACTOR, MAXIMUM_BLOCK_SIZE, MINIMUM_BLOCK_SIZE, PROOF_SIZE, - PROVER_KEY_SIZE, SCALAR_SIZE, - }, - padded_len_of_pad_iec_9797_1, BlockDimensions, Seed, LOG_TARGET, -}; - -#[derive(Serialize, Deserialize)] -pub struct Cell { - pub row: u32, - pub col: u32, -} - -#[derive(Debug)] -pub enum Error { - PlonkError(PlonkError), - CellLenghtExceeded, - BadHeaderHash, - BlockTooBig, - InvalidChunkLength, -} - -impl From for Error { - fn from(error: PlonkError) -> Self { Self::PlonkError(error) } -} - -pub type XtsLayout = Vec<(u32, u32)>; -type FlatData = Vec; -type DataChunk = [u8; DATA_CHUNK_SIZE]; -const PADDING_TAIL_VALUE: u8 = 0x80; - -/// Helper which groups extrinsics data that share the same app_id. -/// We assume the input extrinsics are already sorted by app_id, i.e. extrinsics with the same app_id are consecutive. -/// This function does the same thing as group_by (unstable), just less general. -fn app_extrinsics_group_by_app_id(extrinsics: &[AppExtrinsic]) -> Vec<(u32, Vec>)> { - extrinsics.into_iter().fold(vec![], |mut acc, e| { - match acc.last_mut() { - Some((app_id, data)) if e.app_id == *app_id => data.push(e.data.clone()), - None | Some(_) => acc.push((e.app_id, vec![e.data.clone()])), - } - acc - }) -} - -pub fn flatten_and_pad_block( - max_rows_num: usize, - max_cols_num: usize, - chunk_size: usize, - extrinsics: &[AppExtrinsic], - rng_seed: Seed, -) -> Result<(XtsLayout, FlatData, BlockDimensions), Error> { - // First, sort the extrinsics by their app_id - let mut extrinsics = extrinsics.to_vec(); - extrinsics.sort_by(|a, b| a.app_id.cmp(&b.app_id)); - - let extrinsics = app_extrinsics_group_by_app_id(&extrinsics) - .iter() - .map(|e| (e.0, e.1.encode())) - .collect::>(); - - // Pad data before determining exact block size - // Padding occurs both inside a single chunk and with additional chunk (if needed) - let (tx_layout, padded_chunks): (Vec<_>, Vec<_>) = extrinsics - .iter() - .map(|(app_id, data)| { - let chunks = pad_iec_9797_1(data.clone()); - ((*app_id, chunks.len() as u32), chunks) - }) - .unzip(); - - let mut padded_block = padded_chunks - .into_iter() - .flat_map(|e| { - e.into_iter() - .map(|e| pad_to_chunk(e, chunk_size)) - .flatten() - .collect::>() - }) - .collect::>(); - - // Determine the block size after padding - let block_dims = - get_block_dimensions(padded_block.len(), max_rows_num, max_cols_num, chunk_size)?; - - ensure!(padded_block.len() <= block_dims.size(), Error::BlockTooBig); - - let mut rng = ChaChaRng::from_seed(rng_seed); - - assert!((block_dims.size() - padded_block.len()) % block_dims.chunk_size == 0); - - for _ in 0..((block_dims.size() - padded_block.len()) / block_dims.chunk_size) { - let rnd_values: DataChunk = rng.gen(); - padded_block.append(&mut pad_with_zeroes(rnd_values.to_vec(), chunk_size)); - } - - Ok((tx_layout, padded_block, block_dims)) -} - -pub fn get_block_dimensions( - block_size: usize, - max_rows_num: usize, - max_cols_num: usize, - chunk_size: usize, -) -> Result { - let max_block_dimensions = BlockDimensions { - rows: max_rows_num, - cols: max_cols_num, - chunk_size, - }; - - ensure!( - block_size <= max_block_dimensions.size(), - Error::BlockTooBig - ); - - if block_size == max_block_dimensions.size() || MAXIMUM_BLOCK_SIZE { - return Ok(max_block_dimensions); - } - - // Both row number and column number have to be a power of 2, because of the Plonk FFT constraints - // Implicitly, if both of the assumptions above are correct, the total_cells number will also be a power of 2 - let mut nearest_power_2_size = 2_usize.pow((block_size as f32).log2().ceil() as u32); - if nearest_power_2_size < MINIMUM_BLOCK_SIZE { - nearest_power_2_size = MINIMUM_BLOCK_SIZE; - } - - let total_cells = (nearest_power_2_size as f32 / chunk_size as f32).ceil() as usize; - - // we must minimize number of rows, to minimize header size - // (performance wise it doesn't matter) - let (cols, rows) = if total_cells > max_cols_num { - (max_cols_num, total_cells / max_cols_num) - } else { - (total_cells, 1) - }; - - Ok(BlockDimensions { - cols, - rows, - chunk_size, - }) -} - -#[inline] -fn pad_with_zeroes(mut chunk: Vec, length: usize) -> Vec { - chunk.resize(length, 0); - chunk -} - -fn pad_to_chunk(chunk: DataChunk, chunk_size: usize) -> Vec { - const_assert_eq!(DATA_CHUNK_SIZE, size_of::()); - debug_assert!( - chunk_size >= DATA_CHUNK_SIZE, - "`BlockLength.chunk_size` is valid by design .qed" - ); - - let mut padded = chunk.to_vec(); - padded.resize(chunk_size, 0); - padded -} - -fn pad_iec_9797_1(mut data: Vec) -> Vec { - let padded_size = padded_len_of_pad_iec_9797_1(data.len() as u32); - // Add `PADDING_TAIL_VALUE` and fill with zeros. - data.push(PADDING_TAIL_VALUE); - data.resize(padded_size as usize, 0u8); - - // Transform into `DataChunk`. - const_assert_eq!(DATA_CHUNK_SIZE, size_of::()); - data.chunks(DATA_CHUNK_SIZE) - .map(|e| e.try_into()) - .collect::, _>>() - .expect("Const assertion ensures this transformation to `DataChunk`. qed") -} - -fn extend_column_with_zeros(column: &[BlsScalar], extended_rows_num: usize) -> Vec { - let mut result = column.to_vec(); - result.resize(extended_rows_num, BlsScalar::zero()); - result -} - -pub fn to_bls_scalar(chunk: &[u8]) -> Result { - // TODO: Better error type for BlsScalar case? - let scalar_size_chunk = - <[u8; SCALAR_SIZE]>::try_from(chunk).map_err(|_| Error::InvalidChunkLength)?; - BlsScalar::from_bytes(&scalar_size_chunk).map_err(|_| Error::CellLenghtExceeded) -} - -/// Build extended data matrix, by columns. -/// We are using dusk plonk for erasure coding, -/// which is using roots of unity as evaluation domain for fft and ifft. -/// This means that extension factor has to be multiple of 2, -/// and that original data will be interleaved with erasure codes, -/// instead of being in first k chunks of a column. - -#[cfg(feature = "alloc")] -pub fn par_extend_data_matrix( - block_dims: BlockDimensions, - block: &[u8], -) -> Result, Error> { - let start = Instant::now(); - let rows_num = block_dims.rows; - let extended_rows_num = rows_num * EXTENSION_FACTOR; - - let chunks = block.par_chunks_exact(block_dims.chunk_size); - assert!(chunks.remainder().is_empty()); - - let mut chunk_elements = chunks - .into_par_iter() - .map(to_bls_scalar) - .collect::, Error>>()? - .par_chunks_exact(rows_num) - .flat_map(|column| extend_column_with_zeros(column, extended_rows_num)) - .collect::>(); - - // extend data matrix, column by column - let extended_column_eval_domain = EvaluationDomain::new(extended_rows_num)?; - let column_eval_domain = EvaluationDomain::new(rows_num)?; // rows_num = column_length - - chunk_elements - .par_chunks_exact_mut(extended_rows_num) - .for_each(|col| { - let half_len = col.len() / 2; - // (i)fft functions input parameter slice size has to be a power of 2, otherwise it panics - column_eval_domain.ifft_slice(&mut col[0..half_len]); - extended_column_eval_domain.fft_slice(col); - }); - - info!( - target: LOG_TARGET, - "Time to extend block {:?}", - start.elapsed() - ); - - Ok(chunk_elements) -} - -//TODO cache extended data matrix -//TODO explore faster Variable Base Multi Scalar Multiplication -pub fn build_proof( - public_params: &kzg10::PublicParameters, - block_dims: BlockDimensions, - ext_data_matrix: &[BlsScalar], - cells: &[Cell], -) -> Result, Error> { - let rows_num = block_dims.rows; - let cols_num = block_dims.cols; - let extended_rows_num = rows_num * EXTENSION_FACTOR; - - const SPROOF_SIZE: usize = PROOF_SIZE + SCALAR_SIZE; - - let (prover_key, _) = public_params.trim(cols_num).map_err(Error::from)?; - - // Generate all the x-axis points of the domain on which all the row polynomials reside - let row_eval_domain = EvaluationDomain::new(cols_num).map_err(Error::from)?; - let mut row_dom_x_pts = Vec::with_capacity(row_eval_domain.size()); - row_dom_x_pts.extend(row_eval_domain.elements()); - - let mut result_bytes: Vec = Vec::new(); - result_bytes.reserve_exact(SPROOF_SIZE * cells.len()); - unsafe { - result_bytes.set_len(SPROOF_SIZE * cells.len()); - } - - let prover_key = &prover_key; - let row_dom_x_pts = &row_dom_x_pts; - - info!( - target: LOG_TARGET, - "Number of CPU cores: {:#?}", - num_cpus::get() - ); - // generate proof only for requested cells - let total_start = Instant::now(); - - // attempt to parallelly compute proof for all requested cells - cells - .into_par_iter() - .zip(result_bytes.par_chunks_exact_mut(SPROOF_SIZE)) - .for_each(|(cell, res)| { - let r_index = cell.row as usize; - let c_index = cell.col as usize; - - if (r_index >= extended_rows_num) || (c_index >= cols_num) { - res.fill(0); // for bad cell identifier, fill whole proof with zero bytes ! - } else { - // construct polynomial per extended matrix row - let row = (0..cols_num) - .into_par_iter() - .map(|j| ext_data_matrix[r_index + j * extended_rows_num]) - .collect::>(); - - // row has to be a power of 2, otherwise interpolate() function panics - let poly = Evaluations::from_vec_and_domain(row, row_eval_domain).interpolate(); - let witness = prover_key.compute_single_witness(&poly, &row_dom_x_pts[c_index]); - match prover_key.commit(&witness) { - Ok(commitment_to_witness) => { - let evaluated_point = - ext_data_matrix[r_index + c_index * extended_rows_num]; - - res[0..PROOF_SIZE].copy_from_slice(&commitment_to_witness.to_bytes()); - res[PROOF_SIZE..].copy_from_slice(&evaluated_point.to_bytes()); - }, - Err(_) => { - res.fill(0); // for bad cell identifier, fill whole proof with zero bytes ! - return; - }, - }; - } - }); - - info!( - target: LOG_TARGET, - "Time to build proofs of {} cells: {:?}", - cells.len(), - total_start.elapsed() - ); - - Ok(result_bytes) -} - -#[cfg(feature = "std")] -pub fn par_build_commitments( - rows_num: usize, - cols_num: usize, - chunk_size: usize, - extrinsics_by_key: &[AppExtrinsic], - rng_seed: Seed, -) -> Result<(XtsLayout, Vec, BlockDimensions, Vec), Error> { - let start = Instant::now(); - - // generate data matrix first - let (tx_layout, block, block_dims) = - flatten_and_pad_block(rows_num, cols_num, chunk_size, extrinsics_by_key, rng_seed)?; - - info!( - target: LOG_TARGET, - "Rows: {} Cols: {} Size: {}", - block_dims.rows, - block_dims.cols, - block.len(), - ); - - let ext_data_matrix = par_extend_data_matrix(block_dims, &block)?; - let extended_rows_num = block_dims.rows * EXTENSION_FACTOR; - - info!(target: LOG_TARGET, "Time to prepare {:?}", start.elapsed()); - - let public_params = testnet::public_params(block_dims.cols); - - if log::log_enabled!(target: LOG_TARGET, log::Level::Debug) { - let raw_pp = public_params.to_raw_var_bytes(); - let hash_pp = hex::encode(sp_core::blake2_128(&raw_pp)); - let hex_pp = hex::encode(raw_pp); - log::debug!( - target: LOG_TARGET, - "Public params (len={}): hash: {}", - hex_pp.len(), - hash_pp, - ); - } - - let (prover_key, _) = public_params.trim(block_dims.cols).map_err(Error::from)?; - let row_eval_domain = EvaluationDomain::new(block_dims.cols).map_err(Error::from)?; - - let mut result_bytes: Vec = Vec::new(); - result_bytes.reserve_exact(PROVER_KEY_SIZE * extended_rows_num); - unsafe { - result_bytes.set_len(PROVER_KEY_SIZE * extended_rows_num); - } - - info!( - target: "system", - "Number of CPU cores: {:#?}", - num_cpus::get() - ); - - let start = Instant::now(); - - (0..extended_rows_num) - .into_par_iter() - .map(|i| { - let mut row = Vec::with_capacity(block_dims.cols); - - for j in 0..block_dims.cols { - row.push(ext_data_matrix[i + j * extended_rows_num]); - } - - Evaluations::from_vec_and_domain(row, row_eval_domain).interpolate() - }) - .zip(result_bytes.par_chunks_exact_mut(PROVER_KEY_SIZE)) - .map(|(poly, res)| { - prover_key - .commit(&poly) - .map(|commitment| commitment.to_bytes()) - .map(move |key_bytes| (key_bytes, res)) - .map_err(Error::from) - }) - .collect::, _>>()? - .into_par_iter() - .for_each(|(key_bytes, res)| res.copy_from_slice(&key_bytes[..PROVER_KEY_SIZE])); - - info!( - target: "system", - "Time to build a commitment {:?}", - start.elapsed() - ); - - Ok((tx_layout, result_bytes, block_dims, ext_data_matrix)) -} - -#[cfg(test)] -mod tests { - use std::{convert::TryInto, iter::repeat, str::from_utf8}; - - use da_primitives::asdr::AppExtrinsic; - use dusk_bytes::Serializable; - use dusk_plonk::bls12_381::BlsScalar; - use hex_literal::hex; - use kate_recovery::com::{ - app_specific_cells, decode_app_extrinsics, reconstruct_app_extrinsics, - reconstruct_extrinsics, unflatten_padded_data, AppDataIndex, DataCell, - ExtendedMatrixDimensions, Position, ReconstructionError, - }; - use proptest::{ - collection::{self, size_range}, - prelude::*, - }; - use rand::{prelude::IteratorRandom, Rng, SeedableRng}; - use test_case::test_case; - - use super::*; - use crate::{ - com::{get_block_dimensions, pad_iec_9797_1, par_extend_data_matrix, BlockDimensions}, - config::{DATA_CHUNK_SIZE, MAX_BLOCK_COLUMNS}, - padded_len, - }; - - #[test_case(0, 256, 256 => BlockDimensions { rows: 1, cols: 4 , chunk_size: 32} ; "block size zero")] - #[test_case(11, 256, 256 => BlockDimensions { rows: 1, cols: 4 , chunk_size: 32} ; "below minimum block size")] - #[test_case(300, 256, 256 => BlockDimensions { rows: 1, cols: 16 , chunk_size: 32} ; "regular case")] - #[test_case(513, 256, 256 => BlockDimensions { rows: 1, cols: 32 , chunk_size: 32} ; "minimum overhead after 512")] - #[test_case(8192, 256, 256 => BlockDimensions { rows: 1, cols: 256, chunk_size: 32} ; "maximum cols")] - #[test_case(8224, 256, 256 => BlockDimensions { rows: 2, cols: 256, chunk_size: 32} ; "two rows")] - #[test_case(2097152, 256, 256 => BlockDimensions { rows: 256, cols: 256, chunk_size: 32} ; "max block size")] - #[test_case(2097155, 256, 256 => panics "BlockTooBig" ; "too much data")] - fn test_get_block_dimensions(size: usize, rows: usize, cols: usize) -> BlockDimensions { - get_block_dimensions(size, rows, cols, 32).unwrap() - } - - #[test] - fn test_extend_data_matrix() { - let expected_result = vec![ - b"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e00", - b"ef471ce5550437df64279fba7f3d31b50d6ddd1d80eebf4f0ea22d18e6efab17", - b"1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d00", - b"31d90640d024f44dc965927aba9fc7db36ac0731cf32c530892cc366c4109d5c", - b"3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c00", - b"2d865a239442751da365ddf8bd7b6ff34bab1b5cbe2cfe8d4ce06b56242eea17", - b"5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b00", - b"6f17457e0e63328c07a4d0b8f8dd051a75ea456f0d71036fc76a01a5024fdb5c", - b"7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a00", - b"6bc49861d280b35be1a31b37fcb9ad318ae9599afc6a3ccc8a1eaa94626c2818", - b"9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b900", - b"ad5583bc4ca170ca45e20ef7361c4458b32884ad4baf41ad05a93fe3408d195d", - b"babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d800", - b"a902d79f10bff1991fe259753af8eb6fc82798d83aa97a0ac95ce8d2a0aa6618", - b"d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f700", - b"eb93c1fa8adfae0884204d35755a8296f166c2eb89ed7feb43e77d217fcb575d", - ] - .into_iter() - .map(|e| { - e.chunks_exact(2) - .map(|h| u8::from_str_radix(from_utf8(h).unwrap(), 16).unwrap()) - .collect::>() - }) - .map(|e| { - BlsScalar::from_bytes(e.as_slice().try_into().expect("wrong number of elems")).unwrap() - }) - .collect::>(); - - let block_dims = BlockDimensions { - rows: 2, - cols: 4, - chunk_size: 32, - }; - let block = (0..=247) - .collect::>() - .chunks_exact(DATA_CHUNK_SIZE) - .map(|chunk| pad_with_zeroes(chunk.to_vec(), block_dims.chunk_size)) - .flatten() - .collect::>(); - let res = par_extend_data_matrix(block_dims, &block); - eprintln!("result={:?}", res); - eprintln!("expect={:?}", expected_result); - assert_eq!(res.unwrap(), expected_result); - } - - #[test_case( 1..=29 => "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d8000" ; "chunk more than 3 values shorter")] - #[test_case( 1..=30 => "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e80" ; "Chunk 2 values shorter")] - #[test_case( 1..=31 => "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f80000000000000000000000000000000000000000000000000000000000000" ; "Chunk 1 value shorter")] - #[test_case( 1..=32 => "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20800000000000000000000000000000000000000000000000000000000000" ; "Chunk same size")] - #[test_case( 1..=33 => "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20218000000000000000000000000000000000000000000000000000000000" ; "Chunk 1 value longer")] - #[test_case( 1..=34 => "0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20212280000000000000000000000000000000000000000000000000000000" ; "Chunk 2 value longer")] - fn test_padding>(block: I) -> String { - let padded = pad_iec_9797_1(block.collect()) - .iter() - .flat_map(|e| e.to_vec()) - .collect::>(); - - hex::encode(padded) - } - - #[test] - fn test_flatten_block() { - let chunk_size = 32; - let extrinsics: Vec = vec![ - AppExtrinsic { - app_id: 0, - data: (1..=29).collect(), - }, - AppExtrinsic { - app_id: 1, - data: (1..=30).collect(), - }, - AppExtrinsic { - app_id: 2, - data: (1..=31).collect(), - }, - AppExtrinsic { - app_id: 3, - data: (1..=60).collect(), - }, - ]; - - let expected_dims = BlockDimensions { - rows: 1, - cols: 16, - chunk_size, - }; - let (layout, data, dims) = - flatten_and_pad_block(128, 256, chunk_size, extrinsics.as_slice(), Seed::default()) - .unwrap(); - - let expected_layout = vec![(0, 2), (1, 2), (2, 2), (3, 3)]; - assert_eq!(layout, expected_layout, "The layouts don't match"); - - let expected_data = hex!("04740102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d00800000000000000000000000000000000000000000000000000000000000000004780102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d001e80000000000000000000000000000000000000000000000000000000000000047c0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d001e1f80000000000000000000000000000000000000000000000000000000000004f00102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d001e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c00800000000000000000000000000000000000000000000000000000000000000076a04053bda0a88bda5177b86a15c3b29f559873cb481232299cd5743151ac004b2d63ae198e7bb0a9011f28e473c95f4013d7d53ec5fbc3b42df8ed101f6d00e831e52bfb76e51cca8b4e9016838657edfae09cb9a71eb219025c4c87a67c004aaa86f20ac0aa792bc121ee42e2c326127061eda15599cb5db3db870bea5a00ecf353161c3cb528b0c5d98050c4570bfc942d8b19ed7b0cbba5725e03e5f000b7e30db36b6df82ac151f668f5f80a5e2a9cac7c64991dd6a6ce21c060175800edb9260d2a86c836efc05f17e5c59525e404c6a93d051651fe2e4eefae281300"); - - assert_eq!(dims, expected_dims, "Dimensions don't match the expected"); - assert_eq!(data, expected_data, "Data doesn't match the expected data"); - let index = AppDataIndex::try_from(&layout).unwrap(); - let res = unflatten_padded_data(index.data_ranges(), data, chunk_size).unwrap(); - assert_eq!( - res.len(), - extrinsics.len(), - "Number of extrinsics is not as expected." - ); - - for (res, exp) in res.iter().zip(extrinsics.iter()) { - assert_eq!(res.0, exp.app_id); - assert_eq!(res.1[0], exp.data); - } - } - - fn sample_cells_from_matrix( - matrix: &[BlsScalar], - dimensions: &BlockDimensions, - columns: Option<&[u16]>, - ) -> Vec { - fn random_indexes(length: usize, seed: Seed) -> Vec { - // choose random len/2 (unique) indexes - let mut idx = (0..length).collect::>(); - let mut chosen_idx = Vec::::new(); - let mut rng = ChaChaRng::from_seed(seed); - - for _ in 0..length / 2 { - let i = rng.gen_range(0..idx.len()); - let v = idx.remove(i); - chosen_idx.push(v as u16); - } - chosen_idx - } - - const RNG_SEED: Seed = [42u8; 32]; - matrix - .chunks_exact(dimensions.rows * 2) - .enumerate() - .map(|(col, e)| (col as u16, e)) - .flat_map(|(col, e)| { - random_indexes(e.len(), RNG_SEED) - .into_iter() - .map(|row| DataCell { - position: Position { row, col }, - data: e[row as usize].to_bytes(), - }) - .filter(|cell| { - columns.is_none() || columns.unwrap_or(&[]).contains(&cell.position.col) - }) - .collect::>() - }) - .collect::>() - } - - fn app_extrinsic_strategy() -> impl Strategy { - ( - any::(), - any_with::>(size_range(1..2048).lift()), - ) - .prop_map(|(app_id, data)| AppExtrinsic { app_id, data }) - } - - fn app_extrinsics_strategy() -> impl Strategy> { - collection::vec(app_extrinsic_strategy(), size_range(1..16)).prop_map(|xts| { - let mut new_xts = xts.clone(); - new_xts.sort_by(|a1, a2| a1.app_id.cmp(&a2.app_id)); - new_xts - }) - } - - fn random_cells(cols: usize, rows: usize, percents: usize) -> Vec { - assert!(percents > 0 && percents <= 100); - - let rng = &mut ChaChaRng::from_seed([0u8; 32]); - let amount = (cols as f32 * rows as f32 * (percents as f32 / 100.0)).ceil() as usize; - - (0..cols) - .flat_map(move |col| (0..rows).map(move |row| (row, col))) - .map(|(row, col)| Cell { - col: col as u32, - row: row as u32, - }) - .choose_multiple(rng, amount) - } - - proptest! { - #![proptest_config(ProptestConfig::with_cases(20))] - #[test] - fn test_build_and_reconstruct(ref xts in app_extrinsics_strategy()) { - let (layout, commitments, dims, matrix) = par_build_commitments(64, 16, 32, xts, Seed::default()).unwrap(); - - let columns = sample_cells_from_matrix(&matrix, &dims, None); - let extended_dims = ExtendedMatrixDimensions{cols: dims.cols, rows: dims.rows * 2}; - let index = AppDataIndex::try_from(&layout).unwrap(); - let reconstructed = reconstruct_extrinsics(&index, &extended_dims, columns).unwrap(); - for (result, xt) in reconstructed.iter().zip(xts) { - prop_assert_eq!(result.0, xt.app_id); - prop_assert_eq!(result.1[0].as_slice(), &xt.data); - } - - let public_params = crate::testnet::public_params(MAX_BLOCK_COLUMNS as usize); - let pp = testnet::public_params(dims.cols); - for cell in random_cells(dims.cols, dims.rows, 1) { - let col = cell.col; - let row = cell.row as usize; - - let proof = build_proof(&public_params, dims, &matrix, &[cell]).unwrap(); - prop_assert!(proof.len() == 80); - - let commitment = &commitments[row * 48..(row + 1) * 48]; - let verification = kate_proof::kc_verify_proof(col, &proof, commitment, dims.rows as usize, dims.cols as usize, &pp); - prop_assert!(verification.is_ok()); - } - } - } - - #[test] - // Test build_commitments() function with a predefined input - fn test_build_commitments_simple_commitment_check() { - let block_rows = 256; - let block_cols = 256; - let chunk_size = 32; - let original_data = br#"test"#; - let hash: Seed = [ - 76, 41, 174, 145, 187, 12, 97, 32, 75, 111, 149, 209, 243, 195, 165, 10, 166, 172, 47, - 41, 218, 24, 212, 66, 62, 5, 187, 191, 129, 5, 105, 3, - ]; - - let (_, commitments, dimensions, _) = par_build_commitments( - block_rows, - block_cols, - chunk_size, - &[AppExtrinsic::from(original_data.to_vec())], - hash, - ) - .unwrap(); - - assert_eq!(dimensions, BlockDimensions { - rows: 1, - cols: 4, - chunk_size: 32 - }); - let expected_commitments = hex!("960F08F97D3A8BD21C3F5682366130132E18E375A587A1E5900937D7AA5F33C4E20A1C0ACAE664DCE1FD99EDC2693B8D960F08F97D3A8BD21C3F5682366130132E18E375A587A1E5900937D7AA5F33C4E20A1C0ACAE664DCE1FD99EDC2693B8D"); - assert_eq!(commitments, expected_commitments); - } - - #[test] - fn test_reconstruct_app_extrinsics_with_app_id() { - let app_id_1_data = br#""This is mocked test data. It will be formatted as a matrix of BLS scalar cells and then individual columns -get erasure coded to ensure redundancy."#; - - let app_id_2_data = br#""Let's see how this gets encoded and then reconstructed by sampling only some data."#; - - let hash = Seed::default(); - let xts = vec![ - AppExtrinsic { - app_id: 0, - data: vec![0], - }, - AppExtrinsic { - app_id: 1, - data: app_id_1_data.to_vec(), - }, - AppExtrinsic { - app_id: 2, - data: app_id_2_data.to_vec(), - }, - ]; - - let chunk_size = 32; - - let (layout, data, dims) = flatten_and_pad_block(32, 4, chunk_size, &xts, hash).unwrap(); - let coded: Vec = par_extend_data_matrix(dims, &data[..]).unwrap(); - - let cols_1 = sample_cells_from_matrix(&coded, &dims, Some(&[0, 1])); - - let extended_dims = ExtendedMatrixDimensions { - cols: dims.cols, - rows: dims.rows * 2, - }; - - let index = AppDataIndex::try_from(&layout).unwrap(); - let res_1 = reconstruct_app_extrinsics(&index, &extended_dims, cols_1, 1).unwrap(); - assert_eq!(res_1[0], app_id_1_data); - - let cols_2 = sample_cells_from_matrix(&coded, &dims, Some(&[1, 2])); - - let res_2 = reconstruct_app_extrinsics(&index, &extended_dims, cols_2, 2).unwrap(); - assert_eq!(res_2[0], app_id_2_data); - } - - #[test] - fn test_decode_app_extrinsics() { - let app_id_1_data = br#""This is mocked test data. It will be formatted as a matrix of BLS scalar cells and then individual columns -get erasure coded to ensure redundancy."#; - - let app_id_2_data = br#""Let's see how this gets encoded and then reconstructed by sampling only some data."#; - - let data = [vec![0], app_id_1_data.to_vec(), app_id_2_data.to_vec()]; - - let hash = Seed::default(); - let xts = (0..=2) - .zip(data) - .map(|(app_id, data)| AppExtrinsic { app_id, data }) - .collect::>(); - - let chunk_size = 32; - - let (layout, data, dims) = flatten_and_pad_block(32, 4, chunk_size, &xts, hash).unwrap(); - let coded = par_extend_data_matrix(dims, &data[..]).unwrap(); - - let extended_dims = ExtendedMatrixDimensions { - cols: dims.cols, - rows: dims.rows * 2, - }; - let extended_matrix = coded.chunks(extended_dims.rows).collect::>(); - - let index = AppDataIndex::try_from(&layout).unwrap(); - for xt in xts { - let positions = app_specific_cells(&index, &extended_dims, xt.app_id).unwrap(); - let cells = positions - .iter() - .map(|position| kate_recovery::com::DataCell { - position: position.clone(), - data: extended_matrix[position.col as usize][position.row as usize].to_bytes(), - }) - .collect::>(); - let data = &decode_app_extrinsics(&index, &extended_dims, cells, xt.app_id).unwrap()[0]; - assert_eq!(data, &xt.data); - } - - assert!(matches!( - decode_app_extrinsics(&index, &extended_dims, vec![], 0), - Err(ReconstructionError::MissingCell { .. }) - )); - } - - #[test] - fn test_extend_mock_data() { - let orig_data = br#"This is mocked test data. It will be formatted as a matrix of BLS scalar cells and then individual columns -get erasure coded to ensure redundancy. -Let's see how this gets encoded and then reconstructed by sampling only some data."#; - - // The hash is used for seed for padding the block to next power of two value - let hash = Seed::default(); - let chunk_size = 32; - let (layout, data, dims) = flatten_and_pad_block( - 128, - 2, - chunk_size, - &[AppExtrinsic::from(orig_data.to_vec())], - hash, - ) - .unwrap(); - - let coded: Vec = par_extend_data_matrix(dims, &data[..]).unwrap(); - - let cols = sample_cells_from_matrix(&coded, &dims, None); - - let extended_dims = ExtendedMatrixDimensions { - cols: dims.cols, - rows: dims.rows * 2, - }; - let index = AppDataIndex::try_from(&layout).unwrap(); - let res = reconstruct_extrinsics(&index, &extended_dims, cols).unwrap(); - let s = String::from_utf8_lossy(res[0].1[0].as_slice()); - - assert_eq!(res[0].1[0], orig_data); - - eprintln!("Decoded: {}", s); - } - - #[test] - fn test_multiple_extrinsics_for_same_app_id() { - let xt1 = vec![5, 5]; - let xt2 = vec![6, 6]; - let xts = [ - AppExtrinsic { - app_id: 1, - data: xt1.clone(), - }, - AppExtrinsic { - app_id: 1, - data: xt2.clone(), - }, - ]; - // The hash is used for seed for padding the block to next power of two value - let hash = Seed::default(); - let chunk_size = 32; - let (layout, data, dims) = flatten_and_pad_block(128, 2, chunk_size, &xts, hash).unwrap(); - - let coded: Vec = par_extend_data_matrix(dims, &data[..]).unwrap(); - - let cols = sample_cells_from_matrix(&coded, &dims, None); - let extended_dims = ExtendedMatrixDimensions { - cols: dims.cols, - rows: dims.rows * 2, - }; - - let index = AppDataIndex::try_from(&layout).unwrap(); - let res = reconstruct_extrinsics(&index, &extended_dims, cols).unwrap(); - - assert_eq!(res[0].1[0], xt1); - assert_eq!(res[0].1[1], xt2); - } - - #[test] - fn test_extrinsics_grouping() { - let xt1 = vec![5, 5]; - let xt2 = vec![6, 6]; - let xt3 = vec![7]; - let xt4 = vec![]; - let xts = [ - AppExtrinsic { - app_id: 1, - data: xt1.clone(), - }, - AppExtrinsic { - app_id: 1, - data: xt2.clone(), - }, - AppExtrinsic { - app_id: 2, - data: xt3.clone(), - }, - AppExtrinsic { - app_id: 3, - data: xt4.clone(), - }, - ]; - - let expected = vec![(1u32, vec![xt1, xt2]), (2, vec![xt3]), (3, vec![xt4])]; - let rez = app_extrinsics_group_by_app_id(&xts); - println!("{:?}", rez); - - assert_eq!(rez, expected); - } - - fn build_extrinsics(lens: &[usize]) -> Vec> { - lens.iter() - .map(|len| repeat(b'a').take(*len).collect::>()) - .collect() - } - - fn padded_len_group(lens: &[u32], chunk_size: u32) -> u32 { - lens.iter().map(|len| padded_len(*len, chunk_size)).sum() - } - - #[test_case( build_extrinsics(&[5,30,31]), 32 => padded_len_group(&[5,30,31], 32) ; "Single chunk per ext")] - #[test_case( build_extrinsics(&[5,30,32]), 32 => padded_len_group(&[5,30,32], 32) ; "Extra chunk per ext")] - #[test_case( build_extrinsics(&[5,64,120]), 32 => padded_len_group(&[5,64,120], 32) ; "Extra chunk 2 per ext")] - #[test_case( build_extrinsics(&[]), 32 => padded_len_group(&[], 32) ; "Empty chunk list")] - #[test_case( build_extrinsics(&[4096]), 32 => padded_len_group(&[4096], 32) ; "4K chunk")] - fn test_padding_len(extrinsics: Vec>, chunk_size: usize) -> u32 { - extrinsics - .into_iter() - .map(pad_iec_9797_1) - .flatten() - .map(|chunk| pad_to_chunk(chunk, chunk_size).len() as u32) - .sum() - } -} diff --git a/kate/src/lib.rs b/kate/src/lib.rs deleted file mode 100644 index 415fd2d12..000000000 --- a/kate/src/lib.rs +++ /dev/null @@ -1,104 +0,0 @@ -#![cfg_attr(not(feature = "std"), no_std)] - -use static_assertions::const_assert_ne; - -use crate::config::DATA_CHUNK_SIZE; - -pub const LOG_TARGET: &str = "kate"; -pub type Seed = [u8; 32]; - -pub mod config { - pub const SCALAR_SIZE_WIDE: usize = 64; - pub const SCALAR_SIZE: usize = 32; - pub const DATA_CHUNK_SIZE: usize = 31; // Actual chunk size is 32 after 0 padding is done - pub const EXTENSION_FACTOR: usize = 2; - pub const PROVER_KEY_SIZE: usize = 48; - pub const PROOF_SIZE: usize = 48; - // MINIMUM_BLOCK_SIZE, MAX_BLOCK_ROWS and MAX_BLOCK_COLUMNS have to be a power of 2 because of the FFT functions requirements - pub const MINIMUM_BLOCK_SIZE: usize = 128; - pub const MAX_BLOCK_ROWS: u32 = if cfg!(feature = "extended-columns") { - 128 - } else { - 256 - }; - pub const MAX_BLOCK_COLUMNS: u32 = if cfg!(feature = "extended-columns") { - 512 - } else { - 256 - }; - pub const MAXIMUM_BLOCK_SIZE: bool = cfg!(feature = "maximum-block-size"); -} - -#[cfg(feature = "std")] -pub mod com; -/// Precalculate the length of padding IEC 9797 1. -/// -/// # NOTE -/// There is a unit test to ensure this formula match with the current -/// IEC 9797 1 algorithm we implemented. See `fn pad_iec_9797_1` -#[inline] -fn padded_len_of_pad_iec_9797_1(len: u32) -> u32 { - (len + 1) - + (DATA_CHUNK_SIZE as u32 - ((len + 1) % DATA_CHUNK_SIZE as u32)) % DATA_CHUNK_SIZE as u32 -} - -/// Calculates the padded len based of initial `len`. -pub fn padded_len(len: u32, chunk_size: u32) -> u32 { - let iec_9797_1_len = padded_len_of_pad_iec_9797_1(len); - - const_assert_ne!(DATA_CHUNK_SIZE, 0); - debug_assert!( - chunk_size >= DATA_CHUNK_SIZE as u32, - "`BlockLength.chunk_size` is valid by design .qed" - ); - let diff_per_chunk = chunk_size - DATA_CHUNK_SIZE as u32; - let pad_to_chunk_extra = if diff_per_chunk != 0 { - let chunks_count = iec_9797_1_len / DATA_CHUNK_SIZE as u32; - chunks_count * diff_per_chunk - } else { - 0 - }; - - iec_9797_1_len + pad_to_chunk_extra -} - -#[derive(Clone, Copy, PartialEq, Debug)] -pub struct BlockDimensions { - pub rows: usize, - pub cols: usize, - pub chunk_size: usize, -} - -impl BlockDimensions { - pub fn size(&self) -> usize { - self.rows - .saturating_mul(self.cols) - .saturating_mul(self.chunk_size) - } -} - -#[cfg(feature = "std")] -pub mod testnet { - use std::{collections::HashMap, sync::Mutex}; - - use dusk_plonk::commitment_scheme::kzg10::PublicParameters; - use once_cell::sync::Lazy; - use rand::SeedableRng; - use rand_chacha::ChaChaRng; - - static SRS_DATA: Lazy>> = - Lazy::new(|| Mutex::new(HashMap::new())); - - pub fn public_params(max_degree: usize) -> PublicParameters { - let mut srs_data_locked = SRS_DATA.lock().unwrap(); - srs_data_locked - .entry(max_degree) - .or_insert_with(|| { - let mut rng = ChaChaRng::seed_from_u64(42); - PublicParameters::setup(max_degree, &mut rng).unwrap() - }) - .clone() - } -} - -// vim: set noet nowrap diff --git a/node/Cargo.toml b/node/Cargo.toml index 2ec430aa3..31e7808ac 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "data-avail" -version = "1.1.0" +version = "1.3.0" description = "Polygon Data Avilability Node." authors = ["Anonymous"] homepage = "https://polygon.technology/" @@ -18,12 +18,15 @@ name = "data-avail" [dependencies] # Internals -da-primitives= { path = "../primitives/avail" } +da-primitives = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } +kate = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } da-runtime = { path = "../runtime" } da-control = { path = "../pallets/dactr" } -kate = { path = "../kate" } kate-rpc = { path = "../rpc/kate-rpc" } -dusk-plonk = "0.8.2" +# Nomad +updater-manager = { path = "../pallets/nomad/updater-manager" } +nomad-home = { path = "../pallets/nomad/home" } +da-bridge = { path = "../pallets/nomad/da-bridge" } # 3rd-party codec = { package = "parity-scale-codec", version = "2.0.0" } diff --git a/node/src/chain_spec.rs b/node/src/chain_spec.rs index 76809163f..224277e27 100644 --- a/node/src/chain_spec.rs +++ b/node/src/chain_spec.rs @@ -3,9 +3,9 @@ use da_primitives::currency::AVL; use da_runtime::{ wasm_binary_unwrap, AccountId, AuthorityDiscoveryConfig, BabeConfig, Balance, BalancesConfig, Block, CouncilConfig, DataAvailabilityConfig, DemocracyConfig, DesiredMembers, ElectionsConfig, - GenesisConfig, GrandpaConfig, ImOnlineConfig, IndicesConfig, SessionConfig, SessionKeys, - Signature, StakerStatus, StakingConfig, SudoConfig, SystemConfig, TechnicalCommitteeConfig, - MAX_NOMINATIONS, + GenesisConfig, GrandpaConfig, ImOnlineConfig, IndicesConfig, NomadHomeConfig, SessionConfig, + SessionKeys, Signature, StakerStatus, StakingConfig, SudoConfig, SystemConfig, + TechnicalCommitteeConfig, UpdaterManagerConfig, MAX_NOMINATIONS, }; use frame_system::limits::BlockLength; use kate::config::{MAX_BLOCK_COLUMNS, MAX_BLOCK_ROWS}; @@ -308,18 +308,33 @@ pub fn testnet_genesis( app_keys: vec![ (b"Data Avail".to_vec(), AppKeyInfo { owner: root_key.clone(), - id: 0, + id: 0.into(), }), (b"Ethereum".to_vec(), AppKeyInfo { owner: root_key.clone(), - id: 1, + id: 1.into(), }), (b"Polygon".to_vec(), AppKeyInfo { owner: root_key, - id: 2, + id: 2.into(), }), ], }, + updater_manager: UpdaterManagerConfig { + updater: "0x1563915e194d8cfba1943570603f7606a3115508" + .parse() + .unwrap(), + _phantom: Default::default(), + }, + nomad_home: NomadHomeConfig { + local_domain: 2000, + committed_root: Default::default(), + updater: "0x1563915e194d8cfba1943570603f7606a3115508" + .parse() + .unwrap(), + _phantom: Default::default(), + }, + da_bridge: Default::default(), } } @@ -462,18 +477,21 @@ fn genesis_builder( app_keys: vec![ (b"Data Avail".to_vec(), AppKeyInfo { owner: sudo_key.clone(), - id: 0, + id: 0.into(), }), (b"Ethereum".to_vec(), AppKeyInfo { owner: sudo_key.clone(), - id: 1, + id: 1.into(), }), (b"Polygon".to_vec(), AppKeyInfo { owner: sudo_key, - id: 2, + id: 2.into(), }), ], }, + updater_manager: Default::default(), + nomad_home: Default::default(), + da_bridge: Default::default(), } } diff --git a/node/src/rpc.rs b/node/src/rpc.rs index 4859a47de..097caaa36 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -36,7 +36,7 @@ use std::sync::Arc; -use da_runtime::{Block, BlockNumber, Hash}; +use da_runtime::{Block, BlockNumber, Hash, Runtime}; use sc_consensus_babe::{Config, Epoch}; use sc_consensus_babe_rpc::BabeRpcHandler; use sc_consensus_epochs::SharedEpochChanges; @@ -161,9 +161,9 @@ pub fn create_full( ), )); - io.extend_with(kate_rpc::KateApi::to_delegate(kate_rpc::Kate::new( - client.clone(), - ))); + io.extend_with(kate_rpc::KateApi::::to_delegate( + kate_rpc::Kate::new(client.clone()), + )); io.extend_with(sc_sync_state_rpc::SyncStateRpcApi::to_delegate( sc_sync_state_rpc::SyncStateRpcHandler::new( diff --git a/pallets/dactr/Cargo.toml b/pallets/dactr/Cargo.toml index 54da13c48..6573ba726 100644 --- a/pallets/dactr/Cargo.toml +++ b/pallets/dactr/Cargo.toml @@ -12,8 +12,8 @@ description = "Data Avail Control Module" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -da-primitives = { path = "../../primitives/avail", default-features = false } -kate = { path = "../../kate", default-features = false } +da-primitives = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } +kate = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } # Substrate serde = { version = "1.0.126", optional = true, features = ["derive"] } diff --git a/pallets/dactr/src/benchmarking.rs b/pallets/dactr/src/benchmarking.rs index 876ac78dd..53c01057f 100644 --- a/pallets/dactr/src/benchmarking.rs +++ b/pallets/dactr/src/benchmarking.rs @@ -30,7 +30,7 @@ benchmarks! { }: create_application_key(origin, key) verify { let info = Pallet::::application_key(&key_verify); - assert_eq!( info, Some(AppKeyInfoFor:: { owner: caller, id: 3u32 })); + assert_eq!( info, Some(AppKeyInfoFor:: { owner: caller, id: 3.into()})); } submit_data { diff --git a/pallets/dactr/src/extensions/check_app_id.rs b/pallets/dactr/src/extensions/check_app_id.rs index be72c5a3b..b8a3752d4 100644 --- a/pallets/dactr/src/extensions/check_app_id.rs +++ b/pallets/dactr/src/extensions/check_app_id.rs @@ -54,7 +54,7 @@ where _ => { // Any other call must use `AppId == 0`. ensure!( - self.app_id() == 0, + self.app_id().0 == 0, InvalidTransaction::Custom(InvalidTransactionCustomId::ForbiddenAppId as u8) ); }, @@ -105,7 +105,7 @@ where } } -impl GetAppId for CheckAppId +impl GetAppId for CheckAppId where T: Config + Send + Sync, { @@ -144,7 +144,7 @@ mod tests { #[test_case(0, remark_call() => Ok(ValidTransaction::default()); "System::remark can be called if AppId == 0" )] #[test_case(1, remark_call() => to_invalid_tx(ForbiddenAppId); "System::remark cannot be called if AppId != 0" )] #[test_case(1, submit_data_call() => Ok(ValidTransaction::default()); "submit_data can be called with any valid AppId" )] - fn do_validate_test(app_id: AppId, call: Call) -> TransactionValidity { - new_test_ext().execute_with(|| CheckAppId::::from(app_id).do_validate(&call)) + fn do_validate_test>(app_id: A, call: Call) -> TransactionValidity { + new_test_ext().execute_with(|| CheckAppId::::from(app_id.into()).do_validate(&call)) } } diff --git a/pallets/dactr/src/lib.rs b/pallets/dactr/src/lib.rs index 9f89610ee..8d951a066 100644 --- a/pallets/dactr/src/lib.rs +++ b/pallets/dactr/src/lib.rs @@ -238,10 +238,11 @@ pub mod pallet { .iter() .max() .cloned() - .unwrap_or(0) - .checked_add(1) + .map(Into::into) + .unwrap_or(0u32) + .checked_add(1u32) .expect("DA Control Genesis overflows the last application id"); - NextAppId::::put(last_id); + NextAppId::::put::(last_id.into()); } } @@ -267,7 +268,7 @@ impl Pallet { /// Returns the latest available application ID and increases it. pub fn next_application_id() -> Result> { NextAppId::::try_mutate(|id| { - let new_id = id.checked_add(1).ok_or(Error::::LastAppIdOverflowed)?; + let new_id = AppId(id.0.checked_add(1).ok_or(Error::::LastAppIdOverflowed)?); Ok(replace(id, new_id)) }) } diff --git a/pallets/dactr/src/mock.rs b/pallets/dactr/src/mock.rs index 65ba07598..7a5ef466c 100644 --- a/pallets/dactr/src/mock.rs +++ b/pallets/dactr/src/mock.rs @@ -64,7 +64,7 @@ impl frame_system::Config for Test { type Hash = H256; type Hashing = BlakeTwo256; type Header = Header; - type HeaderBuilder = frame_system::header_builder::da::HeaderBuilder; + type HeaderExtensionBuilder = frame_system::header_builder::da::HeaderExtensionBuilder; type Index = u64; type Lookup = IdentityLookup; type OnKilledAccount = (); @@ -74,6 +74,7 @@ impl frame_system::Config for Test { type PalletInfo = PalletInfo; type Randomness = frame_system::tests::TestRandomness; type SS58Prefix = (); + type SubmittedDataExtractor = (); type SystemWeightInfo = (); type Version = (); } @@ -141,9 +142,18 @@ pub fn new_test_ext() -> sp_io::TestExternalities { da_control::GenesisConfig:: { app_keys: vec![ - (b"Data Avail".to_vec(), AppKeyInfo { owner: 1, id: 0 }), - (b"Ethereum".to_vec(), AppKeyInfo { owner: 2, id: 1 }), - (b"Polygon".to_vec(), AppKeyInfo { owner: 2, id: 2 }), + (b"Data Avail".to_vec(), AppKeyInfo { + owner: 1, + id: 0.into(), + }), + (b"Ethereum".to_vec(), AppKeyInfo { + owner: 2, + id: 1.into(), + }), + (b"Polygon".to_vec(), AppKeyInfo { + owner: 2, + id: 2.into(), + }), ], } .assimilate_storage(&mut storage) diff --git a/pallets/dactr/src/tests.rs b/pallets/dactr/src/tests.rs index 673362f91..d5bc7a655 100644 --- a/pallets/dactr/src/tests.rs +++ b/pallets/dactr/src/tests.rs @@ -23,7 +23,7 @@ fn create_application_keys() { Event::DataAvailability(ApplicationKeyCreated { key: new_key.clone(), owner: 3, - id: 3 + id: 3.into() }) ); assert_noop!( @@ -32,7 +32,10 @@ fn create_application_keys() { ); assert_eq!( DataAvailability::application_key(&new_key), - Some(AppKeyInfoFor:: { id: 3, owner: 3 }) + Some(AppKeyInfoFor:: { + id: 3.into(), + owner: 3 + }) ); }) } diff --git a/pallets/executive/Cargo.toml b/pallets/executive/Cargo.toml index caed507ea..3a90e10bd 100644 --- a/pallets/executive/Cargo.toml +++ b/pallets/executive/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -da-primitives = { path = "../../primitives/avail", default-features = false } +da-primitives = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ "derive", diff --git a/pallets/executive/src/lib.rs b/pallets/executive/src/lib.rs index b5f7e881e..7edab97f0 100644 --- a/pallets/executive/src/lib.rs +++ b/pallets/executive/src/lib.rs @@ -117,7 +117,7 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::{Codec, Encode}; -use da_primitives::asdr::{AppId, GetAppId}; +use da_primitives::asdr::GetAppId; use frame_support::{ dispatch::PostDispatchInfo, traits::{ @@ -176,7 +176,7 @@ impl< > ExecuteBlock for Executive where - Block::Extrinsic: Checkable + Codec + GetAppId, + Block::Extrinsic: Checkable + Codec + GetAppId, CheckedOf: Applyable + GetDispatchInfo, CallOf: Dispatchable, @@ -208,7 +208,7 @@ impl< COnRuntimeUpgrade: OnRuntimeUpgrade, > Executive where - Block::Extrinsic: Checkable + Codec + GetAppId, + Block::Extrinsic: Checkable + Codec + GetAppId, CheckedOf: Applyable + GetDispatchInfo, CallOf: Dispatchable, @@ -600,7 +600,9 @@ where #[cfg(test)] mod tests { use da_control::CheckAppId; - use da_primitives::{asdr::DataLookup, currency::AVL, Header as DaHeader, KateCommitment}; + use da_primitives::{ + asdr::DataLookup, currency::AVL, extension::v1, Header as DaHeader, HeaderExtension, + }; use frame_support::{ assert_err, traits::{Currency, LockIdentifier, LockableCurrency, WithdrawReasons}, @@ -618,7 +620,7 @@ mod tests { use sp_runtime::{ generic::{Block, DigestItem, Era}, testing::Digest, - traits::Block as BlockT, + traits::{BlakeTwo256, Block as BlockT}, transaction_validity::{ InvalidTransaction, TransactionValidityError, UnknownTransaction, ValidTransaction, }, @@ -766,58 +768,48 @@ mod tests { t.into() } - #[test] - fn block_import_works() { - let extrinsics_root = KateCommitment { - hash: hex!("03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314").into(), - commitment: vec![], - rows: 0, - cols: 0, - data_root: [0u8; 32].into(), - }; + fn make_header() -> DaHeader { + let extension = HeaderExtension::V1(v1::HeaderExtension { + app_lookup: DataLookup { + size: 1, + ..Default::default() + }, + ..Default::default() + }); let state_root = - hex!("293056F7324B44B6841297FB8076DEDFF6BD04C0F3F7DACBA3781C5CF3B5A80C").into(); - let app_data_lookup = DataLookup { - size: 1, + hex!("3f1bd581280b838db1f5f16754026f9332e7c526122b764b70106dac450e7992").into(); + let extrinsics_root = + hex!("03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314").into(); + + DaHeader { + parent_hash: [69u8; 32].into(), + number: 1, + state_root, + extrinsics_root, + extension, ..Default::default() - }; + } + } + #[test] + fn block_import_works() { new_test_ext(1).execute_with(|| { Executive::execute_block(Block { - header: DaHeader { - parent_hash: [69u8; 32].into(), - number: 1, - state_root, - extrinsics_root, - digest: Digest { logs: vec![] }, - app_data_lookup, - }, + header: make_header(), extrinsics: vec![], }); - }); + }) } #[test] #[should_panic] fn block_import_of_bad_state_root_fails() { - let extrinsics_root = KateCommitment { - hash: hex!("03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314").into(), - commitment: vec![], - rows: 0, - cols: 0, - data_root: [0u8; 32].into(), - }; + let mut header = DaHeader::default(); + header.extension = HeaderExtension::default(); new_test_ext(1).execute_with(|| { Executive::execute_block(Block { - header: DaHeader { - parent_hash: [69u8; 32].into(), - number: 1, - state_root: [0u8; 32].into(), - extrinsics_root, - digest: Digest { logs: vec![] }, - app_data_lookup: Default::default(), - }, + header, extrinsics: vec![], }); }); @@ -826,26 +818,13 @@ mod tests { #[test] #[should_panic] fn block_import_of_bad_extrinsic_root_fails() { - let state_root = + let mut header = DaHeader::default(); + header.state_root = hex!("49cd58a254ccf6abc4a023d9a22dcfc421e385527a250faec69f8ad0d8ed3e48").into(); - let extrinsics_root = KateCommitment { - hash: [0u8; 32].into(), - commitment: vec![], - rows: 0, - cols: 0, - data_root: [0u8; 32].into(), - }; new_test_ext(1).execute_with(|| { Executive::execute_block(Block { - header: DaHeader { - parent_hash: [69u8; 32].into(), - number: 1, - state_root, - extrinsics_root, - digest: Digest { logs: vec![] }, - app_data_lookup: Default::default(), - }, + header, extrinsics: vec![], }); }); diff --git a/pallets/mocked_runtime/Cargo.toml b/pallets/mocked_runtime/Cargo.toml index 5ba406ea3..8343a5281 100644 --- a/pallets/mocked_runtime/Cargo.toml +++ b/pallets/mocked_runtime/Cargo.toml @@ -9,9 +9,9 @@ repository = "" description = "Mokend Runtime for Testing" [dependencies] -da-primitives = { path = "../../primitives/avail" } +da-primitives = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } +kate = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } da-control = { path = "../dactr" } -kate = { path = "../../kate" } scale-info = { version = "1.0", features = ["derive"] } codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] } diff --git a/pallets/mocked_runtime/src/lib.rs b/pallets/mocked_runtime/src/lib.rs index 86983a4ee..794aff250 100644 --- a/pallets/mocked_runtime/src/lib.rs +++ b/pallets/mocked_runtime/src/lib.rs @@ -124,7 +124,6 @@ thread_local! { // Runtime // - impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountId; @@ -139,7 +138,7 @@ impl frame_system::Config for Runtime { type Hash = sp_core::H256; type Hashing = BlakeTwo256; type Header = da_primitives::Header; - type HeaderBuilder = frame_system::header_builder::da::HeaderBuilder; + type HeaderExtensionBuilder = frame_system::header_builder::da::HeaderExtensionBuilder; type Index = u64; type Lookup = IdentityLookup; type OnKilledAccount = (); @@ -149,6 +148,7 @@ impl frame_system::Config for Runtime { type PalletInfo = PalletInfo; type Randomness = TestRandomness; type SS58Prefix = (); + type SubmittedDataExtractor = (); type SystemWeightInfo = (); type Version = RuntimeVersion; } diff --git a/pallets/mocked_runtime/src/test_xt.rs b/pallets/mocked_runtime/src/test_xt.rs index f37bf9222..78261fdcc 100644 --- a/pallets/mocked_runtime/src/test_xt.rs +++ b/pallets/mocked_runtime/src/test_xt.rs @@ -113,7 +113,7 @@ where fn call(&self) -> &Self::Call { self.0.call() } } -impl GetAppId for TestXt { +impl GetAppId for TestXt { fn app_id(&self) -> AppId { AppId::default() } } diff --git a/pallets/nomad/da-bridge/Cargo.toml b/pallets/nomad/da-bridge/Cargo.toml new file mode 100644 index 000000000..248b94fcf --- /dev/null +++ b/pallets/nomad/da-bridge/Cargo.toml @@ -0,0 +1,64 @@ +[package] +name = "da-bridge" +version = "1.0.0" +authors = [""] +edition = "2021" +license = "Apache-2.0" +homepage = "" +repository = "" +description = "Data Attestation Bridge Module" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +# Our crates +da-primitives = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } +nomad-core = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } +nomad-home = { path = "../home", default-features = false } + +# 3rd-party +serde = { version = "1.0.126", optional = true, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +scale-info = { version = "1.0", default-features = false, features = ["derive"] } +sp-core = { version = "4.0.0-dev", default-features = false } +sp-std = { version = "4.0.0-dev", default-features = false } +sp-io = { version = "4.0.0-dev", default-features = false } +sp-runtime = { version = "4.0.0-dev", default-features = false } +sp-arithmetic = { version = "4.0.0-dev", default-features = false } +frame-support = { version = "4.0.0-dev", default-features = false } +frame-system = { version = "4.0.0-dev", default-features = false } +primitive-types = { git = "https://github.com/paritytech/parity-common.git", tag = "parity-util-mem-v0.10.1", default-features = false } +frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true } +hex-literal = "0.3.4" + + +[dev-dependencies] +rand = "0.8.5" +hex-literal = "0.3.4" +frame-executive = { version = "4.0.0-dev" } +pallet-transaction-payment = { version = "4.0.0-dev" } +da-control = { path = "../../dactr" } +nomad-base = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2" } +merkle = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2" } +updater-manager = { path = "../updater-manager" } + +[features] +default = ["std"] +std = [ + "codec/std", + "scale-info/std", + "frame-support/std", + "frame-system/std", + "frame-benchmarking/std", + "nomad-home/std", + "nomad-core/std", + "da-primitives/std", +] + +runtime-benchmarks = [ + "frame-benchmarking", + "sp-runtime/runtime-benchmarks", + "frame-support/runtime-benchmarks", +] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/nomad/da-bridge/README.md b/pallets/nomad/da-bridge/README.md new file mode 100644 index 000000000..8d751a422 --- /dev/null +++ b/pallets/nomad/da-bridge/README.md @@ -0,0 +1 @@ +License: Unlicense \ No newline at end of file diff --git a/pallets/nomad/da-bridge/src/benchmarking.rs b/pallets/nomad/da-bridge/src/benchmarking.rs new file mode 100644 index 000000000..cf4e44fac --- /dev/null +++ b/pallets/nomad/da-bridge/src/benchmarking.rs @@ -0,0 +1,58 @@ +use da_primitives::traits::ExtendedHeader; +use frame_benchmarking::{benchmarks, whitelisted_caller}; +use frame_system::{BlockHash, RawOrigin}; +use hex_literal::hex; +use nomad_home::Nonces; +use sp_core::H256; +use sp_runtime::traits::Header as _; + +use crate::*; + +benchmarks! { + where_clause { + where + [u8; 32]: From<::AccountId>, + H256: From<::Hash>, + H256: Into<::Hash>, + u32: From<::BlockNumber>, + T::Header: ExtendedHeader, + ::Hash: From, + } + + try_dispatch_data_root { + // Create extrinsics root for block 10 + let extrinsics_root :H256 = hex!("03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314").into(); + + // Create block header for block 10 + let block_number :T::BlockNumber = 10u32.into(); + let state_root = H256::repeat_byte(2u8).into(); + let parent_hash = H256::repeat_byte(1u8).into(); + let extension = Default::default(); + let digest = Default::default(); + + let header = ::new( + block_number.clone(), + extrinsics_root.into(), + state_root, + parent_hash, + digest, + extension); + let header_hash :T::Hash = header.hash(); + + // Insert 10th block's hash into block number --> hash mapping so + // submitting 10th block's header is accepted by pallet + BlockHash::::insert(block_number, header_hash); + + // Get home's current merkle root pre-enqueue + let origin = RawOrigin::Signed(whitelisted_caller::()); + let destination_domain = 1000; + let recipient_address = H256::zero(); + + let pre_nonce = Nonces::::get(destination_domain); + + }: _(origin, destination_domain, recipient_address, header) + verify { + let post_nonce = Nonces::::get(destination_domain); + assert_eq!(pre_nonce +1, post_nonce); + } +} diff --git a/pallets/nomad/da-bridge/src/lib.rs b/pallets/nomad/da-bridge/src/lib.rs new file mode 100644 index 000000000..df41e85ee --- /dev/null +++ b/pallets/nomad/da-bridge/src/lib.rs @@ -0,0 +1,161 @@ +#![cfg_attr(not(feature = "std"), no_std)] + +/// Edit this file to define custom logic or remove it if it is not needed. +/// Learn more about FRAME and the core library of Substrate FRAME pallets: +/// +pub use pallet::*; + +mod message; +pub mod weights; + +#[cfg(test)] +mod mock; + +#[cfg(test)] +mod tests; + +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; + +#[frame_support::pallet] +pub mod pallet { + use da_primitives::traits::ExtendedHeader; + use frame_support::{pallet_prelude::*, sp_runtime::traits::Header}; + use frame_system::{ensure_signed, pallet_prelude::OriginFor}; + use nomad_core::TypedMessage; + use nomad_home::Pallet as Home; + use primitive_types::H256; + + use super::weights::WeightInfo; + use crate::message::{DABridgeMessages, DataRootMessage}; + + #[pallet::config] + pub trait Config: frame_system::Config + nomad_home::Config { + type Event: From> + IsType<::Event>; + + #[pallet::constant] + type DABridgePalletId: Get; + + /// Weights for this pallet. + type WeightInfo: WeightInfo; + } + + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(_); + + // Genesis config + #[pallet::genesis_config] + pub struct GenesisConfig {} + + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { Self {} } + } + + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) {} + } + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + DataRootDispatched { + destination_domain: u32, + recipient_address: H256, + block_number: T::BlockNumber, + data_root: H256, + }, + } + + #[pallet::error] + pub enum Error { + InitializationError, + HashOfBlockNotMatchBlockNumber, + DABridgeMessageExceedsMaxMessageSize, + } + + #[pallet::call] + impl Pallet + where + [u8; 32]: From, + H256: From, + u32: From, + { + /// Dispatch a data root message to the home if the header is valid. + #[pallet::weight(::WeightInfo::try_dispatch_data_root())] + pub fn try_dispatch_data_root( + origin: OriginFor, + #[pallet::compact] destination_domain: u32, + recipient_address: H256, + header: T::Header, + ) -> DispatchResult { + ensure_signed(origin)?; + Self::ensure_valid_header(&header)?; + Self::do_dispatch_data_root(destination_domain, recipient_address, header) + } + } + + impl Pallet + where + [u8; 32]: From, + H256: From, + u32: From, + { + /// Dispatch a data root message for a valid header. + fn do_dispatch_data_root( + destination_domain: u32, + recipient_address: H256, + header: T::Header, + ) -> DispatchResult { + let block_number = *header.number(); + let data_root = header.extension().data_root(); + + let message: DABridgeMessages = DataRootMessage { + block_number: block_number.into(), + data_root, + } + .into(); + + let body: BoundedVec = message + .encode() + .try_into() + .map_err(|_| Error::::DABridgeMessageExceedsMaxMessageSize)?; + + Home::::do_dispatch( + T::DABridgePalletId::get(), + destination_domain, + recipient_address, + body, + )?; + + Self::deposit_event(Event::::DataRootDispatched { + destination_domain, + recipient_address, + block_number, + data_root, + }); + + Ok(()) + } + + /// Ensure a given header's hash has been recorded in the block hash + /// mapping. + fn ensure_valid_header(header: &T::Header) -> Result<(), DispatchError> { + // Ensure header's block number is in the mapping + let number = header.number(); + let stored_hash = frame_system::Pallet::::block_hash(number); + + // Ensure header's hash matches that in the block number to hash + // mapping + let hash = header.hash(); + ensure!( + stored_hash == hash, + Error::::HashOfBlockNotMatchBlockNumber, + ); + + Ok(()) + } + } +} diff --git a/pallets/nomad/da-bridge/src/message.rs b/pallets/nomad/da-bridge/src/message.rs new file mode 100644 index 000000000..da2cd5593 --- /dev/null +++ b/pallets/nomad/da-bridge/src/message.rs @@ -0,0 +1,121 @@ +use core::convert::TryFrom; + +use nomad_core::{TypedMessage, TypedMessageVariant}; +use primitive_types::H256; +use sp_runtime::RuntimeDebug; +use sp_std::vec::Vec; + +/// DA Bridge message 1-byte type tags. Note that the invalid 0 variant +/// is to maintain parity with our existing Solidity contracts. +#[repr(u8)] +#[derive(Clone, Debug, PartialEq)] +pub enum DABridgeMessageTypes { + Invalid = 0, + DataRootMessage = 1, +} + +#[derive(PartialEq, RuntimeDebug)] +/// Errors during the creation from `extrinsics`. +pub enum TryFromError { + /// Unknown DABridgeMessage variant + Unknown, +} + +impl TryFrom for DABridgeMessageTypes { + type Error = TryFromError; + + fn try_from(num: u8) -> Result { + match num { + 0 => Ok(Self::Invalid), + 1 => Ok(Self::DataRootMessage), + _ => Err(TryFromError::Unknown), + } + } +} + +/// Data root message variant. Contains a block number and its corresponding +/// data root. +#[derive(Clone, Debug, PartialEq)] +pub struct DataRootMessage { + /// Block number + pub block_number: u32, + /// Data root + pub data_root: H256, +} + +impl TypedMessageVariant for DataRootMessage { + const MESSAGE_TYPE: u8 = DABridgeMessageTypes::DataRootMessage as u8; + + fn encode(&self) -> Vec { + let block_number_bytes = self.block_number.to_be_bytes(); + let data_root_bytes = self.data_root.as_bytes(); + + let mut buf: Vec = Vec::with_capacity(self.len()); + + buf.push(Self::MESSAGE_TYPE as u8); + buf.extend_from_slice(block_number_bytes.as_ref()); + buf.extend_from_slice(data_root_bytes); + + buf + } +} + +/// Enum of DABridge message types +pub enum DABridgeMessages { + DataRootMessage(DataRootMessage), +} + +impl From for DABridgeMessages { + fn from(data_root_msg: DataRootMessage) -> Self { Self::DataRootMessage(data_root_msg) } +} + +impl TypedMessage for DABridgeMessages { + type MessageEnum = DABridgeMessageTypes; + + fn encode(&self) -> Vec { + match self { + Self::DataRootMessage(msg) => msg.encode(), + } + } +} + +#[cfg(test)] +mod test { + use core::convert::TryInto; + + use frame_support::{parameter_types, BoundedVec}; + use nomad_core::{NomadMessage, NON_BODY_LENGTH}; + + use super::*; + + const DATA_ROOT_MSG_LEN: usize = 1 + 4 + 32; + + parameter_types! { + const MaxMessageBodyBytes: u32 = 1024; + } + + #[test] + fn it_creates_data_root_msg() { + let message = DataRootMessage { + block_number: 5, + data_root: H256::repeat_byte(1), + }; + + assert_eq!(message.len(), DATA_ROOT_MSG_LEN); + + let body: DABridgeMessages = message.into(); + let bounded: BoundedVec = body.encode().try_into().unwrap(); + + let nomad_msg = NomadMessage { + origin: 0, + sender: Default::default(), + nonce: 0, + destination: 0, + recipient: Default::default(), + body: bounded, + }; + + let nomad_msg_vec = nomad_msg.to_vec(); + assert_eq!(nomad_msg_vec.len(), NON_BODY_LENGTH + DATA_ROOT_MSG_LEN); + } +} diff --git a/pallets/nomad/da-bridge/src/mock.rs b/pallets/nomad/da-bridge/src/mock.rs new file mode 100644 index 000000000..3cd511b1e --- /dev/null +++ b/pallets/nomad/da-bridge/src/mock.rs @@ -0,0 +1,164 @@ +use da_primitives::Header; +use frame_support::traits::GenesisBuild; +use frame_system::{self as system}; +use nomad_base::NomadBase; +use primitive_types::{H160, H256}; +use sp_runtime::{ + traits::{BlakeTwo256, IdentityLookup}, + AccountId32, +}; + +use crate::{self as da_bridge}; + +// type TestXt = sp_runtime::testing::TestXt; +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +pub type Block = frame_system::mocking::MockBlock; +pub type BlockNumber = u32; + +// TODO: add proper config once frame executive mocking has been demonstrated +// Configure a mock runtime to test the pallet. +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + UpdaterManager: updater_manager::{Pallet, Call, Storage, Event}, + Home: nomad_home::{Pallet, Call, Storage, Event}, + DABridge: da_bridge::{Pallet, Call, Storage, Event}, + } +); + +frame_support::parameter_types! { + pub const BlockHashCount: u32 = 250; + pub BlockWeights: frame_system::limits::BlockWeights = + frame_system::limits::BlockWeights::simple_max(1024); + pub static ExistentialDeposit: u64 = 0; +} + +impl system::Config for Test { + type AccountData = (); + type AccountId = AccountId32; + type BaseCallFilter = frame_support::traits::Everything; + type BlockHashCount = BlockHashCount; + type BlockLength = (); + type BlockNumber = BlockNumber; + type BlockWeights = (); + type Call = Call; + type DbWeight = (); + type Event = Event; + type Hash = H256; + type Hashing = BlakeTwo256; + type Header = Header; + type HeaderExtensionBuilder = frame_system::header_builder::da::HeaderExtensionBuilder; + type Index = u64; + type Lookup = IdentityLookup; + type OnKilledAccount = (); + type OnNewAccount = (); + type OnSetCode = (); + type Origin = Origin; + type PalletInfo = PalletInfo; + type Randomness = frame_system::tests::TestRandomness; + type SS58Prefix = (); + type SubmittedDataExtractor = (); + type SystemWeightInfo = (); + type Version = (); +} + +impl updater_manager::Config for Test { + type Event = Event; +} + +frame_support::parameter_types! { + pub const MaxMessageBodyBytes: u32 = 2048; +} + +impl nomad_home::Config for Test { + type Event = Event; + type MaxMessageBodyBytes = MaxMessageBodyBytes; + type WeightInfo = (); +} + +frame_support::parameter_types! { + pub const DABridgePalletId: H256 = H256::zero(); +} + +impl da_bridge::Config for Test { + type DABridgePalletId = DABridgePalletId; + type Event = Event; + type WeightInfo = (); +} + +pub(crate) struct ExtBuilder { + updater: H160, + local_domain: u32, + committed_root: H256, +} + +impl Default for ExtBuilder { + fn default() -> ExtBuilder { + ExtBuilder { + updater: Default::default(), + local_domain: Default::default(), + committed_root: Default::default(), + } + } +} + +impl ExtBuilder { + pub(crate) fn with_base(mut self, base: NomadBase) -> Self { + self.updater = base.updater; + self.local_domain = base.local_domain; + self.committed_root = base.committed_root; + self + } + + pub(crate) fn build(self) -> sp_io::TestExternalities { + let mut t = frame_system::GenesisConfig::default() + .build_storage::() + .expect("Frame system builds valid default genesis config"); + + nomad_home::GenesisConfig:: { + updater: self.updater, + local_domain: self.local_domain, + committed_root: self.committed_root, + _phantom: Default::default(), + } + .assimilate_storage(&mut t) + .expect("Pallet base storage can be assimilated"); + updater_manager::GenesisConfig:: { + updater: self.updater, + _phantom: Default::default(), + } + .assimilate_storage(&mut t) + .expect("Updater manager storage cannot be assimilated"); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext + } +} + +pub(crate) fn _events() -> Vec> { + System::events() + .into_iter() + .map(|r| r.event) + .filter_map(|e| { + if let Event::DABridge(inner) = e { + Some(inner) + } else { + None + } + }) + .collect::>() +} + +pub(crate) fn fill_block_hash_mapping_up_to_n(n: u8) { + for i in 0..=n { + frame_system::BlockHash::::insert::::Hash>( + (n as u32).into(), + H256::repeat_byte(i).into(), + ); + } +} diff --git a/pallets/nomad/da-bridge/src/tests.rs b/pallets/nomad/da-bridge/src/tests.rs new file mode 100644 index 000000000..305a0fec0 --- /dev/null +++ b/pallets/nomad/da-bridge/src/tests.rs @@ -0,0 +1,67 @@ +use da_primitives::{Header, HeaderExtension}; +use frame_support::assert_ok; +use frame_system::Config; +use hex_literal::hex; +use merkle::Merkle; +use nomad_base::testing::*; +use primitive_types::H256; +use sp_runtime::{testing::Digest, traits::BlakeTwo256, AccountId32}; + +use crate::mock::*; + +const TEST_SENDER_VEC: [u8; 32] = [2u8; 32]; +const TEST_SENDER_ACCOUNT: AccountId32 = AccountId32::new(TEST_SENDER_VEC); +const DESTINATION_DOMAIN: u32 = 1000; + +#[test] +fn it_accepts_valid_extrinsic_root() { + ExtBuilder::default() + .with_base(*TEST_NOMAD_BASE) + .build() + .execute_with(|| { + fill_block_hash_mapping_up_to_n(9); + + // Create extrinsics root for block 10 + let extension = HeaderExtension::default(); + + // Create block header for block 10 + let header = Header::<::BlockNumber, BlakeTwo256> { + parent_hash: [1u8; 32].into(), + number: 10 as u32, + state_root: [2u8; 32].into(), + extrinsics_root: hex!( + "03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314" + ) + .into(), + digest: Digest { logs: vec![] }, + extension, + }; + + // Insert 10th block's hash into block number --> hash mapping so + // submitting 10th block's header is accepted by pallet + frame_system::BlockHash::::insert::::Hash>( + 10u32.into(), + header.hash(), + ); + + // Get home's current merkle root pre-enqueue + let root_pre = Home::tree().root(); + let nonce_pre = Home::nonces(DESTINATION_DOMAIN); + + // Enqueue extrinsic root + assert_ok!(DABridge::try_dispatch_data_root( + Origin::signed(TEST_SENDER_ACCOUNT), + DESTINATION_DOMAIN, + H256::zero(), + header + )); + + // Get home's merkle root post-enqueue + let root_post = Home::tree().root(); + let nonce_post = Home::nonces(DESTINATION_DOMAIN); + + // Ensure home's merkle root changed after enqueueing message + assert_ne!(root_pre, root_post); + assert_eq!(nonce_pre + 1, nonce_post); + }) +} diff --git a/pallets/nomad/da-bridge/src/weights.rs b/pallets/nomad/da-bridge/src/weights.rs new file mode 100644 index 000000000..164d477e9 --- /dev/null +++ b/pallets/nomad/da-bridge/src/weights.rs @@ -0,0 +1,79 @@ +// This file is part of Data Availability. + +// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for da_bridge +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-10-03, STEPS: `20`, REPEAT: 30, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 + +// Executed Command: +// ./target/release/data-avail +// benchmark +// --chain=dev +// --steps=20 +// --repeat=30 +// --log=warn +// --execution=wasm +// --wasm-execution=compiled +// --template=./.maintain/frame-weight-template.hbs +// --pallet=da-bridge +// --extrinsic=* +// --output=./pallets/nomad/da-bridge/src/weights.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for da_bridge. +pub trait WeightInfo { + fn try_dispatch_data_root() -> Weight; +} + +/// Weights for da_bridge using the Data Avaiability node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + // Storage: System BlockHash (r:1 w:0) + // Storage: NomadHome Base (r:1 w:0) + // Storage: NomadHome Nonces (r:1 w:1) + // Storage: NomadHome Tree (r:1 w:1) + // Storage: NomadHome IndexToRoot (r:0 w:1) + // Storage: NomadHome RootToIndex (r:0 w:1) + fn try_dispatch_data_root() -> Weight { + (93_524_000 as Weight) + .saturating_add(T::DbWeight::get().reads(4 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + // Storage: System BlockHash (r:1 w:0) + // Storage: NomadHome Base (r:1 w:0) + // Storage: NomadHome Nonces (r:1 w:1) + // Storage: NomadHome Tree (r:1 w:1) + // Storage: NomadHome IndexToRoot (r:0 w:1) + // Storage: NomadHome RootToIndex (r:0 w:1) + fn try_dispatch_data_root() -> Weight { + (93_524_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(4 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } +} diff --git a/pallets/nomad/home/Cargo.toml b/pallets/nomad/home/Cargo.toml new file mode 100644 index 000000000..e5056579b --- /dev/null +++ b/pallets/nomad/home/Cargo.toml @@ -0,0 +1,63 @@ +[package] +name = "nomad-home" +version = "4.0.0-dev" +description = "FRAME pallet template for defining custom runtime logic." +authors = ["Substrate DevHub "] +homepage = "https://substrate.io/" +edition = "2021" +license = "Unlicense" +publish = false +repository = "https://github.com/substrate-developer-hub/substrate-node-template/" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +# Our crates +signature = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } +merkle = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } +nomad-base = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } +nomad-core = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } +updater-manager = { path = "../updater-manager", default-features = false } + +# 3rd-party +serde = { version = "1.0.126", optional = true, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +scale-info = { version = "1.0", default-features = false, features = ["derive"] } +sp-core = { version = "4.0.0-dev", default-features = false } +sp-std = { version = "4.0.0-dev", default-features = false } +sp-io = { version = "4.0.0-dev", default-features = false } +sp-runtime = { version = "4.0.0-dev", default-features = false } +sp-arithmetic = { version = "4.0.0-dev", default-features = false } +frame-support = { version = "4.0.0-dev", default-features = false } +frame-system = { version = "4.0.0-dev", default-features = false } +frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true } +primitive-types = { git = "https://github.com/paritytech/parity-common.git", tag = "parity-util-mem-v0.10.1", default-features = false } +thiserror-no-std = "2.0.2" +hex-literal = "0.3.4" + + +[dev-dependencies] +ethers-signers = "0.13.0" +da-primitives = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2" } +test-case = "1.2.3" +frame-benchmarking = "4.0.0-dev" + +[features] +default = ["std"] +std = [ + "codec/std", + "scale-info/std", + "frame-support/std", + "frame-system/std", + "nomad-core/std", + "nomad-base/std", + "updater-manager/std" +] + +runtime-benchmarks = [ + "frame-benchmarking", + "sp-runtime/runtime-benchmarks", + "frame-support/runtime-benchmarks", +] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/nomad/home/README.md b/pallets/nomad/home/README.md new file mode 100644 index 000000000..8d751a422 --- /dev/null +++ b/pallets/nomad/home/README.md @@ -0,0 +1 @@ +License: Unlicense \ No newline at end of file diff --git a/pallets/nomad/home/src/benchmarking.rs b/pallets/nomad/home/src/benchmarking.rs new file mode 100644 index 000000000..8d72dc997 --- /dev/null +++ b/pallets/nomad/home/src/benchmarking.rs @@ -0,0 +1,158 @@ +#[cfg(feature = "runtime-benchmarks")] +use frame_benchmarking::{benchmarks, whitelisted_caller}; +#[cfg(feature = "runtime-benchmarks")] +use frame_support::{assert_ok, traits::Get as _, BoundedVec}; +#[cfg(feature = "runtime-benchmarks")] +use frame_system::RawOrigin; +use hex_literal::hex; +#[cfg(feature = "runtime-benchmarks")] +use merkle::Merkle; +#[cfg(feature = "runtime-benchmarks")] +use nomad_core::NomadState; +use nomad_core::{SignedUpdate, Update}; +use signature::Signature; +use sp_core::{H160, H256, U256}; +#[cfg(feature = "runtime-benchmarks")] +use sp_std::{iter::repeat, vec::Vec}; + +#[cfg(feature = "runtime-benchmarks")] +use crate::*; + +const ID: u32 = 1111; +const UPDATER_ADDRESS: H160 = H160(hex!("19e7e376e7c213b7e7e7e46cc70a5dd086daff2a")); + +// Design of benchmark cases: +// - `improper_update`. The worst case is when updater is slashed and the state change to +// `NomdState::Failed`. +// - `dispatch` cost is affected by the lenght of the message. +// - `update`. The worst case is when `Tree` is full, having `TREE_DEPTH` as max index. + +#[cfg(feature = "runtime-benchmarks")] +benchmarks! { + where_clause { where [u8; 32]: From<::AccountId> } + + improper_update { + let _ = init_tree::(0, 0); + + let origin = RawOrigin::Signed(whitelisted_caller::()); + let signed_update = expected_signed_update(); + }: _(origin, signed_update) + verify { + assert_eq!(Base::::get().state, NomadState::Failed); + } + + dispatch { + let b in 1.. T::MaxMessageBodyBytes::get(); + + let _ = init_tree::(0, 0); + + let origin = RawOrigin::Signed(whitelisted_caller::()); + let recipient_address = H256::zero(); + let body = random_message::(b); + + let prev_nonce = Nonces::::get(ID); + }: _(origin, ID, recipient_address, body) + verify { + let new_nonce = Nonces::::get(ID); + assert_eq!( prev_nonce +1, new_nonce); + } + + update { + use merkle::TREE_DEPTH; + use crate::common_tests_and_benches::expected_longest_tree_signed_update; + + let max_index = TREE_DEPTH as u32; + let origin = RawOrigin::Signed(whitelisted_caller::()); + let new_root = init_tree::(max_index, T::MaxMessageBodyBytes::get()); + let signed_update = expected_longest_tree_signed_update(); + assert_eq!(new_root, signed_update.update.new_root); + + }: _(origin, signed_update, max_index) + verify { + assert_eq!( Tree::::get().root(), new_root); + assert_eq!( Base::::get().committed_root, new_root); + } +} + +#[cfg(test)] +mod tests { + use nomad_core::test_utils::Updater; + use sp_core::H256; + + use super::*; + + const TEST_UPDATER_PRIVKEY: &str = + "1111111111111111111111111111111111111111111111111111111111111111"; + + /// Test case used to generate the constant `SIGNED_UPDATE`. + #[test] + fn generate_sign_update() { + let updater = Updater::new(ID, TEST_UPDATER_PRIVKEY.parse().unwrap()); + assert_eq!(updater.address(), UPDATER_ADDRESS); + + let previous_root = H256::repeat_byte(0); + let new_root = H256::repeat_byte(1); + let signed_update = updater.sign_update(previous_root.clone(), new_root.clone()); + + assert_eq!(signed_update, expected_signed_update()); + } +} + +fn expected_signed_update() -> SignedUpdate { + SignedUpdate { + update: Update { + home_domain: ID, + previous_root: H256([0u8; 32]), + new_root: H256([1u8; 32]), + }, + signature: Signature { + r: U256::from_dec_str( + "108172166467498881923382587939104653020584515778413535909202974529351125581995", + ) + .unwrap(), + s: U256::from_dec_str( + "24567415212865781861322727855523398821160274507883582359476963266144744361252", + ) + .unwrap(), + v: 27, + }, + } +} + +#[cfg(feature = "runtime-benchmarks")] +fn random_message(size: u32) -> BoundedVec { + repeat(3u8) + .take(size as usize) + .collect::>() + .try_into() + .expect("`size` must be less than `T::MaxMessageBodyBytes`") +} + +#[cfg(feature = "runtime-benchmarks")] +fn init_tree(index: u32, message_size: u32) -> H256 +where + T: Config, + [u8; 32]: From<::AccountId>, +{ + let message = random_message::(message_size); + let recipient_address = H256::repeat_byte(3); + let origin = RawOrigin::Signed(whitelisted_caller::()); + + // Initial base: + Base::::put(nomad_base::NomadBase::new( + ID, + H256([0u8; 32]), + UPDATER_ADDRESS, + )); + + for _ in 0..index { + assert_ok!(Pallet::::dispatch( + origin.clone().into(), + ID, + recipient_address, + message.clone() + )); + } + + Tree::::get().root() +} diff --git a/pallets/nomad/home/src/lib.rs b/pallets/nomad/home/src/lib.rs new file mode 100644 index 000000000..aee4aff24 --- /dev/null +++ b/pallets/nomad/home/src/lib.rs @@ -0,0 +1,403 @@ +#![cfg_attr(not(feature = "std"), no_std)] + +/// Edit this file to define custom logic or remove it if it is not needed. +/// Learn more about FRAME and the core library of Substrate FRAME pallets: +/// +pub use pallet::*; + +#[cfg(test)] +mod mock; + +#[cfg(test)] +mod tests; + +#[cfg(any(test, feature = "runtime-benchmarks"))] +mod benchmarking; + +pub mod weights; + +#[frame_support::pallet] +pub mod pallet { + use frame_support::{ + pallet_prelude::{ValueQuery, *}, + sp_runtime::ArithmeticError::Overflow, + transactional, + }; + use frame_system::pallet_prelude::{OriginFor, *}; + use merkle::{Merkle, NomadLightMerkle}; + use nomad_base::NomadBase; + use nomad_core::{destination_and_nonce, NomadMessage, NomadState, SignedUpdate}; + use primitive_types::{H160, H256}; + use sp_std::vec::Vec; + + use super::weights::WeightInfo; + + #[pallet::config] + pub trait Config: frame_system::Config + updater_manager::Config { + type Event: From> + IsType<::Event>; + + /// Max allowed message body size + #[pallet::constant] + type MaxMessageBodyBytes: Get; + + /// Weights for this pallet. + type WeightInfo: WeightInfo; + } + + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(_); + + // Nomad base + #[pallet::storage] + #[pallet::getter(fn base)] + pub type Base = StorageValue<_, NomadBase, ValueQuery>; + + // Merkle tree + #[pallet::storage] + #[pallet::getter(fn tree)] + pub type Tree = StorageValue<_, NomadLightMerkle, ValueQuery>; + + // Nonces + #[pallet::storage] + #[pallet::getter(fn nonces)] + pub type Nonces = StorageMap<_, Twox64Concat, u32, u32, ValueQuery>; + + // Leaf index to root + #[pallet::storage] + #[pallet::getter(fn index_to_root)] + pub type IndexToRoot = StorageMap<_, Twox64Concat, u32, H256>; + + // Root to leaf index + #[pallet::storage] + #[pallet::getter(fn root_to_index)] + pub type RootToIndex = StorageMap<_, Twox64Concat, H256, u32>; + + // Genesis config + #[pallet::genesis_config] + pub struct GenesisConfig { + pub local_domain: u32, + pub committed_root: H256, + pub updater: H160, + pub _phantom: PhantomData, + } + + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + Self { + local_domain: Default::default(), + committed_root: Default::default(), + updater: Default::default(), + _phantom: Default::default(), + } + } + } + + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { + >::put(NomadBase::new( + self.local_domain, + self.committed_root, + self.updater, + )); + >::put(NomadLightMerkle::default()); + } + } + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + Dispatch { + message_hash: H256, + leaf_index: u32, + destination_and_nonce: u64, + committed_root: H256, + message: Vec, + }, + Update { + home_domain: u32, + previous_root: H256, + new_root: H256, + signature: Vec, + }, + ImproperUpdate { + previous_root: H256, + new_root: H256, + signature: Vec, + }, + UpdaterSlashed { + updater: H160, + reporter: T::AccountId, + }, + } + + #[pallet::error] + pub enum Error { + InitializationError, + IngestionError, + SignatureRecoveryError, + MessageTooLarge, + InvalidUpdaterSignature, + CommittedRootNotMatchUpdatePrevious, + RootForIndexNotFound, + IndexForRootNotFound, + FailedState, + MaxIndexWitnessExhausted, + } + + #[pallet::call] + impl Pallet + where + [u8; 32]: From, + { + /// Dispatch a message to the destination domain and recipient address. + #[pallet::weight(T::WeightInfo::dispatch(message_body.len() as u32))] + pub fn dispatch( + origin: OriginFor, + #[pallet::compact] destination_domain: u32, + recipient_address: H256, + message_body: BoundedVec, + ) -> DispatchResult { + let sender: [u8; 32] = ensure_signed(origin)?.into(); + Self::do_dispatch( + sender.into(), + destination_domain, + recipient_address, + message_body, + ) + } + + /// Verify/submit signed update. + #[pallet::weight(T::WeightInfo::update())] + pub fn update( + origin: OriginFor, + signed_update: SignedUpdate, + #[pallet::compact] max_index: u32, + ) -> DispatchResult { + let sender = ensure_signed(origin)?; + Self::do_update(sender, signed_update, max_index) + } + + /// Verify/slash updater for improper update. + #[pallet::weight(T::WeightInfo::improper_update())] + pub fn improper_update( + origin: OriginFor, + signed_update: SignedUpdate, + ) -> DispatchResult { + let sender = ensure_signed(origin)?; + Self::do_improper_update(sender, &signed_update)?; + Ok(()) + } + } + + impl Pallet + where + [u8; 32]: From, + { + fn ensure_not_failed() -> Result<(), Error> { + ensure!( + Self::base().state != NomadState::Failed, + Error::::FailedState + ); + Ok(()) + } + + /// Format message, insert hash into merkle tree, and update mappings + /// between tree roots and message indices. + pub fn do_dispatch( + sender: H256, + destination_domain: u32, + recipient_address: H256, + message_body: BoundedVec, + ) -> DispatchResult { + Self::ensure_not_failed()?; + let base = Self::base(); + let index_of = |tree: &NomadLightMerkle| tree.count() - 1; + + // Get nonce and set new nonce + Nonces::::try_mutate(destination_domain, |nonce| -> Result<(), DispatchError> { + let new_nonce = nonce.checked_add(1).ok_or(DispatchError::from(Overflow))?; + + // Format message and get message hash + let message = NomadMessage { + origin: base.local_domain, + sender, + nonce: *nonce, + destination: destination_domain, + recipient: recipient_address, + body: message_body, + }; + let message_hash = message.hash(); + + // Insert message hash into tree + let tree = + Tree::::try_mutate(|tree| -> Result { + tree.ingest(message_hash) + .map_err(|_| DispatchError::from(>::IngestionError))?; + + // Record new tree root for message + let root = tree.root(); + let index = index_of(tree); + RootToIndex::::insert(root, index); + IndexToRoot::::insert(index, root); + + Ok(*tree) + })?; + + Self::deposit_event(Event::::Dispatch { + message_hash, + leaf_index: index_of(&tree), + destination_and_nonce: destination_and_nonce(destination_domain, *nonce), + committed_root: base.committed_root, + message: message.to_vec(), + }); + + *nonce = new_nonce; + Ok(()) + })?; + + Ok(()) + } + + /// Check for improper update, remove all previous root/index mappings, + /// and emit Update event if valid. + #[transactional] + fn do_update( + sender: T::AccountId, + signed_update: SignedUpdate, + mut max_index_witness: u32, + ) -> DispatchResult { + if Self::do_improper_update(sender, &signed_update)? { + return Ok(()); + } + + let mut root = signed_update.new_root(); + let previous_root = signed_update.previous_root(); + + // Clear previous mappings starting from new_root, going back and + // through previous_root. A new update's previous_root has always + // been cleared in the previous update, as the last update's + // new_root is always the next update's previous_root. + while root != previous_root { + // Ensure witness + ensure!(max_index_witness > 0, Error::::MaxIndexWitnessExhausted); + max_index_witness -= 1; + + // Remove `RootToIndex` & `IndexToRoot` items. + let index = RootToIndex::::take(root).ok_or(Error::::IndexForRootNotFound)?; + IndexToRoot::::remove(index); + + // Force an exit if `index ==0 ` or `index -1` is not found. + root = (index != 0) + .then(|| IndexToRoot::::get(index - 1)) + .flatten() + .unwrap_or_else(|| previous_root.clone()); + } + + Base::::mutate(|base| { + base.set_committed_root(signed_update.new_root()); + + Self::deposit_event(Event::::Update { + home_domain: base.local_domain, + previous_root: signed_update.previous_root(), + new_root: signed_update.new_root(), + signature: signed_update.signature.to_vec(), + }); + }); + + Ok(()) + } + + /// Ensure signed merkle root once existed by checking mapping of roots + /// to indices. + fn do_improper_update( + sender: T::AccountId, + signed_update: &SignedUpdate, + ) -> Result { + Self::ensure_not_failed()?; + + let base = Self::base(); + + // Ensure previous root matches current committed root + ensure!( + base.committed_root == signed_update.previous_root(), + Error::::CommittedRootNotMatchUpdatePrevious, + ); + + // Ensure updater signature is valid + ensure!( + base.is_updater_signature(&signed_update) + .map_err(|_| Error::::SignatureRecoveryError)?, + Error::::InvalidUpdaterSignature, + ); + + // If new root not in history (invalid), slash updater and fail home + let root_not_found = RootToIndex::::get(signed_update.new_root()).is_none(); + if root_not_found { + Self::fail(sender); + Self::deposit_event(Event::::ImproperUpdate { + previous_root: signed_update.previous_root(), + new_root: signed_update.new_root(), + signature: signed_update.signature.to_vec(), + }); + } + + Ok(root_not_found) + } + + /// Set self in failed state and slash updater. + fn fail(reporter: T::AccountId) { + Base::::mutate(|base| base.state = NomadState::Failed); + updater_manager::Pallet::::slash_updater(reporter.clone()); + + let updater = Self::base().updater; + Self::deposit_event(Event::::UpdaterSlashed { updater, reporter }); + } + + /// Set new updater on self as well as updater manager. + /// Note: Not exposed as pallet call, will only be callable by the + /// GovernanceRouter pallet when implemented. + pub fn set_updater(new_updater: H160) -> DispatchResult { + // Modify NomadBase updater + Base::::mutate(|base| base.updater = new_updater); + + // Rotate updater on updater manager + updater_manager::Pallet::::set_updater(new_updater) + } + } +} + +#[cfg(any(test, feature = "runtime-benchmarks"))] +pub mod common_tests_and_benches { + use hex_literal::hex; + use nomad_core::{SignedUpdate, Update}; + use signature::Signature; + use sp_core::{H256, U256}; + + const EXPECTED_NEW_ROOT_LONGEST_TREE: H256 = H256(hex!( + "dd0a05d7b71c171d06b51f11d1191f2ce23dbe679ecabea374ee3a7909383fb6" + )); + + pub fn expected_longest_tree_signed_update() -> SignedUpdate { + SignedUpdate { + update: Update { + home_domain: 1111, + previous_root: H256::zero(), + new_root: EXPECTED_NEW_ROOT_LONGEST_TREE, + }, + signature: Signature { + r: U256::from_dec_str( + "14322696571982726287696567121385710541178197176749280748421005645809674945701", + ) + .unwrap(), + s: U256::from_dec_str( + "30270442654181520335096087658805894014217975025586657453237735885054021806875", + ) + .unwrap(), + v: 27, + }, + } + } +} diff --git a/pallets/nomad/home/src/mock.rs b/pallets/nomad/home/src/mock.rs new file mode 100644 index 000000000..7ffdf9d2a --- /dev/null +++ b/pallets/nomad/home/src/mock.rs @@ -0,0 +1,141 @@ +use da_primitives::Header; +use frame_support::{parameter_types, traits::GenesisBuild}; +use frame_system::{self as system}; +use nomad_base::NomadBase; +use primitive_types::{H160, H256}; +use sp_runtime::{ + traits::{BlakeTwo256, IdentityLookup}, + AccountId32, +}; + +use crate as home; + +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +// Configure a mock runtime to test the pallet. +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + Home: home::{Pallet, Call, Storage, Event}, + UpdaterManager: updater_manager::{Pallet, Call, Storage, Event}, + } +); + +parameter_types! { + pub const BlockHashCount: u32 = 250; + pub BlockWeights: frame_system::limits::BlockWeights = + frame_system::limits::BlockWeights::simple_max(1024); + pub static ExistentialDeposit: u64 = 0; +} + +impl system::Config for Test { + type AccountData = (); + type AccountId = AccountId32; + type BaseCallFilter = frame_support::traits::Everything; + type BlockHashCount = BlockHashCount; + type BlockLength = (); + type BlockNumber = u32; + type BlockWeights = (); + type Call = Call; + type DbWeight = (); + type Event = Event; + type Hash = H256; + type Hashing = BlakeTwo256; + type Header = Header; + type HeaderExtensionBuilder = frame_system::header_builder::da::HeaderExtensionBuilder; + type Index = u64; + type Lookup = IdentityLookup; + type OnKilledAccount = (); + type OnNewAccount = (); + type OnSetCode = (); + type Origin = Origin; + type PalletInfo = PalletInfo; + type Randomness = frame_system::tests::TestRandomness; + type SS58Prefix = (); + type SubmittedDataExtractor = (); + type SystemWeightInfo = (); + type Version = (); +} + +parameter_types! { + pub const MaxMessageBodyBytes: u32 = 2048; +} + +impl home::Config for Test { + type Event = Event; + type MaxMessageBodyBytes = MaxMessageBodyBytes; + type WeightInfo = (); +} + +impl updater_manager::Config for Test { + type Event = Event; +} + +pub(crate) struct ExtBuilder { + updater: H160, + local_domain: u32, + committed_root: H256, +} + +impl Default for ExtBuilder { + fn default() -> ExtBuilder { + ExtBuilder { + updater: Default::default(), + local_domain: Default::default(), + committed_root: Default::default(), + } + } +} + +impl ExtBuilder { + pub(crate) fn with_base(mut self, base: NomadBase) -> Self { + self.updater = base.updater; + self.local_domain = base.local_domain; + self.committed_root = base.committed_root; + self + } + + pub(crate) fn build(self) -> sp_io::TestExternalities { + let mut t = frame_system::GenesisConfig::default() + .build_storage::() + .expect("Frame system builds valid default genesis config"); + + home::GenesisConfig:: { + updater: self.updater, + local_domain: self.local_domain, + committed_root: self.committed_root, + _phantom: Default::default(), + } + .assimilate_storage(&mut t) + .expect("Nomad base storage cannot be assimilated"); + updater_manager::GenesisConfig:: { + updater: self.updater, + _phantom: Default::default(), + } + .assimilate_storage(&mut t) + .expect("Updater manager storage cannot be assimilated"); + + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext + } +} + +pub(crate) fn events() -> Vec> { + System::events() + .into_iter() + .map(|r| r.event) + .filter_map(|e| { + if let Event::Home(inner) = e { + Some(inner) + } else { + None + } + }) + .collect::>() +} diff --git a/pallets/nomad/home/src/tests.rs b/pallets/nomad/home/src/tests.rs new file mode 100644 index 000000000..700fbd6e8 --- /dev/null +++ b/pallets/nomad/home/src/tests.rs @@ -0,0 +1,286 @@ +use std::convert::TryInto; + +use frame_benchmarking::whitelisted_caller; +use frame_support::{assert_err, assert_ok, BoundedVec}; +use merkle::Merkle; +use nomad_base::testing::*; +use nomad_core::{destination_and_nonce, NomadMessage, NomadState}; +use primitive_types::H256; +use sp_runtime::{AccountId32, DispatchResult}; +use test_case::test_case; + +use crate::{ + common_tests_and_benches::expected_longest_tree_signed_update, mock::*, Config, Error, +}; + +const TEST_REMOTE_DOMAIN: u32 = 2222; +const TEST_SENDER_VEC: [u8; 32] = [2u8; 32]; +const TEST_SENDER_BYTES: H256 = H256(TEST_SENDER_VEC); +const TEST_SENDER_ACCOUNT: AccountId32 = AccountId32::new(TEST_SENDER_VEC); +const TEST_RECIPIENT: H256 = H256::repeat_byte(3); + +// TODO: test governance router can set updater for base and UM + +#[test] +fn it_dispatches_message() { + ExtBuilder::default() + .with_base(*TEST_NOMAD_BASE) + .build() + .execute_with(|| { + // Fetch expected values + let nonce = Home::nonces(TEST_REMOTE_DOMAIN); + let destination_and_nonce = destination_and_nonce(TEST_REMOTE_DOMAIN, nonce); + let leaf_index = Home::tree().count(); + let body: BoundedVec = [1u8; 8].to_vec().try_into().unwrap(); + let committed_root = Home::base().committed_root; + + // Format expected message + let message = NomadMessage { + origin: TEST_LOCAL_DOMAIN, + sender: TEST_SENDER_BYTES, + nonce, + destination: TEST_REMOTE_DOMAIN, + recipient: TEST_RECIPIENT, + body: body.clone(), + }; + let message_hash = message.hash(); + + // Dispatch message + let origin = Origin::signed(TEST_SENDER_ACCOUNT); + assert_ok!(Home::dispatch( + origin, + TEST_REMOTE_DOMAIN, + TEST_RECIPIENT, + body + )); + + // Tree count incremented + assert!(Home::tree().count() == 1); + + // Mappings have root and index + let current_root = Home::tree().root(); + assert!(Home::index_to_root(leaf_index).unwrap() == current_root); + assert!(Home::root_to_index(current_root).unwrap() == leaf_index); + + let expected = vec![crate::Event::Dispatch { + message_hash, + leaf_index, + destination_and_nonce, + committed_root, + message: message.to_vec(), + }]; + assert_eq!(events(), expected); + }) +} + +#[test] +fn it_rejects_big_message() { + use core::convert::TryFrom; + + ExtBuilder::default() + .with_base(*TEST_NOMAD_BASE) + .build() + .execute_with(|| { + let bounded_res = BoundedVec::::MaxMessageBodyBytes>::try_from( + [1u8; 5001].to_vec(), + ); + assert!(bounded_res.is_err()); + }) +} + +#[test] +fn it_catches_improper_update() { + ExtBuilder::default() + .with_base(*TEST_NOMAD_BASE) + .build() + .execute_with(|| { + let committed_root = Home::base().committed_root; + + // Sign improper update + let fake_root = H256::repeat_byte(9); + let improper_signed = TEST_UPDATER.sign_update(committed_root, fake_root); + + let origin = Origin::signed(TEST_SENDER_ACCOUNT); + assert_ok!(Home::improper_update(origin, improper_signed.clone())); + assert!(Home::base().state == NomadState::Failed); + + let expected = vec![ + crate::Event::UpdaterSlashed { + updater: TEST_UPDATER.address(), + reporter: TEST_SENDER_ACCOUNT, + }, + crate::Event::ImproperUpdate { + previous_root: committed_root, + new_root: fake_root, + signature: improper_signed.signature.to_vec(), + }, + ]; + assert_eq!(events(), expected); + }) +} + +/// Dispatch a random message and returns the new `root`. +fn dispatch_random_message(origin: Origin) -> H256 { + let body = [1u8; 8].to_vec().try_into().unwrap(); + assert_ok!(Home::dispatch( + origin, + TEST_REMOTE_DOMAIN, + TEST_RECIPIENT, + body + )); + + Home::tree().root() +} + +#[test_case( 1, 0 => Err(Error::::MaxIndexWitnessExhausted.into()) ; "Invalid max index witness")] +#[test_case( 2, 1 => Err(Error::::MaxIndexWitnessExhausted.into()) ; "Max index witness exhausted")] +#[test_case( 2, 2 => Ok(()); "Valid update")] +fn it_update_max_index_witness(dispatch_messages: usize, max_index: u32) -> DispatchResult { + ExtBuilder::default() + .with_base(*TEST_NOMAD_BASE) + .build() + .execute_with(move || { + let committed_root = Home::base().committed_root; + + // Dispatch `dispatch_messages` messages and get the latest root. + let sender = Origin::signed(TEST_SENDER_ACCOUNT); + let last_root = (0..) + .take(dispatch_messages) + .map(|_| dispatch_random_message(sender.clone())) + .last() + .unwrap_or(committed_root.clone()); + + let signed_update = TEST_UPDATER.sign_update(committed_root, last_root); + Home::update(sender, signed_update, max_index) + }) +} + +#[test] +fn it_dispatches_messages_and_accepts_updates() { + ExtBuilder::default() + .with_base(*TEST_NOMAD_BASE) + .build() + .execute_with(move || { + let committed_root = Home::base().committed_root; + + let origin = Origin::signed(TEST_SENDER_ACCOUNT); + + // Dispatch 2 messages. + let roots = (0..2) + .map(|_| dispatch_random_message(origin.clone())) + .collect::>(); + let last_root = roots.last().unwrap().clone(); + + // Get updater signature + let signed_update = TEST_UPDATER.sign_update(committed_root, last_root); + + // Submit signed update + assert_ok!(Home::update(origin.clone(), signed_update.clone(), 3)); + + let expected_update_event = crate::Event::Update { + home_domain: TEST_LOCAL_DOMAIN, + previous_root: committed_root, + new_root: last_root, + signature: signed_update.signature.to_vec(), + }; + assert!(events().contains(&expected_update_event)); + + // Assert mappings are cleared out up to signed_update.new_root() + assert_eq!(Home::base().committed_root, last_root); + for (idx, root) in roots.into_iter().enumerate() { + assert_eq!(Home::index_to_root(idx as u32), None); + assert_eq!(Home::root_to_index(root), None); + } + + // Dispatch third message + let committed_root = Home::base().committed_root; + let root_after_third_msg = dispatch_random_message(origin.clone()); + + // Get updater signature + let signed_update = TEST_UPDATER.sign_update(committed_root, root_after_third_msg); + + // Submit signed update + assert_ok!(Home::update(origin, signed_update.clone(), 3)); + + let expected_update_event = crate::Event::Update { + home_domain: TEST_LOCAL_DOMAIN, + previous_root: committed_root, + new_root: root_after_third_msg, + signature: signed_update.signature.to_vec(), + }; + assert!(events().contains(&expected_update_event)); + + // Assert mappings are cleared out up to signed_update.new_root() + assert!(Home::index_to_root(2).is_none()); + assert!(Home::root_to_index(root_after_third_msg).is_none()); + assert!(Home::base().committed_root == root_after_third_msg); + }) +} + +#[test] +fn it_rejects_invalid_signature() { + ExtBuilder::default() + .with_base(*TEST_NOMAD_BASE) + .build() + .execute_with(move || { + let committed_root = Home::base().committed_root; + + let body: BoundedVec = [1u8; 8].to_vec().try_into().unwrap(); + // Dispatch message + let origin = Origin::signed(TEST_SENDER_ACCOUNT); + assert_ok!(Home::dispatch( + origin.clone(), + TEST_REMOTE_DOMAIN, + TEST_RECIPIENT, + body.clone() + )); + + // Get fake updater signature + let new_root = Home::tree().root(); + let signed_update = FAKE_UPDATER.sign_update(committed_root, new_root); + + // Assert err returned from submitting signed update + assert_err!( + Home::update(origin, signed_update.clone(), 10), + Error::::InvalidUpdaterSignature + ); + }) +} + +#[test] +fn it_longest_tree() { + ExtBuilder::default() + .with_base(*TEST_NOMAD_BASE) + .build() + .execute_with(move || { + use merkle::TREE_DEPTH; + + let committed_root = Home::base().committed_root; + + let body_len = ::MaxMessageBodyBytes::get() as usize; + let body: BoundedVec = sp_std::iter::repeat(3u8) + .take(body_len) + .collect::>() + .try_into() + .unwrap(); + + let origin = Origin::signed(whitelisted_caller::()); + + for _ in 0..TREE_DEPTH { + assert_ok!(Home::dispatch( + origin.clone(), + 1111, + TEST_RECIPIENT, + body.clone() + )); + } + + let new_root = Home::tree().root(); + let signed_update = TEST_UPDATER.sign_update(committed_root, new_root); + let exp_signed_update = expected_longest_tree_signed_update(); + assert_eq!(new_root, exp_signed_update.update.new_root); + assert_eq!(signed_update, exp_signed_update); + + assert_ok!(Home::update(origin, signed_update, TREE_DEPTH as u32)); + }) +} diff --git a/pallets/nomad/home/src/weights.rs b/pallets/nomad/home/src/weights.rs new file mode 100644 index 000000000..a348b54c0 --- /dev/null +++ b/pallets/nomad/home/src/weights.rs @@ -0,0 +1,113 @@ +// This file is part of Data Availability. + +// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for nomad_home +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2022-10-03, STEPS: `20`, REPEAT: 30, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128 + +// Executed Command: +// ./target/release/data-avail +// benchmark +// --chain=dev +// --steps=20 +// --repeat=30 +// --log=warn +// --execution=wasm +// --wasm-execution=compiled +// --template=./.maintain/frame-weight-template.hbs +// --pallet=nomad-home +// --extrinsic=* +// --output=./pallets/nomad/home/src/weights.rs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use sp_std::marker::PhantomData; + +/// Weight functions needed for nomad_home. +pub trait WeightInfo { + fn improper_update() -> Weight; + fn dispatch(b: u32, ) -> Weight; + fn update() -> Weight; +} + +/// Weights for nomad_home using the Data Avaiability node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + // Storage: NomadHome Base (r:1 w:1) + // Storage: NomadHome RootToIndex (r:1 w:0) + fn improper_update() -> Weight { + (342_727_000 as Weight) + .saturating_add(T::DbWeight::get().reads(2 as Weight)) + .saturating_add(T::DbWeight::get().writes(1 as Weight)) + } + // Storage: NomadHome Base (r:1 w:0) + // Storage: NomadHome Nonces (r:1 w:1) + // Storage: NomadHome Tree (r:1 w:1) + // Storage: NomadHome IndexToRoot (r:0 w:1) + // Storage: NomadHome RootToIndex (r:0 w:1) + fn dispatch(b: u32, ) -> Weight { + (80_065_000 as Weight) + // Standard Error: 0 + .saturating_add((5_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(T::DbWeight::get().reads(3 as Weight)) + .saturating_add(T::DbWeight::get().writes(4 as Weight)) + } + // Storage: NomadHome Base (r:1 w:1) + // Storage: NomadHome RootToIndex (r:32 w:32) + // Storage: NomadHome IndexToRoot (r:31 w:32) + fn update() -> Weight { + (657_713_000 as Weight) + .saturating_add(T::DbWeight::get().reads(64 as Weight)) + .saturating_add(T::DbWeight::get().writes(65 as Weight)) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + // Storage: NomadHome Base (r:1 w:1) + // Storage: NomadHome RootToIndex (r:1 w:0) + fn improper_update() -> Weight { + (342_727_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(2 as Weight)) + .saturating_add(RocksDbWeight::get().writes(1 as Weight)) + } + // Storage: NomadHome Base (r:1 w:0) + // Storage: NomadHome Nonces (r:1 w:1) + // Storage: NomadHome Tree (r:1 w:1) + // Storage: NomadHome IndexToRoot (r:0 w:1) + // Storage: NomadHome RootToIndex (r:0 w:1) + fn dispatch(b: u32, ) -> Weight { + (80_065_000 as Weight) + // Standard Error: 0 + .saturating_add((5_000 as Weight).saturating_mul(b as Weight)) + .saturating_add(RocksDbWeight::get().reads(3 as Weight)) + .saturating_add(RocksDbWeight::get().writes(4 as Weight)) + } + // Storage: NomadHome Base (r:1 w:1) + // Storage: NomadHome RootToIndex (r:32 w:32) + // Storage: NomadHome IndexToRoot (r:31 w:32) + fn update() -> Weight { + (657_713_000 as Weight) + .saturating_add(RocksDbWeight::get().reads(64 as Weight)) + .saturating_add(RocksDbWeight::get().writes(65 as Weight)) + } +} diff --git a/pallets/nomad/updater-manager/Cargo.toml b/pallets/nomad/updater-manager/Cargo.toml new file mode 100644 index 000000000..c43101afd --- /dev/null +++ b/pallets/nomad/updater-manager/Cargo.toml @@ -0,0 +1,57 @@ +[package] +name = "updater-manager" +version = "1.0.0" +authors = [""] +edition = "2021" +license = "Apache-2.0" +homepage = "" +repository = "" +description = "Nomad Updater Manager Module" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +# Substrate +serde = { version = "1.0.126", optional = true, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +scale-info = { version = "1.0", default-features = false, features = ["derive"] } +sp-core = { version = "4.0.0-dev", default-features = false } +sp-std = { version = "4.0.0-dev", default-features = false } +sp-io = { version = "4.0.0-dev", default-features = false } +sp-runtime = { version = "4.0.0-dev", default-features = false } +sp-arithmetic = { version = "4.0.0-dev", default-features = false } +frame-support = { version = "4.0.0-dev", default-features = false } +frame-system = { version = "4.0.0-dev", default-features = false } +primitive-types = { git = "https://github.com/paritytech/parity-common.git", tag = "parity-util-mem-v0.10.1", default-features = false } + +# Benchmarking +frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true } + +# Nomad +nomad-core = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } + +[dev-dependencies] +da-primitives = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2" } + +[features] +default = ["std"] +std = [ + "serde", + "codec/std", + "scale-info/std", + "sp-core/std", + "sp-std/std", + "sp-io/std", + "sp-runtime/std", + "sp-arithmetic/std", + "frame-support/std", + "frame-system/std", + "nomad-core/std" +] +runtime-benchmarks = [ + "frame-benchmarking", + "sp-runtime/runtime-benchmarks", + "frame-support/runtime-benchmarks", +] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/nomad/updater-manager/README.md b/pallets/nomad/updater-manager/README.md new file mode 100644 index 000000000..8d751a422 --- /dev/null +++ b/pallets/nomad/updater-manager/README.md @@ -0,0 +1 @@ +License: Unlicense \ No newline at end of file diff --git a/pallets/nomad/updater-manager/src/benchmarking.rs b/pallets/nomad/updater-manager/src/benchmarking.rs new file mode 100644 index 000000000..9d5d0f483 --- /dev/null +++ b/pallets/nomad/updater-manager/src/benchmarking.rs @@ -0,0 +1,20 @@ +// //! Benchmarking setup for pallet-template + +// use super::*; + +// #[allow(unused)] +// use crate::Pallet as Template; +// use frame_benchmarking::{benchmarks, whitelisted_caller}; +// use frame_system::RawOrigin; + +// benchmarks! { +// do_something { +// let s in 0 .. 100; +// let caller: T::AccountId = whitelisted_caller(); +// }: _(RawOrigin::Signed(caller), s) +// verify { +// assert_eq!(Something::::get(), Some(s)); +// } + +// impl_benchmark_test_suite!(Template, crate::mock::new_test_ext(), crate::mock::Test); +// } diff --git a/pallets/nomad/updater-manager/src/lib.rs b/pallets/nomad/updater-manager/src/lib.rs new file mode 100644 index 000000000..3a673db11 --- /dev/null +++ b/pallets/nomad/updater-manager/src/lib.rs @@ -0,0 +1,99 @@ +#![cfg_attr(not(feature = "std"), no_std)] + +/// Edit this file to define custom logic or remove it if it is not needed. +/// Learn more about FRAME and the core library of Substrate FRAME pallets: +/// +pub use pallet::*; + +#[cfg(test)] +mod mock; + +#[cfg(test)] +mod tests; + +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; + +#[frame_support::pallet] +pub mod pallet { + use frame_support::pallet_prelude::{ValueQuery, *}; + use primitive_types::H160; + + #[pallet::config] + pub trait Config: frame_system::Config { + type Event: From> + IsType<::Event>; + } + + #[pallet::pallet] + #[pallet::generate_store(pub(super) trait Store)] + pub struct Pallet(_); + + // Updater + #[pallet::storage] + #[pallet::getter(fn updater)] + pub type Updater = StorageValue<_, H160, ValueQuery>; + + // Genesis config + #[pallet::genesis_config] + pub struct GenesisConfig { + pub updater: H160, + pub _phantom: PhantomData, + } + + #[cfg(feature = "std")] + impl Default for GenesisConfig { + fn default() -> Self { + Self { + updater: Default::default(), + _phantom: Default::default(), + } + } + } + + #[pallet::genesis_build] + impl GenesisBuild for GenesisConfig { + fn build(&self) { >::put(&self.updater); } + } + + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + NewUpdater { + old_updater: H160, + new_updater: H160, + }, + FakeSlashed { + reporter: T::AccountId, + }, + } + + #[pallet::error] + pub enum Error { + InitializationError, + } + + // No exposed methods. The updater manager can only be called through the + // Home pallet. + #[pallet::call] + impl Pallet {} + + impl Pallet { + pub fn get_updater() -> H160 { Updater::::get() } + + pub fn set_updater(new_updater: H160) -> DispatchResult { + let old_updater = Updater::::get(); + Updater::::put(new_updater); + + Self::deposit_event(Event::::NewUpdater { + old_updater, + new_updater, + }); + + Ok(()) + } + + pub fn slash_updater(reporter: T::AccountId) { + Self::deposit_event(Event::::FakeSlashed { reporter }); + } + } +} diff --git a/pallets/nomad/updater-manager/src/mock.rs b/pallets/nomad/updater-manager/src/mock.rs new file mode 100644 index 000000000..591ab04cd --- /dev/null +++ b/pallets/nomad/updater-manager/src/mock.rs @@ -0,0 +1,87 @@ +use da_primitives::Header; +use frame_support::parameter_types; +use frame_system::{self as system}; +use primitive_types::H256; +use sp_runtime::traits::{BlakeTwo256, IdentityLookup}; + +use crate as updater_manager; + +type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +type Block = frame_system::mocking::MockBlock; + +// Configure a mock runtime to test the pallet. +frame_support::construct_runtime!( + pub enum Test where + Block = Block, + NodeBlock = Block, + UncheckedExtrinsic = UncheckedExtrinsic, + { + System: frame_system::{Pallet, Call, Config, Storage, Event}, + UpdaterManager: updater_manager::{Pallet, Call, Storage, Event}, + } +); + +parameter_types! { + pub const BlockHashCount: u32 = 250; + pub BlockWeights: frame_system::limits::BlockWeights = + frame_system::limits::BlockWeights::simple_max(1024); + pub static ExistentialDeposit: u64 = 0; +} + +impl system::Config for Test { + type AccountData = (); + type AccountId = u64; + type BaseCallFilter = frame_support::traits::Everything; + type BlockHashCount = BlockHashCount; + type BlockLength = (); + type BlockNumber = u32; + type BlockWeights = (); + type Call = Call; + type DbWeight = (); + type Event = Event; + type Hash = H256; + type Hashing = BlakeTwo256; + type Header = Header; + type HeaderExtensionBuilder = frame_system::header_builder::da::HeaderExtensionBuilder; + type Index = u64; + type Lookup = IdentityLookup; + type OnKilledAccount = (); + type OnNewAccount = (); + type OnSetCode = (); + type Origin = Origin; + type PalletInfo = PalletInfo; + type Randomness = frame_system::tests::TestRandomness; + type SS58Prefix = (); + type SubmittedDataExtractor = (); + type SystemWeightInfo = (); + type Version = (); +} + +impl updater_manager::Config for Test { + type Event = Event; +} + +// Build genesis storage according to the mock runtime. +pub fn new_test_ext() -> sp_io::TestExternalities { + let t = system::GenesisConfig::default() + .build_storage::() + .unwrap() + .into(); + let mut ext = sp_io::TestExternalities::new(t); + ext.execute_with(|| System::set_block_number(1)); + ext +} + +pub(crate) fn events() -> Vec> { + System::events() + .into_iter() + .map(|r| r.event) + .filter_map(|e| { + if let Event::UpdaterManager(inner) = e { + Some(inner) + } else { + None + } + }) + .collect::>() +} diff --git a/pallets/nomad/updater-manager/src/tests.rs b/pallets/nomad/updater-manager/src/tests.rs new file mode 100644 index 000000000..58c4e6656 --- /dev/null +++ b/pallets/nomad/updater-manager/src/tests.rs @@ -0,0 +1,35 @@ +use frame_support::assert_ok; +use primitive_types::H160; + +use crate::mock::*; + +#[test] +fn it_sets_updater() { + new_test_ext().execute_with(|| { + // Default updater is zero bytes + assert_eq!(UpdaterManager::get_updater(), H160::zero()); + + // Set to 1 and check new state + let new_updater = H160::repeat_byte(1); + assert_ok!(UpdaterManager::set_updater(new_updater)); + assert_eq!(UpdaterManager::get_updater(), new_updater); + + let expected = vec![crate::Event::NewUpdater { + old_updater: H160::zero(), + new_updater, + }]; + assert_eq!(events(), expected); + }); +} + +#[test] +fn it_slashes_updater() { + new_test_ext().execute_with(|| { + // Slash updater + let reporter = 1u64; + UpdaterManager::slash_updater(reporter); + + let expected = vec![crate::Event::FakeSlashed { reporter }]; + assert_eq!(events(), expected); + }); +} diff --git a/pallets/system/Cargo.toml b/pallets/system/Cargo.toml index 5346b1562..7896f2026 100644 --- a/pallets/system/Cargo.toml +++ b/pallets/system/Cargo.toml @@ -13,14 +13,13 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -kate = { path = "../../kate", default-features = false } -da-primitives = { path = "../../primitives/avail", default-features = false } - +da-primitives = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false} +kate = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } # Other impl-trait-for-tuples = "0.2.1" static_assertions = "1.1.0" log = { version = "0.4.14", default-features = false } -rs_merkle = { version = "1.2.0", default-features = false } +rs_merkle = { version = "1.2.0", default-features = false, optional = true } # Substrate serde = { version = "1.0.126", optional = true, features = ["derive"] } @@ -33,6 +32,7 @@ sp-runtime = { version = "4.0.0-dev", default-features = false } sp-version = { version = "4.0.0-dev", default-features = false } frame-support = { version = "4.0.0-dev", default-features = false } sp-runtime-interface = { version = "4.0.0-dev", default-features = false } +beefy-merkle-tree = { git = "https://github.com/paritytech/substrate.git/", branch = "polkadot-v0.9.13", default-features = false } [dev-dependencies] criterion = "0.3.3" @@ -55,6 +55,7 @@ std = [ "sp-runtime-interface/std", "sp-runtime/std", "sp-version/std", + "beefy-merkle-tree/std", "log/std", ] runtime-benchmarks = [ @@ -62,6 +63,13 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", ] try-runtime = ["frame-support/try-runtime"] +force-rs-merkle = [ + "rs_merkle" +] + +# For testing backward/forward header compatibility. +header-compatibility-test = [ + "da-primitives/header-backward-compatibility-test" ] [[bench]] name = "bench" diff --git a/pallets/system/benchmarking/Cargo.toml b/pallets/system/benchmarking/Cargo.toml index 38d060ec4..15971fef2 100644 --- a/pallets/system/benchmarking/Cargo.toml +++ b/pallets/system/benchmarking/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -da-primitives = { path = "../../../primitives/avail", default-features = false } +da-primitives = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false } scale-info = { version = "1.0", default-features = false, features = ["derive"] } sp-std = { version = "4.0.0-dev", default-features = false } diff --git a/pallets/system/benchmarking/src/lib.rs b/pallets/system/benchmarking/src/lib.rs index eddf78ce6..df6601afd 100644 --- a/pallets/system/benchmarking/src/lib.rs +++ b/pallets/system/benchmarking/src/lib.rs @@ -22,7 +22,7 @@ use codec::Encode; use frame_benchmarking::{benchmarks, whitelisted_caller}; use frame_support::{storage, traits::Get, weights::DispatchClass}; -use frame_system::{Call, Pallet as System, RawOrigin}; +use frame_system::{header_builder::HeaderExtensionBuilder, Call, Pallet as System, RawOrigin}; use sp_core::storage::well_known_keys; use sp_runtime::traits::Hash; use sp_std::{prelude::*, vec}; @@ -124,5 +124,16 @@ benchmarks! { assert_eq!(storage::unhashed::get_raw(&last_key), None); } + #[extra] + header_extension_builder { + let app_extrinsics = vec![]; + let data_root = Default::default(); + let block_length = Default::default(); + let block_number = 1u32.into(); + + }: { + let _header = T::HeaderExtensionBuilder::build(app_extrinsics, data_root, block_length, block_number); + } + impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); } diff --git a/pallets/system/benchmarking/src/mock.rs b/pallets/system/benchmarking/src/mock.rs index fa776a8cc..1758abd11 100644 --- a/pallets/system/benchmarking/src/mock.rs +++ b/pallets/system/benchmarking/src/mock.rs @@ -54,7 +54,7 @@ impl frame_system::Config for Test { type Hash = sp_core::H256; type Hashing = ::sp_runtime::traits::BlakeTwo256; type Header = Header; - type HeaderBuilder = frame_system::header_builder::da::HeaderBuilder; + type HeaderExtensionBuilder = frame_system::header_builder::da::HeaderExtensionBuilder; type Index = AccountIndex; type Lookup = IdentityLookup; type OnKilledAccount = (); @@ -64,6 +64,7 @@ impl frame_system::Config for Test { type PalletInfo = PalletInfo; type Randomness = TestRandomness; type SS58Prefix = (); + type SubmittedDataExtractor = (); type SystemWeightInfo = (); type Version = (); } diff --git a/pallets/system/src/data_root_builder.rs b/pallets/system/src/data_root_builder.rs new file mode 100644 index 000000000..b597aad94 --- /dev/null +++ b/pallets/system/src/data_root_builder.rs @@ -0,0 +1,356 @@ +use codec::Decode; +use da_primitives::asdr::AppExtrinsic; +use frame_support::traits::ExtrinsicCall; +use sp_core::H256; +use sp_runtime::traits::Extrinsic; +use sp_std::vec::Vec; + +const LOG_TARGET: &str = "runtime::system::data_root_builder"; + +pub type DRFOutput = Option>; +pub type DRFCallOf = ::Call; + +pub trait DataRootFilter { + type UncheckedExtrinsic: Decode + ExtrinsicCall; + + fn filter(call: &DRFCallOf) -> DRFOutput; +} + +pub trait DataRootBuilder { + fn build<'a, I>(app_extrinsics: I) -> H256 + where + I: IntoIterator, + { + let mut used_extrinsics_count = 0u32; + let mut total_extrinsics_count = 0u32; + + let filtered_iter = app_extrinsics + .into_iter() + .enumerate() + .filter_map(|(idx, app_extrinsic)| { + // Decode call and log any failure. + total_extrinsics_count += 1; + match F::UncheckedExtrinsic::decode(&mut app_extrinsic.data.as_slice()) { + Ok(app_unchecked_extrinsic) => Some(app_unchecked_extrinsic), + Err(err) => { + // NOTE: Decodification issue is like a `unrecheable` because this + // extrinsic was decoded previously, when node executed the block. + // We will keep this here just to have a trace if we update + // `System::note_extrinsic` in the future. + log::error!( + target: LOG_TARGET, + "Extrinsic {} cannot be decoded: {:?}", + idx, + err + ); + None + }, + } + }) + .filter_map(|app_unchecked_extrinsic| { + // Filter calls and traces removed calls + // @TODO: We could avoid the the copy of data from filter + // once `beefy_merkle_tree::merkelize` becomes public. In that case, + // we could work with iterator and lifescopes, having something like: + // + // ```Rust + // pub trait DataRootFilter { + // type UncheckedExtrinsic: Decode + ExtrinsicCall; + // fn filter<'a>(call: &'a ::Call) -> Option<&'a [u8]>; + // } + // ``` + let maybe_data = F::filter(app_unchecked_extrinsic.call()); + if maybe_data.is_some() { + used_extrinsics_count += 1; + } + + maybe_data + }); + + let root = Self::merkle_root(filtered_iter); + + log::debug!( + target: LOG_TARGET, + "Used {} extrinsics of {}", + used_extrinsics_count, + total_extrinsics_count + ); + + root.into() + } + + #[cfg(not(feature = "force-rs-merkle"))] + fn merkle_root(leaves: I) -> H256 + where + I: Iterator>, + { + use beefy_merkle_tree::{merkle_root, Hash, Hasher}; + use sp_io::hashing::sha2_256; + + #[derive(Copy, Clone)] + struct Sha2_256 {} + + impl Hasher for Sha2_256 { + fn hash(data: &[u8]) -> Hash { sha2_256(data) } + } + + merkle_root::(leaves).into() + } + + #[cfg(feature = "force-rs-merkle")] + fn merkle_root<'a, I>(leaves: I) -> H256 + where + I: Iterator>, + { + use rs_merkle::{algorithms::Sha256, Hasher, MerkleTree}; + + let mut tree = MerkleTree::::new(); + leaves.for_each(|leave| { + let leave_hash = Sha256::hash(leave.as_slice()); + tree.insert(leave_hash); + }); + + tree.commit(); + tree.root().unwrap_or_default().into() + } +} + +impl DataRootBuilder for F {} + +#[cfg(all(test, feature = "force-rs-merkle"))] +mod test { + use da_primitives::asdr::AppId; + use hex_literal::hex; + use rs_merkle::{algorithms::Sha256, Hasher, MerkleTree}; + use test_case::test_case; + + use super::*; + + mod nomad { + use codec::{Compact, Error as DecodeError, Input}; + use sp_runtime::{AccountId32, MultiAddress, MultiSignature}; + + use super::*; + + #[derive(Debug, Clone, PartialEq, Eq, Default)] + pub struct AvailExtrinsic { + pub app_id: u32, + pub signature: Option, + pub data: Vec, + } + + pub type AvailSignedExtra = ((), (), (), AvailMortality, Nonce, (), Balance, u32); + + #[derive(Decode)] + pub struct Balance(#[codec(compact)] u128); + + #[derive(Decode)] + pub struct Nonce(#[codec(compact)] u32); + + pub enum AvailMortality { + Immortal, + Mortal(u64, u64), + } + + impl Decode for AvailMortality { + fn decode(input: &mut I) -> Result { + let first = input.read_byte()?; + if first == 0 { + Ok(Self::Immortal) + } else { + let encoded = first as u64 + ((input.read_byte()? as u64) << 8); + let period = 2 << (encoded % (1 << 4)); + let quantize_factor = (period >> 12).max(1); + let phase = (encoded >> 4) * quantize_factor; + if period >= 4 && phase < period { + Ok(Self::Mortal(period, phase)) + } else { + Err("Invalid period and phase".into()) + } + } + } + } + + const EXTRINSIC_VERSION: u8 = 4; + impl Decode for AvailExtrinsic { + fn decode(input: &mut I) -> Result { + // This is a little more complicated than usual since the binary format must be compatible + // with substrate's generic `Vec` type. Basically this just means accepting that there + // will be a prefix of vector length (we don't need + // to use this). + let _length_do_not_remove_me_see_above: Compact = Decode::decode(input)?; + + let version = input.read_byte()?; + + let is_signed = version & 0b1000_0000 != 0; + let version = version & 0b0111_1111; + if version != EXTRINSIC_VERSION { + return Err("Invalid transaction version".into()); + } + let (app_id, signature) = if is_signed { + let _address = >::decode(input)?; + let sig = MultiSignature::decode(input)?; + let extra = ::decode(input)?; + let app_id = extra.7; + + (app_id, Some(sig)) + } else { + return Err("Not signed".into()); + }; + + let section: u8 = Decode::decode(input)?; + let method: u8 = Decode::decode(input)?; + + let data: Vec = match (section, method) { + // TODO: Define these pairs as enums or better yet - make a dependency on substrate enums if possible + (29, 1) => Decode::decode(input)?, + _ => return Err("Not Avail Extrinsic".into()), + }; + + Ok(Self { + app_id, + signature, + data, + }) + } + } + } + + fn encoded_timestamp_call() -> AppExtrinsic { + AppExtrinsic { + app_id: 0.into(), + data: hex!("280403000BC26208378301").into(), + } + } + + fn encoded_fillblock_call>(app_id: A) -> AppExtrinsic { + let data = hex!("5D0284001CBD2D43530A44705AD088AF313E18F80B53EF16B36177CD4B77B846F2A5F07C01C44755794EA949E9410390CB4CE07FE2D8068656185B5AB9B43EEF934C3680478968C1F83E360A5D942FE75E9D58E49106A8E8B23601CBC6A633D80E5D089D83A4000400030000001D01A46868616A6B616E636B61206C61682069616B6A206361697568206162206169616A6820612067616861").to_vec(); + AppExtrinsic { + app_id: app_id.into(), + data, + } + } + + fn encoded_tx_bob() -> AppExtrinsic { + let data = hex!("490284001cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c0166de9fcb3903fa119cb6d23dd903b93a67719f76922b2b4c15a2539d11021102b75f4c452595b65b3bacef0e852430bbfa44bd38133b16cd5d48edb45962568204010000000000000600008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a4802093d00").to_vec(); + AppExtrinsic { + app_id: 0.into(), + data, + } + } + + fn dr_input_1() -> Vec { + vec![encoded_timestamp_call(), encoded_fillblock_call(3)] + } + + fn dr_output_1() -> H256 { + hex!("DDF368647A902A6F6AB9F53B32245BE28EDC99E92F43F0004BBC2CB359814B2A").into() + } + + /* + #[test_case( dr_input_1() => dr_output_1())] + #[test_case( vec![encoded_timestamp_call()] => H256::zero(); "Empty block")] + #[test_case( vec![encoded_tx_bob()] => H256::zero(); "Signed Native Tx")] + fn it_build_data_root(app_extrinsics: Vec) -> H256 { + build_data_root(&app_extrinsics) + }*/ + + #[test] + fn test_merkle_proof() { + let avail_data: Vec> = vec![ + hex!("3033333166613733656565636362653465323235").into(), + hex!("3630646564316635616236373261373132376261").into(), + hex!("3262313166316464333935353666623261623432").into(), + ]; + + let leaves = avail_data + .iter() + .map(|xt| Sha256::hash(&xt)) + .collect::>(); + + let data_tree = MerkleTree::::from_leaves(&leaves); + let proof = data_tree.proof(&[1usize]); + let root_proof = proof.proof_hashes().to_vec(); + assert_eq!(root_proof, vec![ + hex!("754B9412E0ED7907BDF4B7CA5D2A22F5E129A03DEB1F4E1C1FE42D322FDEE90E"), + hex!("8D6E30E494D17D7675A94C3C614467FF8CCE35201C1056751A6E9A100515DAF9") + ]); + } + + #[test] + fn test_single_merkle_proof() { + let empty_vec: Vec<[u8; 32]> = vec![]; + + let avail_data: Vec> = + vec![hex!("3435346666383063303838616137666162396531").to_vec()]; + + let leaves = avail_data + .iter() + .map(|xt| Sha256::hash(&xt)) + .collect::>(); + + let data_tree = MerkleTree::::from_leaves(&leaves); + let proof = data_tree.proof(&[0usize]); + let root_proof = proof.proof_hashes().to_vec(); + // here the proof is shown empty because the root itself is the proof as there is only one appdata extrinsic + assert_eq!(root_proof, empty_vec); + } + + ///using rs-merkle proof verify function + #[test] + fn verify_merkle_proof() { + let avail_data: Vec> = vec![ + hex!("3033333166613733656565636362653465323235").into(), + hex!("3630646564316635616236373261373132376261").into(), + hex!("3262313166316464333935353666623261623432").into(), + hex!("6433326630643762346634306264346563323665").into(), + ]; + let leaves = avail_data + .iter() + .map(|xt| Sha256::hash(&xt)) + .collect::>(); + + let merkle_tree = MerkleTree::::from_leaves(&leaves); + let indices_to_prove = vec![3]; + let leaves_to_prove = leaves.get(3..4).ok_or("can't get leaves to prove").unwrap(); + + let proof = merkle_tree.proof(&indices_to_prove); + let root = merkle_tree + .root() + .ok_or("couldn't get the merkle root") + .unwrap(); + + assert!(proof.verify(root, &indices_to_prove, leaves_to_prove, leaves.len())); + } + + #[test] + fn verify_nodata_merkle_proof() { + let avail_data: Vec> = vec![]; + + let leaves = avail_data + .iter() + .map(|xt| Sha256::hash(&xt)) + .collect::>(); + let leaves_to_prove = if let Ok(leaves) = leaves.get(0).ok_or("can't get leaves to prove") { + leaves + } else { + &[0u8; 32] + }; + assert_eq!(leaves_to_prove, &[0u8; 32]); + } + + fn encoded_submit_call>(app_id: A) -> AppExtrinsic { + let data = hex!("5D0284001CBD2D43530A44705AD088AF313E18F80B53EF16B36177CD4B77B846F2A5F07C01C44755794EA949E9410390CB4CE07FE2D8068656185B5AB9B43EEF934C3680478968C1F83E360A5D942FE75E9D58E49106A8E8B23601CBC6A633D80E5D089D83A4000400030000001D01A46868616A6B616E636B61206C61682069616B6A206361697568206162206169616A6820612067616861").to_vec(); + AppExtrinsic { + app_id: app_id.into(), + data, + } + } + + /* + #[test_case( encoded_submit_call(0) => H256(hex!("ddf368647a902a6f6ab9f53b32245be28edc99e92f43f0004bbc2cb359814b2a")); "Submit data 0")] + #[test_case( encoded_submit_call(1) => H256(hex!("ddf368647a902a6f6ab9f53b32245be28edc99e92f43f0004bbc2cb359814b2a")); "Submit data 1")] + fn nomad_merkle_root_compatibility(extrinsic: AppExtrinsic) -> H256 { + build_data_root(&[extrinsic]) + }*/ +} diff --git a/pallets/system/src/header_builder.rs b/pallets/system/src/header_builder.rs index 23c43a974..05fc574c4 100644 --- a/pallets/system/src/header_builder.rs +++ b/pallets/system/src/header_builder.rs @@ -1,15 +1,16 @@ -use codec::{Compact, Decode, Encode, Error as DecodeError, Input}; -use da_primitives::{asdr::AppExtrinsic, traits::ExtendedHeader}; +use da_primitives::{asdr::AppExtrinsic, traits::ExtendedHeader, HeaderExtension}; +#[cfg(feature = "std")] +use da_primitives::{asdr::DataLookup, KateCommitment}; use frame_support::traits::Randomness; pub use kate::Seed; -use rs_merkle::{algorithms::Sha256, Hasher, MerkleTree}; -use scale_info::TypeInfo; use sp_core::H256; -use sp_runtime::{traits::Hash, AccountId32, MultiAddress, MultiSignature}; -use sp_runtime_interface::{pass_by::PassByCodec, runtime_interface}; +use sp_runtime::traits::Hash; +#[cfg(feature = "std")] +use sp_runtime::SaturatedConversion; +use sp_runtime_interface::runtime_interface; use sp_std::vec::Vec; -use crate::{generic::Digest, limits::BlockLength, Config, LOG_TARGET}; +use crate::{limits::BlockLength, Config, LOG_TARGET}; pub mod da { use core::marker::PhantomData; @@ -17,33 +18,28 @@ pub mod da { use da_primitives::Header as DaHeader; use sp_runtime::traits::BlakeTwo256; - use super::{AppExtrinsic, BlockLength, Config, DigestWrapper, Vec}; - - pub type BlockNumber = u32; + use super::{AppExtrinsic, BlockLength, Config, HeaderExtension, Vec, H256}; pub type Hash = sp_core::H256; - pub type Hasher = BlakeTwo256; - pub type Header = DaHeader; + pub type BlockNumber = u32; /// Data-Avail Header builder. - pub struct HeaderBuilder(PhantomData); + pub struct HeaderExtensionBuilder(PhantomData); - impl super::HeaderBuilder for HeaderBuilder { - type Header = Header; + impl super::HeaderExtensionBuilder for HeaderExtensionBuilder { + type Header = DaHeader; #[inline] fn build( app_extrinsics: Vec, - parent_hash: Hash, - digest: DigestWrapper, + data_root: H256, block_length: BlockLength, block_number: BlockNumber, - ) -> Header { + ) -> HeaderExtension { let seed = Self::random_seed::(); super::hosted_header_builder::build( app_extrinsics, - parent_hash, - digest, + data_root, block_length, block_number, seed, @@ -52,26 +48,17 @@ pub mod da { } } -/// It is just a wapper to support `PassBy` on `Digest` type. -#[derive(Clone, TypeInfo, Encode, Decode, PassByCodec)] -pub struct DigestWrapper(pub Digest); - -impl From for DigestWrapper { - fn from(d: Digest) -> Self { Self(d) } -} - /// Trait for header builder. -pub trait HeaderBuilder { +pub trait HeaderExtensionBuilder { type Header: sp_runtime::traits::Header + ExtendedHeader; /// Creates the header using the given parameters. fn build( app_extrinsics: Vec, - parent_hash: ::Hash, - digest: DigestWrapper, + data_root: H256, block_length: BlockLength, block_number: ::Number, - ) -> Self::Header; + ) -> HeaderExtension; /// Generates a random seed using the _epoch seed_ and the _current block_ returned by /// `T::Randomness` type. @@ -91,303 +78,89 @@ pub trait HeaderBuilder { } } +#[allow(dead_code)] +#[cfg(all(feature = "std", feature = "header-compatibility-test"))] +fn build_extension_v_test( + app_extrinsics: &[AppExtrinsic], + data_root: H256, + block_length: BlockLength, + seed: Seed, +) -> HeaderExtension { + let extension_v1 = build_extension_v1(app_extrinsics, data_root, block_length, seed); + match extension_v1 { + HeaderExtension::V1(extension) => HeaderExtension::VTest(extension.into()), + r @ HeaderExtension::VTest(_) => r, + } +} + +#[cfg(feature = "std")] +fn build_extension_v1( + app_extrinsics: &[AppExtrinsic], + data_root: H256, + block_length: BlockLength, + seed: Seed, +) -> HeaderExtension { + use da_primitives::header::extension::v1; + + let (xts_layout, commitment, block_dims, _data_matrix) = kate::com::par_build_commitments( + block_length.rows as usize, + block_length.cols as usize, + block_length.chunk_size() as usize, + app_extrinsics, + seed, + ) + .expect("Build commitments cannot fail .qed"); + let app_lookup = + DataLookup::try_from(xts_layout.as_slice()).expect("Extrinsic size cannot overflow .qed"); + + let commitment = KateCommitment { + rows: block_dims.rows.saturated_into::(), + cols: block_dims.cols.saturated_into::(), + commitment, + data_root, + }; + + HeaderExtension::V1(v1::HeaderExtension { + commitment, + app_lookup, + }) +} + /// Hosted function to build the header using `kate` commitments. #[runtime_interface] pub trait HostedHeaderBuilder { /// Creates the header using the given parameters. + /// *NOTE:* Version 1 uses `dusk-plonk v0.8.2` + #[version(1)] fn build( app_extrinsics: Vec, - parent_hash: da::Hash, - digest: DigestWrapper, + data_root: H256, block_length: BlockLength, - block_number: da::BlockNumber, + _block_number: u32, seed: Seed, - ) -> da::Header { - use da_primitives::{asdr::DataLookup, traits::ExtrinsicsWithCommitment as _}; - use sp_runtime::traits::Hash; - - use crate::generic::DigestItem; - - let (kate_commitment, block_dims, data_index) = { - let (xts_layout, kate_commitment, block_dims, _data_matrix) = - kate::com::par_build_commitments( - block_length.rows as usize, - block_length.cols as usize, - block_length.chunk_size() as usize, - app_extrinsics.as_slice(), - seed, - ) - .expect("Build commitments cannot fail .qed"); - let data_index = DataLookup::try_from(xts_layout.as_slice()) - .expect("Extrinsic size cannot overflow .qed"); - - log::debug!(target: LOG_TARGET, "App DataLookup: {:?}", data_index); - - (kate_commitment, block_dims, data_index) - }; - - let extrinsics: Vec> = app_extrinsics.clone().into_iter().map(|e| e.data).collect(); - let data_root = build_data_root(&app_extrinsics); - - log::debug!("Avail Data Root: {:?}\n", data_root); - - let root_hash = da::Hasher::ordered_trie_root(extrinsics); - - let storage_root = da::Hash::decode(&mut &sp_io::storage::root()[..]) - .expect("Node is configured to use the same hash; qed"); - let storage_changes_root = sp_io::storage::changes_root(&parent_hash.encode()); - - let mut digest = digest.0; - // we can't compute changes trie root earlier && put it to the Digest - // because it will include all currently existing temporaries. - if let Some(storage_changes_root) = storage_changes_root { - let hash_changes_root = da::Hash::decode(&mut &storage_changes_root[..]) - .expect("Node is configured to use the same hash; qed"); - let item = DigestItem::Other(hash_changes_root.as_ref().to_vec()); - digest.push(item); - } - - let extrinsics_root = ::Root::new_with_commitment( - root_hash, - kate_commitment, - block_dims.rows as u16, - block_dims.cols as u16, - data_root, - ); - - ::new( - block_number, - extrinsics_root, - storage_root, - parent_hash, - digest, - data_index, - ) - } -} - -#[derive(Debug, Clone, PartialEq, Eq, Default)] -pub struct AvailExtrinsic { - pub app_id: u32, - pub signature: Option, - pub data: Vec, -} - -pub type AvailSignedExtra = ((), (), (), AvailMortality, Nonce, (), Balance, u32); - -#[derive(Decode)] -pub struct Balance(#[codec(compact)] u128); - -#[derive(Decode)] -pub struct Nonce(#[codec(compact)] u32); - -pub enum AvailMortality { - Immortal, - Mortal(u64, u64), -} - -impl Decode for AvailMortality { - fn decode(input: &mut I) -> Result { - let first = input.read_byte()?; - if first == 0 { - Ok(Self::Immortal) - } else { - let encoded = first as u64 + ((input.read_byte()? as u64) << 8); - let period = 2 << (encoded % (1 << 4)); - let quantize_factor = (period >> 12).max(1); - let phase = (encoded >> 4) * quantize_factor; - if period >= 4 && phase < period { - Ok(Self::Mortal(period, phase)) - } else { - Err("Invalid period and phase".into()) - } - } + ) -> HeaderExtension { + build_extension_v1(&app_extrinsics, data_root, block_length, seed) } -} - -const EXTRINSIC_VERSION: u8 = 4; -impl Decode for AvailExtrinsic { - fn decode(input: &mut I) -> Result { - // This is a little more complicated than usual since the binary format must be compatible - // with substrate's generic `Vec` type. Basically this just means accepting that there - // will be a prefix of vector length (we don't need - // to use this). - let _length_do_not_remove_me_see_above: Compact = Decode::decode(input)?; - - let version = input.read_byte()?; - let is_signed = version & 0b1000_0000 != 0; - let version = version & 0b0111_1111; - if version != EXTRINSIC_VERSION { - return Err("Invalid transaction version".into()); - } - let (app_id, signature) = if is_signed { - let _address = >::decode(input)?; - let sig = MultiSignature::decode(input)?; - let extra = ::decode(input)?; - let app_id = extra.7; - - (app_id, Some(sig)) + /* + // @TODO Miguel: Substrate v0.9.29 supports deactivated new version of hosted functions. + // NOTE: It is just for testing the forward compatibility in header extension. + #[cfg(feature = "header-compatibility-test")] + #[version(2)] + fn build( + app_extrinsics: Vec, + data_root: H256, + block_length: BlockLength, + block_number: u32, + seed: Seed, + ) -> HeaderExtension { + // Genesis HAS TO use the legacy header extension + let build_extension_fn = if block_number > 1 { + build_extension_v_test } else { - return Err("Not signed".into()); - }; - - let section: u8 = Decode::decode(input)?; - let method: u8 = Decode::decode(input)?; - - let data: Vec = match (section, method) { - // TODO: Define these pairs as enums or better yet - make a dependency on substrate enums if possible - (29, 1) => Decode::decode(input)?, - _ => return Err("Not Avail Extrinsic".into()), + build_extension_v1 }; - Ok(Self { - app_id, - signature, - data, - }) - } -} - -fn build_data_root(app_ext: &[AppExtrinsic]) -> H256 { - let mut tree = MerkleTree::::new(); - - app_ext - .iter() - // NOTE: `AvailExtrinsic` decode fn will filter onlye `Da_Control::submit_data` extrinsics. - // TODO: It implies a circular dependency atm between system & DA control pallets. - .filter_map(|e| AvailExtrinsic::decode(&mut &e.data[..]).ok()) - .for_each(|ext| { - let ext_hash = Sha256::hash(&ext.data); - tree.insert(ext_hash); - }); - - tree.commit(); - tree.root().unwrap_or_default().into() -} - -#[cfg(test)] -mod tests { - use da_primitives::asdr::AppId; - use hex_literal::hex; - use sp_core::H256; - use test_case::test_case; - - use super::*; - - fn encoded_timestamp_call() -> AppExtrinsic { - AppExtrinsic { - app_id: 0, - data: hex!("280403000BC26208378301").into(), - } - } - - fn encoded_fillblock_call(app_id: AppId) -> AppExtrinsic { - let data = hex!("5D0284001CBD2D43530A44705AD088AF313E18F80B53EF16B36177CD4B77B846F2A5F07C01C44755794EA949E9410390CB4CE07FE2D8068656185B5AB9B43EEF934C3680478968C1F83E360A5D942FE75E9D58E49106A8E8B23601CBC6A633D80E5D089D83A4000400030000001D01A46868616A6B616E636B61206C61682069616B6A206361697568206162206169616A6820612067616861").to_vec(); - AppExtrinsic { app_id, data } - } - - fn encoded_tx_bob() -> AppExtrinsic { - let data = hex!("490284001cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c0166de9fcb3903fa119cb6d23dd903b93a67719f76922b2b4c15a2539d11021102b75f4c452595b65b3bacef0e852430bbfa44bd38133b16cd5d48edb45962568204010000000000000600008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a4802093d00").to_vec(); - AppExtrinsic { app_id: 0, data } - } - - fn dr_input_1() -> Vec { - vec![encoded_timestamp_call(), encoded_fillblock_call(3)] - } - - fn dr_output_1() -> H256 { - hex!("DDF368647A902A6F6AB9F53B32245BE28EDC99E92F43F0004BBC2CB359814B2A").into() - } - - #[test_case( dr_input_1() => dr_output_1())] - #[test_case( vec![encoded_timestamp_call()] => H256::zero(); "Empty block")] - #[test_case( vec![encoded_tx_bob()] => H256::zero(); "Signed Native Tx")] - fn it_build_data_root(app_extrinsics: Vec) -> H256 { - build_data_root(&app_extrinsics).into() - } - - #[test] - fn test_merkle_proof() { - let avail_data: Vec> = vec![ - hex!("3033333166613733656565636362653465323235").into(), - hex!("3630646564316635616236373261373132376261").into(), - hex!("3262313166316464333935353666623261623432").into(), - ]; - - let leaves = avail_data - .iter() - .map(|xt| Sha256::hash(&xt)) - .collect::>(); - - let data_tree = MerkleTree::::from_leaves(&leaves); - let proof = data_tree.proof(&[1usize]); - let root_proof = proof.proof_hashes().to_vec(); - assert_eq!(root_proof, vec![ - hex!("754B9412E0ED7907BDF4B7CA5D2A22F5E129A03DEB1F4E1C1FE42D322FDEE90E"), - hex!("8D6E30E494D17D7675A94C3C614467FF8CCE35201C1056751A6E9A100515DAF9") - ]); - } - - #[test] - fn test_single_merkle_proof() { - let empty_vec: Vec<[u8; 32]> = vec![]; - - let avail_data: Vec> = - vec![hex!("3435346666383063303838616137666162396531").to_vec()]; - - let leaves = avail_data - .iter() - .map(|xt| Sha256::hash(&xt)) - .collect::>(); - - let data_tree = MerkleTree::::from_leaves(&leaves); - let proof = data_tree.proof(&[0usize]); - let root_proof = proof.proof_hashes().to_vec(); - // here the proof is shown empty because the root itself is the proof as there is only one appdata extrinsic - assert_eq!(root_proof, empty_vec); - } - - ///using rs-merkle proof verify function - #[test] - fn verify_merkle_proof() { - let avail_data: Vec> = vec![ - hex!("3033333166613733656565636362653465323235").into(), - hex!("3630646564316635616236373261373132376261").into(), - hex!("3262313166316464333935353666623261623432").into(), - hex!("6433326630643762346634306264346563323665").into(), - ]; - let leaves = avail_data - .iter() - .map(|xt| Sha256::hash(&xt)) - .collect::>(); - - let merkle_tree = MerkleTree::::from_leaves(&leaves); - let indices_to_prove = vec![3]; - let leaves_to_prove = leaves.get(3..4).ok_or("can't get leaves to prove").unwrap(); - - let proof = merkle_tree.proof(&indices_to_prove); - let root = merkle_tree - .root() - .ok_or("couldn't get the merkle root") - .unwrap(); - - assert!(proof.verify(root, &indices_to_prove, leaves_to_prove, leaves.len())); - } - - #[test] - fn verify_nodata_merkle_proof() { - let avail_data: Vec> = vec![]; - - let leaves = avail_data - .iter() - .map(|xt| Sha256::hash(&xt)) - .collect::>(); - let leaves_to_prove = if let Ok(leaves) = leaves.get(0).ok_or("can't get leaves to prove") { - leaves - } else { - &[0u8; 32] - }; - assert_eq!(leaves_to_prove, &[0u8; 32]); - } + build_extension_fn(app_extrinsics.as_slice(), data_root, block_length, seed) + }*/ } diff --git a/pallets/system/src/lib.rs b/pallets/system/src/lib.rs index 0a2ba8f03..3a0725f03 100644 --- a/pallets/system/src/lib.rs +++ b/pallets/system/src/lib.rs @@ -64,7 +64,11 @@ #![cfg_attr(not(feature = "std"), no_std)] use codec::{Decode, Encode, EncodeLike, FullCodec}; -use da_primitives::{asdr::AppExtrinsic, traits::ExtendedHeader, BLOCK_CHUNK_SIZE}; +use da_primitives::{ + asdr::{AppExtrinsic, AppId}, + traits::ExtendedHeader, + BLOCK_CHUNK_SIZE, +}; #[cfg(feature = "std")] use frame_support::traits::GenesisBuild; use frame_support::{ @@ -101,16 +105,16 @@ use sp_std::map; use sp_std::{fmt::Debug, marker::PhantomData, prelude::*}; use sp_version::RuntimeVersion; +mod extensions; +pub mod header_builder; +pub mod submitted_data; +use header_builder::HeaderExtensionBuilder; pub mod limits; +pub mod migrations; #[cfg(test)] pub(crate) mod mock; pub mod offchain; -mod extensions; -pub mod header_builder; -pub mod migrations; -use header_builder::HeaderBuilder; - #[cfg(feature = "std")] pub mod mocking; pub mod tests; @@ -125,6 +129,14 @@ pub use weights::WeightInfo; pub const LOG_TARGET: &str = "runtime::system"; +/// Compute the trie root of a list of extrinsics. +pub fn extrinsics_root(extrinsics: &[E]) -> H::Output { + extrinsics_data_root::(extrinsics.iter().map(codec::Encode::encode).collect()) +} + +/// Compute the trie root of a list of extrinsics. +pub fn extrinsics_data_root(xts: Vec>) -> H::Output { H::ordered_trie_root(xts) } + /// An object to track the currently used extrinsic weight in a block. pub type ConsumedWeight = PerDispatchClass; @@ -214,6 +226,7 @@ pub mod pallet { + sp_std::str::FromStr + MaybeMallocSizeOf + MaxEncodedLen + + Into + TypeInfo; /// The output of the `Hashing` function. @@ -261,7 +274,7 @@ pub mod pallet { + ExtendedHeader; /// Header builder - type HeaderBuilder: header_builder::HeaderBuilder
; + type HeaderExtensionBuilder: header_builder::HeaderExtensionBuilder; /// Source of random seeds. type Randomness: frame_support::traits::Randomness; @@ -323,6 +336,9 @@ pub mod pallet { /// It's unlikely that this needs to be customized, unless you are writing a parachain using /// `Cumulus`, where the actual code change is deferred. type OnSetCode: SetCode; + + /// Filter used by `DataRootBuilder`. + type SubmittedDataExtractor: submitted_data::Extractor + submitted_data::Filter; } #[pallet::pallet] @@ -1326,7 +1342,16 @@ impl Pallet { // stay to be inspected by the client and will be cleared by `Self::initialize`. let number = >::get(); let parent_hash = >::get(); - let digest = >::get().into(); + let digest = >::get(); + + let app_extrinsics = Self::take_app_extrinsics(); + + // @TODO Miguel: Is it possible to avoid copies here? + let extrinsics = app_extrinsics + .iter() + .map(|e| e.data.clone()) + .collect::>(); + let extrinsics_root = extrinsics_data_root::(extrinsics); // move block hash pruning window by one block let block_hash_count = T::BlockHashCount::get(); @@ -1339,10 +1364,42 @@ impl Pallet { >::remove(to_remove); } - let app_extrinsics = Self::get_app_extrinsics(); + let storage_root = T::Hash::decode(&mut &sp_io::storage::root()[..]) + .expect("Node is configured to use the same hash; qed"); + + /* + // we can't compute changes trie root earlier && put it to the Digest + // because it will include all currently existing temporaries. + if let Some(storage_changes_root) = changes_root(&parent_hash.encode()) { + let hash_changes_root = T::Hash::decode(&mut &storage_changes_root[..]) + .expect("Node is configured to use the same hash; qed"); + let item = DigestItem::Other(hash_changes_root.as_ref().to_vec()); + digest.push(item); + }*/ + let block_length = Self::block_length(); + let data_root = submitted_data::extrinsics_root::( + app_extrinsics.iter().cloned(), + ); + + let extension = header_builder::da::HeaderExtensionBuilder::::build( + app_extrinsics, + data_root, + block_length, + number.into(), + ); + + let header = ::new( + number, + extrinsics_root, + storage_root, + parent_hash, + digest, + extension, + ); - T::HeaderBuilder::build(app_extrinsics, parent_hash, digest, block_length, number) + log::trace!(target: LOG_TARGET, "Header {:?}", header); + header } /// Deposits a log and ensures it matches the block's log data. @@ -1447,7 +1504,7 @@ impl Pallet { /// /// This is required to be called before applying an extrinsic. The data will used /// in [`Self::finalize`] to calculate the correct extrinsics root. - pub fn note_extrinsic(app_id: u32, encoded_xt: Vec) { + pub fn note_extrinsic(app_id: AppId, encoded_xt: Vec) { let idx = Self::extrinsic_index().unwrap_or_default(); ExtrinsicData::::insert(idx, AppExtrinsic { app_id, @@ -1524,12 +1581,16 @@ impl Pallet { Ok(()) } - /// Returns the extrinsics. - pub fn get_app_extrinsics() -> Vec { - let extrinsics = (0..ExtrinsicCount::::take().unwrap_or_default()) + /// Takes all extrinsics from the storage. + pub fn take_app_extrinsics() -> Vec { + (0..Self::extrinsic_count()) .map(ExtrinsicData::::take) - .collect::>(); - extrinsics + .collect::>() + } + + /// Iterator over all extrinsics. + pub fn app_extrinsics() -> impl Iterator { + (0..Self::extrinsic_count()).map(ExtrinsicData::::get) } /// Creates a `ExtrinsicLen` based on `len` as raw length. diff --git a/pallets/system/src/limits.rs b/pallets/system/src/limits.rs index 00f67ba7f..1cb0433da 100644 --- a/pallets/system/src/limits.rs +++ b/pallets/system/src/limits.rs @@ -25,7 +25,7 @@ //! `DispatchClass`. This module contains configuration object for both resources, //! which should be passed to `frame_system` configuration when runtime is being set up. -use codec::{Decode, Encode, Error, Input}; +use codec::{Compact, Decode, Encode, Error, Input}; use da_primitives::BLOCK_CHUNK_SIZE; use frame_support::{ ensure, @@ -49,8 +49,11 @@ pub struct BlockLength { /// `MAX(max)` #[cfg_attr(feature = "std", serde(with = "per_dispatch_class_serde"))] pub max: PerDispatchClass, + #[codec(compact)] pub cols: u32, + #[codec(compact)] pub rows: u32, + #[codec(compact)] chunk_size: u32, } @@ -78,15 +81,19 @@ impl BlockLength { } impl Decode for BlockLength { + // NOTE: Decodification ensures that `chunk_size` is valid. fn decode(input: &mut I) -> Result { let max = >::decode(input) .map_err(|e| e.chain("Could not decode `BlockLength::max`"))?; - let cols = - ::decode(input).map_err(|e| e.chain("Could not decode `BlockLength::cols`"))?; - let rows = - ::decode(input).map_err(|e| e.chain("Could not decode `BlockLength::rows`"))?; - let chunk_size = ::decode(input) - .map_err(|e| e.chain("Could not decode `BlockLength::chunk_size`"))?; + let cols = >::decode(input) + .map_err(|e| e.chain("Could not decode `BlockLength::cols`"))? + .0; + let rows = >::decode(input) + .map_err(|e| e.chain("Could not decode `BlockLength::rows`"))? + .0; + let chunk_size = >::decode(input) + .map_err(|e| e.chain("Could not decode `BlockLength::chunk_size`"))? + .0; ensure!( is_chunk_size_valid(chunk_size), Error::from("Invalid `BlockLength::chunk_size`") diff --git a/pallets/system/src/mock.rs b/pallets/system/src/mock.rs index d7705e724..90db241f7 100644 --- a/pallets/system/src/mock.rs +++ b/pallets/system/src/mock.rs @@ -100,7 +100,7 @@ impl Config for Test { type Hash = H256; type Hashing = BlakeTwo256; type Header = da_primitives::Header; - type HeaderBuilder = frame_system::header_builder::da::HeaderBuilder; + type HeaderExtensionBuilder = frame_system::header_builder::da::HeaderExtensionBuilder; type Index = u64; type Lookup = IdentityLookup; type OnKilledAccount = RecordKilled; @@ -110,6 +110,7 @@ impl Config for Test { type PalletInfo = PalletInfo; type Randomness = TestRandomness; type SS58Prefix = (); + type SubmittedDataExtractor = (); type SystemWeightInfo = (); type Version = Version; } diff --git a/pallets/system/src/submitted_data.rs b/pallets/system/src/submitted_data.rs new file mode 100644 index 000000000..040e4d552 --- /dev/null +++ b/pallets/system/src/submitted_data.rs @@ -0,0 +1,438 @@ +use beefy_merkle_tree::{merkle_proof, merkle_root, verify_proof, Leaf, MerkleProof}; +use da_primitives::{asdr::AppExtrinsic, data_proof::HasherSha256}; +use sp_core::H256; +use sp_std::{cell::RefCell, rc::Rc, vec::Vec}; + +const LOG_TARGET: &str = "runtime::system::submitted_data"; + +/// Information about `submitted_data_root` and `submitted_data_proof` methods. +#[derive(Default, Debug)] +pub struct Metrics { + /// Number of extrinsics containing one or more submitted data. + pub data_submit_extrinsics: u32, + /// Total number of submitted data. + pub data_submit_leaves: u32, + /// Total number of analysed extrinsic. + pub total_extrinsics: u32, +} +pub type RcMetrics = Rc>; + +impl Metrics { + /// Creates a shared metric with internal mutability. + fn new_shared() -> RcMetrics { Rc::new(RefCell::new(Self::default())) } +} + +/// Extracts the `data` field from some types of extrinsics. +pub trait Extractor { + /// Returns the `data` field of `app_ext` if it contains one. + /// The `metrics` will be used to write accountability information about the whole process. + fn extract(app_ext: AppExtrinsic, metrics: RcMetrics) -> Option>; +} + +impl Extractor for () { + fn extract(_: AppExtrinsic, _: RcMetrics) -> Option> { None } +} + +/// It is similar to `Extractor` but it uses `C` type for calls, instead of `AppExtrinsic`. +pub trait Filter { + /// Returns the `data` field of `call` if it is a valid `da_ctrl::submit_data` call. + fn filter(call: C, metrics: RcMetrics) -> Option>; +} + +impl Filter for () { + fn filter(_: C, _: RcMetrics) -> Option> { None } +} + +/// Construct a root hash of Binary Merkle Tree created from given filtered `app_extrincs`. +pub fn extrinsics_root(app_extrinsics: I) -> H256 +where + E: Extractor, + I: Iterator, +{ + let metrics = Metrics::new_shared(); + let submitted_data = app_extrinsics.filter_map(|ext| E::extract(ext, Rc::clone(&metrics))); + root(submitted_data, Rc::clone(&metrics)) +} + +/// Construct a root hash of Binary Merkle Tree created from given filtered `calls`. +pub fn calls_root(calls: I) -> H256 +where + F: Filter, + I: Iterator, +{ + let metrics = Metrics::new_shared(); + let submitted_data = calls.filter_map(|c| F::filter(c, Rc::clone(&metrics))); + root(submitted_data, Rc::clone(&metrics)) +} + +/// Construct a root hash of a Binary Merkle Tree created from given leaves and stores +/// information about the process into `metrics`. +/// +/// In case an empty list of leaves is passed the function returns a 0-filled hash. +fn root>>(submitted_data: I, metrics: RcMetrics) -> H256 { + #[cfg(not(feature = "force-rs-merkle"))] + let root = merkle_root::(submitted_data).into(); + #[cfg(feature = "force-rs-merkle")] + let root = rs_merkle_root(submitted_data).into(); + log::debug!( + target: LOG_TARGET, + "Build submitted data root: {:?}, metrics: {:?}", + root, + metrics + ); + + root +} + +/// Calculates the merkle root using `Sha256` and `rs_merkle` crate. +#[cfg(feature = "force-rs-merkle")] +fn rs_merkle_root(leaves: I) -> H256 +where + I: Iterator>, +{ + use rs_merkle::{algorithms::Sha256, Hasher, MerkleTree}; + + let mut tree = MerkleTree::::new(); + leaves.for_each(|leave| { + let leave_hash = Sha256::hash(leave.as_slice()); + tree.insert(leave_hash); + }); + + tree.commit(); + tree.root().unwrap_or_default().into() +} + +/// Creates the Merkle Proof of the submitted data items in `app_extrinsics` filtered and +/// extracted by `E` and the given `data_index`. +/// +/// If `data_index` is greater than the number of Merkle leaves, it will return `None`. +/// +/// # TODO +/// - The `merkle_proof` requires `ExactSizeIterator`, forcing to load all submitted data into +/// memory. That would increase the memory footprint of the node significantly. We could fix this +/// adding the number of submitted data items at `System` pallet. +pub fn extrinsics_proof(app_extrinsics: I, data_index: u32) -> Option>> +where + E: Extractor, + I: Iterator, +{ + let metrics = Metrics::new_shared(); + let submitted_data = app_extrinsics + .filter_map(|ext| E::extract(ext, Rc::clone(&metrics))) + .collect::>(); + + proof(submitted_data, data_index, Rc::clone(&metrics)) +} + +/// Creates the Merkle Proof of the submitted data items in `calls` filtered by `F` and +/// the given `data_index`. +/// +/// If `data_index` is greater than the number of Merkle leaves, it will return `None`. +/// +/// # TODO +/// - The `merkle_proof` requires `ExactSizeIterator`, forcing to load all submitted data into +/// memory. That would increase the memory footprint of the node significantly. We could fix this +/// adding the number of submitted data items at `System` pallet. +pub fn calls_proof(calls: I, data_index: u32) -> Option>> +where + F: Filter, + I: Iterator, +{ + let metrics = Metrics::new_shared(); + let submitted_data = calls + .filter_map(|c| F::filter(c, Rc::clone(&metrics))) + .collect::>(); + + proof(submitted_data, data_index, Rc::clone(&metrics)) +} + +/// Construct a Merkle Proof for `submit_data` given by `data_index` and stores +/// information about the process into `metrics`. +/// +/// If `data_index` is greater than the number of Merkle leaves, it will return `None`. +fn proof( + submitted_data: Vec>, + data_index: u32, + metrics: RcMetrics, +) -> Option>> { + let data_index = data_index as usize; + // NOTE: `merkle_proof` panics if `data_index > leaves`. + if data_index >= submitted_data.len() { + return None; + } + + let proof = merkle_proof::(submitted_data, data_index); + log::debug!( + target: LOG_TARGET, + "Build submitted data proof of index {data_index}: {:?} metrics: {:?}", + proof, + metrics + ); + + Some(proof) +} + +/// Verify Merkle Proof correctness versus given root hash. +/// +/// The proof is NOT expected to contain leaf hash as the first +/// element, but only all adjacent nodes required to eventually by process of +/// concatenating and hashing end up with given root hash. +/// +/// The proof must not contain the root hash. +pub fn verify( + root: H256, + proof: I, + number_of_submitted_data: u32, + data_index: u32, + data_hash: H256, +) -> bool +where + I: IntoIterator, +{ + let leaf = Leaf::Hash(data_hash.0); + verify_proof::( + root.as_fixed_bytes(), + proof.into_iter().map(|hash| hash.to_fixed_bytes()), + number_of_submitted_data as usize, + data_index as usize, + leaf, + ) +} + +#[cfg(all(test, feature = "force-rs-merkle"))] +mod test { + use da_primitives::asdr::AppId; + use hex_literal::hex; + use rs_merkle::{algorithms::Sha256, Hasher, MerkleTree}; + use test_case::test_case; + + use super::*; + + mod nomad { + use codec::{Compact, Error as DecodeError, Input}; + use sp_runtime::{AccountId32, MultiAddress, MultiSignature}; + + use super::*; + + #[derive(Debug, Clone, PartialEq, Eq, Default)] + pub struct AvailExtrinsic { + pub app_id: u32, + pub signature: Option, + pub data: Vec, + } + + pub type AvailSignedExtra = ((), (), (), AvailMortality, Nonce, (), Balance, u32); + + #[derive(Decode)] + pub struct Balance(#[codec(compact)] u128); + + #[derive(Decode)] + pub struct Nonce(#[codec(compact)] u32); + + pub enum AvailMortality { + Immortal, + Mortal(u64, u64), + } + + impl Decode for AvailMortality { + fn decode(input: &mut I) -> Result { + let first = input.read_byte()?; + if first == 0 { + Ok(Self::Immortal) + } else { + let encoded = first as u64 + ((input.read_byte()? as u64) << 8); + let period = 2 << (encoded % (1 << 4)); + let quantize_factor = (period >> 12).max(1); + let phase = (encoded >> 4) * quantize_factor; + if period >= 4 && phase < period { + Ok(Self::Mortal(period, phase)) + } else { + Err("Invalid period and phase".into()) + } + } + } + } + + const EXTRINSIC_VERSION: u8 = 4; + impl Decode for AvailExtrinsic { + fn decode(input: &mut I) -> Result { + // This is a little more complicated than usual since the binary format must be compatible + // with substrate's generic `Vec` type. Basically this just means accepting that there + // will be a prefix of vector length (we don't need + // to use this). + let _length_do_not_remove_me_see_above: Compact = Decode::decode(input)?; + + let version = input.read_byte()?; + + let is_signed = version & 0b1000_0000 != 0; + let version = version & 0b0111_1111; + if version != EXTRINSIC_VERSION { + return Err("Invalid transaction version".into()); + } + let (app_id, signature) = if is_signed { + let _address = >::decode(input)?; + let sig = MultiSignature::decode(input)?; + let extra = ::decode(input)?; + let app_id = extra.7; + + (app_id, Some(sig)) + } else { + return Err("Not signed".into()); + }; + + let section: u8 = Decode::decode(input)?; + let method: u8 = Decode::decode(input)?; + + let data: Vec = match (section, method) { + // TODO: Define these pairs as enums or better yet - make a dependency on substrate enums if possible + (29, 1) => Decode::decode(input)?, + _ => return Err("Not Avail Extrinsic".into()), + }; + + Ok(Self { + app_id, + signature, + data, + }) + } + } + } + + fn encoded_timestamp_call() -> AppExtrinsic { + AppExtrinsic { + app_id: 0.into(), + data: hex!("280403000BC26208378301").into(), + } + } + + fn encoded_fillblock_call>(app_id: A) -> AppExtrinsic { + let data = hex!("5D0284001CBD2D43530A44705AD088AF313E18F80B53EF16B36177CD4B77B846F2A5F07C01C44755794EA949E9410390CB4CE07FE2D8068656185B5AB9B43EEF934C3680478968C1F83E360A5D942FE75E9D58E49106A8E8B23601CBC6A633D80E5D089D83A4000400030000001D01A46868616A6B616E636B61206C61682069616B6A206361697568206162206169616A6820612067616861").to_vec(); + AppExtrinsic { + app_id: app_id.into(), + data, + } + } + + fn encoded_tx_bob() -> AppExtrinsic { + let data = hex!("490284001cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c0166de9fcb3903fa119cb6d23dd903b93a67719f76922b2b4c15a2539d11021102b75f4c452595b65b3bacef0e852430bbfa44bd38133b16cd5d48edb45962568204010000000000000600008eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a4802093d00").to_vec(); + AppExtrinsic { + app_id: 0.into(), + data, + } + } + + fn dr_input_1() -> Vec { + vec![encoded_timestamp_call(), encoded_fillblock_call(3)] + } + + fn dr_output_1() -> H256 { + hex!("DDF368647A902A6F6AB9F53B32245BE28EDC99E92F43F0004BBC2CB359814B2A").into() + } + + /* + #[test_case( dr_input_1() => dr_output_1())] + #[test_case( vec![encoded_timestamp_call()] => H256::zero(); "Empty block")] + #[test_case( vec![encoded_tx_bob()] => H256::zero(); "Signed Native Tx")] + fn it_build_data_root(app_extrinsics: Vec) -> H256 { + build_data_root(&app_extrinsics) + }*/ + + #[test] + fn test_merkle_proof() { + let avail_data: Vec> = vec![ + hex!("3033333166613733656565636362653465323235").into(), + hex!("3630646564316635616236373261373132376261").into(), + hex!("3262313166316464333935353666623261623432").into(), + ]; + + let leaves = avail_data + .iter() + .map(|xt| Sha256::hash(&xt)) + .collect::>(); + + let data_tree = MerkleTree::::from_leaves(&leaves); + let proof = data_tree.proof(&[1usize]); + let root_proof = proof.proof_hashes().to_vec(); + assert_eq!(root_proof, vec![ + hex!("754B9412E0ED7907BDF4B7CA5D2A22F5E129A03DEB1F4E1C1FE42D322FDEE90E"), + hex!("8D6E30E494D17D7675A94C3C614467FF8CCE35201C1056751A6E9A100515DAF9") + ]); + } + + #[test] + fn test_single_merkle_proof() { + let empty_vec: Vec<[u8; 32]> = vec![]; + + let avail_data: Vec> = + vec![hex!("3435346666383063303838616137666162396531").to_vec()]; + + let leaves = avail_data + .iter() + .map(|xt| Sha256::hash(&xt)) + .collect::>(); + + let data_tree = MerkleTree::::from_leaves(&leaves); + let proof = data_tree.proof(&[0usize]); + let root_proof = proof.proof_hashes().to_vec(); + // here the proof is shown empty because the root itself is the proof as there is only one appdata extrinsic + assert_eq!(root_proof, empty_vec); + } + + ///using rs-merkle proof verify function + #[test] + fn verify_merkle_proof() { + let avail_data: Vec> = vec![ + hex!("3033333166613733656565636362653465323235").into(), + hex!("3630646564316635616236373261373132376261").into(), + hex!("3262313166316464333935353666623261623432").into(), + hex!("6433326630643762346634306264346563323665").into(), + ]; + let leaves = avail_data + .iter() + .map(|xt| Sha256::hash(&xt)) + .collect::>(); + + let merkle_tree = MerkleTree::::from_leaves(&leaves); + let indices_to_prove = vec![3]; + let leaves_to_prove = leaves.get(3..4).ok_or("can't get leaves to prove").unwrap(); + + let proof = merkle_tree.proof(&indices_to_prove); + let root = merkle_tree + .root() + .ok_or("couldn't get the merkle root") + .unwrap(); + + assert!(proof.verify(root, &indices_to_prove, leaves_to_prove, leaves.len())); + } + + #[test] + fn verify_nodata_merkle_proof() { + let avail_data: Vec> = vec![]; + + let leaves = avail_data + .iter() + .map(|xt| Sha256::hash(&xt)) + .collect::>(); + let leaves_to_prove = if let Ok(leaves) = leaves.get(0).ok_or("can't get leaves to prove") { + leaves + } else { + &[0u8; 32] + }; + assert_eq!(leaves_to_prove, &[0u8; 32]); + } + + fn encoded_submit_call>(app_id: A) -> AppExtrinsic { + let data = hex!("5D0284001CBD2D43530A44705AD088AF313E18F80B53EF16B36177CD4B77B846F2A5F07C01C44755794EA949E9410390CB4CE07FE2D8068656185B5AB9B43EEF934C3680478968C1F83E360A5D942FE75E9D58E49106A8E8B23601CBC6A633D80E5D089D83A4000400030000001D01A46868616A6B616E636B61206C61682069616B6A206361697568206162206169616A6820612067616861").to_vec(); + AppExtrinsic { + app_id: app_id.into(), + data, + } + } + + /* + #[test_case( encoded_submit_call(0) => H256(hex!("ddf368647a902a6f6ab9f53b32245be28edc99e92f43f0004bbc2cb359814b2a")); "Submit data 0")] + #[test_case( encoded_submit_call(1) => H256(hex!("ddf368647a902a6f6ab9f53b32245be28edc99e92f43f0004bbc2cb359814b2a")); "Submit data 1")] + fn nomad_merkle_root_compatibility(extrinsic: AppExtrinsic) -> H256 { + build_data_root(&[extrinsic]) + }*/ +} diff --git a/pallets/system/src/tests.rs b/pallets/system/src/tests.rs index f7b4bd86c..8f8484d9e 100644 --- a/pallets/system/src/tests.rs +++ b/pallets/system/src/tests.rs @@ -531,9 +531,9 @@ mod tests { new_test_ext().execute_with(|| { System::initialize(&1, &[0u8; 32].into(), &Default::default(), InitKind::Full); System::note_finished_initialize(); - System::note_extrinsic(0, vec![1]); + System::note_extrinsic(0.into(), vec![1]); System::note_applied_extrinsic(&Ok(().into()), Default::default()); - System::note_extrinsic(0, vec![2]); + System::note_extrinsic(0.into(), vec![2]); System::note_applied_extrinsic( &Err(DispatchError::BadOrigin.into()), Default::default(), @@ -542,8 +542,7 @@ mod tests { let header = System::finalize(); let ext_root = extrinsics_data_root::(vec![vec![1], vec![2]]); - let expected = da_primitives::traits::ExtendedHeader::extrinsics_root(&header); - assert_eq!(ext_root, expected.hash); + assert_eq!(ext_root, header.extrinsics_root); }); } diff --git a/primitives/avail/Cargo.toml b/primitives/avail/Cargo.toml deleted file mode 100644 index 801e00c51..000000000 --- a/primitives/avail/Cargo.toml +++ /dev/null @@ -1,39 +0,0 @@ -[package] -name = "da-primitives" -version = "0.1.0" -authors = [] -edition = "2018" - -[dependencies] -# Others -log = { version = "0.4.8", default-features = false } -serde = { version = "1.0.121", optional = true, features = ["derive"] } -serde_json = { version = "1.0", optional = true } - -# Substrate -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sp-std = { version = "4.0.0-dev", default-features = false } -sp-core = { version = "4.0.0-dev", default-features = false } -sp-io = { version = "4.0.0-dev", default-features = false } -sp-runtime = { version = "4.0.0-dev", default-features = false } -sp-runtime-interface = { version = "4.0.0-dev", default-features = false } -frame-support = { version = "4.0.0-dev", default-features = false } -parity-util-mem = { version = "0.10.2", default-features = false, features = ["primitive-types"] } - -[features] -default = ["std"] -std = [ - "serde", - "serde_json", - "codec/std", - "scale-info/std", - "log/std", - "sp-core/std", - "sp-std/std", - "sp-io/std", - "sp-runtime/std", - "sp-runtime-interface/std", - "frame-support/std", - "parity-util-mem/std", -] diff --git a/primitives/avail/src/asdr.rs b/primitives/avail/src/asdr.rs deleted file mode 100644 index a98d24aa1..000000000 --- a/primitives/avail/src/asdr.rs +++ /dev/null @@ -1,36 +0,0 @@ -use codec::{Decode, Encode}; -use frame_support::RuntimeDebug; -use scale_info::TypeInfo; -use sp_std::vec::Vec; - -mod data_lookup; -pub use data_lookup::*; - -mod get_app_id; -pub use get_app_id::*; - -mod app_unchecked_extrinsic; -pub use app_unchecked_extrinsic::*; - -pub type AppId = u32; - -/// Raw Extrinsic with application id. -#[derive(Clone, TypeInfo, RuntimeDebug, Default, Encode, Decode)] -pub struct AppExtrinsic { - pub app_id: AppId, - pub data: Vec, -} - -impl From> for AppExtrinsic { - #[inline] - fn from(data: Vec) -> Self { - Self { - data, - app_id: <_>::default(), - } - } -} - -impl GetAppId for AppExtrinsic { - fn app_id(&self) -> AppId { self.app_id } -} diff --git a/primitives/avail/src/asdr/app_unchecked_extrinsic.rs b/primitives/avail/src/asdr/app_unchecked_extrinsic.rs deleted file mode 100644 index 59955b102..000000000 --- a/primitives/avail/src/asdr/app_unchecked_extrinsic.rs +++ /dev/null @@ -1,581 +0,0 @@ -// This file is part of Substrate. - -// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Generic implementation of an unchecked (pre-verification) extrinsic. - -use codec::{Compact, Decode, Encode, EncodeLike, Error, Input}; -use frame_support::{ - traits::ExtrinsicCall, - weights::{DispatchInfo, GetDispatchInfo}, -}; -#[cfg(feature = "std")] -use parity_util_mem::{MallocSizeOf, MallocSizeOfOps}; -use scale_info::{build::Fields, meta_type, Path, StaticTypeInfo, Type, TypeInfo, TypeParameter}; -use sp_io::hashing::blake2_256; -use sp_runtime::{ - generic::CheckedExtrinsic, - traits::{ - self, Checkable, Extrinsic, ExtrinsicMetadata, IdentifyAccount, MaybeDisplay, Member, - SignedExtension, - }, - transaction_validity::{InvalidTransaction, TransactionValidityError}, - OpaqueExtrinsic, -}; -use sp_std::{ - fmt::{Debug, Formatter, Result as FmtResult}, - vec, - vec::Vec, -}; - -use crate::asdr::{AppId, GetAppId}; - -/// Current version of the [`AppUncheckedExtrinsic`] format. -const EXTRINSIC_VERSION: u8 = 4; - -/// A extrinsic right from the external world. This is unchecked and so -/// can contain a signature. -#[derive(PartialEq, Eq, Clone)] -pub struct AppUncheckedExtrinsic -where - Extra: SignedExtension, -{ - /// The signature, address, number of extrinsics have come before from - /// the same signer and an era describing the longevity of this transaction, - /// if this is a signed extrinsic. - pub signature: Option<(Address, Signature, Extra)>, - /// The function that should be called. - pub function: Call, -} - -/// Manual [`TypeInfo`] implementation because of custom encoding. The data is a valid encoded -/// `Vec`, but requires some logic to extract the signature and payload. -/// -/// See [`AppUncheckedExtrinsic::encode`] and [`AppUncheckedExtrinsic::decode`]. -impl TypeInfo - for AppUncheckedExtrinsic -where - Address: StaticTypeInfo, - Call: StaticTypeInfo, - Signature: StaticTypeInfo, - Extra: SignedExtension + StaticTypeInfo, -{ - type Identity = AppUncheckedExtrinsic; - - fn type_info() -> Type { - Type::builder() - .path(Path::new("AppUncheckedExtrinsic", module_path!())) - // Include the type parameter types, even though they are not used directly in any of - // the described fields. These type definitions can be used by downstream consumers - // to help construct the custom decoding from the opaque bytes (see below). - .type_params(vec![ - TypeParameter::new("Address", Some(meta_type::
())), - TypeParameter::new("Call", Some(meta_type::())), - TypeParameter::new("Signature", Some(meta_type::())), - TypeParameter::new("Extra", Some(meta_type::())), - ]) - .docs(&["AppUncheckedExtrinsic raw bytes, requires custom decoding routine"]) - // Because of the custom encoding, we can only accurately describe the encoding as an - // opaque `Vec`. Downstream consumers will need to manually implement the codec to - // encode/decode the `signature` and `function` fields. - .composite(Fields::unnamed().field(|f| f.ty::>())) - } -} - -#[cfg(feature = "std")] -impl MallocSizeOf - for AppUncheckedExtrinsic -where - Extra: SignedExtension, -{ - fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize { 0 } -} - -impl - AppUncheckedExtrinsic -{ - /// New instance of a signed extrinsic aka "transaction". - pub fn new_signed(function: Call, signed: Address, signature: Signature, extra: Extra) -> Self { - Self { - signature: Some((signed, signature, extra)), - function, - } - } - - /// New instance of an unsigned extrinsic aka "inherent". - pub fn new_unsigned(function: Call) -> Self { - Self { - signature: None, - function, - } - } -} - -impl Extrinsic - for AppUncheckedExtrinsic -{ - type Call = Call; - type SignaturePayload = (Address, Signature, Extra); - - fn is_signed(&self) -> Option { Some(self.signature.is_some()) } - - fn new(function: Call, signed_data: Option) -> Option { - Some(if let Some((address, signature, extra)) = signed_data { - Self::new_signed(function, address, signature, extra) - } else { - Self::new_unsigned(function) - }) - } -} - -impl Checkable - for AppUncheckedExtrinsic -where - Address: Member + MaybeDisplay, - Call: Encode + Member, - Signature: Member + traits::Verify, - ::Signer: IdentifyAccount, - Extra: SignedExtension, - AccountId: Member + MaybeDisplay, - Lookup: traits::Lookup, - ::AdditionalSigned: sp_std::fmt::Debug, -{ - type Checked = CheckedExtrinsic; - - fn check(self, lookup: &Lookup) -> Result { - Ok(match self.signature { - Some((signed, signature, extra)) => { - let signed = lookup.lookup(signed)?; - let raw_payload = SignedPayload::new(self.function, extra)?; - - log::debug!( - "AppUncheckedExtrinsic: Signed: {:?}, Signature: {:?}, RawPayload: {:?}", - signed, - signature, - raw_payload - ); - - if !raw_payload.using_encoded(|payload| signature.verify(payload, &signed)) { - return Err(InvalidTransaction::BadProof.into()); - } - - let (function, extra, _) = raw_payload.deconstruct(); - CheckedExtrinsic { - signed: Some((signed, extra)), - function, - } - }, - None => CheckedExtrinsic { - signed: None, - function: self.function, - }, - }) - } -} - -impl ExtrinsicMetadata - for AppUncheckedExtrinsic -where - Extra: SignedExtension, -{ - type SignedExtensions = Extra; - - const VERSION: u8 = EXTRINSIC_VERSION; -} - -impl GetDispatchInfo - for AppUncheckedExtrinsic -where - Call: GetDispatchInfo, - Extra: SignedExtension, -{ - fn get_dispatch_info(&self) -> DispatchInfo { self.function.get_dispatch_info() } -} - -/// A payload that has been signed for an unchecked extrinsics. -/// -/// Note that the payload that we sign to produce unchecked extrinsic signature -/// is going to be different than the `SignaturePayload` - so the thing the extrinsic -/// actually contains. -pub struct SignedPayload((Call, Extra, Extra::AdditionalSigned)); - -impl Debug for SignedPayload -where - Call: Debug, - Extra: SignedExtension + Debug, - Extra::AdditionalSigned: Debug, -{ - fn fmt(&self, f: &mut Formatter) -> FmtResult { - write!( - f, - "SignedPayload(call: {:?}, extra: {:?}, additional_signed: {:?})", - self.0 .0, self.0 .1, self.0 .2 - ) - } -} - -impl SignedPayload -where - Call: Encode, - Extra: SignedExtension, -{ - /// Create new `SignedPayload`. - /// - /// This function may fail if `additional_signed` of `Extra` is not available. - pub fn new(call: Call, extra: Extra) -> Result { - let additional_signed = extra.additional_signed()?; - let raw_payload = (call, extra, additional_signed); - Ok(Self(raw_payload)) - } - - /// Create new `SignedPayload` from raw components. - pub fn from_raw(call: Call, extra: Extra, additional_signed: Extra::AdditionalSigned) -> Self { - Self((call, extra, additional_signed)) - } - - /// Deconstruct the payload into it's components. - pub fn deconstruct(self) -> (Call, Extra, Extra::AdditionalSigned) { self.0 } -} - -impl Encode for SignedPayload -where - Call: Encode, - Extra: SignedExtension, -{ - /// Get an encoded version of this payload. - /// - /// Payloads longer than 256 bytes are going to be `blake2_256`-hashed. - fn using_encoded R>(&self, f: F) -> R { - self.0.using_encoded(|payload| { - if payload.len() > 256 { - f(&blake2_256(payload)[..]) - } else { - f(payload) - } - }) - } -} - -impl EncodeLike for SignedPayload -where - Call: Encode, - Extra: SignedExtension, -{ -} - -impl Decode - for AppUncheckedExtrinsic -where - Address: Decode, - Signature: Decode, - Call: Decode, - Extra: SignedExtension, -{ - fn decode(input: &mut I) -> Result { - // This is a little more complicated than usual since the binary format must be compatible - // with substrate's generic `Vec` type. Basically this just means accepting that there - // will be a prefix of vector length (we don't need - // to use this). - let _length_do_not_remove_me_see_above: Compact = Decode::decode(input)?; - - let version = input.read_byte()?; - - let is_signed = version & 0b1000_0000 != 0; - let version = version & 0b0111_1111; - if version != EXTRINSIC_VERSION { - return Err("Invalid transaction version".into()); - } - - Ok(Self { - signature: if is_signed { - Some(Decode::decode(input)?) - } else { - None - }, - function: Decode::decode(input)?, - }) - } -} - -impl Encode - for AppUncheckedExtrinsic -where - Address: Encode, - Signature: Encode, - Call: Encode, - Extra: SignedExtension, -{ - fn encode(&self) -> Vec { - let mut tmp = Vec::with_capacity(sp_std::mem::size_of::()); - - // 1 byte version id. - match self.signature.as_ref() { - Some(s) => { - tmp.push(EXTRINSIC_VERSION | 0b1000_0000); - s.encode_to(&mut tmp); - }, - None => { - tmp.push(EXTRINSIC_VERSION & 0b0111_1111); - }, - } - self.function.encode_to(&mut tmp); - - let compact_len = codec::Compact::(tmp.len() as u32); - - // Allocate the output buffer with the correct length - let mut output = Vec::with_capacity(compact_len.size_hint() + tmp.len()); - - compact_len.encode_to(&mut output); - output.extend(tmp); - - output - } -} - -impl EncodeLike - for AppUncheckedExtrinsic -where - Address: Encode, - Signature: Encode, - Call: Encode, - Extra: SignedExtension, -{ -} - -#[cfg(feature = "std")] -impl serde::Serialize - for AppUncheckedExtrinsic -{ - fn serialize(&self, seq: S) -> Result - where - S: ::serde::Serializer, - { - self.using_encoded(|bytes| sp_core::bytes::serialize(bytes, seq)) - } -} - -#[cfg(feature = "std")] -impl<'a, Address: Decode, Signature: Decode, Call: Decode, Extra: SignedExtension> - serde::Deserialize<'a> for AppUncheckedExtrinsic -{ - fn deserialize(de: D) -> Result - where - D: serde::Deserializer<'a>, - { - let r = sp_core::bytes::deserialize(de)?; - Decode::decode(&mut &r[..]) - .map_err(|e| serde::de::Error::custom(format!("Decode error: {}", e))) - } -} - -impl Debug - for AppUncheckedExtrinsic -where - Address: Debug, - Call: Debug, - Extra: SignedExtension, -{ - fn fmt(&self, f: &mut Formatter) -> FmtResult { - write!( - f, - "AppUncheckedExtrinsic({:?}, {:?})", - self.signature.as_ref().map(|x| (&x.0, &x.2)), - self.function, - ) - } -} - -impl GetAppId - for AppUncheckedExtrinsic -where - Extra: SignedExtension + GetAppId, -{ - fn app_id(&self) -> u32 { - self.signature - .as_ref() - .map(|(_address, _signature, extra)| extra.app_id()) - .unwrap_or_default() - } -} - -impl ExtrinsicCall - for AppUncheckedExtrinsic -where - Extra: SignedExtension, -{ - fn call(&self) -> &Self::Call { &self.function } -} - -impl From> - for OpaqueExtrinsic -where - Address: Encode, - Signature: Encode, - Call: Encode, - Extra: SignedExtension, -{ - fn from(extrinsic: AppUncheckedExtrinsic) -> Self { - Self::from_bytes(extrinsic.encode().as_slice()).expect( - "both OpaqueExtrinsic and AppUncheckedExtrinsic have encoding that is compatible with \ - raw Vec encoding; qed", - ) - } -} - -#[cfg(test)] -mod tests { - use sp_core::blake2_256; - use sp_runtime::{ - codec::{Decode, Encode}, - testing::TestSignature as TestSig, - traits::{IdentityLookup, SignedExtension}, - }; - - use super::*; - - type TestContext = IdentityLookup; - type TestAccountId = u64; - type TestCall = Vec; - - const TEST_ACCOUNT: TestAccountId = 0; - - // NOTE: this is demonstration. One can simply use `()` for testing. - #[derive( - Debug, Encode, Decode, Clone, Eq, PartialEq, Ord, PartialOrd, TypeInfo, MallocSizeOf, - )] - struct TestExtra; - impl SignedExtension for TestExtra { - type AccountId = u64; - type AdditionalSigned = (); - type Call = (); - type Pre = (); - - const IDENTIFIER: &'static str = "TestExtra"; - - fn additional_signed(&self) -> sp_std::result::Result<(), TransactionValidityError> { - Ok(()) - } - } - - impl GetAppId for TestExtra { - fn app_id(&self) -> AppId { 0 } - } - - type Ex = AppUncheckedExtrinsic; - type CEx = CheckedExtrinsic; - - #[test] - fn unsigned_codec_should_work() { - let ux = Ex::new_unsigned(vec![0u8; 0]); - let encoded = ux.encode(); - assert_eq!(Ex::decode(&mut &encoded[..]), Ok(ux)); - } - - #[test] - fn signed_codec_should_work() { - let ux = Ex::new_signed( - vec![0u8; 0], - TEST_ACCOUNT, - TestSig(TEST_ACCOUNT, (vec![0u8; 0], TestExtra).encode()), - TestExtra, - ); - let encoded = ux.encode(); - assert_eq!(Ex::decode(&mut &encoded[..]), Ok(ux)); - } - - #[test] - fn large_signed_codec_should_work() { - let ux = Ex::new_signed( - vec![0u8; 0], - TEST_ACCOUNT, - TestSig( - TEST_ACCOUNT, - (vec![0u8; 257], TestExtra).using_encoded(blake2_256)[..].to_owned(), - ), - TestExtra, - ); - let encoded = ux.encode(); - assert_eq!(Ex::decode(&mut &encoded[..]), Ok(ux)); - } - - #[test] - fn unsigned_check_should_work() { - let ux = Ex::new_unsigned(vec![0u8; 0]); - assert!(!ux.is_signed().unwrap_or(false)); - assert!(>::check(ux, &Default::default()).is_ok()); - } - - #[test] - fn badly_signed_check_should_fail() { - let ux = Ex::new_signed( - vec![0u8; 0], - TEST_ACCOUNT, - TestSig(TEST_ACCOUNT, vec![0u8; 0]), - TestExtra, - ); - assert!(ux.is_signed().unwrap_or(false)); - assert_eq!( - >::check(ux, &Default::default()), - Err(InvalidTransaction::BadProof.into()), - ); - } - - #[test] - fn signed_check_should_work() { - let ux = Ex::new_signed( - vec![0u8; 0], - TEST_ACCOUNT, - TestSig(TEST_ACCOUNT, (vec![0u8; 0], TestExtra).encode()), - TestExtra, - ); - assert!(ux.is_signed().unwrap_or(false)); - assert_eq!( - >::check(ux, &Default::default()), - Ok(CEx { - signed: Some((TEST_ACCOUNT, TestExtra)), - function: vec![0u8; 0] - }), - ); - } - - #[test] - fn encoding_matches_vec() { - let ex = Ex::new_unsigned(vec![0u8; 0]); - let encoded = ex.encode(); - let decoded = Ex::decode(&mut encoded.as_slice()).unwrap(); - assert_eq!(decoded, ex); - let as_vec: Vec = Decode::decode(&mut encoded.as_slice()).unwrap(); - assert_eq!(as_vec.encode(), encoded); - } - - #[test] - fn conversion_to_opaque() { - let ux = Ex::new_unsigned(vec![0u8; 0]); - let encoded = ux.encode(); - let opaque: OpaqueExtrinsic = ux.into(); - let opaque_encoded = opaque.encode(); - assert_eq!(opaque_encoded, encoded); - } - - #[test] - fn large_bad_prefix_should_work() { - let encoded = Compact::::from(u32::MAX).encode(); - assert_eq!( - Ex::decode(&mut &encoded[..]), - Err(Error::from("Not enough data to fill buffer")) - ); - } -} diff --git a/primitives/avail/src/asdr/data_lookup.rs b/primitives/avail/src/asdr/data_lookup.rs deleted file mode 100644 index 480509632..000000000 --- a/primitives/avail/src/asdr/data_lookup.rs +++ /dev/null @@ -1,95 +0,0 @@ -use codec::{Decode, Encode}; -use frame_support::ensure; -#[cfg(feature = "std")] -use parity_util_mem::{MallocSizeOf, MallocSizeOfOps}; -use scale_info::TypeInfo; -#[cfg(feature = "std")] -use serde::{Deserialize, Serialize}; -use sp_core::RuntimeDebug; -use sp_std::{convert::TryFrom, vec::Vec}; - -use crate::asdr::AppId; - -#[derive(PartialEq, Eq, Clone, RuntimeDebug, Encode, Decode, Default, TypeInfo)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub struct DataLookup { - /// size of the look up - pub size: u32, - /// sorted vector of tuples(key, start index) - pub index: Vec<(AppId, u32)>, -} - -#[derive(PartialEq, RuntimeDebug)] -/// Errors during the creation from `extrinsics`. -pub enum TryFromError { - /// Size overflows - SizeOverflow, - /// Extrinsics are not sorted. - UnsortedExtrinsics, -} - -impl TryFrom<&[(AppId, u32)]> for DataLookup { - type Error = TryFromError; - - fn try_from(extrinsics: &[(AppId, u32)]) -> Result { - let mut index = Vec::new(); - // transactions are order by application id - // skip transactions with 0 application id - it's not a data txs - let mut size = 0u32; - let mut prev_app_id = 0u32; - - for (app_id, data_len) in extrinsics { - if *app_id != 0 && prev_app_id != *app_id { - index.push((*app_id, size)); - } - - size = size - .checked_add(*data_len) - .ok_or(Self::Error::SizeOverflow)?; - ensure!(prev_app_id <= *app_id, Self::Error::UnsortedExtrinsics); - prev_app_id = *app_id; - } - - Ok(DataLookup { size, index }) - } -} - -#[cfg(feature = "std")] -impl MallocSizeOf for DataLookup { - fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize { - self.size.size_of(ops) + self.index.size_of(ops) - } -} - -#[cfg(test)] -mod test { - use super::*; - - fn from_extrinsics_data() -> Vec<(Vec<(AppId, u32)>, Result)> { - vec![ - ( - vec![(0, 5), (0, 10), (1, 5), (1, 10), (2, 100), (2, 50)], - Ok(DataLookup { - size: 180, - index: vec![(1, 15), (2, 30)], - }), - ), - ( - vec![(0, 5), (0, 10), (1, u32::MAX)], - Err(TryFromError::SizeOverflow), - ), - ( - vec![(0, 5), (0, 10), (1, 5), (2, 100), (1, 10), (2, 50)], - Err(TryFromError::UnsortedExtrinsics), - ), - ] - } - - #[test] - fn from_extrinsics() { - for (extrinsic, expected) in from_extrinsics_data() { - let data_lookup = DataLookup::try_from(extrinsic.as_slice()); - assert_eq!(data_lookup, expected); - } - } -} diff --git a/primitives/avail/src/asdr/get_app_id.rs b/primitives/avail/src/asdr/get_app_id.rs deleted file mode 100644 index b59f483c7..000000000 --- a/primitives/avail/src/asdr/get_app_id.rs +++ /dev/null @@ -1,32 +0,0 @@ -/// Get application Id trait -pub trait GetAppId { - fn app_id(&self) -> T { T::default() } -} - -impl> GetAppId for (A, B, C, D, E, F, G, H) { - fn app_id(&self) -> u32 { self.7.app_id() } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::asdr::AppId; - - struct CustomAppId {} - - impl GetAppId for CustomAppId { - fn app_id(&self) -> AppId { 7 } - } - - struct DefaultGetAppId {} - impl GetAppId for DefaultGetAppId {} - - #[test] - fn app_id_trait_on_tuples() { - let custom_app_id = (0, 1, 2, 3, 4, 5, 6, CustomAppId {}); - let default_app_id = (0, 1, 2, 3, 4, 5, 6, DefaultGetAppId {}); - - assert_eq!(custom_app_id.app_id(), 7); - assert_eq!(default_app_id.app_id(), u32::default()); - } -} diff --git a/primitives/avail/src/header.rs b/primitives/avail/src/header.rs deleted file mode 100644 index c454cb648..000000000 --- a/primitives/avail/src/header.rs +++ /dev/null @@ -1,438 +0,0 @@ -use codec::{Codec, Decode, Encode, EncodeAsRef, Error, HasCompact, Input, Output}; -#[cfg(feature = "std")] -use parity_util_mem::{MallocSizeOf, MallocSizeOfOps}; -use scale_info::TypeInfo; -#[cfg(feature = "std")] -use serde::{Deserialize, Serialize}; -use sp_core::{RuntimeDebug, H256, U256}; -use sp_runtime::{ - traits::{ - AtLeast32BitUnsigned, Hash as HashT, Header as HeaderT, MaybeDisplay, MaybeFromStr, - MaybeMallocSizeOf, MaybeSerialize, MaybeSerializeDeserialize, Member, SimpleBitOps, - }, - Digest, -}; -use sp_runtime_interface::pass_by::{Codec as PassByCodecImpl, PassBy}; -use sp_std::{convert::TryFrom, fmt::Debug, hash::Hash as StdHash}; - -use crate::{ - asdr::DataLookup, - traits::{ExtendedHeader, ExtrinsicsWithCommitment as _}, - KateCommitment, -}; - -pub trait HeaderNumberTrait: - Member - + AtLeast32BitUnsigned - + Codec - + MaybeSerializeDeserialize - + MaybeDisplay - + MaybeFromStr - + MaybeFromStr - + MaybeMallocSizeOf - + StdHash - + Copy - + Into - + TryFrom - + Debug - + Eq -{ -} - -impl< - T: Member - + AtLeast32BitUnsigned - + Codec - + MaybeSerializeDeserialize - + MaybeDisplay - + MaybeFromStr - + MaybeMallocSizeOf - + StdHash - + Copy - + Into - + TryFrom - + Debug - + Eq, - > HeaderNumberTrait for T -{ -} - -pub trait KateHashTrait: HashT {} -impl KateHashTrait for T {} - -pub trait KateHashOutputTrait: - MaybeDisplay + Decode + MaybeMallocSizeOf + SimpleBitOps + Ord -{ -} - -impl KateHashOutputTrait for T {} - -/// Abstraction over a block header for a substrate chain. -#[derive(PartialEq, Eq, Clone, RuntimeDebug, TypeInfo)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -#[cfg_attr(feature = "std", serde(deny_unknown_fields, rename_all = "camelCase"))] -pub struct Header { - /// The parent hash. - pub parent_hash: Hash::Output, - /// The block number. - #[cfg_attr(feature = "std", serde(with = "number_serde"))] - #[codec(compact)] - pub number: Number, - /// The state trie merkle root - pub state_root: Hash::Output, - /// Hash and Kate Commitment - pub extrinsics_root: KateCommitment, - /// A chain-specific digest of data useful for light clients or referencing auxiliary data. - pub digest: Digest, - /// Application specific data index. - pub app_data_lookup: DataLookup, -} - -impl Default for Header -where - N: HeaderNumberTrait, - H: KateHashTrait, - ::Output: From<[u8; 32]>, -{ - fn default() -> Self { - Self { - number: 1u32.into(), - extrinsics_root: Default::default(), - state_root: Default::default(), - parent_hash: Default::default(), - digest: Default::default(), - app_data_lookup: Default::default(), - } - } -} - -impl PassBy for Header -where - Number: HeaderNumberTrait, - Hash: KateHashTrait, -{ - type PassBy = PassByCodecImpl>; -} - -/// This module adds serialization support to `Header::number` field. -#[cfg(feature = "std")] -mod number_serde { - use serde::{Deserializer, Serializer}; - - use super::*; - - pub fn serialize(n: &N, serializer: S) -> Result - where - N: HeaderNumberTrait, - S: Serializer, - { - let u256: U256 = (*n).into(); - serde::Serialize::serialize(&u256, serializer) - } - - pub fn deserialize<'de, D, T>(d: D) -> Result - where - T: HeaderNumberTrait, - D: Deserializer<'de>, - { - let u256: U256 = serde::Deserialize::deserialize(d)?; - TryFrom::try_from(u256).map_err(|_| serde::de::Error::custom("Try from failed")) - } -} - -#[cfg(feature = "std")] -impl MallocSizeOf for Header -where - Number: HeaderNumberTrait, - Hash: KateHashTrait, - Hash::Output: KateHashOutputTrait, -{ - fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize { - self.parent_hash.size_of(ops) - + self.number.size_of(ops) - + self.state_root.size_of(ops) - + self.extrinsics_root.size_of(ops) - + self.digest.size_of(ops) - + self.app_data_lookup.size_of(ops) - } -} - -impl Decode for Header -where - Number: HeaderNumberTrait, - Hash: KateHashTrait, - Hash::Output: Decode, -{ - fn decode(input: &mut I) -> Result { - let parent_hash = Decode::decode(input)?; - let number = <::Type>::decode(input)?.into(); - let state_root = Decode::decode(input)?; - let extrinsics_root = Decode::decode(input)?; - let digest = Decode::decode(input)?; - let app_data_lookup = Decode::decode(input)?; - - Ok(Self { - parent_hash, - number, - state_root, - extrinsics_root, - digest, - app_data_lookup, - }) - } -} - -impl Encode for Header -where - Number: HeaderNumberTrait, - Hash: KateHashTrait, - Hash::Output: Encode, -{ - fn encode_to(&self, dest: &mut T) { - self.parent_hash.encode_to(dest); - <<::Type as EncodeAsRef<_>>::RefType>::from(&self.number) - .encode_to(dest); - self.state_root.encode_to(dest); - self.extrinsics_root.encode_to(dest); - self.digest.encode_to(dest); - self.app_data_lookup.encode_to(dest); - } -} - -impl codec::EncodeLike for Header -where - Number: HeaderNumberTrait, - Hash: KateHashTrait, - Hash::Output: Encode, -{ -} - -impl HeaderT for Header -where - Number: Member - + MaybeSerializeDeserialize - + Debug - + sp_std::hash::Hash - + MaybeDisplay - + AtLeast32BitUnsigned - + Codec - + Copy - + Into - + TryFrom - + sp_std::str::FromStr - + MaybeMallocSizeOf, - Hash: HashT, - Hash::Output: Default - + sp_std::hash::Hash - + Copy - + Member - + Ord - + MaybeSerialize - + Debug - + MaybeDisplay - + SimpleBitOps - + Codec - + MaybeMallocSizeOf, -{ - type Hash = ::Output; - type Hashing = Hash; - type Number = Number; - - fn number(&self) -> &Self::Number { &self.number } - - fn set_number(&mut self, num: Self::Number) { self.number = num } - - fn extrinsics_root(&self) -> &Self::Hash { self.extrinsics_root.hash() } - - fn set_extrinsics_root(&mut self, _root: Self::Hash) { todo!() } - - fn state_root(&self) -> &Self::Hash { &self.state_root } - - fn set_state_root(&mut self, root: Self::Hash) { self.state_root = root } - - fn parent_hash(&self) -> &Self::Hash { &self.parent_hash } - - fn set_parent_hash(&mut self, hash: Self::Hash) { self.parent_hash = hash } - - fn digest(&self) -> &Digest { &self.digest } - - fn digest_mut(&mut self) -> &mut Digest { - #[cfg(feature = "std")] - log::debug!(target: "header", "Retrieving mutable reference to digest"); - &mut self.digest - } - - fn new( - number: Self::Number, - extrinsics_root_hash: Self::Hash, - state_root: Self::Hash, - parent_hash: Self::Hash, - digest: Digest, - ) -> Self { - let extrinsics_root = extrinsics_root_hash.into(); - Self { - number, - parent_hash, - state_root, - digest, - extrinsics_root, - app_data_lookup: Default::default(), - } - } -} - -impl ExtendedHeader for Header -where - N: HeaderNumberTrait, - H: KateHashTrait, -{ - type Hash = ::Output; - type Number = N; - type Root = KateCommitment; - - fn extrinsics_root(&self) -> &Self::Root { &self.extrinsics_root } - - fn set_extrinsics_root(&mut self, root: Self::Root) { self.extrinsics_root = root; } - - fn data_root(&self) -> H256 { self.extrinsics_root.data_root.into() } - - fn set_data_root(&mut self, data_root: H256) { - self.extrinsics_root.data_root = data_root.into(); - } - - fn data_lookup(&self) -> &DataLookup { &self.app_data_lookup } - - /// Creates new header. - fn new( - number: Self::Number, - extrinsics_root: Self::Root, - state_root: Self::Hash, - parent_hash: Self::Hash, - digest: Digest, - app_data_lookup: DataLookup, - ) -> Self { - // TODO @miguel: Default app_data_lookup? - Self { - number, - extrinsics_root, - state_root, - parent_hash, - digest, - app_data_lookup, - } - } -} - -impl Header -where - Number: HeaderNumberTrait, - Hash: KateHashTrait, -{ - /// Convenience helper for computing the hash of the header without having - /// to import the trait. - pub fn hash(&self) -> Hash::Output { Hash::hash_of(self) } -} - -#[cfg(all(test, feature = "std"))] -mod tests { - use super::*; - - #[test] - fn should_serialize_numbers() { - fn serialize(num: u128) -> String { - let mut v = vec![]; - { - let mut ser = serde_json::Serializer::new(std::io::Cursor::new(&mut v)); - number_serde::serialize(&num, &mut ser).unwrap(); - } - String::from_utf8(v).unwrap() - } - - assert_eq!(serialize(0), "\"0x0\"".to_owned()); - assert_eq!(serialize(1), "\"0x1\"".to_owned()); - assert_eq!( - serialize(u64::max_value() as u128), - "\"0xffffffffffffffff\"".to_owned() - ); - assert_eq!( - serialize(u64::max_value() as u128 + 1), - "\"0x10000000000000000\"".to_owned() - ); - } - - #[test] - fn should_deserialize_number() { - fn deserialize(num: &str) -> u128 { - let mut der = serde_json::Deserializer::new(serde_json::de::StrRead::new(num)); - number_serde::deserialize(&mut der).unwrap() - } - - assert_eq!(deserialize("\"0x0\""), 0); - assert_eq!(deserialize("\"0x1\""), 1); - assert_eq!( - deserialize("\"0xffffffffffffffff\""), - u64::max_value() as u128 - ); - assert_eq!( - deserialize("\"0x10000000000000000\""), - u64::max_value() as u128 + 1 - ); - } - #[test] - fn ensure_format_is_unchanged() { - use sp_runtime::{ - generic::{Digest, DigestItem}, - traits::BlakeTwo256, - }; - - use crate::KateCommitment; - let extrinsic_root = KateCommitment { - hash: BlakeTwo256::hash(b"4"), - rows: 1, - cols: 4, - commitment: vec![ - 128, 233, 73, 235, 218, 245, 193, 62, 9, 100, 156, 88, 124, 107, 25, 5, 251, 119, - 11, 74, 104, 67, 171, 170, 198, 180, 19, 227, 167, 64, 93, 152, 37, 172, 118, 77, - 178, 52, 29, 185, 183, 150, 89, 101, 7, 62, 151, 89, 128, 233, 73, 235, 218, 245, - 193, 62, 9, 100, 156, 88, 124, 107, 25, 5, 251, 119, 11, 74, 104, 67, 171, 170, - 198, 180, 19, 227, 167, 64, 93, 152, 37, 172, 118, 77, 178, 52, 29, 185, 183, 150, - 89, 101, 7, 62, 151, 89, - ], - data_root: [ - 63, 191, 50, 39, 146, 108, 250, 63, 65, 103, 119, 30, 90, 217, 28, 250, 44, 45, - 112, 144, 102, 124, 224, 30, 145, 28, 169, 11, 79, 49, 91, 17, - ] - .into(), - }; - let data_lookup = DataLookup { - size: 1, - index: vec![], - }; - let header = Header:: { - parent_hash: BlakeTwo256::hash(b"1"), - number: 2, - state_root: BlakeTwo256::hash(b"3"), - extrinsics_root: extrinsic_root, - digest: Digest { - logs: vec![DigestItem::Other(b"5".to_vec())], - }, - app_data_lookup: data_lookup, - }; - let encoded = header.encode(); - assert_eq!(encoded, vec![ - 146, 205, 245, 120, 196, 112, 133, 165, 153, 34, 86, 240, 220, 249, 125, 11, 25, 241, - 241, 201, 222, 77, 95, 227, 12, 58, 206, 97, 145, 182, 229, 219, 8, 88, 19, 72, 51, - 123, 15, 62, 20, 134, 32, 23, 61, 170, 165, 249, 77, 0, 216, 129, 112, 93, 203, 240, - 170, 131, 239, 218, 186, 97, 210, 237, 225, 235, 134, 73, 33, 73, 151, 87, 78, 32, 196, - 100, 56, 138, 23, 36, 32, 210, 84, 3, 104, 43, 187, 184, 12, 73, 104, 49, 200, 204, 31, - 143, 13, 129, 1, 128, 233, 73, 235, 218, 245, 193, 62, 9, 100, 156, 88, 124, 107, 25, - 5, 251, 119, 11, 74, 104, 67, 171, 170, 198, 180, 19, 227, 167, 64, 93, 152, 37, 172, - 118, 77, 178, 52, 29, 185, 183, 150, 89, 101, 7, 62, 151, 89, 128, 233, 73, 235, 218, - 245, 193, 62, 9, 100, 156, 88, 124, 107, 25, 5, 251, 119, 11, 74, 104, 67, 171, 170, - 198, 180, 19, 227, 167, 64, 93, 152, 37, 172, 118, 77, 178, 52, 29, 185, 183, 150, 89, - 101, 7, 62, 151, 89, 1, 0, 4, 0, 63, 191, 50, 39, 146, 108, 250, 63, 65, 103, 119, 30, - 90, 217, 28, 250, 44, 45, 112, 144, 102, 124, 224, 30, 145, 28, 169, 11, 79, 49, 91, - 17, 4, 0, 4, 53, 1, 0, 0, 0, 0 - ],); - } -} diff --git a/primitives/avail/src/kate_commitment.rs b/primitives/avail/src/kate_commitment.rs deleted file mode 100644 index 89a78cce6..000000000 --- a/primitives/avail/src/kate_commitment.rs +++ /dev/null @@ -1,86 +0,0 @@ -use codec::{Codec, Decode, Encode}; -use scale_info::TypeInfo; -#[cfg(feature = "std")] -use serde::{Deserialize, Serialize}; -use sp_core::H256; -use sp_runtime::traits::Member; -use sp_std::vec::Vec; - -use crate::traits::ExtrinsicsWithCommitment; - -/// Customized extrinsics root to save the commitment. -#[derive(PartialEq, Eq, Clone, sp_core::RuntimeDebug, Default, Encode, Decode, TypeInfo)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -#[cfg_attr(feature = "std", serde(rename_all = "camelCase"))] -#[cfg_attr(feature = "std", serde(deny_unknown_fields))] -pub struct KateCommitment { - /// The merkle root of the extrinsics. - pub hash: HashOutput, - /// Plonk commitment. - pub commitment: Vec, - /// Rows - pub rows: u16, - /// Cols - pub cols: u16, - /// The merkle root of the data submitted - pub data_root: H256, -} - -/// Marker trait for types `T` that can be use as `Hash` in `ExtrinsicsRoot`. -pub trait KateExtrinsicHash: Member + Codec {} - -impl KateExtrinsicHash for T {} - -impl ExtrinsicsWithCommitment for KateCommitment { - type HashOutput = HashOutput; - - fn hash(&self) -> &Self::HashOutput { &self.hash } - - fn commitment(&self) -> &Vec { &self.commitment } - - fn data_root(&self) -> &H256 { &self.data_root } - - fn new(hash: HashOutput) -> Self { hash.into() } - - fn new_with_commitment( - hash: HashOutput, - commitment: Vec, - rows: u16, - cols: u16, - data_root: H256, - ) -> Self { - Self { - hash, - commitment, - rows, - cols, - data_root, - } - } -} - -impl From for KateCommitment { - fn from(hash: Hash) -> Self { - Self { - hash, - commitment: Default::default(), - rows: 0, - cols: 0, - data_root: Default::default(), - } - } -} - -#[cfg(feature = "std")] -impl parity_util_mem::MallocSizeOf for KateCommitment -where - HashOutput: parity_util_mem::MallocSizeOf, -{ - fn size_of(&self, ops: &mut parity_util_mem::MallocSizeOfOps) -> usize { - self.hash.size_of(ops) - + self.commitment.size_of(ops) - + self.rows.size_of(ops) - + self.cols.size_of(ops) - + self.data_root.size_of(ops) - } -} diff --git a/primitives/avail/src/lib.rs b/primitives/avail/src/lib.rs deleted file mode 100644 index 831aaee81..000000000 --- a/primitives/avail/src/lib.rs +++ /dev/null @@ -1,70 +0,0 @@ -#![cfg_attr(not(feature = "std"), no_std)] - -use sp_runtime::Perbill; - -/// Customized headers. -pub mod header; -pub use header::*; - -/// Kate Commitment on Headers. -pub mod kate_commitment; -pub use kate_commitment::*; - -/// Application Specific Data Retrieval -pub mod asdr; - -pub mod traits; - -pub mod well_known_keys { - /// Public params used to generate Kate commitment - pub const KATE_PUBLIC_PARAMS: &[u8] = b":kate_public_params:"; -} - -/// We allow `Normal` extrinsics to fill up the block up to 90%, the rest can be used -/// by Operational extrinsics. -pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(90); - -pub const BLOCK_CHUNK_SIZE: u32 = 32; - -/// Money matters. -pub mod currency { - - pub type Balance = u128; - - /// AVL has 18 decimal positions. - pub const AVL: Balance = 1_000_000_000_000_000_000; - - /// Cents of AVL has 16 decimal positions (100 Cents = $1) - /// 1 DOLLARS = 10_000_000_000_000_000 - pub const CENTS: Balance = AVL / 100; - - /// Millicent of AVL has 13 decimal positions( 100 mCents = 1 cent). - pub const MILLICENTS: Balance = CENTS / 1_000; -} - -#[repr(u8)] -pub enum InvalidTransactionCustomId { - /// The AppId is not registered. - InvalidAppId = 137, - /// Extrinsic is not allowed for the given `AppId`. - ForbiddenAppId, -} - -/// Provides an implementation of [`frame_support::traits::Randomness`] that should only be used in -/// on Benchmarks! -pub struct BenchRandomness(sp_std::marker::PhantomData); - -impl frame_support::traits::Randomness for BenchRandomness -where - Output: codec::Decode + Default, - T: Default, -{ - fn random(subject: &[u8]) -> (Output, T) { - use sp_runtime::traits::TrailingZeroInput; - - ( - Output::decode(&mut TrailingZeroInput::new(subject)).unwrap_or_default(), - T::default(), - ) - } -} diff --git a/primitives/avail/src/traits.rs b/primitives/avail/src/traits.rs deleted file mode 100644 index f03cce912..000000000 --- a/primitives/avail/src/traits.rs +++ /dev/null @@ -1,54 +0,0 @@ -use sp_core::H256; -use sp_runtime::Digest; -use sp_std::vec::Vec; - -use crate::asdr::DataLookup; - -pub trait ExtrinsicsWithCommitment { - type HashOutput; - - fn hash(&self) -> &Self::HashOutput; - fn commitment(&self) -> &Vec; - fn data_root(&self) -> &H256; - - fn new(hash: Self::HashOutput) -> Self; - - fn new_with_commitment( - hash: Self::HashOutput, - commitment: Vec, - rows: u16, - cols: u16, - data_root: H256, - ) -> Self; -} - -/// Extended header with : -/// - Extrinsics with commitments. -/// - Application data lookup. -pub trait ExtendedHeader { - /// Root Data. - type Root: ExtrinsicsWithCommitment; - - /// Header number. - type Number; - /// Header hash type - type Hash; - - fn extrinsics_root(&self) -> &Self::Root; - fn set_extrinsics_root(&mut self, root: Self::Root); - - fn data_root(&self) -> H256; - fn set_data_root(&mut self, root: H256); - - fn data_lookup(&self) -> &DataLookup; - - /// Creates new header. - fn new( - number: Self::Number, - extrinsics_root: Self::Root, - state_root: Self::Hash, - parent_hash: Self::Hash, - digest: Digest, - app_data_lookup: DataLookup, - ) -> Self; -} diff --git a/primitives/nomad/merkle/Cargo.toml b/primitives/nomad/merkle/Cargo.toml deleted file mode 100644 index 802543d58..000000000 --- a/primitives/nomad/merkle/Cargo.toml +++ /dev/null @@ -1,47 +0,0 @@ -[package] -name = "merkle" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -nomad-core = { path = "../nomad-core", default-features = false } - -# Substrate -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sp-std = { version = "4.0.0-dev", default-features = false } -sp-core = { version = "4.0.0-dev", default-features = false } -sp-io = { version = "4.0.0-dev", default-features = false } -sp-runtime = { version = "4.0.0-dev", default-features = false } -frame-support = { version = "4.0.0-dev", default-features = false } -parity-util-mem = { version = "0.10.2", default-features = false, features = ["primitive-types"] } -tiny-keccak = { version = "2.0.2", default-features = false, features = ["keccak"] } - -primitive-types = { version = "0.10.1", default-features = false, features = ["scale-info", "codec"] } -thiserror-no-std = "2.0.2" -static_assertions = "1.1.0" -hex-literal = "0.3.4" - -[dev-dependencies] -serde = { version = "1.0", features = ["derive"] } -serde_json = { version = "1.0" } -ethers-core = "0.13.0" - -[dependencies.serde] -version = "1.0" -default-features = false -optional = true -features = ["derive"] - -[features] -default = ["std"] -std = [ - "serde", - "nomad-core/std", - "primitive-types/serde", - "codec/std", - "scale-info/std", - "frame-support/std", -] diff --git a/primitives/nomad/merkle/fixtures/merkle.json b/primitives/nomad/merkle/fixtures/merkle.json deleted file mode 100644 index afb59f1dc..000000000 --- a/primitives/nomad/merkle/fixtures/merkle.json +++ /dev/null @@ -1,2029 +0,0 @@ -[ - { - "testName": "three leaves", - "expectedRoot": "0x18f2f1646fee335a1eaf5191a8ce58ea772080057d0fda687df59c45e47e6f68", - "leaves": [ - "one", - "two", - "three" - ], - "proofs": [ - { - "leaf": "0xf0fe7c99ef23ace1835385e83dd61c9ecb6192d6514fcc13356ef912788eaa8a", - "index": 0, - "path": [ - "0x65ad6b7c39c687dad3edc05bec09300b742363f5c1f42db586bdce40c9fc5eef", - "0xe9884debea0619a2ce25ba3bbe6a4438a42bc11b2308f62c65ed43be0b43d445", - "0xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30", - "0x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x65ad6b7c39c687dad3edc05bec09300b742363f5c1f42db586bdce40c9fc5eef", - "index": 1, - "path": [ - "0xf0fe7c99ef23ace1835385e83dd61c9ecb6192d6514fcc13356ef912788eaa8a", - "0xe9884debea0619a2ce25ba3bbe6a4438a42bc11b2308f62c65ed43be0b43d445", - "0xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30", - "0x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x769dbf057c1b1544b7b4a9a4f98893cad73080764ad63ee83344312494dc296e", - "index": 2, - "path": [ - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x606fc91d919e5a5b5b0ce2a1b2f6d33355b39558b5a12a4b14c3a381b18769a2", - "0xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30", - "0x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - } - ] - }, - { - "testName": "one leaf", - "expectedRoot": "0x54fea87823728b754368018753f79a24e5f5cacee26c8785f3d33aabfd03372e", - "leaves": [ - "one" - ], - "proofs": [ - { - "leaf": "0xf0fe7c99ef23ace1835385e83dd61c9ecb6192d6514fcc13356ef912788eaa8a", - "index": 0, - "path": [ - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5", - "0xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30", - "0x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - } - ] - }, - { - "testName": "no leaves", - "expectedRoot": "0x27ae5ba08d7291c96c8cbddcc148bf48a6d68c7974b94356f53754ef6171d757", - "leaves": [], - "proofs": [] - }, - { - "testName": "forty-two leaves", - "expectedRoot": "0x274d610098d8f109587e97c908cf549d129a14f5bad7eb10d36a427da97be6fc", - "leaves": [ - "bacon", - "eye", - "we", - "ghost", - "listen", - "corn", - "blonde", - "gutter", - "sanctuary", - "seat", - "generate", - "twist", - "waterfall", - "monster", - "elbow", - "flash", - "arrow", - "moment", - "cheat", - "unity", - "steak", - "shelter", - "camera", - "album", - "bread", - "tease", - "sentence", - "tribe", - "miserable", - "ridge", - "guerrilla", - "inhabitant", - "suspicion", - "mosque", - "printer", - "land", - "reliable", - "circle", - "first-hand", - "time", - "content", - "management" - ], - "proofs": [ - { - "leaf": "0xdedc5b0226dc6135af110369edd66b863f13c89043d4f68b914be1cefe27304e", - "index": 0, - "path": [ - "0x4f4fa1fc880f5f6622bd953386092771d488568327e40eaa09c403e1e4529eac", - "0x66677e36ec586995e5e91cc3bc3ff07208c03b59f3b4058dc56e608dcabe20c5", - "0xa19e6312073514ab346a7db383ab9ca167f1b9d0eb6dc76225eeb1cac766630f", - "0x0bf20de5643721f47c8833fd9f81ed5b4e38b051a8fc8017c1540bbb91b32638", - "0xe3e71a410d357ee0708b0764646554ec888e950e4440cf0f138d2279c647bf59", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x4f4fa1fc880f5f6622bd953386092771d488568327e40eaa09c403e1e4529eac", - "index": 1, - "path": [ - "0xdedc5b0226dc6135af110369edd66b863f13c89043d4f68b914be1cefe27304e", - "0x66677e36ec586995e5e91cc3bc3ff07208c03b59f3b4058dc56e608dcabe20c5", - "0xa19e6312073514ab346a7db383ab9ca167f1b9d0eb6dc76225eeb1cac766630f", - "0x0bf20de5643721f47c8833fd9f81ed5b4e38b051a8fc8017c1540bbb91b32638", - "0xe3e71a410d357ee0708b0764646554ec888e950e4440cf0f138d2279c647bf59", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x7003a5b06332d5f75cdf9474ccf863a7986f2eebf8fb54122011dfa4f5a0ec1f", - "index": 2, - "path": [ - "0xdb07d7a5fdaaf861f5ae3a145081c53fb6b111bffab064e201c3682b3f254fab", - "0xafe54c4a88d8b9e4707a28576e41d0be20418ab90b10654ebfd00aecd2bad592", - "0xa19e6312073514ab346a7db383ab9ca167f1b9d0eb6dc76225eeb1cac766630f", - "0x0bf20de5643721f47c8833fd9f81ed5b4e38b051a8fc8017c1540bbb91b32638", - "0xe3e71a410d357ee0708b0764646554ec888e950e4440cf0f138d2279c647bf59", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xdb07d7a5fdaaf861f5ae3a145081c53fb6b111bffab064e201c3682b3f254fab", - "index": 3, - "path": [ - "0x7003a5b06332d5f75cdf9474ccf863a7986f2eebf8fb54122011dfa4f5a0ec1f", - "0xafe54c4a88d8b9e4707a28576e41d0be20418ab90b10654ebfd00aecd2bad592", - "0xa19e6312073514ab346a7db383ab9ca167f1b9d0eb6dc76225eeb1cac766630f", - "0x0bf20de5643721f47c8833fd9f81ed5b4e38b051a8fc8017c1540bbb91b32638", - "0xe3e71a410d357ee0708b0764646554ec888e950e4440cf0f138d2279c647bf59", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xd9fa9b21a8500576003cc17f6f715898735b4affe6021bba300fd88b6665e70f", - "index": 4, - "path": [ - "0x745df104209724b953eadc3bdcdce16c87be927a33f6b61a1eabea980983111d", - "0x8e6af6a7c964ca809ed0fd77c7261eed5f23baf9bfe8c3aa98cb84b0a21c5190", - "0x97748c9f3b4fe02bfbca5b7752b04b6f77fc3f0753ad711b5cff568104d31a0c", - "0x0bf20de5643721f47c8833fd9f81ed5b4e38b051a8fc8017c1540bbb91b32638", - "0xe3e71a410d357ee0708b0764646554ec888e950e4440cf0f138d2279c647bf59", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x745df104209724b953eadc3bdcdce16c87be927a33f6b61a1eabea980983111d", - "index": 5, - "path": [ - "0xd9fa9b21a8500576003cc17f6f715898735b4affe6021bba300fd88b6665e70f", - "0x8e6af6a7c964ca809ed0fd77c7261eed5f23baf9bfe8c3aa98cb84b0a21c5190", - "0x97748c9f3b4fe02bfbca5b7752b04b6f77fc3f0753ad711b5cff568104d31a0c", - "0x0bf20de5643721f47c8833fd9f81ed5b4e38b051a8fc8017c1540bbb91b32638", - "0xe3e71a410d357ee0708b0764646554ec888e950e4440cf0f138d2279c647bf59", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x3c508ba7eb05bc907dc43e906bd5998745a94c400ba840e3a2252a1fe0493da2", - "index": 6, - "path": [ - "0x473776a7204dbaaab3e5689b20893261ab524105fe1b8f04e325e23ce33163d9", - "0xd985746e1f983a7d84824d0bc12f764fc0cfeec2850882a6dcb8b87e0049eee9", - "0x97748c9f3b4fe02bfbca5b7752b04b6f77fc3f0753ad711b5cff568104d31a0c", - "0x0bf20de5643721f47c8833fd9f81ed5b4e38b051a8fc8017c1540bbb91b32638", - "0xe3e71a410d357ee0708b0764646554ec888e950e4440cf0f138d2279c647bf59", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x473776a7204dbaaab3e5689b20893261ab524105fe1b8f04e325e23ce33163d9", - "index": 7, - "path": [ - "0x3c508ba7eb05bc907dc43e906bd5998745a94c400ba840e3a2252a1fe0493da2", - "0xd985746e1f983a7d84824d0bc12f764fc0cfeec2850882a6dcb8b87e0049eee9", - "0x97748c9f3b4fe02bfbca5b7752b04b6f77fc3f0753ad711b5cff568104d31a0c", - "0x0bf20de5643721f47c8833fd9f81ed5b4e38b051a8fc8017c1540bbb91b32638", - "0xe3e71a410d357ee0708b0764646554ec888e950e4440cf0f138d2279c647bf59", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xc3be211a46aaf5876c32021a85edeff36cce1c0e61a48bc93b3e71b9e2f55b17", - "index": 8, - "path": [ - "0xb281dd16a96ca77a323e291058930e46428f4931fb3aec25d07b1574584f731c", - "0xd4ae409d561eaa3eb0d4cd034a63bf37f4ac7b6d722ee496064a2bb70644ce44", - "0xc6e696f0f313b67ef05f0afa77826f5373e7fe6d769bd42b8c94ea27e640728b", - "0x6841d65094f6e26c290c0bf0d84270c7dbba56c9124126094daf5404650bb1b9", - "0xe3e71a410d357ee0708b0764646554ec888e950e4440cf0f138d2279c647bf59", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xb281dd16a96ca77a323e291058930e46428f4931fb3aec25d07b1574584f731c", - "index": 9, - "path": [ - "0xc3be211a46aaf5876c32021a85edeff36cce1c0e61a48bc93b3e71b9e2f55b17", - "0xd4ae409d561eaa3eb0d4cd034a63bf37f4ac7b6d722ee496064a2bb70644ce44", - "0xc6e696f0f313b67ef05f0afa77826f5373e7fe6d769bd42b8c94ea27e640728b", - "0x6841d65094f6e26c290c0bf0d84270c7dbba56c9124126094daf5404650bb1b9", - "0xe3e71a410d357ee0708b0764646554ec888e950e4440cf0f138d2279c647bf59", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xcae382a2f3f639f6e833ae37e4db2603b617e74827f8d819f9d64bad9d90b9b1", - "index": 10, - "path": [ - "0x38c0d391c04c3bdd439ef968d599c65976150a72b1655d7d6650cbe5844a2502", - "0xca9b27d05fc15b94d68498e756f213b5f75393f2a26c686c24aae75227e0dcc6", - "0xc6e696f0f313b67ef05f0afa77826f5373e7fe6d769bd42b8c94ea27e640728b", - "0x6841d65094f6e26c290c0bf0d84270c7dbba56c9124126094daf5404650bb1b9", - "0xe3e71a410d357ee0708b0764646554ec888e950e4440cf0f138d2279c647bf59", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x38c0d391c04c3bdd439ef968d599c65976150a72b1655d7d6650cbe5844a2502", - "index": 11, - "path": [ - "0xcae382a2f3f639f6e833ae37e4db2603b617e74827f8d819f9d64bad9d90b9b1", - "0xca9b27d05fc15b94d68498e756f213b5f75393f2a26c686c24aae75227e0dcc6", - "0xc6e696f0f313b67ef05f0afa77826f5373e7fe6d769bd42b8c94ea27e640728b", - "0x6841d65094f6e26c290c0bf0d84270c7dbba56c9124126094daf5404650bb1b9", - "0xe3e71a410d357ee0708b0764646554ec888e950e4440cf0f138d2279c647bf59", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x5573d8dcf04fd96cfe496f0bbe58ae4c97b431577261107ad0970cb802548e6b", - "index": 12, - "path": [ - "0x76c94951c7a0535e1759714f1cf568a6b17327c115b31b24cc90fae4fc69ea9c", - "0x0298e56ac1989266f4a3137545bd1a97511f40530e6fa4e21fa951b324bad2d1", - "0x9836a5d16bebd9d88a110dd88207f1ba4bd9fa919cb59d0bc0c27a3c91c3611f", - "0x6841d65094f6e26c290c0bf0d84270c7dbba56c9124126094daf5404650bb1b9", - "0xe3e71a410d357ee0708b0764646554ec888e950e4440cf0f138d2279c647bf59", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x76c94951c7a0535e1759714f1cf568a6b17327c115b31b24cc90fae4fc69ea9c", - "index": 13, - "path": [ - "0x5573d8dcf04fd96cfe496f0bbe58ae4c97b431577261107ad0970cb802548e6b", - "0x0298e56ac1989266f4a3137545bd1a97511f40530e6fa4e21fa951b324bad2d1", - "0x9836a5d16bebd9d88a110dd88207f1ba4bd9fa919cb59d0bc0c27a3c91c3611f", - "0x6841d65094f6e26c290c0bf0d84270c7dbba56c9124126094daf5404650bb1b9", - "0xe3e71a410d357ee0708b0764646554ec888e950e4440cf0f138d2279c647bf59", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xb840bbb177fc5ba12f4c6d4c9af5077105d6c933b507edfc7db36c8a192913e1", - "index": 14, - "path": [ - "0xf65ec5e6611c7426cac9f7798fe934545c9c6f861b6ec87e07502fc2a5c6a43b", - "0xacede158b8b16bcfd5d3fd4e0547d1a4d3906537b9e505f2f13c8bb50b35b576", - "0x9836a5d16bebd9d88a110dd88207f1ba4bd9fa919cb59d0bc0c27a3c91c3611f", - "0x6841d65094f6e26c290c0bf0d84270c7dbba56c9124126094daf5404650bb1b9", - "0xe3e71a410d357ee0708b0764646554ec888e950e4440cf0f138d2279c647bf59", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xf65ec5e6611c7426cac9f7798fe934545c9c6f861b6ec87e07502fc2a5c6a43b", - "index": 15, - "path": [ - "0xb840bbb177fc5ba12f4c6d4c9af5077105d6c933b507edfc7db36c8a192913e1", - "0xacede158b8b16bcfd5d3fd4e0547d1a4d3906537b9e505f2f13c8bb50b35b576", - "0x9836a5d16bebd9d88a110dd88207f1ba4bd9fa919cb59d0bc0c27a3c91c3611f", - "0x6841d65094f6e26c290c0bf0d84270c7dbba56c9124126094daf5404650bb1b9", - "0xe3e71a410d357ee0708b0764646554ec888e950e4440cf0f138d2279c647bf59", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xa14e758134deb96c68f1ea4190d27ac4f14cd77b4bb44dc1757c35cad91fd249", - "index": 16, - "path": [ - "0xe70096bebc510a5a3b07b77cbe0444576da2f1c580dc143b1ccdc399095952c9", - "0x1ca9d77bfa38c6054c5cf7995458e00612f28e18bd93d4892f513e654301a0ed", - "0x1b9795e811e59c10161ebc3a6e419fbc9d02621575bdbe66fc5840202f4caf07", - "0xa9746be9b9a03c397661e5f88a5ea0f3750eb25936f56da836758b720fa4cb48", - "0x6f197b0602b9d16dbb069ca4dcf94a825347a35061cb30a6e044790722a3d754", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xe70096bebc510a5a3b07b77cbe0444576da2f1c580dc143b1ccdc399095952c9", - "index": 17, - "path": [ - "0xa14e758134deb96c68f1ea4190d27ac4f14cd77b4bb44dc1757c35cad91fd249", - "0x1ca9d77bfa38c6054c5cf7995458e00612f28e18bd93d4892f513e654301a0ed", - "0x1b9795e811e59c10161ebc3a6e419fbc9d02621575bdbe66fc5840202f4caf07", - "0xa9746be9b9a03c397661e5f88a5ea0f3750eb25936f56da836758b720fa4cb48", - "0x6f197b0602b9d16dbb069ca4dcf94a825347a35061cb30a6e044790722a3d754", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x668e924309f236219283c0f16640d294edf013d7bb4953531ff7bef8780b03da", - "index": 18, - "path": [ - "0xf2a7d3c8fab1a3bc703b08b5ce78ab8ebfd2b38336d70b39d6c55e6d796bfc7f", - "0xd785b494114d63896c3ea806462858f7172f356e5f02b8131ad9020da38f2b34", - "0x1b9795e811e59c10161ebc3a6e419fbc9d02621575bdbe66fc5840202f4caf07", - "0xa9746be9b9a03c397661e5f88a5ea0f3750eb25936f56da836758b720fa4cb48", - "0x6f197b0602b9d16dbb069ca4dcf94a825347a35061cb30a6e044790722a3d754", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xf2a7d3c8fab1a3bc703b08b5ce78ab8ebfd2b38336d70b39d6c55e6d796bfc7f", - "index": 19, - "path": [ - "0x668e924309f236219283c0f16640d294edf013d7bb4953531ff7bef8780b03da", - "0xd785b494114d63896c3ea806462858f7172f356e5f02b8131ad9020da38f2b34", - "0x1b9795e811e59c10161ebc3a6e419fbc9d02621575bdbe66fc5840202f4caf07", - "0xa9746be9b9a03c397661e5f88a5ea0f3750eb25936f56da836758b720fa4cb48", - "0x6f197b0602b9d16dbb069ca4dcf94a825347a35061cb30a6e044790722a3d754", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xca69fd669b297fe4cc27bfb7229389d8465a82217c373bd1f6b604d23dc75541", - "index": 20, - "path": [ - "0x5715c8e3de41f125c3006466f6ef1a610467ed45d89ac848fab504adbb3e868a", - "0xf4f6e397b08163292b827532b1577aa0f843ef48b25aa1aa6e96a0ecbb3f0534", - "0xea830ec90e2b4c4eec5a704c2fbf196270fbb0149e9025c43151f499dceda93c", - "0xa9746be9b9a03c397661e5f88a5ea0f3750eb25936f56da836758b720fa4cb48", - "0x6f197b0602b9d16dbb069ca4dcf94a825347a35061cb30a6e044790722a3d754", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x5715c8e3de41f125c3006466f6ef1a610467ed45d89ac848fab504adbb3e868a", - "index": 21, - "path": [ - "0xca69fd669b297fe4cc27bfb7229389d8465a82217c373bd1f6b604d23dc75541", - "0xf4f6e397b08163292b827532b1577aa0f843ef48b25aa1aa6e96a0ecbb3f0534", - "0xea830ec90e2b4c4eec5a704c2fbf196270fbb0149e9025c43151f499dceda93c", - "0xa9746be9b9a03c397661e5f88a5ea0f3750eb25936f56da836758b720fa4cb48", - "0x6f197b0602b9d16dbb069ca4dcf94a825347a35061cb30a6e044790722a3d754", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x31d1564a1b6b8dd1c5cd4036878b85c58efbbd65230f4076cd72cea24a98f154", - "index": 22, - "path": [ - "0x30b25cba6ec910fe7a0b4b70fe89e7bf67d1315d8119575b2811dd18e7eb3de2", - "0x4bb1f84869a082ff32090743d10afdd86db162a5a9f3f57367070261aa83631c", - "0xea830ec90e2b4c4eec5a704c2fbf196270fbb0149e9025c43151f499dceda93c", - "0xa9746be9b9a03c397661e5f88a5ea0f3750eb25936f56da836758b720fa4cb48", - "0x6f197b0602b9d16dbb069ca4dcf94a825347a35061cb30a6e044790722a3d754", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x30b25cba6ec910fe7a0b4b70fe89e7bf67d1315d8119575b2811dd18e7eb3de2", - "index": 23, - "path": [ - "0x31d1564a1b6b8dd1c5cd4036878b85c58efbbd65230f4076cd72cea24a98f154", - "0x4bb1f84869a082ff32090743d10afdd86db162a5a9f3f57367070261aa83631c", - "0xea830ec90e2b4c4eec5a704c2fbf196270fbb0149e9025c43151f499dceda93c", - "0xa9746be9b9a03c397661e5f88a5ea0f3750eb25936f56da836758b720fa4cb48", - "0x6f197b0602b9d16dbb069ca4dcf94a825347a35061cb30a6e044790722a3d754", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x1621364c11a2ca32daef709e72728bc398c1c9fca44a613b478378d431d68718", - "index": 24, - "path": [ - "0xc1093dcc4522764deb9b3c739183dee9ad341f34659da169f67c5f5ffd78ca19", - "0xd3589bcbd40fc75989260def3c87d37f007ae533238fe81cac92eb809af55a3c", - "0x26b17a6513d3c3f33be0e7440da0fcfdaa33b6bb69cbd2019503dcd06378d240", - "0xd2c18eb014793f8344a112a2cbee465e788a9dc14ce89389b5d9c265ec6d416c", - "0x6f197b0602b9d16dbb069ca4dcf94a825347a35061cb30a6e044790722a3d754", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xc1093dcc4522764deb9b3c739183dee9ad341f34659da169f67c5f5ffd78ca19", - "index": 25, - "path": [ - "0x1621364c11a2ca32daef709e72728bc398c1c9fca44a613b478378d431d68718", - "0xd3589bcbd40fc75989260def3c87d37f007ae533238fe81cac92eb809af55a3c", - "0x26b17a6513d3c3f33be0e7440da0fcfdaa33b6bb69cbd2019503dcd06378d240", - "0xd2c18eb014793f8344a112a2cbee465e788a9dc14ce89389b5d9c265ec6d416c", - "0x6f197b0602b9d16dbb069ca4dcf94a825347a35061cb30a6e044790722a3d754", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xca0cb7165fa77f59914e8df8d8b18c9f600dc1b27d1e92d39c45d13d813853c5", - "index": 26, - "path": [ - "0xec77244f0cc53d209a29424d4ba057b2bcc00b8d98d60843df7a3ed255613386", - "0x49985b3dfc2df830e274f4644bf418fe4e3d8010d2dd94f91123463d50213d99", - "0x26b17a6513d3c3f33be0e7440da0fcfdaa33b6bb69cbd2019503dcd06378d240", - "0xd2c18eb014793f8344a112a2cbee465e788a9dc14ce89389b5d9c265ec6d416c", - "0x6f197b0602b9d16dbb069ca4dcf94a825347a35061cb30a6e044790722a3d754", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xec77244f0cc53d209a29424d4ba057b2bcc00b8d98d60843df7a3ed255613386", - "index": 27, - "path": [ - "0xca0cb7165fa77f59914e8df8d8b18c9f600dc1b27d1e92d39c45d13d813853c5", - "0x49985b3dfc2df830e274f4644bf418fe4e3d8010d2dd94f91123463d50213d99", - "0x26b17a6513d3c3f33be0e7440da0fcfdaa33b6bb69cbd2019503dcd06378d240", - "0xd2c18eb014793f8344a112a2cbee465e788a9dc14ce89389b5d9c265ec6d416c", - "0x6f197b0602b9d16dbb069ca4dcf94a825347a35061cb30a6e044790722a3d754", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xc027e6fda36b1fe17d72fb8463da7835931991aa0a687d09383358188dc94aaa", - "index": 28, - "path": [ - "0x1e308c515825785648d1f880fb1153b70efc0c7041c4e4c1e92dd4e92f4d45ea", - "0x6b6d1518efc8be5b8601c7f27027ef9e0be813ee6db267d9cf7d0b0dd1899688", - "0xb8ccc25b33d396a0c5708f0cb13181d2618a6cc95dc538ef7cae850eaaea10ea", - "0xd2c18eb014793f8344a112a2cbee465e788a9dc14ce89389b5d9c265ec6d416c", - "0x6f197b0602b9d16dbb069ca4dcf94a825347a35061cb30a6e044790722a3d754", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x1e308c515825785648d1f880fb1153b70efc0c7041c4e4c1e92dd4e92f4d45ea", - "index": 29, - "path": [ - "0xc027e6fda36b1fe17d72fb8463da7835931991aa0a687d09383358188dc94aaa", - "0x6b6d1518efc8be5b8601c7f27027ef9e0be813ee6db267d9cf7d0b0dd1899688", - "0xb8ccc25b33d396a0c5708f0cb13181d2618a6cc95dc538ef7cae850eaaea10ea", - "0xd2c18eb014793f8344a112a2cbee465e788a9dc14ce89389b5d9c265ec6d416c", - "0x6f197b0602b9d16dbb069ca4dcf94a825347a35061cb30a6e044790722a3d754", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x75090a35989bed9e15c77acafd73ea8b6dd56cccf75160f79e80545c7d6fe9a1", - "index": 30, - "path": [ - "0x10546cdf15b1dbc40610fd6634d4e20e160d32aa2b499180e2531f9e4dff5f2b", - "0xf723df57b49cec812e5c7fbea7834a70982305eb81a407fb830a5189c50f3f3d", - "0xb8ccc25b33d396a0c5708f0cb13181d2618a6cc95dc538ef7cae850eaaea10ea", - "0xd2c18eb014793f8344a112a2cbee465e788a9dc14ce89389b5d9c265ec6d416c", - "0x6f197b0602b9d16dbb069ca4dcf94a825347a35061cb30a6e044790722a3d754", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x10546cdf15b1dbc40610fd6634d4e20e160d32aa2b499180e2531f9e4dff5f2b", - "index": 31, - "path": [ - "0x75090a35989bed9e15c77acafd73ea8b6dd56cccf75160f79e80545c7d6fe9a1", - "0xf723df57b49cec812e5c7fbea7834a70982305eb81a407fb830a5189c50f3f3d", - "0xb8ccc25b33d396a0c5708f0cb13181d2618a6cc95dc538ef7cae850eaaea10ea", - "0xd2c18eb014793f8344a112a2cbee465e788a9dc14ce89389b5d9c265ec6d416c", - "0x6f197b0602b9d16dbb069ca4dcf94a825347a35061cb30a6e044790722a3d754", - "0xc9baf9cda8eaf9b9a3b456dd0e6108cf9ccf2e4a150493365a62da49fee0426d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x15a0acea87ff0a9f0a28637acefa1caba9fdb66598701d6ea0666045549cb62f", - "index": 32, - "path": [ - "0x62cef892da1c8a3b6b222a5fc54a7e15588f500a5c39c15da38bb5192e1869af", - "0xe29484e6612551bf20faad9fba9d3687a1a0b59bc37313643b3d55ee187a74e6", - "0x5e623385224fae9d4efff4b86a3193c0b823e39a472614689fcc54b173d1e498", - "0xfd53f69e35c997752fbf656b13f1cf48911a7d219d29bedd55b2687025ffacbf", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0xb6f125e6b2977262366343bbabcbbc6a9284533e85f4caa7140e22f2bd5ab139", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x62cef892da1c8a3b6b222a5fc54a7e15588f500a5c39c15da38bb5192e1869af", - "index": 33, - "path": [ - "0x15a0acea87ff0a9f0a28637acefa1caba9fdb66598701d6ea0666045549cb62f", - "0xe29484e6612551bf20faad9fba9d3687a1a0b59bc37313643b3d55ee187a74e6", - "0x5e623385224fae9d4efff4b86a3193c0b823e39a472614689fcc54b173d1e498", - "0xfd53f69e35c997752fbf656b13f1cf48911a7d219d29bedd55b2687025ffacbf", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0xb6f125e6b2977262366343bbabcbbc6a9284533e85f4caa7140e22f2bd5ab139", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xd8e15a4aa45e47de08dc0d5a1b88a4567c8bb793de2b6309a924b34f21594400", - "index": 34, - "path": [ - "0x880f289aab63ef908117bb8f9b70156cc0a9bb4e527e504fd6a479aca7c03739", - "0x4812b6b9890e0c2d80fd365ac38a0bfd30c9ba5ab8b28396fa7295c5f7f9cc09", - "0x5e623385224fae9d4efff4b86a3193c0b823e39a472614689fcc54b173d1e498", - "0xfd53f69e35c997752fbf656b13f1cf48911a7d219d29bedd55b2687025ffacbf", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0xb6f125e6b2977262366343bbabcbbc6a9284533e85f4caa7140e22f2bd5ab139", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x880f289aab63ef908117bb8f9b70156cc0a9bb4e527e504fd6a479aca7c03739", - "index": 35, - "path": [ - "0xd8e15a4aa45e47de08dc0d5a1b88a4567c8bb793de2b6309a924b34f21594400", - "0x4812b6b9890e0c2d80fd365ac38a0bfd30c9ba5ab8b28396fa7295c5f7f9cc09", - "0x5e623385224fae9d4efff4b86a3193c0b823e39a472614689fcc54b173d1e498", - "0xfd53f69e35c997752fbf656b13f1cf48911a7d219d29bedd55b2687025ffacbf", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0xb6f125e6b2977262366343bbabcbbc6a9284533e85f4caa7140e22f2bd5ab139", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xaec1732926c6969efbb2e0bf2d6fc80bfe78e5f1dc1533b800acbd293a339f71", - "index": 36, - "path": [ - "0xdbbce7f4ed1905678a14232500d05429280e9e3902815e6a595a45643129c09b", - "0xcb28c96b9b0f8b8bde8916aa45bebf368883a3fb4f6638710cc3f61d8b1e185b", - "0x4226792eeb5d994cb82a53b3017f502a70efc87f12ce215824b5826be31ef7f1", - "0xfd53f69e35c997752fbf656b13f1cf48911a7d219d29bedd55b2687025ffacbf", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0xb6f125e6b2977262366343bbabcbbc6a9284533e85f4caa7140e22f2bd5ab139", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xdbbce7f4ed1905678a14232500d05429280e9e3902815e6a595a45643129c09b", - "index": 37, - "path": [ - "0xaec1732926c6969efbb2e0bf2d6fc80bfe78e5f1dc1533b800acbd293a339f71", - "0xcb28c96b9b0f8b8bde8916aa45bebf368883a3fb4f6638710cc3f61d8b1e185b", - "0x4226792eeb5d994cb82a53b3017f502a70efc87f12ce215824b5826be31ef7f1", - "0xfd53f69e35c997752fbf656b13f1cf48911a7d219d29bedd55b2687025ffacbf", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0xb6f125e6b2977262366343bbabcbbc6a9284533e85f4caa7140e22f2bd5ab139", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x9b11dd7ebcfce9fb6e57c39abe4657abc4ac1f894ffb231acc1d4b141324852c", - "index": 38, - "path": [ - "0xe536cf6c7b89b6d158f7081b541cd33369510425a367643eb90e091e6b6e430d", - "0x8f4bcde10bb01adc55bd8f857c43c14fa5576a8720f5bf5ff517f9b05d9a7580", - "0x4226792eeb5d994cb82a53b3017f502a70efc87f12ce215824b5826be31ef7f1", - "0xfd53f69e35c997752fbf656b13f1cf48911a7d219d29bedd55b2687025ffacbf", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0xb6f125e6b2977262366343bbabcbbc6a9284533e85f4caa7140e22f2bd5ab139", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xe536cf6c7b89b6d158f7081b541cd33369510425a367643eb90e091e6b6e430d", - "index": 39, - "path": [ - "0x9b11dd7ebcfce9fb6e57c39abe4657abc4ac1f894ffb231acc1d4b141324852c", - "0x8f4bcde10bb01adc55bd8f857c43c14fa5576a8720f5bf5ff517f9b05d9a7580", - "0x4226792eeb5d994cb82a53b3017f502a70efc87f12ce215824b5826be31ef7f1", - "0xfd53f69e35c997752fbf656b13f1cf48911a7d219d29bedd55b2687025ffacbf", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0xb6f125e6b2977262366343bbabcbbc6a9284533e85f4caa7140e22f2bd5ab139", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x0f4018446a76e502f3ebed4e1a68dbe7c802d148ee512dee783de380c317d0d8", - "index": 40, - "path": [ - "0x28346050f1a67ddd3f6f2f7bc5e25fd013f5c8862214a82223fb1dd5715900e4", - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5", - "0xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30", - "0x321207516f2beb911791d1a42a49dbf554f4aa7b7472562545d39e2b959be65d", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0xb6f125e6b2977262366343bbabcbbc6a9284533e85f4caa7140e22f2bd5ab139", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x28346050f1a67ddd3f6f2f7bc5e25fd013f5c8862214a82223fb1dd5715900e4", - "index": 41, - "path": [ - "0x0f4018446a76e502f3ebed4e1a68dbe7c802d148ee512dee783de380c317d0d8", - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5", - "0xb4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30", - "0x321207516f2beb911791d1a42a49dbf554f4aa7b7472562545d39e2b959be65d", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0xb6f125e6b2977262366343bbabcbbc6a9284533e85f4caa7140e22f2bd5ab139", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - } - ] - }, - { - "testName": "containing empty leaf", - "expectedRoot": "0x1841827275d59b7515da81fb121637567b70ebd8b38ec5aadb51f4300976cba1", - "leaves": [ - "anna", - "james", - "", - "luke", - "erin" - ], - "proofs": [ - { - "leaf": "0x8bffab2351d4f65868fcdbb6d31e19d67f61d10c49b1bcc90d60fed54d9ec259", - "index": 0, - "path": [ - "0xe1e277208109c76f11aadfd43d8945f7c78a32da28df09687378435425c7a636", - "0x1fb86381cdfbd54d7ceee326730da96d69acf815c35b6ab3b2cf8c2a5f3f74a4", - "0xf9735da6e2c0e7f08a672602e23a4b3d899b12756e9e6ea171f19fa8f93ec4d7", - "0x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0xe1e277208109c76f11aadfd43d8945f7c78a32da28df09687378435425c7a636", - "index": 1, - "path": [ - "0x8bffab2351d4f65868fcdbb6d31e19d67f61d10c49b1bcc90d60fed54d9ec259", - "0x1fb86381cdfbd54d7ceee326730da96d69acf815c35b6ab3b2cf8c2a5f3f74a4", - "0xf9735da6e2c0e7f08a672602e23a4b3d899b12756e9e6ea171f19fa8f93ec4d7", - "0x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x5f35dce98ba4fba25530a026ed80b2cecdaa31091ba4958b99b52ea1d068adad", - "index": 2, - "path": [ - "0x15881b991602c46d60dc4e4b7cb3c7d6df9fa9cfc6d93a749ac9428a8ad9f0d7", - "0x15baffb1b0f3a33541686a8c657aa2b592994a26c053479b3aedfdd303473675", - "0xf9735da6e2c0e7f08a672602e23a4b3d899b12756e9e6ea171f19fa8f93ec4d7", - "0x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x15881b991602c46d60dc4e4b7cb3c7d6df9fa9cfc6d93a749ac9428a8ad9f0d7", - "index": 3, - "path": [ - "0x5f35dce98ba4fba25530a026ed80b2cecdaa31091ba4958b99b52ea1d068adad", - "0x15baffb1b0f3a33541686a8c657aa2b592994a26c053479b3aedfdd303473675", - "0xf9735da6e2c0e7f08a672602e23a4b3d899b12756e9e6ea171f19fa8f93ec4d7", - "0x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - }, - { - "leaf": "0x8b6e037544bd6f5b933519214ac01249d909a992255c93dd2fad4ca2fe7d84fa", - "index": 4, - "path": [ - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0xad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5", - "0x8c1f4f82a62770b5cd35ea9d7dd4fcdea20e427b80be264b1f54d63464fbf74b", - "0x21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85", - "0xe58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344", - "0x0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d", - "0x887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968", - "0xffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83", - "0x9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af", - "0xcefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0", - "0xf9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5", - "0xf8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892", - "0x3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c", - "0xc1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb", - "0x5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc", - "0xda7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2", - "0x2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f", - "0xe1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a", - "0x5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0", - "0xb46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0", - "0xc65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2", - "0xf4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9", - "0x5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377", - "0x4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652", - "0xcdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef", - "0x0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d", - "0xb8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0", - "0x838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e", - "0x662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e", - "0x388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322", - "0x93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735", - "0x8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - ] - } - ] - } -] diff --git a/primitives/nomad/merkle/src/error.rs b/primitives/nomad/merkle/src/error.rs deleted file mode 100644 index acd3141c4..000000000 --- a/primitives/nomad/merkle/src/error.rs +++ /dev/null @@ -1,35 +0,0 @@ -use sp_core::H256; - -/// Tree Errors -#[derive(Debug, thiserror_no_std::Error, Clone, Copy)] -pub enum VerifyingError { - /// Failed proof verification - #[error("Proof verification failed. Root is {expected}, produced is {actual}")] - #[allow(dead_code)] - VerificationFailed { - /// The expected root (this tree's current root) - expected: H256, - /// The root produced by branch evaluation - actual: H256, - }, -} - -/// Error type for merkle tree ops. -#[derive(Debug, PartialEq, Clone, Copy, thiserror_no_std::Error)] -pub enum TreeError { - /// Trying to push in a leaf - #[error("Trying to push in a leaf")] - LeafReached, - /// No more space in the MerkleTree - #[error("No more space in the MerkleTree")] - MerkleTreeFull, - /// MerkleTree is invalid - #[error("MerkleTree is invalid")] - Invalid, - /// Incorrect Depth provided - #[error("Incorrect Depth provided")] - DepthTooSmall, - /// Depth provided too large - #[error("Provided tree depth exceeded 32")] - DepthTooLarge, -} diff --git a/primitives/nomad/merkle/src/lib.rs b/primitives/nomad/merkle/src/lib.rs deleted file mode 100644 index a9237eadc..000000000 --- a/primitives/nomad/merkle/src/lib.rs +++ /dev/null @@ -1,195 +0,0 @@ -#![cfg_attr(not(feature = "std"), no_std)] -#![warn(missing_debug_implementations)] -#![warn(missing_copy_implementations)] - -extern crate alloc; - -/// Hashing utils -pub mod utils; - -/// Common error types for the merkle trees. -pub mod error; - -/// A lightweight incremental merkle, suitable for running on-chain. Stores O -/// (1) data -pub mod light; -/// Merkle Proof struct -pub mod proof; - -/// Test utils -#[cfg(test)] -pub(crate) mod test_utils; - -use frame_support::ensure; -use sp_core::H256; - -/// Tree depth -pub const TREE_DEPTH: usize = 32; -/// An incremental Nomad protocol standard-depth tree -pub type NomadLightMerkle = light::LightMerkle; -/// A Nomad protocol standard-depth proof -pub type NomadProof = proof::Proof; - -pub use error::{TreeError, VerifyingError, VerifyingError::VerificationFailed}; -use hex_literal::hex; -pub use light::*; -pub use proof::*; -pub use utils::*; - -/// A cache of the zero hashes for each layer of the tree. -/// See `zero_hashes_pre_build()` test to check how it is calculated. -pub const ZERO_HASHES: [H256; TREE_DEPTH + 1] = [ - H256::zero(), - H256(hex!( - "ad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb5" - )), - H256(hex!( - "b4c11951957c6f8f642c4af61cd6b24640fec6dc7fc607ee8206a99e92410d30" - )), - H256(hex!( - "21ddb9a356815c3fac1026b6dec5df3124afbadb485c9ba5a3e3398a04b7ba85" - )), - H256(hex!( - "e58769b32a1beaf1ea27375a44095a0d1fb664ce2dd358e7fcbfb78c26a19344" - )), - H256(hex!( - "0eb01ebfc9ed27500cd4dfc979272d1f0913cc9f66540d7e8005811109e1cf2d" - )), - H256(hex!( - "887c22bd8750d34016ac3c66b5ff102dacdd73f6b014e710b51e8022af9a1968" - )), - H256(hex!( - "ffd70157e48063fc33c97a050f7f640233bf646cc98d9524c6b92bcf3ab56f83" - )), - H256(hex!( - "9867cc5f7f196b93bae1e27e6320742445d290f2263827498b54fec539f756af" - )), - H256(hex!( - "cefad4e508c098b9a7e1d8feb19955fb02ba9675585078710969d3440f5054e0" - )), - H256(hex!( - "f9dc3e7fe016e050eff260334f18a5d4fe391d82092319f5964f2e2eb7c1c3a5" - )), - H256(hex!( - "f8b13a49e282f609c317a833fb8d976d11517c571d1221a265d25af778ecf892" - )), - H256(hex!( - "3490c6ceeb450aecdc82e28293031d10c7d73bf85e57bf041a97360aa2c5d99c" - )), - H256(hex!( - "c1df82d9c4b87413eae2ef048f94b4d3554cea73d92b0f7af96e0271c691e2bb" - )), - H256(hex!( - "5c67add7c6caf302256adedf7ab114da0acfe870d449a3a489f781d659e8becc" - )), - H256(hex!( - "da7bce9f4e8618b6bd2f4132ce798cdc7a60e7e1460a7299e3c6342a579626d2" - )), - H256(hex!( - "2733e50f526ec2fa19a22b31e8ed50f23cd1fdf94c9154ed3a7609a2f1ff981f" - )), - H256(hex!( - "e1d3b5c807b281e4683cc6d6315cf95b9ade8641defcb32372f1c126e398ef7a" - )), - H256(hex!( - "5a2dce0a8a7f68bb74560f8f71837c2c2ebbcbf7fffb42ae1896f13f7c7479a0" - )), - H256(hex!( - "b46a28b6f55540f89444f63de0378e3d121be09e06cc9ded1c20e65876d36aa0" - )), - H256(hex!( - "c65e9645644786b620e2dd2ad648ddfcbf4a7e5b1a3a4ecfe7f64667a3f0b7e2" - )), - H256(hex!( - "f4418588ed35a2458cffeb39b93d26f18d2ab13bdce6aee58e7b99359ec2dfd9" - )), - H256(hex!( - "5a9c16dc00d6ef18b7933a6f8dc65ccb55667138776f7dea101070dc8796e377" - )), - H256(hex!( - "4df84f40ae0c8229d0d6069e5c8f39a7c299677a09d367fc7b05e3bc380ee652" - )), - H256(hex!( - "cdc72595f74c7b1043d0e1ffbab734648c838dfb0527d971b602bc216c9619ef" - )), - H256(hex!( - "0abf5ac974a1ed57f4050aa510dd9c74f508277b39d7973bb2dfccc5eeb0618d" - )), - H256(hex!( - "b8cd74046ff337f0a7bf2c8e03e10f642c1886798d71806ab1e888d9e5ee87d0" - )), - H256(hex!( - "838c5655cb21c6cb83313b5a631175dff4963772cce9108188b34ac87c81c41e" - )), - H256(hex!( - "662ee4dd2dd7b2bc707961b1e646c4047669dcb6584f0d8d770daf5d7e7deb2e" - )), - H256(hex!( - "388ab20e2573d171a88108e79d820e98f26c0b84aa8b2f4aa4968dbb818ea322" - )), - H256(hex!( - "93237c50ba75ee485f4c22adf2f741400bdf8d6a9cc7df7ecae576221665d735" - )), - H256(hex!( - "8448818bb4ae4562849e949e17ac16e0be16688e156b5cf15e098c627c0056a9" - )), - H256(hex!( - "27ae5ba08d7291c96c8cbddcc148bf48a6d68c7974b94356f53754ef6171d757" - )), -]; - -/// A merkle proof -pub trait MerkleProof { - /// Calculate the merkle root of this proof's branch - fn root(&self) -> H256; -} - -/// A simple trait for merkle-based accumulators -pub trait Merkle: core::fmt::Debug + Default { - /// A proof of some leaf in this tree - type Proof: MerkleProof; - - /// The maximum number of elements the tree can ingest - fn max_elements() -> u32; - - /// The number of elements currently in the tree - fn count(&self) -> u32; - - /// Calculate the root hash of this Merkle tree. - fn root(&self) -> H256; - - /// Get the tree's depth. - fn depth(&self) -> usize; - - /// Push a leaf to the tree - fn ingest(&mut self, element: H256) -> Result; - - /// Verify a proof against this tree's root. - fn verify(&self, proof: &Self::Proof) -> Result<(), VerifyingError> { - let actual = proof.root(); - let expected = self.root(); - ensure!(expected == actual, VerificationFailed { expected, actual }); - - Ok(()) - } -} - -#[cfg(test)] -mod tests { - use nomad_core::keccak256_concat; - use sp_core::H256; - - use super::{TREE_DEPTH, ZERO_HASHES}; - - /// Ensures that `ZERO_HASHES` pre-build image is valid. - #[test] - fn zero_hashes_pre_build() { - // Build image. - let mut hashes = [H256::zero(); TREE_DEPTH + 1]; - for i in 0..TREE_DEPTH { - hashes[i + 1] = keccak256_concat!(hashes[i], hashes[i]); - } - - assert_eq!(hashes, ZERO_HASHES); - } -} diff --git a/primitives/nomad/merkle/src/light.rs b/primitives/nomad/merkle/src/light.rs deleted file mode 100644 index ac635a7ca..000000000 --- a/primitives/nomad/merkle/src/light.rs +++ /dev/null @@ -1,228 +0,0 @@ -use codec::{Decode, Encode, MaxEncodedLen}; -use frame_support::ensure; -use nomad_core::keccak256_concat; -use scale_info::TypeInfo; -#[cfg(feature = "std")] -use serde::{Deserialize, Serialize}; -use sp_core::{RuntimeDebug, H256}; - -use super::{error::TreeError, Merkle, MerkleProof, Proof, TREE_DEPTH, ZERO_HASHES}; - -/// Const assertions at `LightMerkle` struct. -struct AssertLightMerkleN; -impl AssertLightMerkleN { - /// `N` must be less or equal to `TREE_DEPTH`. - pub const N_LESS_EQ_TREE_DEPTH: usize = TREE_DEPTH - N; -} - -/// Verify at compilation time that `N <= TREE_DEPTH` -#[inline] -#[allow(path_statements)] -const fn const_assert_n_is_valid() { - AssertLightMerkleN::::N_LESS_EQ_TREE_DEPTH; -} - -/// An incremental merkle tree, modeled on the eth2 deposit contract -#[derive(Clone, Copy, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub struct LightMerkle { - #[cfg_attr(feature = "std", serde(with = "arrays"))] - branch: [H256; N], - count: u32, // TODO: is this reasonable over usize due to scale limitations -} - -impl Default for LightMerkle { - fn default() -> Self { - const_assert_n_is_valid::(); - let mut branch: [H256; N] = [Default::default(); N]; - branch - .iter_mut() - .enumerate() - .for_each(|(i, elem)| *elem = ZERO_HASHES[i]); - Self { branch, count: 0 } - } -} - -impl Merkle for LightMerkle { - type Proof = Proof; - - /// Return the maximum number of leaves in this tree - fn max_elements() -> u32 { - const_assert_n_is_valid::(); - 2u32.saturating_pow(N as u32) - } - - fn count(&self) -> u32 { self.count } - - fn root(&self) -> H256 { - let mut node: H256 = Default::default(); - let mut size = self.count; - - self.branch.iter().enumerate().for_each(|(i, elem)| { - let (left, right) = if (size & 1) == 1 { - (elem.as_bytes(), node.as_bytes()) - } else { - (node.as_bytes(), ZERO_HASHES[i].as_bytes()) - }; - node = keccak256_concat!(left, right); - size /= 2; - }); - - node - } - - fn depth(&self) -> usize { N } - - fn ingest(&mut self, element: H256) -> Result { - ensure!(Self::max_elements() > self.count, TreeError::MerkleTreeFull); - - let mut node = element; - - self.count += 1; - let mut size = self.count; - for i in 0..TREE_DEPTH { - if (size & 1) == 1 { - self.branch[i] = node; - return Ok(self.root()); - } - node = keccak256_concat!(self.branch[i].as_bytes(), node.as_bytes()); - size /= 2; - } - - Err(TreeError::Invalid) - } -} - -impl LightMerkle { - /// Instantiate a new tree with a known depth and a starting leaf-set - pub fn from_leaves(leaves: &[H256]) -> Result { - let mut tree = Self::default(); - - for leaf in leaves.iter() { - tree.ingest(*leaf).map_err(|_| TreeError::MerkleTreeFull)?; - } - - Ok(tree) - } - - /// Calculate the initital root of a tree of this depth - pub fn initial_root() -> H256 { LightMerkle::::default().root() } - - /// Get the leading-edge branch. - pub fn branch(&self) -> &[H256; N] { &self.branch } - - /// Verify a incremental merkle proof of inclusion - pub fn verify(&self, proof: &Proof) -> bool { proof.root() == self.root() } -} - -#[cfg(feature = "std")] -mod arrays { - use std::{convert::TryInto, marker::PhantomData}; - - use serde::{ - de::{SeqAccess, Visitor}, - ser::SerializeTuple, - Deserialize, Deserializer, Serialize, Serializer, - }; - pub fn serialize( - data: &[T; N], - ser: S, - ) -> Result { - let mut s = ser.serialize_tuple(N)?; - for item in data { - s.serialize_element(item)?; - } - s.end() - } - struct ArrayVisitor(PhantomData); - impl<'de, T, const N: usize> Visitor<'de> for ArrayVisitor - where - T: Deserialize<'de>, - { - type Value = [T; N]; - - fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result { - formatter.write_str(&format!("an array of length {}", N)) - } - - #[inline] - fn visit_seq(self, mut seq: A) -> Result - where - A: SeqAccess<'de>, - { - // can be optimized using MaybeUninit - let mut data = Vec::with_capacity(N); - for _ in 0..N { - match (seq.next_element())? { - Some(val) => data.push(val), - None => return Err(serde::de::Error::invalid_length(N, &self)), - } - } - data.try_into() - .map_err(|_| serde::de::Error::custom("Failed to convert sized Vec into [T; N]")) - } - } - pub fn deserialize<'de, D, T, const N: usize>(deserializer: D) -> Result<[T; N], D::Error> - where - D: Deserializer<'de>, - T: Deserialize<'de>, - { - deserializer.deserialize_tuple(N, ArrayVisitor::(PhantomData)) - } -} - -#[cfg(test)] -mod test { - use ethers_core::utils::hash_message; - - use super::*; - use crate::{test_utils, NomadLightMerkle}; - - #[test] - fn it_calculates_the_initial_root() { - assert_eq!( - NomadLightMerkle::initial_root(), - "0x27ae5ba08d7291c96c8cbddcc148bf48a6d68c7974b94356f53754ef6171d757" - .parse() - .unwrap() - ); - } - - #[test] - fn it_computes_branch_roots() { - let test_cases = test_utils::load_merkle_test_json(); - for test_case in test_cases.iter() { - let mut tree = NomadLightMerkle::default(); - // insert the leaves - for leaf in test_case.leaves.iter() { - // TODO: ethers core and crate have different primitive types - // versions. Must get inner bytes and call into(). - let hashed_leaf = hash_message(leaf).0.into(); - tree.ingest(hashed_leaf).expect("!ingest"); - } - // assert the tree has the proper leaf count - assert_eq!(tree.count() as usize, test_case.leaves.len()); - // assert the tree generates the proper root - let root = tree.root(); // root is type H256 - assert_eq!(root, test_case.expected_root); - for n in 0..test_case.leaves.len() { - // check that the tree can verify the proof for this leaf - assert!(tree.verify(&test_case.proofs[n])); - } - } - } - - #[test] - fn it_n_less_than_max_tree_depth() { - const TREE_DEPTH_MINUS_ONE: usize = TREE_DEPTH - 1; - - let _ = LightMerkle::<0>::default(); - let _ = LightMerkle::<1>::default(); - let _ = LightMerkle::::default(); - let _ = LightMerkle::::default(); - - // Following code does not compile due to static asserts. - // const TREE_DEPTH_PLUS_ONE :usize = TREE_DEPTH +1; - // let _ = LightMerkle::::default(); - } -} diff --git a/primitives/nomad/merkle/src/proof.rs b/primitives/nomad/merkle/src/proof.rs deleted file mode 100644 index 6b82dea02..000000000 --- a/primitives/nomad/merkle/src/proof.rs +++ /dev/null @@ -1,58 +0,0 @@ -use sp_core::H256; - -use super::{merkle_root_from_branch, MerkleProof}; - -/// A merkle proof object. The leaf, its path to the root, and its index in the -/// tree. -#[derive(Debug)] -#[cfg_attr(test, derive(serde::Serialize, serde::Deserialize))] -pub struct Proof { - /// The leaf - pub leaf: H256, - /// The index - pub index: usize, - /// The merkle branch - #[cfg_attr(test, serde(with = "const_array_serde"))] - pub path: [H256; N], -} - -#[cfg(test)] -mod const_array_serde { - use serde::{ser::SerializeSeq, Deserialize, Deserializer, Serializer}; - - use super::H256; - - pub fn serialize(item: &[H256; N], serializer: S) -> Result - where - S: Serializer, - { - let mut seq = serializer.serialize_seq(Some(N))?; - for i in item { - seq.serialize_element(i)?; - } - seq.end() - } - - pub fn deserialize<'de, D, const N: usize>(d: D) -> Result<[H256; N], D::Error> - where - D: Deserializer<'de>, - { - let v: Vec = Deserialize::deserialize(d)?; - if v.len() != N { - Err(serde::de::Error::custom(format!( - "Expected a sequence with {} elements. Got {} elements", - N, - v.len() - ))) - } else { - let mut h: [H256; N] = [Default::default(); N]; - h.copy_from_slice(&v[..N]); - Ok(h) - } - } -} - -impl MerkleProof for Proof { - /// Calculate the merkle root produced by evaluating the proof - fn root(&self) -> H256 { merkle_root_from_branch(self.leaf, &self.path, self.index) } -} diff --git a/primitives/nomad/merkle/src/test_utils.rs b/primitives/nomad/merkle/src/test_utils.rs deleted file mode 100644 index 0192420c1..000000000 --- a/primitives/nomad/merkle/src/test_utils.rs +++ /dev/null @@ -1,29 +0,0 @@ -#![cfg(test)] - -use std::{fs::File, io::Read}; - -use sp_core::H256; - -use crate::NomadProof; - -/// Struct representing a single merkle test case -#[cfg_attr(test, derive(serde::Serialize, serde::Deserialize))] -#[cfg_attr(test, serde(rename_all = "camelCase"))] -pub struct MerkleTestCase { - /// Test case name - pub test_name: String, - /// Leaves of merkle tree - pub leaves: Vec, - /// Proofs for leaves in tree - pub proofs: Vec, - /// Root of tree - pub expected_root: H256, -} - -/// Reads merkle test case json file and returns a vector of `MerkleTestCase`s -pub fn load_merkle_test_json() -> Vec { - let mut file = File::open("fixtures/merkle.json").unwrap(); - let mut data = String::new(); - file.read_to_string(&mut data).unwrap(); - serde_json::from_str(&data).unwrap() -} diff --git a/primitives/nomad/merkle/src/utils.rs b/primitives/nomad/merkle/src/utils.rs deleted file mode 100644 index 05119ac18..000000000 --- a/primitives/nomad/merkle/src/utils.rs +++ /dev/null @@ -1,23 +0,0 @@ -use nomad_core::keccak256_concat; -use sp_core::H256; - -/// Compute a root hash from a leaf and a Merkle proof. -pub fn merkle_root_from_branch( - leaf: H256, - branch: &[H256; N], - index: usize, -) -> H256 { - let mut current = leaf; - - for (i, next) in branch.iter().enumerate().take(N) { - let ith_bit = (index >> i) & 0x01; - let (left, right) = if ith_bit == 1 { - (next.as_bytes(), current.as_bytes()) - } else { - (current.as_bytes(), next.as_bytes()) - }; - current = keccak256_concat!(left, right); - } - - current -} diff --git a/primitives/nomad/nomad-base/Cargo.toml b/primitives/nomad/nomad-base/Cargo.toml deleted file mode 100644 index 5d88f05b2..000000000 --- a/primitives/nomad/nomad-base/Cargo.toml +++ /dev/null @@ -1,40 +0,0 @@ -[package] -name = "nomad-base" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -# Substrate -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sp-std = { version = "4.0.0-dev", default-features = false } -sp-core = { version = "4.0.0-dev", default-features = false } -sp-io = { version = "4.0.0-dev", default-features = false } -frame-support = { version = "4.0.0-dev", default-features = false } -parity-util-mem = { version = "0.10.2", default-features = false, features = ["primitive-types"] } - -primitive-types = { version = "0.10.1", default-features = false, features = ["scale-info", "codec"] } -tiny-keccak = { version = "2.0.2", default-features = false, features = ["keccak"] } -signature = { path = "../signature", default-features = false } - -nomad-core = { path = "../nomad-core", default-features = false } -serde = { version = "1.0", default-features = false, optional = true, features = ["derive"] } - -[dev-dependencies] -ethers-signers = "0.13.0" -once_cell = "1.8.0" - - -[features] -default = ["std"] -std = [ - "serde", - "primitive-types/serde", - "codec/std", - "scale-info/std", - "frame-support/std", - "nomad-core/std" -] - diff --git a/primitives/nomad/nomad-base/src/lib.rs b/primitives/nomad/nomad-base/src/lib.rs deleted file mode 100644 index 51d8cdef2..000000000 --- a/primitives/nomad/nomad-base/src/lib.rs +++ /dev/null @@ -1,108 +0,0 @@ -#![cfg_attr(not(feature = "std"), no_std)] - -use frame_support::pallet_prelude::*; -use nomad_core::{home_domain_hash, to_eth_signed_message_hash, NomadState, SignedUpdate, Update}; -#[cfg(feature = "std")] -use serde::{Deserialize, Serialize}; -use signature::SignatureError; -use sp_core::{H160, H256}; - -#[cfg(test)] -pub mod testing; - -#[derive(Clone, Copy, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub struct NomadBase { - pub state: NomadState, - pub local_domain: u32, - pub committed_root: H256, - pub updater: H160, -} - -impl Default for NomadBase { - fn default() -> Self { - Self { - state: NomadState::Active, - local_domain: Default::default(), - committed_root: Default::default(), - updater: Default::default(), - } - } -} - -pub enum NomadBaseError { - FailedInitialization, -} - -impl NomadBase { - pub fn new(local_domain: u32, committed_root: H256, updater: H160) -> Self { - Self { - state: Default::default(), - local_domain, - committed_root, - updater, - } - } - - pub fn home_domain_hash(&self) -> H256 { home_domain_hash(self.local_domain) } - - pub fn set_committed_root(&mut self, new_committed_root: H256) { - self.committed_root = new_committed_root; - } - - pub fn is_updater_signature( - &self, - signed_update: &SignedUpdate, - ) -> Result { - let supposed_signing_hash = Update { - home_domain: self.local_domain, - previous_root: signed_update.previous_root(), - new_root: signed_update.new_root(), - } - .signing_hash(); - - let digest = to_eth_signed_message_hash(&supposed_signing_hash); - signed_update - .signature - .recover(digest) - .map(|a| a == self.updater) - } -} - -#[cfg(test)] -mod test { - use nomad_core::test_utils::Updater; - - use super::*; - use crate::testing::{FAKE_UPDATER, TEST_NOMAD_BASE, TEST_UPDATER, TEST_UPDATER_PRIVKEY}; - - #[test] - fn it_accepts_valid_signature() { - let valid_signed = TEST_UPDATER.sign_update(H256::repeat_byte(0), H256::repeat_byte(1)); - assert!( - TEST_NOMAD_BASE.is_updater_signature(&valid_signed).unwrap(), - "should have passed on valid signature" - ); - } - - #[test] - fn it_rejects_invalid_signature() { - let invalid_signed = FAKE_UPDATER.sign_update(H256::repeat_byte(0), H256::repeat_byte(1)); - assert!( - !TEST_NOMAD_BASE - .is_updater_signature(&invalid_signed) - .unwrap(), - "should have failed on invalid signature" - ); - - let other_updater = Updater::new(9999, TEST_UPDATER_PRIVKEY.parse().unwrap()); - let wrong_domain_signed = - other_updater.sign_update(H256::repeat_byte(0), H256::repeat_byte(1)); - assert!( - !TEST_NOMAD_BASE - .is_updater_signature(&wrong_domain_signed) - .unwrap(), - "should have failed on invalid signature" - ); - } -} diff --git a/primitives/nomad/nomad-base/src/testing.rs b/primitives/nomad/nomad-base/src/testing.rs deleted file mode 100644 index c451c9ea0..000000000 --- a/primitives/nomad/nomad-base/src/testing.rs +++ /dev/null @@ -1,33 +0,0 @@ -#[cfg(test)] -use ethers_signers::LocalWallet; -use nomad_core::test_utils::Updater; -use once_cell::sync::Lazy; - -use crate::NomadBase; - -pub const TEST_LOCAL_DOMAIN: u32 = 1111; -pub const TEST_UPDATER_PRIVKEY: &str = - "1111111111111111111111111111111111111111111111111111111111111111"; - -pub static TEST_UPDATER: Lazy = Lazy::new(|| { - let signer: LocalWallet = TEST_UPDATER_PRIVKEY.parse().unwrap(); - - Updater::new(TEST_LOCAL_DOMAIN, signer) -}); - -pub const FAKE_UPDATER_PRIVKEY: &str = - "2222222222222222222222222222222222222222222222222222222222222222"; - -pub static FAKE_UPDATER: Lazy = Lazy::new(|| { - let signer: LocalWallet = FAKE_UPDATER_PRIVKEY.parse().unwrap(); - - Updater::new(TEST_LOCAL_DOMAIN, signer) -}); - -pub static TEST_NOMAD_BASE: Lazy = Lazy::new(|| { - NomadBase::new( - TEST_LOCAL_DOMAIN, - Default::default(), - TEST_UPDATER.address(), - ) -}); diff --git a/primitives/nomad/nomad-core/Cargo.toml b/primitives/nomad/nomad-core/Cargo.toml deleted file mode 100644 index 828a52e1d..000000000 --- a/primitives/nomad/nomad-core/Cargo.toml +++ /dev/null @@ -1,43 +0,0 @@ -[package] -name = "nomad-core" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -# Substrate -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sp-std = { version = "4.0.0-dev", default-features = false } -sp-core = { version = "4.0.0-dev", default-features = false } -sp-io = { version = "4.0.0-dev", default-features = false } -sp-runtime = { version = "4.0.0-dev", default-features = false } -frame-support = { version = "4.0.0-dev", default-features = false } -parity-util-mem = { version = "0.10.2", default-features = false, features = ["primitive-types"] } - -primitive-types = { version = "0.10.1", default-features = false, features = ["scale-info", "codec"] } -tiny-keccak = { version = "2.0.2", default-features = false, features = ["keccak"] } -signature = { path = "../signature", default-features = false } -getrandom = { version = "0.2", default-features = false, features = ["js"] } - -serde = { version = "1.0", default-features = false, optional = true, features = ["derive"] } -ethers-core = { version = "0.13.0", optional = true } -ethers-signers = { version = "0.13.0", optional = true } - -[dev-dependencies] -async-trait = "0.1.42" - -[features] -default = ["std"] -std = [ - "serde", - "ethers-core", - "ethers-signers", - "primitive-types/serde", - "signature/std", - "codec/std", - "scale-info/std", - "frame-support/std", -] - diff --git a/primitives/nomad/nomad-core/src/lib.rs b/primitives/nomad/nomad-core/src/lib.rs deleted file mode 100644 index 9de3d8082..000000000 --- a/primitives/nomad/nomad-core/src/lib.rs +++ /dev/null @@ -1,90 +0,0 @@ -#![cfg_attr(not(feature = "std"), no_std)] - -/// Variadic macro used by `keccak256_concat` internally. -#[macro_export] -macro_rules! keccak256_concat_update { - ($hasher:ident, $e:expr) => {{ - $hasher.update($e.as_ref()); - }}; - - ($hasher:ident, $e:expr, $($es:expr),+) => {{ - $hasher.update($e.as_ref()); - $crate::keccak256_concat_update!($hasher, $($es),+); - }}; -} - -/// Calculates the Kecck 256 of arguments with NO extra allocations to join inputs. -#[macro_export] -macro_rules! keccak256_concat{ - ($($arg:tt)*) => {{ - { - use tiny_keccak::Hasher as _; - let mut output = [0u8; 32]; - let mut hasher = tiny_keccak::Keccak::v256(); - $crate::keccak256_concat_update!(hasher, $($arg)*); - hasher.finalize(&mut output); - sp_core::H256::from(output) - } - }} -} - -extern crate alloc; - -mod update_v2; - -mod update; -pub use update::*; - -mod state; -pub use state::*; - -mod nomad_message; -pub use nomad_message::*; - -mod typed_message; -pub use typed_message::*; - -mod utils; -pub use utils::*; - -#[cfg(feature = "std")] -pub mod test_utils; - -#[cfg(test)] -mod test { - use sp_core::H256; - use sp_runtime::traits::{Hash, Keccak256}; - - /// Tests `keccak256_concat` macro expansion with several arguments. - #[test] - fn it_keccak_256_contact() { - let a = b"123"; - let b = b"456"; - let c = b"789"; - let abc = vec![a, b, c] - .into_iter() - .flatten() - .copied() - .collect::>(); - - // Single - let output = keccak256_concat!(a); - let expected = Keccak256::hash(&a[..]).into(); - assert_eq!(output, expected); - - // Variadic - let output = keccak256_concat!(a, b, c); - let expected = Keccak256::hash(abc.as_slice()).into(); - assert_eq!(output, expected); - - // Test `as_ref()`. - let output = keccak256_concat!(H256::default(), a, b); - let concat = vec![H256::default().as_bytes(), a, b] - .into_iter() - .flatten() - .copied() - .collect::>(); - let expected = Keccak256::hash(concat.as_slice()).into(); - assert_eq!(output, expected); - } -} diff --git a/primitives/nomad/nomad-core/src/nomad_message.rs b/primitives/nomad/nomad-core/src/nomad_message.rs deleted file mode 100644 index 17b263723..000000000 --- a/primitives/nomad/nomad-core/src/nomad_message.rs +++ /dev/null @@ -1,85 +0,0 @@ -use frame_support::{pallet_prelude::*, traits::Get}; -use sp_core::H256; -use sp_std::mem::size_of; - -/// Size of `NomadMessage` fields except `body`. -const NON_BODY_LENGTH: usize = 3 * size_of::() + 2 * size_of::(); - -/// A full Nomad message -#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] -pub struct NomadMessage> { - /// 4 SLIP-44 ID - pub origin: u32, - /// 32 Address in home convention - pub sender: H256, - /// 4 Count of all previous messages to destination - pub nonce: u32, - /// 4 SLIP-44 ID - pub destination: u32, - /// 32 Address in destination convention - pub recipient: H256, - /// 0+ Message contents - pub body: BoundedVec, -} - -impl> NomadMessage { - /// Serialize to a vec - pub fn to_vec(&self) -> Vec { - let size = NON_BODY_LENGTH + (&self.body).len(); - let mut buf = Vec::::with_capacity(size); - - buf.extend_from_slice(&self.origin.to_be_bytes()); - buf.extend_from_slice(&self.sender.as_ref()); - buf.extend_from_slice(&self.nonce.to_be_bytes()); - buf.extend_from_slice(&self.destination.to_be_bytes()); - buf.extend_from_slice(&self.recipient.as_ref()); - buf.extend_from_slice(&self.body); - - buf - } - - /// Get hash of message - pub fn hash(&self) -> H256 { - keccak256_concat!( - &self.origin.to_be_bytes(), - &self.sender, - &self.nonce.to_be_bytes(), - &self.destination.to_be_bytes(), - &self.recipient, - &self.body - ) - } -} - -#[cfg(test)] -mod tests { - use frame_support::parameter_types; - use sp_std::mem::size_of_val; - - use super::{NomadMessage, NON_BODY_LENGTH}; - - parameter_types! { - const MaxBodyLen :u32 = 1024; - } - - /// Double checks that constant `NON_BODY_LENGTH` will be synchronized with actual - #[test] - fn non_body_lenght_synch_with_nomad_message_type() { - let m = NomadMessage:: { - origin: 0, - sender: Default::default(), - nonce: 0, - destination: 0, - recipient: Default::default(), - body: Default::default(), - }; - - let actual_non_body_len = size_of_val(&m.origin) - + size_of_val(&m.sender) - + size_of_val(&m.nonce) - + size_of_val(&m.destination) - + size_of_val(&m.recipient); - - assert_eq!(actual_non_body_len, NON_BODY_LENGTH); - } -} diff --git a/primitives/nomad/nomad-core/src/state.rs b/primitives/nomad/nomad-core/src/state.rs deleted file mode 100644 index a029185f2..000000000 --- a/primitives/nomad/nomad-core/src/state.rs +++ /dev/null @@ -1,16 +0,0 @@ -use frame_support::pallet_prelude::*; -#[cfg(feature = "std")] -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Copy, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub enum NomadState { - /// Contract is active - Active, - /// Contract has failed - Failed, -} - -impl Default for NomadState { - fn default() -> Self { Self::Active } -} diff --git a/primitives/nomad/nomad-core/src/test_utils.rs b/primitives/nomad/nomad-core/src/test_utils.rs deleted file mode 100644 index aa56a4d90..000000000 --- a/primitives/nomad/nomad-core/src/test_utils.rs +++ /dev/null @@ -1,51 +0,0 @@ -use ethers_core::utils::hash_message; -use ethers_signers::{LocalWallet, Signer}; -use signature::Signature; -use sp_core::{H160, H256}; - -use crate::{ - update_v2::{SignedUpdateV2, UpdateV2}, - SignedUpdate, Update, -}; - -#[derive(Debug, Clone)] -pub struct Updater { - pub domain: u32, - pub signer: LocalWallet, -} - -impl Updater { - pub fn new(domain: u32, signer: LocalWallet) -> Self { Self { domain, signer } } - - pub fn address(&self) -> H160 { self.signer.address().0.into() } - - fn sign_message_without_eip_155>(&self, message: M) -> Signature { - // Had to reimplement hash and signing to remove async-ness for - // substrate testing - let message = message.as_ref(); - let message_hash = hash_message(message); - let mut signature = self.signer.sign_hash(message_hash); - - signature.v = 28 - (signature.v % 2); - signature.into() - } - - pub fn sign_update(&self, previous_root: H256, new_root: H256) -> SignedUpdate { - let update = Update { - home_domain: self.domain, - previous_root, - new_root, - }; - let signature = self.sign_message_without_eip_155(update.signing_hash()); - SignedUpdate { update, signature } - } - - pub fn sign_update_v2(&self, root: H256) -> SignedUpdateV2 { - let update = UpdateV2 { - home_domain: self.domain, - root, - }; - let signature = self.sign_message_without_eip_155(update.signing_hash()); - SignedUpdateV2 { update, signature } - } -} diff --git a/primitives/nomad/nomad-core/src/typed_message.rs b/primitives/nomad/nomad-core/src/typed_message.rs deleted file mode 100644 index d5e8fffde..000000000 --- a/primitives/nomad/nomad-core/src/typed_message.rs +++ /dev/null @@ -1,20 +0,0 @@ -use alloc::vec::Vec; - -/// This trait provides structure for encoding a Vec as a xapp message. -/// First byte of Vec is a u8 corresponding to a message type. The remaining -/// bytes make up the message body. -pub trait TypedMessage: AsRef<[u8]> { - type MessageEnum: From; - - /// Return the message type - fn message_type(&self) -> Self::MessageEnum { - let slice: &[u8] = self.as_ref(); - slice[0].into() - } - - /// Return the message body after the type byte - fn message_body(&self) -> Vec { - let slice: &[u8] = self.as_ref(); - slice[1..].to_vec() - } -} diff --git a/primitives/nomad/nomad-core/src/update.rs b/primitives/nomad/nomad-core/src/update.rs deleted file mode 100644 index ad2b52440..000000000 --- a/primitives/nomad/nomad-core/src/update.rs +++ /dev/null @@ -1,83 +0,0 @@ -use frame_support::pallet_prelude::*; -#[cfg(feature = "std")] -use serde::{Deserialize, Serialize}; -use signature::{hash_message, Signature, SignatureError}; -use sp_core::{H160, H256}; - -use crate::utils::home_domain_hash; - -/// Nomad update -#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub struct Update { - /// The home chain - pub home_domain: u32, - /// The previous root - pub previous_root: H256, - /// The new root - pub new_root: H256, -} - -impl Update { - /// Get signing hash for update - pub fn signing_hash(&self) -> H256 { - keccak256_concat!( - home_domain_hash(self.home_domain), - self.previous_root, - self.new_root - ) - } - - fn prepended_hash(&self) -> H256 { hash_message(self.signing_hash()) } -} - -/// A Signed Nomad Update -#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub struct SignedUpdate { - /// The update - pub update: Update, - /// The signature - pub signature: Signature, -} - -impl SignedUpdate { - pub fn previous_root(&self) -> H256 { self.update.previous_root } - - pub fn new_root(&self) -> H256 { self.update.new_root } - - /// Recover the Ethereum address of the signer - pub fn recover(&self) -> Result { - self.signature.recover(self.update.prepended_hash()) - } - - /// Check whether a message was signed by a specific address - pub fn verify(&self, signer: H160) -> Result<(), SignatureError> { - self.signature.verify(self.update.prepended_hash(), signer) - } -} - -#[cfg(test)] -mod tests { - use super::H256; - use crate::test_utils::Updater; - - pub const TEST_UPDATER_PRIVKEY: &str = - "1111111111111111111111111111111111111111111111111111111111111111"; - - #[test] - fn recover_valid_update() { - use ethers_signers::{LocalWallet, Signer}; - - let wallet: LocalWallet = TEST_UPDATER_PRIVKEY.parse().unwrap(); - println!("Wallet address: {:x}", wallet.address()); - - let updater = Updater::new(1000, TEST_UPDATER_PRIVKEY.parse().unwrap()); - let signed_update = updater.sign_update(H256::repeat_byte(0), H256::repeat_byte(1)); - - let recovered = signed_update.recover().expect("!recover"); - println!("Recovered address: {:x}", recovered); - - signed_update.verify(updater.address()).expect("!sig"); - } -} diff --git a/primitives/nomad/nomad-core/src/update_v2.rs b/primitives/nomad/nomad-core/src/update_v2.rs deleted file mode 100644 index a08b9bf95..000000000 --- a/primitives/nomad/nomad-core/src/update_v2.rs +++ /dev/null @@ -1,75 +0,0 @@ -#![allow(dead_code)] - -use frame_support::pallet_prelude::*; -#[cfg(feature = "std")] -use serde::{Deserialize, Serialize}; -use signature::{hash_message, Signature, SignatureError}; -use sp_core::{H160, H256}; - -use crate::utils::home_domain_hash; - -/// Nomad update -#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub struct UpdateV2 { - /// The home chain - pub home_domain: u32, - /// The new root - pub root: H256, -} - -impl UpdateV2 { - /// Get signing hash for update - pub fn signing_hash(&self) -> H256 { - keccak256_concat!(home_domain_hash(self.home_domain), self.root) - } - - fn prepended_hash(&self) -> H256 { hash_message(self.signing_hash()) } -} - -/// A Signed Nomad Update -#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub struct SignedUpdateV2 { - /// The update - pub update: UpdateV2, - /// The signature - pub signature: Signature, -} - -impl SignedUpdateV2 { - /// Recover the Ethereum address of the signer - pub fn recover(&self) -> Result { - self.signature.recover(self.update.prepended_hash()) - } - - /// Check whether a message was signed by a specific address - pub fn verify(&self, signer: H160) -> Result<(), SignatureError> { - self.signature.verify(self.update.prepended_hash(), signer) - } -} - -#[cfg(test)] -mod tests { - use super::H256; - use crate::test_utils::Updater; - - pub const TEST_UPDATER_PRIVKEY: &str = - "1111111111111111111111111111111111111111111111111111111111111111"; - - #[test] - fn recover_valid_update_v2() { - use ethers_signers::{LocalWallet, Signer}; - - let wallet: LocalWallet = TEST_UPDATER_PRIVKEY.parse().unwrap(); - println!("Wallet address: {:x}", wallet.address()); - - let updater = Updater::new(1000, TEST_UPDATER_PRIVKEY.parse().unwrap()); - let signed_update = updater.sign_update_v2(H256::repeat_byte(1)); - - let recovered = signed_update.recover().expect("!recover"); - println!("Recovered address: {:x}", recovered); - - signed_update.verify(updater.address()).expect("!sig"); - } -} diff --git a/primitives/nomad/nomad-core/src/utils.rs b/primitives/nomad/nomad-core/src/utils.rs deleted file mode 100644 index 874300770..000000000 --- a/primitives/nomad/nomad-core/src/utils.rs +++ /dev/null @@ -1,18 +0,0 @@ -use sp_core::H256; - -const NOMAD_SUFFIX: &[u8] = b"NOMAD"; -const ETH_PREFIX: &[u8] = b"\x19Ethereum Signed Message:\n32"; - -/// Computes hash of home domain concatenated with "NOMAD" -pub fn home_domain_hash(home_domain: u32) -> H256 { - keccak256_concat!(home_domain.to_be_bytes(), NOMAD_SUFFIX) -} - -/// Hash a message according to EIP-191 with the ethereum signed message prefix. -pub fn to_eth_signed_message_hash(hash: &H256) -> H256 { keccak256_concat!(ETH_PREFIX, hash) } - -/// Destination and destination-specific nonce combined in single field ( -/// (destination << 32) & nonce) -pub fn destination_and_nonce(destination: u32, nonce: u32) -> u64 { - ((destination as u64) << 32) | nonce as u64 -} diff --git a/primitives/nomad/signature/Cargo.toml b/primitives/nomad/signature/Cargo.toml deleted file mode 100644 index 6dbaa8d25..000000000 --- a/primitives/nomad/signature/Cargo.toml +++ /dev/null @@ -1,59 +0,0 @@ -[package] -name = "signature" -version = "0.1.0" -edition = "2021" -authors = ["Luke Tchang "] -license = "MIT OR Apache-2.0" -readme = "README.md" -repository = "https://github.com/ltchang2019/no-std-eth-signature" -description = """ -`ethers-rs` signature implemented as no_std. -""" - -[package.metadata.docs.rs] -targets = ["x86_64-unknown-linux-gnu"] - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -# Substrate -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sp-std = { version = "4.0.0-dev", default-features = false } -sp-core = { version = "4.0.0-dev", default-features = false } -sp-io = { version = "4.0.0-dev", default-features = false } -frame-support = { version = "4.0.0-dev", default-features = false } -parity-util-mem = { version = "0.10.2", default-features = false, features = ["primitive-types"] } -primitive-types = { version = "0.10.1", default-features = false, features = ["scale-info", "codec"] } -rlp = { version = "0.5.0", default-features = false } -ethabi = { version = "17.0.0", default-features = false, features = ["rlp"] } -arrayvec = { version = "0.7.2", default-features = false } -rlp-derive = { version = "0.1.0", default-features = false } - -# crypto -elliptic-curve = { version = "0.11.12", default-features = false } -generic-array = { version = "0.14.5", default-features = false } -k256 = { version = "0.10.4", default-features = false, features = ["keccak256", "ecdsa"] } -tiny-keccak = { version = "2.0.2", default-features = false } - -# misc -thiserror-no-std = "2.0.1" -hex = { version = "0.4.3", default-features = false } -once_cell = { version = "1.12.0", optional = true } - -serde = { version = "1.0", default-features = false, optional = true, features = ["derive"] } -ethers-core = { version = "0.13.0", optional = true } - -[dev-dependencies] -byte-slice-cast = "1.2.1" - -[features] -default = ["std"] -std = [ - "serde", - "primitive-types/serde", - "codec/std", - "scale-info/std", - "frame-support/std", - "ethers-core" -] diff --git a/primitives/nomad/signature/README.md b/primitives/nomad/signature/README.md deleted file mode 100644 index 6b2c9f824..000000000 --- a/primitives/nomad/signature/README.md +++ /dev/null @@ -1 +0,0 @@ -`ethers-rs` signature implemented with as no_std. diff --git a/primitives/nomad/signature/src/lib.rs b/primitives/nomad/signature/src/lib.rs deleted file mode 100644 index 0d56153e0..000000000 --- a/primitives/nomad/signature/src/lib.rs +++ /dev/null @@ -1,12 +0,0 @@ -#![cfg_attr(not(feature = "std"), no_std)] - -mod signature; -pub use crate::signature::*; - -mod utils; -pub use utils::*; - -extern crate thiserror_no_std as thiserror; - -#[macro_use] -extern crate alloc; diff --git a/primitives/nomad/signature/src/signature.rs b/primitives/nomad/signature/src/signature.rs deleted file mode 100644 index b2e28d892..000000000 --- a/primitives/nomad/signature/src/signature.rs +++ /dev/null @@ -1,288 +0,0 @@ -// Code adapted from: https://github.com/gakonst/ethers-rs/blob/master/ethers-core/src/types/signature.rs - -use alloc::{borrow::ToOwned, string::String, vec::Vec}; -use core::{convert::TryFrom, fmt, str::FromStr}; - -use elliptic_curve::{consts::U32, sec1::ToEncodedPoint}; -use frame_support::{pallet_prelude::*, sp_runtime::traits::Keccak256}; -use generic_array::GenericArray; -use k256::{ - ecdsa::{ - recoverable::{Id as RecoveryId, Signature as RecoverableSignature}, - Error as K256SignatureError, Signature as K256Signature, - }, - PublicKey as K256PublicKey, -}; -#[cfg(feature = "std")] -use serde::{Deserialize, Serialize}; -use sp_core::{Hasher, H160, H256, U256}; -use thiserror::Error; - -use crate::utils::hash_message; - -type Address = H160; - -/// An error involving a signature. -#[derive(Debug, Error)] -pub enum SignatureError { - /// Invalid length, secp256k1 signatures are 65 bytes - #[error("invalid signature length, got {0}, expected 65")] - InvalidLength(usize), - /// When parsing a signature from string to hex - #[error(transparent)] - DecodingError(#[from] hex::FromHexError), - /// Thrown when signature verification failed (i.e. when the address that - /// produced the signature did not match the expected address) - #[error("Signature verification failed. Expected {0:?}, got {1:?}")] - VerificationError(Address, Address), - /// Internal error during signature recovery - #[error(transparent)] - K256Error(#[from] K256SignatureError), - /// Error in recovering public key from signature - #[error("Public key recovery error")] - RecoveryError, -} - -/// Recovery message data. -/// -/// The message data can either be a binary message that is first hashed -/// according to EIP-191 and then recovered based on the signature or a -/// precomputed hash. -#[derive(Clone, Debug, PartialEq, Eq)] -pub enum RecoveryMessage { - /// Message bytes - Data(Vec), - /// Message hash - Hash(H256), -} - -/// An ECDSA signature -#[derive(Clone, Encode, Decode, PartialEq, RuntimeDebug, TypeInfo)] -#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] -pub struct Signature { - /// R value - pub r: U256, - /// S Value - pub s: U256, - /// V value - pub v: u64, -} - -impl fmt::Display for Signature { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let sig = <[u8; 65]>::from(self); - write!(f, "{}", hex::encode(&sig[..])) - } -} - -impl Signature { - /// Verifies that signature on `message` was produced by `address` - pub fn verify(&self, message: M, address: A) -> Result<(), SignatureError> - where - M: Into, - A: Into
, - { - let address = address.into(); - let recovered = self.recover(message)?; - ensure!( - recovered == address, - SignatureError::VerificationError(address, recovered) - ); - - Ok(()) - } - - /// Recovers the Ethereum address which was used to sign the given message. - /// - /// Recovery signature data uses 'Electrum' notation, this means the `v` - /// value is expected to be either `27` or `28`. - pub fn recover(&self, message: M) -> Result - where - M: Into, - { - let message = message.into(); - let message_hash = match message { - RecoveryMessage::Data(ref message) => hash_message(message), - RecoveryMessage::Hash(hash) => hash, - }; - - let (recoverable_sig, _recovery_id) = self.as_signature()?; - let verify_key = - recoverable_sig.recover_verify_key_from_digest_bytes(message_hash.as_ref().into())?; - - let public_key = K256PublicKey::from(&verify_key); - let public_key = public_key.to_encoded_point(/* compress = */ false); - let public_key = public_key.as_bytes(); - debug_assert_eq!(public_key[0], 0x04); - let hash = Keccak256::hash(&public_key[1..]); - Ok(Address::from_slice(&hash[12..])) - } - - /// Retrieves the recovery signature. - fn as_signature(&self) -> Result<(RecoverableSignature, RecoveryId), SignatureError> { - let recovery_id = self.recovery_id()?; - let signature = { - let mut r_bytes = [0u8; 32]; - let mut s_bytes = [0u8; 32]; - self.r.to_big_endian(&mut r_bytes); - self.s.to_big_endian(&mut s_bytes); - let gar: &GenericArray = GenericArray::from_slice(&r_bytes); - let gas: &GenericArray = GenericArray::from_slice(&s_bytes); - let sig = K256Signature::from_scalars(*gar, *gas)?; - RecoverableSignature::new(&sig, recovery_id)? - }; - - Ok((signature, recovery_id)) - } - - /// Retrieve the recovery ID. - pub fn recovery_id(&self) -> Result { - let standard_v = normalize_recovery_id(self.v); - Ok(RecoveryId::new(standard_v)?) - } - - /// Copies and serializes `self` into a new `Vec` with the recovery id included - #[allow(clippy::wrong_self_convention)] - pub fn to_vec(&self) -> Vec { self.into() } -} - -fn normalize_recovery_id(v: u64) -> u8 { - match v { - 0 => 0, - 1 => 1, - 27 => 0, - 28 => 1, - v if v >= 35 => ((v - 1) % 2) as _, - _ => 4, - } -} - -impl<'a> TryFrom<&'a [u8]> for Signature { - type Error = SignatureError; - - /// Parses a raw signature which is expected to be 65 bytes long where - /// the first 32 bytes is the `r` value, the second 32 bytes the `s` value - /// and the final byte is the `v` value in 'Electrum' notation. - fn try_from(bytes: &'a [u8]) -> Result { - if bytes.len() != 65 { - return Err(SignatureError::InvalidLength(bytes.len())); - } - - let v = bytes[64]; - let r = U256::from_big_endian(&bytes[0..32]); - let s = U256::from_big_endian(&bytes[32..64]); - - Ok(Signature { r, s, v: v.into() }) - } -} - -impl FromStr for Signature { - type Err = SignatureError; - - fn from_str(s: &str) -> Result { - let s = s.strip_prefix("0x").unwrap_or(s); - let bytes = hex::decode(s)?; - Signature::try_from(&bytes[..]) - } -} - -impl From<&Signature> for [u8; 65] { - fn from(src: &Signature) -> [u8; 65] { - let mut sig = [0u8; 65]; - src.r.to_big_endian(&mut sig[..32]); - src.s.to_big_endian(&mut sig[32..64]); - // TODO: What if we try to serialize a signature where - // the `v` is not normalized? - - // The u64 to u8 cast is safe because `sig.v` can only ever be 27 or 28 - // here. Regarding EIP-155, the modification to `v` happens during tx - // creation only _after_ the transaction is signed using - // `ethers_signers::to_eip155_v`. - sig[64] = src.v as u8; - sig - } -} - -impl From for [u8; 65] { - fn from(src: Signature) -> [u8; 65] { <[u8; 65]>::from(&src) } -} - -impl From<&Signature> for Vec { - fn from(src: &Signature) -> Vec { <[u8; 65]>::from(src).to_vec() } -} - -impl From for Vec { - fn from(src: Signature) -> Vec { <[u8; 65]>::from(&src).to_vec() } -} - -impl From<&[u8]> for RecoveryMessage { - fn from(s: &[u8]) -> Self { s.to_owned().into() } -} - -impl From> for RecoveryMessage { - fn from(s: Vec) -> Self { RecoveryMessage::Data(s) } -} - -impl From<&str> for RecoveryMessage { - fn from(s: &str) -> Self { s.as_bytes().to_owned().into() } -} - -impl From for RecoveryMessage { - fn from(s: String) -> Self { RecoveryMessage::Data(s.into_bytes()) } -} - -impl From<[u8; 32]> for RecoveryMessage { - fn from(hash: [u8; 32]) -> Self { H256(hash).into() } -} - -impl From for RecoveryMessage { - fn from(hash: H256) -> Self { RecoveryMessage::Hash(hash) } -} - -#[cfg(feature = "std")] -// Want to convert ethers signature into our no-std version in tests -impl From for Signature { - fn from(sig: ethers_core::types::Signature) -> Self { - // ethers-core 0.13.0 uses primitive types 0.11.1, sp-core 4.0.0-dev - // uses primitive types 0.10.1 - let r_bytes: [u8; 32] = sig.r.into(); - let s_bytes: [u8; 32] = sig.s.into(); - - Self { - r: r_bytes.into(), - s: s_bytes.into(), - v: sig.v, - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn recover_web3_signature() { - // test vector taken from: - // https://web3js.readthedocs.io/en/v1.2.2/web3-eth-accounts.html#sign - let signature = Signature::from_str( - "b91467e570a6466aa9e9876cbcd013baba02900b8979d43fe208a4a4f339f5fd6007e74cd82e037b800186422fc2da167c747ef045e5d18a5f5d4300f8e1a0291c" - ).expect("could not parse signature"); - assert_eq!( - signature.recover("Some data").unwrap(), - Address::from_str("2c7536E3605D9C16a7a3D7b1898e529396a65c23").unwrap() - ); - } - - #[test] - fn signature_from_str() { - let s1 = Signature::from_str( - "0xaa231fbe0ed2b5418e6ba7c19bee2522852955ec50996c02a2fe3e71d30ddaf1645baf4823fea7cb4fcc7150842493847cfb6a6d63ab93e8ee928ee3f61f503500" - ).expect("could not parse 0x-prefixed signature"); - - let s2 = Signature::from_str( - "aa231fbe0ed2b5418e6ba7c19bee2522852955ec50996c02a2fe3e71d30ddaf1645baf4823fea7cb4fcc7150842493847cfb6a6d63ab93e8ee928ee3f61f503500" - ).expect("could not parse non-prefixed signature"); - - assert_eq!(s1, s2); - } -} diff --git a/primitives/nomad/signature/src/utils.rs b/primitives/nomad/signature/src/utils.rs deleted file mode 100644 index ce4e9ebf0..000000000 --- a/primitives/nomad/signature/src/utils.rs +++ /dev/null @@ -1,25 +0,0 @@ -//! Various utilities for manipulating Ethereum related data -use sp_core::H256; -use tiny_keccak::{Hasher, Keccak}; - -const PREFIX: &str = "\x19Ethereum Signed Message:\n"; - -/// Hash a message according to EIP-191. -/// -/// The data is a UTF-8 encoded string and will enveloped as follows: -/// `"\x19Ethereum Signed Message:\n" + message.length + message` and hashed -/// using keccak256. -pub fn hash_message(message: S) -> H256 -where - S: AsRef<[u8]>, -{ - let message = message.as_ref(); - let eth_message = format!("{}{}", PREFIX, message.len()).into_bytes(); - - let mut output = [0u8; 32]; - let mut hasher = Keccak::v256(); - hasher.update(eth_message.as_ref()); - hasher.update(message); - hasher.finalize(&mut output); - output.into() -} diff --git a/rpc/kate-rpc-runtime-api/Cargo.toml b/rpc/kate-rpc-runtime-api/Cargo.toml index bee94ce26..780790b2a 100644 --- a/rpc/kate-rpc-runtime-api/Cargo.toml +++ b/rpc/kate-rpc-runtime-api/Cargo.toml @@ -7,14 +7,26 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +da-primitives = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } sp-api = { version = "4.0.0-dev", default-features = false } sp-std = { version = "4.0.0-dev", default-features = false } +sp-core = { version = "4.0.0-dev", default-features = false } +sp-arithmetic = { version = "4.0.0-dev", default-features = false } frame-system = { version = "4.0.0-dev", default-features = false } +beefy-merkle-tree = { git = "https://github.com/paritytech/substrate.git/", branch = "polkadot-v0.9.13", default-features = false } +serde = { version = "1.0.126", optional = true, features = ["derive"] } [features] default = ["std"] std = [ + "serde", + "codec/std", "sp-std/std", "sp-api/std", + "sp-core/std", + "sp-arithmetic/std", "frame-system/std", + "beefy-merkle-tree/std", + "da-primitives/std", ] diff --git a/rpc/kate-rpc-runtime-api/src/lib.rs b/rpc/kate-rpc-runtime-api/src/lib.rs index 28f848983..30106bf6b 100644 --- a/rpc/kate-rpc-runtime-api/src/lib.rs +++ b/rpc/kate-rpc-runtime-api/src/lib.rs @@ -3,7 +3,7 @@ #![allow(clippy::unnecessary_mut_passed)] use frame_system::limits::BlockLength; -use sp_std::prelude::*; +use sp_std::vec::Vec; sp_api::decl_runtime_apis! { pub trait KateParamsGetter { diff --git a/rpc/kate-rpc/Cargo.toml b/rpc/kate-rpc/Cargo.toml index ab684a77d..d329c935a 100644 --- a/rpc/kate-rpc/Cargo.toml +++ b/rpc/kate-rpc/Cargo.toml @@ -12,14 +12,13 @@ frame-system = { version = "4.0.0-dev", default-features = false } frame-support = { version = "4.0.0-dev", default-features = false } kate-rpc-runtime-api = { path = "../kate-rpc-runtime-api", default-features = false } sc-client-db = { version = "0.10.0-dev", default-features = false } +thiserror = "1.0.30" rs_merkle = { version = "1.2.0", default-features = false } - codec = { package = "parity-scale-codec", version = "2.0.0" } -da-primitives= { path = "../../primitives/avail" } -kate = { path = "../../kate" } -dusk-plonk = "0.8.2" -# frame-system = "4.0.0-dev" +da-primitives = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } +kate = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } + frame-system-rpc-runtime-api = "4.0.0-dev" jsonrpc-core = "18.0.0" jsonrpc-core-client = "18.0.0" @@ -30,3 +29,4 @@ sc-client-api = { version = "4.0.0-dev" } sp-blockchain = { version = "4.0.0-dev" } sp-rpc = { version = "4.0.0-dev" } sp-runtime = { version = "4.0.0-dev" } +sp-core = { version = "4.0.0-dev" } diff --git a/rpc/kate-rpc/src/lib.rs b/rpc/kate-rpc/src/lib.rs index 399795435..ad23cc16c 100644 --- a/rpc/kate-rpc/src/lib.rs +++ b/rpc/kate-rpc/src/lib.rs @@ -4,45 +4,49 @@ use std::{ }; use codec::{Compact, Decode, Encode, Error as DecodeError, Input}; -use da_primitives::asdr::{AppExtrinsic, AppId, GetAppId}; -use dusk_plonk::commitment_scheme::kzg10::PublicParameters; -use frame_system::limits::BlockLength; +use da_primitives::{ + asdr::{AppExtrinsic, GetAppId}, + traits::ExtendedHeader, + DataProof, +}; +use frame_support::traits::ExtrinsicCall; +use frame_system::{limits::BlockLength, submitted_data}; use jsonrpc_core::{Error as RpcError, Result}; use jsonrpc_derive::rpc; -use kate::BlockDimensions; +use kate::{com::Cell, BlockDimensions, BlsScalar, PublicParameters}; use kate_rpc_runtime_api::KateParamsGetter; use lru::LruCache; -use rs_merkle::{algorithms::Sha256, Hasher, MerkleTree}; use sc_client_api::{BlockBackend, StorageProvider}; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; -use sp_rpc::number::NumberOrHex; use sp_runtime::{ generic::BlockId, - traits::{Block as BlockT, Header, NumberFor}, + traits::{Block as BlockT, Extrinsic, Header}, AccountId32, MultiAddress, MultiSignature, }; +pub type HashOf = ::Hash; +pub type CallOf = <::Extrinsic as Extrinsic>::Call; + #[rpc] -pub trait KateApi { +pub trait KateApi +where + Block: BlockT, + SDFilter: submitted_data::Filter>, +{ #[rpc(name = "kate_queryProof")] - fn query_proof( - &self, - block_number: NumberOrHex, - cells: Vec, - ) -> Result>; + fn query_proof(&self, cells: Vec, at: Option>) -> Result>; #[rpc(name = "kate_blockLength")] - fn query_block_length(&self) -> Result; + fn query_block_length(&self, at: Option>) -> Result; #[rpc(name = "kate_queryDataProof")] - fn query_data_proof(&self, block_number: NumberOrHex, index: usize) -> Result>; + fn query_data_proof(&self, data_index: u32, at: Option>) -> Result; } pub struct Kate { client: Arc, - block_ext_cache: - RwLock, BlockDimensions)>>, + block_ext_cache: RwLock, BlockDimensions)>>, } impl Kate @@ -82,35 +86,48 @@ macro_rules! internal_err { }} } -impl KateApi for Kate +impl Kate +where + Block: BlockT, + Block::Extrinsic: GetAppId, + Block::Header: ExtendedHeader, + Client: Send + Sync + 'static, + Client: HeaderBackend + + ProvideRuntimeApi + + BlockBackend + + StorageProvider>, + Client::Api: KateParamsGetter, +{ + fn block_id(&self, at: Option<::Hash>) -> BlockId { + let hash = at.unwrap_or_else(|| self.client.info().best_hash); + BlockId::Hash(hash) + } +} + +impl KateApi for Kate where Block: BlockT, - Block::Extrinsic: GetAppId, + Block::Extrinsic: GetAppId + ExtrinsicCall, + Block::Header: ExtendedHeader, Client: Send + Sync + 'static, Client: HeaderBackend + ProvideRuntimeApi + BlockBackend + StorageProvider>, Client::Api: KateParamsGetter, + SDFilter: submitted_data::Filter>, + <::Extrinsic as Extrinsic>::Call: Clone, { //TODO allocate static thread pool, just for RPC related work, to free up resources, for the block producing processes. - fn query_proof( - &self, - block_number: NumberOrHex, - cells: Vec, - ) -> Result> { - let block_num: u32 = block_number - .try_into() - .map_err(|_| RpcError::invalid_params("Invalid block number"))?; - - let block_num = >::from(block_num); + fn query_proof(&self, cells: Vec, at: Option>) -> Result> { + let block_id = self.block_id(at); + let signed_block = self .client - .block(&BlockId::number(block_num)) + .block(&block_id) .map_err(|e| internal_err!("Invalid block number: {:?}", e))? - .ok_or_else(|| internal_err!("Missing block number {}", block_num))?; + .ok_or_else(|| internal_err!("Missing block {}", block_id))?; let block_hash = signed_block.block.header().hash(); - let block_id = BlockId::hash(block_hash.clone()); let mut block_ext_cache = self .block_ext_cache @@ -136,13 +153,11 @@ where .collect(); // Use Babe's VRF - let seed: [u8; 32] = - self.client - .runtime_api() - .get_babe_vrf(&block_id) - .map_err(|e| { - internal_err!("Babe VRF not found for block {}: {:?}", block_num, e) - })?; + let seed: [u8; 32] = self + .client + .runtime_api() + .get_babe_vrf(&block_id) + .map_err(|e| internal_err!("Babe VRF not found for block {}: {:?}", block_id, e))?; let (_, block, block_dims) = kate::com::flatten_and_pad_block( block_length.rows as usize, @@ -181,58 +196,44 @@ where Ok(proof) } - fn query_block_length(&self) -> Result { - let best_hash = self.client.info().best_hash; + fn query_block_length(&self, at: Option>) -> Result { + let block_id = self.block_id(at); let block_length = self .client .runtime_api() - .get_block_length(&BlockId::hash(best_hash)) - .map_err(|e| internal_err!("Length of best block({:?}): {:?}", best_hash, e))?; + .get_block_length(&block_id) + .map_err(|e| internal_err!("Length of best block({:?}): {:?}", block_id, e))?; Ok(block_length) } - fn query_data_proof(&self, block_number: NumberOrHex, index: usize) -> Result> { - let block_num: u32 = block_number - .try_into() - .map_err(|_| RpcError::invalid_params("Invalid block number"))?; - - let block_num = >::from(block_num); - let signed_block = self + fn query_data_proof(&self, data_index: u32, at: Option>) -> Result { + // Fetch block + let block_id = self.block_id(at); + let block = self .client - .block(&BlockId::number(block_num)) + .block(&block_id) .map_err(|e| internal_err!("Invalid block number: {:?}", e))? - .ok_or_else(|| internal_err!("Missing block number {}", block_num))?; - - let mut leaves: Vec<[u8; 32]> = Vec::new(); - let mut interested_leaf_position: Option = None; - - for (pos, xt) in signed_block.block.extrinsics().iter().enumerate() { - let avail_extrinsic = AppExtrinsic { - app_id: xt.app_id(), - data: xt.encode(), - }; - let optional_decoded_xt = ::decode(&mut &avail_extrinsic.data[..]); - - match optional_decoded_xt { - Ok(decoded_xt) => leaves.push(Sha256::hash(&decoded_xt.data)), - Err(_) => continue, - } - if pos == index { - interested_leaf_position = Some(leaves.len() - 1); - } - } - - if leaves.len() > 0 { - if let Some(position) = interested_leaf_position { - let data_tree = MerkleTree::::from_leaves(&leaves); - // TODO: Enable assertion - // assert_eq!(data_tree.root(), signed_block.block.header().extrinsics_root().data_root(), "Wrong data root!"); - let proof = data_tree.proof(&[position]); - return Ok(proof.proof_hashes().to_vec()); - } - } - Err(internal_err!("Proof not possible!")) + .ok_or_else(|| internal_err!("Missing block number {:?}", block_id))? + .block; + + // Get App Extrinsics from the block. + let calls = block + .extrinsics() + .iter() + .map(|extrinsic| extrinsic.call().clone()); + + // Build the proof. + let merkle_proof = submitted_data::calls_proof::(calls, data_index) + .ok_or_else(|| { + internal_err!( + "Data proof cannot be generated for index={} at block {:?}", + data_index, + block_id + ) + })?; + DataProof::try_from(&merkle_proof) + .map_err(|e| internal_err!("Data proof cannot be loaded from merkle root: {:?}", e)) } } diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 0e8abe300..b2d477694 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "da-runtime" -version = "4.0.0" +version = "6.0.0" authors = ["Anonymous"] description = "Polygon Data Avilability Runtime" edition = "2018" @@ -13,14 +13,20 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] # Internal -da-primitives = { path = "../primitives/avail", default-features = false } +da-primitives = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } +kate = { git = "https://github.com/maticnetwork/avail-core.git", tag = "v0.2.2", default-features = false } da-control = { path = "../pallets/dactr", default-features = false } -kate = { path = "../kate", default-features = false } kate-rpc-runtime-api = { path = "../rpc/kate-rpc-runtime-api", default-features = false } +## Nomad +updater-manager = { path = "../pallets/nomad/updater-manager", default-features = false } +nomad-home = { path = "../pallets/nomad/home", default-features = false } +da-bridge = { path = "../pallets/nomad/da-bridge", default-features = false } + # External static_assertions = "1.1.0" serde = { version = "1.0.121", optional = true, features = ["derive"] } +log = { version = "0.4.14", default-features = false } # Substrate scale-info = { version = "1.0", default-features = false, features = ["derive"] } @@ -97,12 +103,14 @@ hex = "0.4" hex-literal = "0.3.4" serde_json = "1.0" sp-keyring = "4.0.0-dev" +env_logger = "0.9.1" [features] default = ["std"] std = [ "serde", "parity-util-mem/std", + "log/std", "da-primitives/std", "sp-io/std", "sp-core/std", @@ -152,15 +160,18 @@ std = [ "pallet-mmr/std", "frame-system-rpc-runtime-api/std", "da-control/std", + "updater-manager/std", + "nomad-home/std", + "da-bridge/std", ] runtime-benchmarks = [ "frame-benchmarking", "frame-system/runtime-benchmarks", "da-control/runtime-benchmarks", + "nomad-home/runtime-benchmarks", + "da-bridge/runtime-benchmarks", "pallet-collective/runtime-benchmarks", "frame-system-benchmarking", "hex-literal", ] -# "sp-runtime/runtime-benchmarks", , "hex-literal", , "pallet-balances/runtime-benchmarks", "pallet-timestamp/runtime-benchmarks", "pallet-babe/runtime-benchmarks", "pallet-elections-phragmen/runtime-benchmarks", "pallet-grandpa/runtime-benchmarks", "pallet-im-online/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", - diff --git a/runtime/src/data_root_tests.rs b/runtime/src/data_root_tests.rs new file mode 100644 index 000000000..6d2037c84 --- /dev/null +++ b/runtime/src/data_root_tests.rs @@ -0,0 +1,69 @@ +use da_control::CheckAppId; +use da_primitives::asdr::AppExtrinsic; +use frame_system::submitted_data::extrinsics_root; +use hex_literal::hex; +use pallet_transaction_payment::ChargeTransactionPayment; +use sp_core::{sr25519::Signature, H256}; +use sp_runtime::{generic::Era, AccountId32, MultiAddress}; +use test_case::test_case; + +use super::*; + +fn submit_call>(app_id: A) -> AppExtrinsic { + let data = hex!("ed018400d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01be06880f2f6203365b508b4226fd697d3d79d3a50a5617aad714466d40ef47067225e823135b32121aa0f6f56e696f5f71107a6d44768c2fefe38cb209f7f28224000000041d014054657374207375626d69742064617461").to_vec(); + AppExtrinsic { + app_id: app_id.into(), + data, + } +} +fn submit_call_expected() -> H256 { + // hex!("ddf368647a902a6f6ab9f53b32245be28edc99e92f43f0004bbc2cb359814b2a").into() + // hex!("9c6cf805b377632c6a224e1ca035f8f6975932529a5e492e73742e4f861ba89d").into() + hex!("66dde8b32cbd3e6c3ae02f570a23202413d67870b15354c17cc12c4c49894c55").into() +} + +#[test] +fn decode_submit_call() { + let encoded_call = submit_call(1).data; + + let call = super::UncheckedExtrinsic::decode(&mut encoded_call.as_slice()).unwrap(); + + let account = hex!("d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"); + let expected_signature = MultiSignature::Sr25519(Signature(hex!("be06880f2f6203365b508b4226fd697d3d79d3a50a5617aad714466d40ef47067225e823135b32121aa0f6f56e696f5f71107a6d44768c2fefe38cb209f7f282"))); + let expected_call = AppUncheckedExtrinsic { + function: Call::DataAvailability(da_control::Call::submit_data { + data: hex!("54657374207375626d69742064617461") + .to_vec() + .try_into() + .unwrap(), + }), + + // signature: Option<(Address, Signature, Extra)>, + signature: Some(( + MultiAddress::Id(AccountId32::new(account)), + expected_signature.clone(), + // super::SignedExtra::default() + ( + CheckSpecVersion::::new(), + CheckTxVersion::::new(), + CheckGenesis::::new(), + CheckEra::::from(Era::Mortal(32, 2)), + CheckNonce::::from(0), + CheckWeight::::new(), + ChargeTransactionPayment::::from(0), + CheckAppId::::from(1.into()), + ), + )), + }; + + if let Some(ref signature) = call.signature { + assert_eq!(signature.1, expected_signature); + } + assert_eq!(call, expected_call); +} + +#[test_case( submit_call(0) => submit_call_expected(); "Submit data 0")] +#[test_case( submit_call(1) => submit_call_expected(); "Submit data 1")] +fn data_root_filter(extrinsic: AppExtrinsic) -> H256 { + extrinsics_root::(vec![extrinsic].into_iter()) +} diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 80a28e23b..246a9c6df 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -17,15 +17,15 @@ pub use frame_support::{ }; use frame_system::{ limits::{BlockLength, BlockWeights as SystemBlockWeights}, - CheckEra, CheckGenesis, CheckNonce, CheckSpecVersion, CheckTxVersion, CheckWeight, EnsureOneOf, - EnsureRoot, + submitted_data, CheckEra, CheckGenesis, CheckNonce, CheckSpecVersion, CheckTxVersion, + CheckWeight, EnsureOneOf, EnsureRoot, }; use pallet_session::historical as pallet_session_historical; use sp_api::impl_runtime_apis; use sp_core::{ crypto::KeyTypeId, u32_trait::{_1, _2, _3, _4, _5}, - OpaqueMetadata, + OpaqueMetadata, H256, }; use sp_inherents::{CheckInherentsResult, InherentData}; use sp_runtime::{ @@ -41,6 +41,9 @@ use sp_std::prelude::*; #[cfg(feature = "std")] use sp_version::NativeVersion; +#[cfg(test)] +mod data_root_tests; + #[cfg(feature = "std")] pub fn wasm_binary_unwrap() -> &'static [u8] { WASM_BINARY.expect( @@ -52,10 +55,10 @@ pub fn wasm_binary_unwrap() -> &'static [u8] { use currency::*; /// Import the DA pallet. pub use da_primitives::{ - asdr::{AppId, AppUncheckedExtrinsic, GetAppId}, + asdr::{AppExtrinsic, AppId, AppUncheckedExtrinsic, GetAppId}, currency::{Balance, AVL, CENTS, MILLICENTS}, well_known_keys::KATE_PUBLIC_PARAMS, - Header as DaHeader, NORMAL_DISPATCH_RATIO, + DataProof, Header as DaHeader, NORMAL_DISPATCH_RATIO, }; pub use pallet_balances::Call as BalancesCall; use pallet_grandpa::{ @@ -140,7 +143,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to 0. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 5, + spec_version: 6, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -152,7 +155,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { /// up by `pallet_babe` to implement `fn slot_duration()`. /// /// Change this to adjust the block time. -pub const MILLISECS_PER_BLOCK: u64 = 20000; +pub const MILLISECS_PER_BLOCK: u64 = 20_000; pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK; @@ -163,12 +166,7 @@ pub const DAYS: BlockNumber = HOURS * 24; pub const PRIMARY_PROBABILITY: (u64, u64) = (1, 4); -pub const EPOCH_DURATION_IN_BLOCKS: BlockNumber = 10 * MINUTES; -pub const EPOCH_DURATION_IN_SLOTS: u64 = { - const SLOT_FILL_RATE: f64 = MILLISECS_PER_BLOCK as f64 / SLOT_DURATION as f64; - - (EPOCH_DURATION_IN_BLOCKS as f64 * SLOT_FILL_RATE) as u64 -}; +pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = 1 * HOURS; /// The BABE epoch configuration at genesis. pub const BABE_GENESIS_EPOCH_CONFIG: sp_consensus_babe::BabeEpochConfiguration = @@ -224,7 +222,7 @@ impl OnUnbalanced for DealWithFees { /// We assume that ~10% of the block weight is consumed by `on_initialize` handlers. /// This is used to limit the maximal weight of a single extrinsic. const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10); -/// We allow for 2 seconds of compute with a 6 second average block time. +/// We allow for 2 seconds of compute with a 20 second average block time. const MAXIMUM_BLOCK_WEIGHT: Weight = 2 * WEIGHT_PER_SECOND; parameter_types! { @@ -257,8 +255,42 @@ parameter_types! { pub const SS58Prefix: u16 = 42; } -// Configure FRAME pallets to include in runtime. +/// Filters and extracts `data` from `call` if it is a `DataAvailability::submit_data` type. +/// +/// # TODO +/// - Support utility pallet containing severals `DataAvailability::submit_data` calls. +impl submitted_data::Filter for Runtime { + fn filter(call: Call, metrics: submitted_data::RcMetrics) -> Option> { + metrics.borrow_mut().total_extrinsics += 1; + + match call { + Call::DataAvailability(method) => match method { + da_control::Call::submit_data { data } => { + let mut metrics = metrics.borrow_mut(); + metrics.data_submit_leaves += 1; + metrics.data_submit_extrinsics += 1; + Some(data.into_inner()) + }, + _ => None, + }, + Call::Utility(_) => { + // TODO Support utility here. + None + }, + _ => None, + } + } +} + +/// Decodes and extracts the `data` of `DataAvailability::submit_data` extrinsics. +impl submitted_data::Extractor for Runtime { + fn extract(app_ext: AppExtrinsic, metrics: submitted_data::RcMetrics) -> Option> { + let extrinsic = UncheckedExtrinsic::decode(&mut app_ext.data.as_slice()).ok()?; + >::filter(extrinsic.function, metrics) + } +} +// Configure FRAME pallets to include in runtime. impl frame_system::Config for Runtime { /// The data to be stored in an account. type AccountData = pallet_balances::AccountData; @@ -287,7 +319,7 @@ impl frame_system::Config for Runtime { /// The header type. type Header = DaHeader; /// The header builder type. - type HeaderBuilder = frame_system::header_builder::da::HeaderBuilder; + type HeaderExtensionBuilder = frame_system::header_builder::da::HeaderExtensionBuilder; /// The index type for storing how many extrinsics an account has signed. type Index = Index; /// The lookup mechanism to get account ID from whatever is passed in dispatchers. @@ -308,6 +340,8 @@ impl frame_system::Config for Runtime { type Randomness = pallet_babe::RandomnessFromOneEpochAgo; /// This is used as an identifier of the chain. 42 is the generic substrate prefix. type SS58Prefix = SS58Prefix; + /// Data Root + type SubmittedDataExtractor = Runtime; /// Weight information for the extrinsics of this pallet. type SystemWeightInfo = frame_system::weights::SubstrateWeight; /// Version of the runtime. @@ -339,10 +373,10 @@ impl pallet_scheduler::Config for Runtime { } parameter_types! { - pub const EpochDuration: u64 = EPOCH_DURATION_IN_SLOTS; + pub const EpochDuration: BlockNumber = EPOCH_DURATION_IN_SLOTS; pub const ExpectedBlockTime: Moment = MILLISECS_PER_BLOCK; - pub const ReportLongevity: u64 = - BondingDuration::get() as u64 * SessionsPerEra::get() as u64 * EpochDuration::get(); + pub const ReportLongevity: BlockNumber = + BondingDuration::get() * SessionsPerEra::get() * EpochDuration::get(); } impl pallet_babe::Config for Runtime { @@ -548,8 +582,8 @@ impl pallet_staking::Config for Runtime { parameter_types! { // phase durations. 1/4 of the last session for each. - pub const SignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS / 4; - pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_BLOCKS / 4; + pub const SignedPhase: u32 = EPOCH_DURATION_IN_SLOTS / 4; + pub const UnsignedPhase: u32 = EPOCH_DURATION_IN_SLOTS / 4; // signed config pub const SignedMaxSubmissions: u32 = 10; @@ -927,10 +961,6 @@ parameter_types! { // Make sure that there are no more than `MaxMembers` members elected via elections-phragmen. const_assert!(DesiredMembers::get() <= CouncilMaxMembers::get()); -parameter_types! { - pub const SessionDuration: BlockNumber = EPOCH_DURATION_IN_SLOTS as _; -} - impl pallet_bounties::Config for Runtime { type BountyCuratorDeposit = BountyCuratorDeposit; type BountyDepositBase = BountyDepositBase; @@ -975,6 +1005,30 @@ impl da_control::Config for Runtime { type WeightInfo = da_control::weights::SubstrateWeight; } +impl updater_manager::Config for Runtime { + type Event = Event; +} + +parameter_types! { + pub const MaxMessageBodyBytes: u32 = 2048; +} + +impl nomad_home::Config for Runtime { + type Event = Event; + type MaxMessageBodyBytes = MaxMessageBodyBytes; + type WeightInfo = nomad_home::weights::SubstrateWeight; +} + +parameter_types! { + pub const DABridgePalletId: H256 = H256::repeat_byte(1); +} + +impl da_bridge::Config for Runtime { + type DABridgePalletId = DABridgePalletId; + type Event = Event; + type WeightInfo = da_bridge::weights::SubstrateWeight; +} + // TODO @miguel Aline this with previous order and ID to keep the compatibility. // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( @@ -1009,14 +1063,19 @@ construct_runtime!( Offences: pallet_offences = 22, Historical: pallet_session_historical = 23, - Scheduler: pallet_scheduler, - Bounties: pallet_bounties, - Tips: pallet_tips, - Mmr: pallet_mmr, - BagsList: pallet_bags_list, + Scheduler: pallet_scheduler = 24, + Bounties: pallet_bounties = 25, + Tips: pallet_tips = 26, + Mmr: pallet_mmr = 27, + BagsList: pallet_bags_list = 28, // DA module - DataAvailability: da_control, + DataAvailability: da_control = 29, + + // Nomad + UpdaterManager: updater_manager = 30, + NomadHome: nomad_home = 31, + DABridge: da_bridge = 32, } ); @@ -1172,7 +1231,7 @@ impl_runtime_apis! { // sp_consensus_babe::BabeGenesisConfiguration { slot_duration: Babe::slot_duration(), - epoch_length: EpochDuration::get(), + epoch_length: EpochDuration::get() as u64, c: BABE_GENESIS_EPOCH_CONFIG.c, genesis_authorities: Babe::authorities().to_vec(), randomness: Babe::randomness(), @@ -1290,7 +1349,6 @@ impl_runtime_apis! { seed.into() } - } impl sp_session::SessionKeys for Runtime { @@ -1325,6 +1383,8 @@ impl_runtime_apis! { list_benchmark!(list, extra, frame_benchmarking, BaselineBench::); list_benchmark!(list, extra, frame_system, SystemBench::); list_benchmark!(list, extra, da_control, DataAvailability); + list_benchmark!(list, extra, nomad_home, NomadHome); + list_benchmark!(list, extra, da_bridge, DABridge); let storage_info = AllPalletsWithSystem::storage_info(); @@ -1368,6 +1428,8 @@ impl_runtime_apis! { add_benchmark!(params, batches, frame_benchmarking, BaselineBench::); add_benchmark!(params, batches, frame_system, SystemBench::); add_benchmark!(params, batches, da_control, DataAvailability); + add_benchmark!(params, batches, nomad_home, NomadHome); + add_benchmark!(params, batches, da_bridge, DABridge); Ok(batches) } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index e027c9647..a979f3ef2 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2021-12-05" +channel = "1.64" components = ["rustfmt", "clippy", "llvm-tools-preview"] profile = "minimal" targets = ["wasm32-unknown-unknown"] diff --git a/tests/js_api/README.md b/tests/js_api/README.md index 4c9d7975b..b072a55a2 100644 --- a/tests/js_api/README.md +++ b/tests/js_api/README.md @@ -43,7 +43,7 @@ Do Keep in mind that the receiver address should be specified when you are using - Creation of app_id ``` - ts-node app_id.ts -i 10 + ts-node app_id.ts -i "10" ``` Here `i` is the app_id that we would like to create(default is 1). App Id needs to be created before mentioning it in config file. But the app_id which is mentioned in the config is the index of the app_id which is stored. You can check the app_id by checking in the explorer. diff --git a/tests/js_api/package-lock.json b/tests/js_api/package-lock.json index 97a19649e..1724ccd9a 100644 --- a/tests/js_api/package-lock.json +++ b/tests/js_api/package-lock.json @@ -1,2450 +1,8 @@ { "name": "tx", "version": "1.0.0", - "lockfileVersion": 2, + "lockfileVersion": 1, "requires": true, - "packages": { - "": { - "name": "tx", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "@polkadot/api": "^7.9.1" - }, - "devDependencies": { - "@types/yargs": "^17.0.12", - "@typescript-eslint/eslint-plugin": "^5.12.0", - "@typescript-eslint/parser": "^5.12.0", - "eslint": "^8.9.0", - "eslint-config-google": "^0.14.0", - "ts-node": "^10.5.0", - "typescript": "^4.5.5" - } - }, - "node_modules/@babel/runtime": { - "version": "7.17.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.17.2.tgz", - "integrity": "sha512-hzeyJyMA1YGdJTuWU0e/j4wKXrU4OMFvY2MSlaI9B7VQb0r5cxTE3EAIS2Q7Tn2RIcDkRvTA/v2JsAEhxe99uw==", - "dependencies": { - "regenerator-runtime": "^0.13.4" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@cspotcode/source-map-consumer": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", - "integrity": "sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==", - "dev": true, - "engines": { - "node": ">= 12" - } - }, - "node_modules/@cspotcode/source-map-support": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz", - "integrity": "sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==", - "dev": true, - "dependencies": { - "@cspotcode/source-map-consumer": "0.8.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.1.0.tgz", - "integrity": "sha512-C1DfL7XX4nPqGd6jcP01W9pVM1HYCuUkFk1432D7F0v3JSlUIeOYn9oCoi3eoLZ+iwBSb29BMFxxny0YrrEZqg==", - "dev": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.3.1", - "globals": "^13.9.0", - "ignore": "^4.0.6", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.0.4", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/@eslint/eslintrc/node_modules/ignore": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.3.tgz", - "integrity": "sha512-3xSMlXHh03hCcCmFc0rbKp3Ivt2PFEJnQUJDDMTJQ2wkECZWdq4GePs2ctc5H8zV+cHPaq8k2vU8mrQjA6iHdQ==", - "dev": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.4" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true - }, - "node_modules/@noble/hashes": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.0.0.tgz", - "integrity": "sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg==" - }, - "node_modules/@noble/secp256k1": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.5.2.tgz", - "integrity": "sha512-5mzA40W2q55VCRuC9XzmkiEnODdY0c5a7qsK2QcOfI5/MuVQyBaWGQyE6YOEF7kDwp+tDVWGsCDVJUME+wsWWw==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ] - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@polkadot/api": { - "version": "7.9.1", - "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-7.9.1.tgz", - "integrity": "sha512-bV+qaUwbNsPwLYVQ2ZmA7Spi8znp1RrNGJPP3ZiR96vdShe4iLizbkcPpV+X9+E/tytvTouU2pGUM4UW4EsQ5w==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/api-augment": "7.9.1", - "@polkadot/api-base": "7.9.1", - "@polkadot/api-derive": "7.9.1", - "@polkadot/keyring": "^8.4.1", - "@polkadot/rpc-augment": "7.9.1", - "@polkadot/rpc-core": "7.9.1", - "@polkadot/rpc-provider": "7.9.1", - "@polkadot/types": "7.9.1", - "@polkadot/types-augment": "7.9.1", - "@polkadot/types-codec": "7.9.1", - "@polkadot/types-create": "7.9.1", - "@polkadot/types-known": "7.9.1", - "@polkadot/util": "^8.4.1", - "@polkadot/util-crypto": "^8.4.1", - "eventemitter3": "^4.0.7", - "rxjs": "^7.5.4" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/api-augment": { - "version": "7.9.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-augment/-/api-augment-7.9.1.tgz", - "integrity": "sha512-mfCcN73uXH/KN69Gfsijzas7L68FU/oV5AhVW4ijp7/9uG66+VWYkhRTnHRBgFdavUQME7fTQ+eQiyA3kRozTg==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/api-base": "7.9.1", - "@polkadot/rpc-augment": "7.9.1", - "@polkadot/types": "7.9.1", - "@polkadot/types-augment": "7.9.1", - "@polkadot/types-codec": "7.9.1", - "@polkadot/util": "^8.4.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/api-base": { - "version": "7.9.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-base/-/api-base-7.9.1.tgz", - "integrity": "sha512-sxUEbQAt80/UEtnY5ho+tNmh0Zl8fJxhIaSlWbSyEr15gAOeP2vu4U9RxFzESOK393QuUsm8Ef0F79RkQYG5Ew==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/rpc-core": "7.9.1", - "@polkadot/types": "7.9.1", - "@polkadot/util": "^8.4.1", - "rxjs": "^7.5.4" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/api-derive": { - "version": "7.9.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-7.9.1.tgz", - "integrity": "sha512-yEBSGPkQN+eR2RPYWxt91pR5k8gljV8zYo+6m5NvESYCrPWzfOJL1mQRr+N+4cNcfZ+ZL0+8e0LUIlac4MMesw==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/api": "7.9.1", - "@polkadot/api-augment": "7.9.1", - "@polkadot/api-base": "7.9.1", - "@polkadot/rpc-core": "7.9.1", - "@polkadot/types": "7.9.1", - "@polkadot/types-codec": "7.9.1", - "@polkadot/util": "^8.4.1", - "@polkadot/util-crypto": "^8.4.1", - "rxjs": "^7.5.4" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/keyring": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-8.4.1.tgz", - "integrity": "sha512-0qfS7qikUxhe6LEdCOcMRdCxEa26inJ5aSUWaf5dXy+dgy9VJiov6uXAbXdAd1UHpDvr9hvw94FX+hXsJ7Vsyw==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/util": "8.4.1", - "@polkadot/util-crypto": "8.4.1" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "@polkadot/util": "8.4.1", - "@polkadot/util-crypto": "8.4.1" - } - }, - "node_modules/@polkadot/networks": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-8.4.1.tgz", - "integrity": "sha512-YFY3fPLbc1Uz9zsX4TOzjY/FF09nABMgrMkvqddrVbSgo71NvoBv3Gqw3mKV/7bX1Gzk1ODfvTzamdpsKEWSnA==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/util": "8.4.1", - "@substrate/ss58-registry": "^1.14.0" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/rpc-augment": { - "version": "7.9.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-augment/-/rpc-augment-7.9.1.tgz", - "integrity": "sha512-8rI0cfNT7A6rdrk7lBRcB/1Qm8x6yarDTVUaRuqTBLzjgr/4WExg1h7sjjFOLVPE6T+SXBY0RKjRKglTcolv5g==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/rpc-core": "7.9.1", - "@polkadot/types": "7.9.1", - "@polkadot/types-codec": "7.9.1", - "@polkadot/util": "^8.4.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/rpc-core": { - "version": "7.9.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-7.9.1.tgz", - "integrity": "sha512-p1Z0Ii+/w31EBS3lcE9fr83Gf3zZK7IM1+AEuCW7NGM9iHMTLZtzMKE23B34Hs8eR5JdDBcXMYtcwNL+W/I5jA==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/rpc-augment": "7.9.1", - "@polkadot/rpc-provider": "7.9.1", - "@polkadot/types": "7.9.1", - "@polkadot/util": "^8.4.1", - "rxjs": "^7.5.4" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/rpc-provider": { - "version": "7.9.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-7.9.1.tgz", - "integrity": "sha512-gDcWFxzea5sfjEOCiO3rRRGxWYiUzlcra8PK/aS0H7GU6QnYNi7VXQY4fgM0VZbo1tkrw0+lBlpXrEZcPAP6Qg==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/keyring": "^8.4.1", - "@polkadot/types": "7.9.1", - "@polkadot/types-support": "7.9.1", - "@polkadot/util": "^8.4.1", - "@polkadot/util-crypto": "^8.4.1", - "@polkadot/x-fetch": "^8.4.1", - "@polkadot/x-global": "^8.4.1", - "@polkadot/x-ws": "^8.4.1", - "eventemitter3": "^4.0.7", - "mock-socket": "^9.1.2", - "nock": "^13.2.4" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/types": { - "version": "7.9.1", - "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-7.9.1.tgz", - "integrity": "sha512-yyBMqPh3pmEWY+G5XWwO8HK6Xh80rrrPiq+BoggPIue8c9ecrXhwRbOyzah7Gk4/Mq2My7nwsDwyhqJfwkUtKw==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/keyring": "^8.4.1", - "@polkadot/types-augment": "7.9.1", - "@polkadot/types-codec": "7.9.1", - "@polkadot/types-create": "7.9.1", - "@polkadot/util": "^8.4.1", - "@polkadot/util-crypto": "^8.4.1", - "rxjs": "^7.5.4" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/types-augment": { - "version": "7.9.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-7.9.1.tgz", - "integrity": "sha512-2dl7CzgEBgGSjcqNcH2F2ZIlGVkf/mtbvu8ObmVw4z/ojpRLv26MO2TexF6fUMAFi7uNnq4r4yB9NsAxdUv2ZQ==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/types": "7.9.1", - "@polkadot/types-codec": "7.9.1", - "@polkadot/util": "^8.4.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/types-codec": { - "version": "7.9.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-7.9.1.tgz", - "integrity": "sha512-wFSvVrBuk7s8SF1pIs1ftwE0B1TpU2CuWy/AGCh4TG510nbrpCh7DaJQJKfsRXprpbo08ybkocT2p6Snv6SIOA==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/util": "^8.4.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/types-create": { - "version": "7.9.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-create/-/types-create-7.9.1.tgz", - "integrity": "sha512-/l0EIMrtQFlD7mltwyWv2GuZiOYCHWOSvMMIYSocmhijKIBlJb0Wsn5RIpmUaDojYre01tx5NSwnLH82uTK6mQ==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/types-codec": "7.9.1", - "@polkadot/util": "^8.4.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/types-known": { - "version": "7.9.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-7.9.1.tgz", - "integrity": "sha512-O4Mir1Iec4Dex+i5tu9ouUjD2hEV1LzwWsqnu690QoIKNdb4Kc3LDSBt4CyCsb/yTvn4tXIMwO+D3n0i91QJuQ==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/networks": "^8.4.1", - "@polkadot/types": "7.9.1", - "@polkadot/types-codec": "7.9.1", - "@polkadot/types-create": "7.9.1", - "@polkadot/util": "^8.4.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/types-support": { - "version": "7.9.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-7.9.1.tgz", - "integrity": "sha512-WO0xE2P01KqfQ7vJH0DGRYeK/UdIEKakJLdm7Js5zXoWwAtjSJ9Xk66F6TOpqnji5dvYlVcEA0t3a5NgivuzcQ==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/util": "^8.4.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/util": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-8.4.1.tgz", - "integrity": "sha512-8+wqHgFbFWI5TfrvtcL888w0nWvFpbTTYIcbpEw+zYGp3n1YZTAMMP26bXWAaQX5AttxynJRij7JP3ySxYY1fg==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/x-bigint": "8.4.1", - "@polkadot/x-global": "8.4.1", - "@polkadot/x-textdecoder": "8.4.1", - "@polkadot/x-textencoder": "8.4.1", - "@types/bn.js": "^5.1.0", - "bn.js": "^5.2.0", - "ip-regex": "^4.3.0" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/util-crypto": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-8.4.1.tgz", - "integrity": "sha512-mWjp83aIWw+EhKN9RkUDmubXibo25q5yHJl4BGm2gT71yTZcABB7q1SGfpDqLH9AB3eXJiutqhC4L3SH7YZ+6Q==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@noble/hashes": "1.0.0", - "@noble/secp256k1": "1.5.2", - "@polkadot/networks": "8.4.1", - "@polkadot/util": "8.4.1", - "@polkadot/wasm-crypto": "^4.5.1", - "@polkadot/x-bigint": "8.4.1", - "@polkadot/x-randomvalues": "8.4.1", - "@scure/base": "1.0.0", - "ed2curve": "^0.3.0", - "tweetnacl": "^1.0.3" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "@polkadot/util": "8.4.1" - } - }, - "node_modules/@polkadot/wasm-crypto": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto/-/wasm-crypto-4.5.1.tgz", - "integrity": "sha512-Cr21ais3Kq3aedIHZ3J1tjgeD/+K8FCiwEawr0oRywNBSJR8wyuZMePs4swR/6xm8wbBkpqoBVHz/UQHqqQJmA==", - "dependencies": { - "@babel/runtime": "^7.16.3", - "@polkadot/wasm-crypto-asmjs": "^4.5.1", - "@polkadot/wasm-crypto-wasm": "^4.5.1" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "@polkadot/util": "*", - "@polkadot/x-randomvalues": "*" - } - }, - "node_modules/@polkadot/wasm-crypto-asmjs": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-4.5.1.tgz", - "integrity": "sha512-DOdRiWhxVvmqTvp+E9z1j+Yr0zDOGsDvqnT/eNw0Dl1FVUOImsEa7FKns/urASmcxCVEE1jtUWSnij29jrORMQ==", - "dependencies": { - "@babel/runtime": "^7.16.3" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/wasm-crypto-wasm": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-4.5.1.tgz", - "integrity": "sha512-hPwke85HxpgG/RAlwdCE8u5w7bThvWg399mlB+XjogXMxOUWBZSgq2XYbgzROUXx27inK9nStF4Pnc4zJnqs9A==", - "dependencies": { - "@babel/runtime": "^7.16.3" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/x-bigint": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-8.4.1.tgz", - "integrity": "sha512-QVP0UMoM0nBD998s3ESeaoSiVMEnHK3x0CCqocKO4l7ADNw8lfWdDG7Bb0+ymNaFYGz2KgEWxkN0VhNEnXzo0w==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/x-global": "8.4.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/x-fetch": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-8.4.1.tgz", - "integrity": "sha512-DPkgXZYt1B4xCzEw/3hxRc4/lR+NEr/b/GYijSPM8UsVoEKqHWTx2qCXrxvmKh1WD9reQ+oUACPVjRcBz5bs+g==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/x-global": "8.4.1", - "@types/node-fetch": "^2.5.12", - "node-fetch": "^2.6.7" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/x-global": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-8.4.1.tgz", - "integrity": "sha512-MQs89LKQrJwiXjV7dY2kDOPNaiWrwaQ/Fzg93ycB2xMCclRV1jRFRhnhTPJ8Ao79lhCCoazd7pXIyFgfifxdqg==", - "dependencies": { - "@babel/runtime": "^7.17.2" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/x-randomvalues": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-8.4.1.tgz", - "integrity": "sha512-1dRIFIib4RzyVo0k5oMLuxqSuZEV6UVvvN+jJw9G/9P1ggZtHjM1KwoFcyHgvpk2RWTB9eJZFemwSvQTpdmSJw==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/x-global": "8.4.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/x-textdecoder": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-8.4.1.tgz", - "integrity": "sha512-qbSXyR2KvE1bO6QGsxWU3Yrx5e70rX2lwv0MHG++MyyNaDoBM3hjx14lF911bYRWXR6MW4eZ+0Nakn0oM5uSKw==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/x-global": "8.4.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/x-textencoder": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-8.4.1.tgz", - "integrity": "sha512-1UYuckNOk6NUk70Y/SGbK8oyGbqPlrny1x2OWoK/BT3/tyL2xKVV5TlXDOiFrX1PChbskXye5M8blCTYikFiJg==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/x-global": "8.4.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@polkadot/x-ws": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-8.4.1.tgz", - "integrity": "sha512-u9rsJdVrBkSARy8BhJPho1yMMBSiI/Z/W8ZQRr1I28/QOwl02VYktFpFWWrhkBHsL9JlZ0wfnyKBPXrw8Wp2Vw==", - "dependencies": { - "@babel/runtime": "^7.17.2", - "@polkadot/x-global": "8.4.1", - "@types/websocket": "^1.0.5", - "websocket": "^1.0.34" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/@scure/base": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.0.0.tgz", - "integrity": "sha512-gIVaYhUsy+9s58m/ETjSJVKHhKTBMmcRb9cEV5/5dwvfDlfORjKrFsDeDHWRrm6RjcPvCLZFwGJjAjLj1gg4HA==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ] - }, - "node_modules/@substrate/ss58-registry": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/@substrate/ss58-registry/-/ss58-registry-1.15.0.tgz", - "integrity": "sha512-UU5uN8HEp0NM22od6kHWLltX0McQPgPX6O3gj7fSf1mMExsCS5fzW88gv1WaVaT8Q+umvGgnIAF7+Tvp8fqTFw==" - }, - "node_modules/@tsconfig/node10": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", - "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", - "dev": true - }, - "node_modules/@tsconfig/node12": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", - "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", - "dev": true - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", - "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", - "dev": true - }, - "node_modules/@tsconfig/node16": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", - "dev": true - }, - "node_modules/@types/bn.js": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.0.tgz", - "integrity": "sha512-QSSVYj7pYFN49kW77o2s9xTCwZ8F2xLbjLLSEVh8D2F4JUhZtPAGOFLTD+ffqksBx/u4cE/KImFjyhqCjn/LIA==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/json-schema": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", - "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", - "dev": true - }, - "node_modules/@types/node": { - "version": "17.0.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.18.tgz", - "integrity": "sha512-eKj4f/BsN/qcculZiRSujogjvp5O/k4lOW5m35NopjZM/QwLOR075a8pJW5hD+Rtdm2DaCVPENS6KtSQnUD6BA==" - }, - "node_modules/@types/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", - "dependencies": { - "@types/node": "*", - "form-data": "^3.0.0" - } - }, - "node_modules/@types/websocket": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.5.tgz", - "integrity": "sha512-NbsqiNX9CnEfC1Z0Vf4mE1SgAJ07JnRYcNex7AJ9zAVzmiGHmjKFEk7O4TJIsgv2B1sLEb6owKFZrACwdYngsQ==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/yargs": { - "version": "17.0.12", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.12.tgz", - "integrity": "sha512-Nz4MPhecOFArtm81gFQvQqdV7XYCrWKx5uUt6GNHredFHn1i2mtWqXTON7EPXMtNi1qjtjEM/VCHDhcHsAMLXQ==", - "dev": true, - "dependencies": { - "@types/yargs-parser": "*" - } - }, - "node_modules/@types/yargs-parser": { - "version": "21.0.0", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", - "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", - "dev": true - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.12.0.tgz", - "integrity": "sha512-fwCMkDimwHVeIOKeBHiZhRUfJXU8n6xW1FL9diDxAyGAFvKcH4csy0v7twivOQdQdA0KC8TDr7GGRd3L4Lv0rQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.12.0", - "@typescript-eslint/type-utils": "5.12.0", - "@typescript-eslint/utils": "5.12.0", - "debug": "^4.3.2", - "functional-red-black-tree": "^1.0.1", - "ignore": "^5.1.8", - "regexpp": "^3.2.0", - "semver": "^7.3.5", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.12.0.tgz", - "integrity": "sha512-MfSwg9JMBojMUoGjUmX+D2stoQj1CBYTCP0qnnVtu9A+YQXVKNtLjasYh+jozOcrb/wau8TCfWOkQTiOAruBog==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.12.0", - "@typescript-eslint/types": "5.12.0", - "@typescript-eslint/typescript-estree": "5.12.0", - "debug": "^4.3.2" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.12.0.tgz", - "integrity": "sha512-GAMobtIJI8FGf1sLlUWNUm2IOkIjvn7laFWyRx7CLrv6nLBI7su+B7lbStqVlK5NdLvHRFiJo2HhiDF7Ki01WQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.12.0", - "@typescript-eslint/visitor-keys": "5.12.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.12.0.tgz", - "integrity": "sha512-9j9rli3zEBV+ae7rlbBOotJcI6zfc6SHFMdKI9M3Nc0sy458LJ79Os+TPWeBBL96J9/e36rdJOfCuyRSgFAA0Q==", - "dev": true, - "dependencies": { - "@typescript-eslint/utils": "5.12.0", - "debug": "^4.3.2", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/types": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.12.0.tgz", - "integrity": "sha512-JowqbwPf93nvf8fZn5XrPGFBdIK8+yx5UEGs2QFAYFI8IWYfrzz+6zqlurGr2ctShMaJxqwsqmra3WXWjH1nRQ==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.12.0.tgz", - "integrity": "sha512-Dd9gVeOqt38QHR0BEA8oRaT65WYqPYbIc5tRFQPkfLquVEFPD1HAtbZT98TLBkEcCkvwDYOAvuSvAD9DnQhMfQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.12.0", - "@typescript-eslint/visitor-keys": "5.12.0", - "debug": "^4.3.2", - "globby": "^11.0.4", - "is-glob": "^4.0.3", - "semver": "^7.3.5", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.12.0.tgz", - "integrity": "sha512-k4J2WovnMPGI4PzKgDtQdNrCnmBHpMUFy21qjX2CoPdoBcSBIMvVBr9P2YDP8jOqZOeK3ThOL6VO/sy6jtnvzw==", - "dev": true, - "dependencies": { - "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.12.0", - "@typescript-eslint/types": "5.12.0", - "@typescript-eslint/typescript-estree": "5.12.0", - "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.12.0.tgz", - "integrity": "sha512-cFwTlgnMV6TgezQynx2c/4/tx9Tufbuo9LPzmWqyRC3QC4qTGkAG1C6pBr0/4I10PAI/FlYunI3vJjIcu+ZHMg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.12.0", - "eslint-visitor-keys": "^3.0.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/bn.js": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", - "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/bufferutil": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.6.tgz", - "integrity": "sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw==", - "hasInstallScript": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true - }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "dependencies": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "node_modules/debug": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", - "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/ed2curve": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/ed2curve/-/ed2curve-0.3.0.tgz", - "integrity": "sha512-8w2fmmq3hv9rCrcI7g9hms2pMunQr1JINfcjwR9tAyZqhtyaMN991lF/ZfHfr5tzZQ8c7y7aBgZbjfbd0fjFwQ==", - "dependencies": { - "tweetnacl": "1.x.x" - } - }, - "node_modules/es5-ext": { - "version": "0.10.53", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", - "integrity": "sha512-Xs2Stw6NiNHWypzRTY1MtaG/uJlwCk8kH81920ma8mvN8Xq1gsfhZvpkImLQArw8AHnv8MT2I45J3c0R8slE+Q==", - "dependencies": { - "es6-iterator": "~2.0.3", - "es6-symbol": "~3.1.3", - "next-tick": "~1.0.0" - } - }, - "node_modules/es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "dependencies": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "node_modules/es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "dependencies": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "8.9.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.9.0.tgz", - "integrity": "sha512-PB09IGwv4F4b0/atrbcMFboF/giawbBLVC7fyDamk5Wtey4Jh2K+rYaBhCAbUyEI4QzB1ly09Uglc9iCtFaG2Q==", - "dev": true, - "dependencies": { - "@eslint/eslintrc": "^1.1.0", - "@humanwhocodes/config-array": "^0.9.2", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.1", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.6.0", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.0.4", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0", - "v8-compile-cache": "^2.0.3" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-config-google": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/eslint-config-google/-/eslint-config-google-0.14.0.tgz", - "integrity": "sha512-WsbX4WbjuMvTdeVL6+J3rK1RGhCTqjsFjX7UMSMgZiyxxaNLkoJENbrGExzERFeoTpGw3F3FypTiWAP9ZXzkEw==", - "dev": true, - "engines": { - "node": ">=0.10.0" - }, - "peerDependencies": { - "eslint": ">=5.16.0" - } - }, - "node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/espree": { - "version": "9.3.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.1.tgz", - "integrity": "sha512-bvdyLmJMfwkV3NCRl5ZhJf22zBFo1y8bYh3VYb+bfzqNB4Je68P2sSuXyuFquzWLebHpNd2/d5uv7yoP9ISnGQ==", - "dev": true, - "dependencies": { - "acorn": "^8.7.0", - "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" - }, - "node_modules/ext": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.6.0.tgz", - "integrity": "sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg==", - "dependencies": { - "type": "^2.5.0" - } - }, - "node_modules/ext/node_modules/type": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/type/-/type-2.6.0.tgz", - "integrity": "sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ==" - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", - "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true - }, - "node_modules/fastq": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", - "dev": true - }, - "node_modules/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", - "dev": true - }, - "node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/globals": { - "version": "13.12.1", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.12.1.tgz", - "integrity": "sha512-317dFlgY2pdJZ9rspXDks7073GpDmXdfbM3vYYp0HAMKGDh1FfWPleI2ljVNLQX5M5lXcAslTcPTrOrMEFOjyw==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ignore": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/ip-regex": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", - "integrity": "sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "node_modules/lodash.set": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", - "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=" - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", - "integrity": "sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg==", - "dev": true, - "dependencies": { - "braces": "^3.0.1", - "picomatch": "^2.2.3" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mime-db": { - "version": "1.51.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz", - "integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.34", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz", - "integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==", - "dependencies": { - "mime-db": "1.51.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/mock-socket": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/mock-socket/-/mock-socket-9.1.2.tgz", - "integrity": "sha512-XKZkCnQ9ISOlTnaPg4LYYSMj7+6i78HyadYzLA5JM4465ibLdjappZD9Csnqc3Tfzep/eEK/LCJ29BTaLHoB1A==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true - }, - "node_modules/next-tick": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", - "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" - }, - "node_modules/nock": { - "version": "13.2.4", - "resolved": "https://registry.npmjs.org/nock/-/nock-13.2.4.tgz", - "integrity": "sha512-8GPznwxcPNCH/h8B+XZcKjYPXnUV5clOKCjAqyjsiqA++MpNx9E9+t8YPp0MbThO+KauRo7aZJ1WuIZmOrT2Ug==", - "dependencies": { - "debug": "^4.1.0", - "json-stringify-safe": "^5.0.1", - "lodash.set": "^4.3.2", - "propagate": "^2.0.0" - }, - "engines": { - "node": ">= 10.13" - } - }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node-gyp-build": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", - "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==", - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/propagate": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", - "integrity": "sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==", - "engines": { - "node": ">= 8" - } - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/regenerator-runtime": { - "version": "0.13.9", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", - "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==" - }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/rxjs": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.4.tgz", - "integrity": "sha512-h5M3Hk78r6wAheJF0a5YahB1yRQKCsZ4MsGdZ5O9ETbVtjPcScGfrMmoOq7EBsCRzd4BDkvDJ7ogP8Sz5tTFiQ==", - "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/rxjs/node_modules/tslib": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", - "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" - }, - "node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", - "dev": true - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "node_modules/ts-node": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.5.0.tgz", - "integrity": "sha512-6kEJKwVxAJ35W4akuiysfKwKmjkbYxwQMTBaAxo9KKAx/Yd26mPUyhGz3ji+EsJoAgrLqVsYHNuuYwQe22lbtw==", - "dev": true, - "dependencies": { - "@cspotcode/source-map-support": "0.7.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.0", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", - "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } - } - }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/tweetnacl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" - }, - "node_modules/type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, - "node_modules/typescript": { - "version": "4.5.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", - "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/utf-8-validate": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.8.tgz", - "integrity": "sha512-k4dW/Qja1BYDl2qD4tOMB9PFVha/UJtxTc1cXYOe3WwA/2m0Yn4qB7wLMpJyLJ/7DR0XnTut3HsCSzDT4ZvKgA==", - "hasInstallScript": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, - "node_modules/v8-compile-cache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true - }, - "node_modules/v8-compile-cache-lib": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz", - "integrity": "sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==", - "dev": true - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "node_modules/websocket": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", - "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", - "dependencies": { - "bufferutil": "^4.0.1", - "debug": "^2.2.0", - "es5-ext": "^0.10.50", - "typedarray-to-buffer": "^3.1.5", - "utf-8-validate": "^5.0.2", - "yaeti": "^0.0.6" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/websocket/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/websocket/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true - }, - "node_modules/yaeti": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha1-8m9ITXJoTPQr7ft2lwqhYI+/lXc=", - "engines": { - "node": ">=0.10.32" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, - "engines": { - "node": ">=6" - } - } - }, "dependencies": { "@babel/runtime": { "version": "7.17.2", @@ -3078,8 +636,7 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "requires": {} + "dev": true }, "acorn-walk": { "version": "8.2.0", @@ -3102,14 +659,12 @@ "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "requires": { "color-convert": "^2.0.1" } @@ -3191,11 +746,20 @@ "supports-color": "^7.1.0" } }, + "cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + } + }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "requires": { "color-name": "~1.1.4" } @@ -3203,8 +767,7 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "combined-stream": { "version": "1.0.8", @@ -3297,6 +860,11 @@ "tweetnacl": "1.x.x" } }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, "es5-ext": { "version": "0.10.53", "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", @@ -3326,6 +894,11 @@ "ext": "^1.1.2" } }, + "escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==" + }, "escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", @@ -3379,8 +952,7 @@ "version": "0.14.0", "resolved": "https://registry.npmjs.org/eslint-config-google/-/eslint-config-google-0.14.0.tgz", "integrity": "sha512-WsbX4WbjuMvTdeVL6+J3rK1RGhCTqjsFjX7UMSMgZiyxxaNLkoJENbrGExzERFeoTpGw3F3FypTiWAP9ZXzkEw==", - "dev": true, - "requires": {} + "dev": true }, "eslint-scope": { "version": "7.1.1", @@ -3583,6 +1155,11 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, "glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", @@ -3684,6 +1261,11 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -3945,6 +1527,11 @@ "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + }, "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -4020,11 +1607,20 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "requires": { "ansi-regex": "^5.0.1" } @@ -4225,12 +1821,27 @@ "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + }, "yaeti": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", @@ -4242,6 +1853,25 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "yargs": { + "version": "17.6.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", + "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", + "requires": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + } + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" + }, "yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", diff --git a/tests/js_api/package.json b/tests/js_api/package.json index 5b9f8410f..a71c392a2 100644 --- a/tests/js_api/package.json +++ b/tests/js_api/package.json @@ -24,6 +24,7 @@ "typescript": "^4.5.5" }, "dependencies": { - "@polkadot/api": "^7.9.1" + "@polkadot/api": "^7.9.1", + "yargs": "^17.6.2" } } diff --git a/tests/js_api/src/api.ts b/tests/js_api/src/api.ts new file mode 100644 index 000000000..714d3de0d --- /dev/null +++ b/tests/js_api/src/api.ts @@ -0,0 +1,135 @@ +import { ApiPromise, WsProvider } from "@polkadot/api"; +import config from './config'; + +export function createApi(): Promise { + const provider = new WsProvider(config.ApiURL); + + // Create the API and wait until ready + return ApiPromise.create({ + provider, + rpc: { + kate: { + blockLength: { + description: "Get Block Length", + params: [ + { + name: 'at', + type: 'Hash', + isOptional: true + } + ], + type: 'BlockLength' + }, + queryProof: { + description: 'Generate the kate proof for the given `cells`', + params: [ + { + name: 'cells', + type: 'Vec' + }, + { + name: 'at', + type: 'Hash', + isOptional: true + }, + ], + type: 'Vec' + }, + queryDataProof: { + description: 'Generate the data proof for the given `index`', + params: [ + { + name: 'data_index', + type: 'u32' + }, + { + name: 'at', + type: 'Hash', + isOptional: true + } + ], + type: 'DataProof' + } + } + }, + types: { + AppId: 'Compact', + DataLookupIndexItem: { + appId: 'AppId', + start: 'Compact' + }, + DataLookup: { + size: 'Compact', + index: 'Vec' + }, + KateCommitment: { + rows: 'Compact', + cols: 'Compact', + dataRoot: 'H256', + commitment: 'Vec' + }, + V1HeaderExtension: { + commitment: 'KateCommitment', + appLookup: 'DataLookup' + }, + VTHeaderExtension: { + newField: 'Vec', + commitment: 'KateCommitment', + appLookup: 'DataLookup' + }, + HeaderExtension: { + _enum: { + V1: 'V1HeaderExtension', + VTest: 'VTHeaderExtension' + } + }, + DaHeader: { + parentHash: 'Hash', + number: 'Compact', + stateRoot: 'Hash', + extrinsicsRoot: 'Hash', + digest: 'Digest', + extension: 'HeaderExtension' + }, + Header: 'DaHeader', + CheckAppIdExtra: { + appId: 'AppId' + }, + CheckAppIdTypes: {}, + CheckAppId: { + extra: 'CheckAppIdExtra', + types: 'CheckAppIdTypes' + }, + BlockLength: { + max: 'PerDispatchClass', + cols: 'Compact', + rows: 'Compact', + chunkSize: 'Compact' + }, + PerDispatchClass: { + normal: 'u32', + operational: 'u32', + mandatory: 'u32' + }, + DataProof: { + root: 'H256', + proof: 'Vec', + numberOfLeaves: 'Compact', + leaf_index: 'Compact', + leaf: 'H256' + }, + Cell: { + row: 'u32', + col: 'u32', + } + }, + signedExtensions: { + CheckAppId: { + extrinsic: { + appId: 'AppId' + }, + payload: {} + }, + }, + }); +} \ No newline at end of file diff --git a/tests/js_api/src/app_id.ts b/tests/js_api/src/app_id.ts index d063aa047..4f5c0440b 100644 --- a/tests/js_api/src/app_id.ts +++ b/tests/js_api/src/app_id.ts @@ -4,6 +4,7 @@ import type { EventRecord, ExtrinsicStatus, H256 } from '@polkadot/types/interfa import type { ISubmittableResult, SignatureOptions } from '@polkadot/types/types'; import yargs from 'yargs/yargs'; import config from './config'; +import { createApi } from './api'; const keyring = new Keyring({ type: 'sr25519' }); @@ -15,56 +16,14 @@ async function cli_arguments() { type: 'string', default: '1' } - - }).argv; -} - -async function createApi(): Promise { - const provider = new WsProvider(config.ApiURL); - // Create the API and wait until ready - return ApiPromise.create({ - provider, - types: { - DataLookup: { - size: 'u32', - index: 'Vec<(u32,u32)>' - }, - KateExtrinsicRoot: { - hash: 'Hash', - commitment: 'Vec', - rows: 'u16', - cols: 'u16', - dataRoot: 'H256', - }, - KateHeader: { - parentHash: 'Hash', - number: 'Compact', - stateRoot: 'Hash', - extrinsicsRoot: 'KateExtrinsicRoot', - digest: 'Digest', - appDataLookup: 'DataLookup' - }, - Header: 'KateHeader', - AppId: 'u32', - }, - signedExtensions: { - CheckAppId: { - extrinsic: { - appId: 'u32' - }, - payload: {} - }, - }, - }); + }).argv; } interface SignatureOptionsNew extends SignatureOptions { app_id: number } - - //async funtion to get the nonce async function getNonce(api: ApiPromise, address: string): Promise { const nonce = (await api.rpc.system.accountNextIndex(address)).toNumber(); @@ -73,7 +32,7 @@ async function getNonce(api: ApiPromise, address: string): Promise { -async function createKey(api: ApiPromise, sender: KeyringPair, nonce: number, id:string): Promise { +async function createKey(api: ApiPromise, sender: KeyringPair, nonce: number, id: string): Promise { try { /* @note here app_id is 1, but if you want to have one your own then create one first before initialising here */ @@ -101,19 +60,13 @@ async function createKey(api: ApiPromise, sender: KeyringPair, nonce: number, id } } - - //function to retreive data - - - let block = async (hash: H256, api: ApiPromise) => { const block = await api.rpc.chain.getBlock(hash); const block_num = await block.block.header.number; console.log(`💡Tx included in Block Number: ${block_num} with hash ${hash}\n`); } - async function main() { const argv = await cli_arguments(); const api = await createApi(); diff --git a/tests/js_api/src/full.ts b/tests/js_api/src/full.ts index c492e2440..50280c9e4 100644 --- a/tests/js_api/src/full.ts +++ b/tests/js_api/src/full.ts @@ -3,49 +3,10 @@ import { KeyringPair } from '@polkadot/keyring/types'; import type { EventRecord, ExtrinsicStatus, H256 } from '@polkadot/types/interfaces'; import type { ISubmittableResult, SignatureOptions } from '@polkadot/types/types'; import config from './config'; +import { createApi } from './api'; const keyring = new Keyring({ type: 'sr25519' }); -async function createApi(): Promise { - const provider = new WsProvider(config.ApiURL); - - // Create the API and wait until ready - return ApiPromise.create({ - provider, - types: { - DataLookup: { - size: 'u32', - index: 'Vec<(u32,u32)>' - }, - KateExtrinsicRoot: { - hash: 'Hash', - commitment: 'Vec', - rows: 'u16', - cols: 'u16', - dataRoot: 'H256', - }, - KateHeader: { - parentHash: 'Hash', - number: 'Compact', - stateRoot: 'Hash', - extrinsicsRoot: 'KateExtrinsicRoot', - digest: 'Digest', - appDataLookup: 'DataLookup' - }, - Header: 'KateHeader', - AppId: 'u32', - }, - signedExtensions: { - CheckAppId: { - extrinsic: { - appId: 'u32' - }, - payload: {} - }, - }, - }); -} - interface SignatureOptionsNew extends SignatureOptions { app_id: number } diff --git a/tests/js_api/src/sub.ts b/tests/js_api/src/sub.ts index 663aac965..cdbf92250 100644 --- a/tests/js_api/src/sub.ts +++ b/tests/js_api/src/sub.ts @@ -3,48 +3,10 @@ import { KeyringPair } from '@polkadot/keyring/types'; import type { EventRecord, ExtrinsicStatus, H256 } from '@polkadot/types/interfaces'; import type { ISubmittableResult, SignatureOptions } from '@polkadot/types/types'; import config from './config'; +import { createApi } from './api'; -const keyring = new Keyring({ type: 'sr25519' }); - -async function createApi(): Promise { - const provider = new WsProvider(config.ApiURL); - // Create the API and wait until ready - return ApiPromise.create({ - provider, - types: { - DataLookup: { - size: 'u32', - index: 'Vec<(u32,u32)>' - }, - KateExtrinsicRoot: { - hash: 'Hash', - commitment: 'Vec', - rows: 'u16', - cols: 'u16', - dataRoot: 'H256', - }, - KateHeader: { - parentHash: 'Hash', - number: 'Compact', - stateRoot: 'Hash', - extrinsicsRoot: 'KateExtrinsicRoot', - digest: 'Digest', - appDataLookup: 'DataLookup' - }, - Header: 'KateHeader', - AppId: 'u32', - }, - signedExtensions: { - CheckAppId: { - extrinsic: { - appId: 'u32' - }, - payload: {} - }, - }, - }); -} +const keyring = new Keyring({ type: 'sr25519' }); async function main() { const api = await createApi(); diff --git a/tests/js_api/src/transfer.ts b/tests/js_api/src/transfer.ts index e12048097..f51c1f274 100644 --- a/tests/js_api/src/transfer.ts +++ b/tests/js_api/src/transfer.ts @@ -3,63 +3,20 @@ import { KeyringPair } from '@polkadot/keyring/types'; import type { EventRecord, ExtrinsicStatus, H256 } from '@polkadot/types/interfaces'; import type { ISubmittableResult, SignatureOptions } from '@polkadot/types/types'; import config from './config'; +import { createApi } from './api'; const keyring = new Keyring({ type: 'sr25519' }); -async function createApi(): Promise { - const provider = new WsProvider(config.ApiURL); - - // Create the API and wait until ready - return ApiPromise.create({ - provider, - types: { - DataLookup: { - size: 'u32', - index: 'Vec<(u32,u32)>' - }, - KateExtrinsicRoot: { - hash: 'Hash', - commitment: 'Vec', - rows: 'u16', - cols: 'u16', - dataRoot: 'H256', - }, - KateHeader: { - parentHash: 'Hash', - number: 'Compact', - stateRoot: 'Hash', - extrinsicsRoot: 'KateExtrinsicRoot', - digest: 'Digest', - appDataLookup: 'DataLookup' - }, - Header: 'KateHeader', - AppId: 'u32', - }, - signedExtensions: { - CheckAppId: { - extrinsic: { - appId: 'u32' - }, - payload: {} - }, - }, - }); -} - interface SignatureOptionsNew extends SignatureOptions { app_id: number } - //async funtion to get the nonce async function getNonce(api: ApiPromise, address: string): Promise { const nonce = (await api.rpc.system.accountNextIndex(address)).toNumber(); return nonce; } - - - async function Transfer(api: ApiPromise) { try { const acc = keyring.addFromUri(config.mnemonic); //and its address can be used by `acc.address`