From dbcf56042ccaf0e8329623461f2faf245a871843 Mon Sep 17 00:00:00 2001 From: Ben Luelo Date: Fri, 7 Jan 2022 14:04:04 -0500 Subject: [PATCH 01/15] Implement basic RPC structure Implement basic RPC structure Implement basic balance_of functionality (untested) Add asset rpc to node Add assets RPC to picasso runtime Remove develop feature gate from rpc Add assets rpc to picasso runtime (WIP) Add assets RPC to dali and composable runtimes Fix WASM build This requird refactoring the assets pallet into 3 separate crates: rpc, runtime-api, and pallet so that there weren't non-wasm compatable dependencies in the runtime. add std feature to composable Move assets pallet back to frame/assets Remove extraneous commented code Update workspace Cargo.toml Formatting Add crowdloan rewards rpc Fix workspace members Update cargo.lock & add crowdloan rewards rcp to runtimes Implement basic crowdloan rewards rpc custom rpc polkadotjs Change signature of crowdloan rewards rpc to use AccountId add interface types Fix integration test structure Add basic assets tests structure WIP push Fix u128 error in rpc definitions with wrapper type Fix errors after rebase & add RPC documentation Fix missed merge conflict marker Improve RPC documentation Reorganize types Re-add types Fix testing with assets rpc Clean up imports Reorganize assets rpc tests Update crowdloan rewards tests Uncomment integration tests Formatting Update Cargo.lock Remove unused imports Attempt to fix wasm build error Remove unnecessary dependencies from assets pallet Remove commented code and dbg! usage in assets pallet Cargo.toml formatting Reorganize dependencies in picasso-runtime Update assets rpc to v0.9.16 Clean up dependencies in assets-runtime-api Clean up dependencies in composable-support Clean up dependencies in composable-traits Clean up rpc.md Review & reorganize dependencies in currency-factory Remove extra newline in workspace Cargo.toml Remove num-traits dependency from assets pallet Review & reorganize dependencies in crowdloan-rewards Review & reorganize dependencies in crowdloan-rewards rpc Review & reorganize dependencies in crowdloan-rewards runtime-api Reorganize composable-support/rpc_helpers Update Cargo.lock --- Cargo.lock | 506 +++++---- Cargo.toml | 340 +++--- docs/rpc.md | 279 +++++ frame/assets/Cargo.toml | 23 +- frame/assets/rpc/Cargo.toml | 45 + frame/assets/rpc/src/lib.rs | 73 ++ frame/assets/runtime-api/Cargo.toml | 19 + frame/assets/runtime-api/src/lib.rs | 20 + frame/assets/src/tests.rs | 208 ++++ frame/composable-support/Cargo.toml | 22 +- frame/composable-support/src/lib.rs | 3 + frame/composable-support/src/rpc_helpers.rs | 79 ++ frame/composable-traits/Cargo.toml | 16 +- frame/crowdloan-rewards/Cargo.toml | 17 +- frame/crowdloan-rewards/rpc/Cargo.toml | 54 + frame/crowdloan-rewards/rpc/src/lib.rs | 88 ++ .../crowdloan-rewards/runtime-api/Cargo.toml | 21 + .../crowdloan-rewards/runtime-api/src/lib.rs | 18 + frame/crowdloan-rewards/src/lib.rs | 50 +- frame/currency-factory/Cargo.toml | 8 +- frame/dutch-auction/Cargo.toml | 8 +- frame/lending/Cargo.toml | 2 +- integration-tests/Cargo.toml | 24 +- integration-tests/runtime-tests/.mocharc.json | 5 +- .../runtime-tests/package-lock.json | 979 +++++++++++------- integration-tests/runtime-tests/package.json | 1 + integration-tests/runtime-tests/src/test.ts | 12 +- .../src/tests/rpc/assets/rpcAssetsTests.ts | 32 + .../rpcCrowdloanRewardsTests.ts | 15 +- .../tx/bondedFinance/txBondedFinanceTests.ts | 30 +- .../types/interfaces/assets/definitions.ts | 28 + .../interfaces/{default => assets}/index.ts | 0 .../src/types/interfaces/assets/types.ts | 12 + .../types/interfaces/augment-api-errors.ts | 2 + .../types/interfaces/augment-api-events.ts | 3 +- .../src/types/interfaces/augment-api-query.ts | 6 +- .../src/types/interfaces/augment-api-rpc.ts | 21 +- .../src/types/interfaces/augment-api-tx.ts | 12 +- .../src/types/interfaces/augment-types.ts | 26 +- .../crowdloanRewards/definitions.ts | 95 ++ .../interfaces/crowdloanRewards/index.ts | 4 + .../{default => crowdloanRewards}/types.ts | 7 +- .../src/types/interfaces/definitions.ts | 75 +- .../src/types/interfaces/types.ts | 3 +- .../runtime-tests/src/utils/testSetup.ts | 30 +- node/Cargo.toml | 16 +- node/src/rpc.rs | 11 +- node/src/runtime.rs | 5 + runtime/composable/Cargo.toml | 20 +- runtime/composable/src/lib.rs | 80 ++ runtime/dali/Cargo.toml | 30 +- runtime/dali/src/lib.rs | 25 +- runtime/picasso/Cargo.toml | 7 +- runtime/picasso/src/lib.rs | 57 +- runtime/primitives/Cargo.toml | 8 +- runtime/primitives/src/currency.rs | 27 + 56 files changed, 2573 insertions(+), 1034 deletions(-) create mode 100644 docs/rpc.md create mode 100644 frame/assets/rpc/Cargo.toml create mode 100644 frame/assets/rpc/src/lib.rs create mode 100644 frame/assets/runtime-api/Cargo.toml create mode 100644 frame/assets/runtime-api/src/lib.rs create mode 100644 frame/assets/src/tests.rs create mode 100644 frame/composable-support/src/rpc_helpers.rs create mode 100644 frame/crowdloan-rewards/rpc/Cargo.toml create mode 100644 frame/crowdloan-rewards/rpc/src/lib.rs create mode 100644 frame/crowdloan-rewards/runtime-api/Cargo.toml create mode 100644 frame/crowdloan-rewards/runtime-api/src/lib.rs create mode 100644 integration-tests/runtime-tests/src/tests/rpc/assets/rpcAssetsTests.ts create mode 100644 integration-tests/runtime-tests/src/types/interfaces/assets/definitions.ts rename integration-tests/runtime-tests/src/types/interfaces/{default => assets}/index.ts (100%) create mode 100644 integration-tests/runtime-tests/src/types/interfaces/assets/types.ts create mode 100644 integration-tests/runtime-tests/src/types/interfaces/crowdloanRewards/definitions.ts create mode 100644 integration-tests/runtime-tests/src/types/interfaces/crowdloanRewards/index.ts rename integration-tests/runtime-tests/src/types/interfaces/{default => crowdloanRewards}/types.ts (97%) diff --git a/Cargo.lock b/Cargo.lock index 39b85bbe878..7120242de99 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -157,6 +157,32 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" +[[package]] +name = "assets-rpc" +version = "0.0.1" +dependencies = [ + "assets-runtime-api", + "composable-support", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-blockchain", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "assets-runtime-api" +version = "0.0.1" +dependencies = [ + "composable-support", + "parity-scale-codec", + "sp-api", +] + [[package]] name = "async-attributes" version = "1.1.2" @@ -274,7 +300,7 @@ dependencies = [ "async-io", "async-lock", "async-process", - "crossbeam-utils 0.8.6", + "crossbeam-utils 0.8.7", "futures-channel", "futures-core", "futures-io", @@ -354,7 +380,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b88d82667eca772c4aa12f0f1348b3ae643424c8876448f3f7bd5787032e234c" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", ] [[package]] @@ -376,15 +402,18 @@ dependencies = [ [[package]] name = "autocfg" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" +dependencies = [ + "autocfg 1.1.0", +] [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" @@ -454,7 +483,7 @@ source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16# dependencies = [ "beefy-primitives", "fnv", - "futures 0.3.19", + "futures 0.3.21", "log 0.4.14", "parity-scale-codec", "parking_lot 0.11.2", @@ -484,7 +513,7 @@ dependencies = [ "beefy-gadget", "beefy-primitives", "derive_more", - "futures 0.3.19", + "futures 0.3.21", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -685,9 +714,9 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.10.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" dependencies = [ "generic-array 0.14.5", ] @@ -992,7 +1021,7 @@ checksum = "ba2ae6de944143141f6155a473a6b02f66c7c3f9f47316f802f80204ebfe6e12" dependencies = [ "camino", "cargo-platform", - "semver 1.0.4", + "semver 1.0.5", "serde", "serde_json", ] @@ -1233,8 +1262,12 @@ dependencies = [ name = "composable-node" version = "1.0.9" dependencies = [ + "assets-rpc", + "assets-runtime-api", "common", "composable-runtime", + "crowdloan-rewards-rpc", + "crowdloan-rewards-runtime-api", "cumulus-client-cli", "cumulus-client-collator", "cumulus-client-consensus-aura", @@ -1251,6 +1284,8 @@ dependencies = [ "hex", "jsonrpc-core", "log 0.4.14", + "pallet-assets", + "pallet-crowdloan-rewards", "pallet-transaction-payment-rpc", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", @@ -1259,6 +1294,7 @@ dependencies = [ "polkadot-parachain", "polkadot-primitives", "polkadot-service", + "primitives", "sc-basic-authorship", "sc-chain-spec", "sc-cli", @@ -1303,8 +1339,11 @@ dependencies = [ name = "composable-runtime" version = "0.1.0" dependencies = [ + "assets-runtime-api", "common", + "composable-support", "composable-traits", + "crowdloan-rewards-runtime-api", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -1334,6 +1373,7 @@ dependencies = [ "pallet-call-filter", "pallet-collator-selection", "pallet-collective", + "pallet-crowdloan-rewards", "pallet-currency-factory", "pallet-democracy 4.0.0-dev", "pallet-governance-registry", @@ -1414,7 +1454,6 @@ dependencies = [ "composable-support", "frame-support", "frame-system", - "orml-traits", "parity-scale-codec", "plotters", "proptest 1.0.0", @@ -1449,9 +1488,9 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core-foundation" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ "core-foundation-sys", "libc", @@ -1618,9 +1657,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2209c310e29876f7f0b2721e7e26b84aff178aa3da5d091f9bfbf47669e60e3" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if 1.0.0", ] @@ -1632,7 +1671,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.6", + "crossbeam-utils 0.8.7", ] [[package]] @@ -1643,17 +1682,17 @@ checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" dependencies = [ "cfg-if 1.0.0", "crossbeam-epoch", - "crossbeam-utils 0.8.6", + "crossbeam-utils 0.8.7", ] [[package]] name = "crossbeam-epoch" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97242a70df9b89a65d0b6df3c4bf5b9ce03c5b7309019777fbde37e7537f8762" +checksum = "c00d6d2ea26e8b151d99093005cb442fb9a37aeaca582a03ec70946f49ab5ed9" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils 0.8.6", + "crossbeam-utils 0.8.7", "lazy_static", "memoffset", "scopeguard", @@ -1665,21 +1704,53 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "cfg-if 0.1.10", "lazy_static", ] [[package]] name = "crossbeam-utils" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120" +checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6" dependencies = [ "cfg-if 1.0.0", "lazy_static", ] +[[package]] +name = "crowdloan-rewards-rpc" +version = "0.0.1" +dependencies = [ + "composable-support", + "composable-traits", + "crowdloan-rewards-runtime-api", + "frame-support", + "jsonrpc-core", + "jsonrpc-core-client", + "jsonrpc-derive", + "num-traits", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-arithmetic", + "sp-blockchain", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "crowdloan-rewards-runtime-api" +version = "0.0.1" +dependencies = [ + "composable-support", + "parity-scale-codec", + "sp-api", +] + [[package]] name = "crunchy" version = "0.2.2" @@ -1773,7 +1844,7 @@ dependencies = [ "cumulus-client-network", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.19", + "futures 0.3.21", "parity-scale-codec", "parking_lot 0.10.2", "polkadot-node-primitives", @@ -1796,7 +1867,7 @@ dependencies = [ "async-trait", "cumulus-client-consensus-common", "cumulus-primitives-core", - "futures 0.3.19", + "futures 0.3.21", "parity-scale-codec", "sc-client-api", "sc-consensus", @@ -1825,7 +1896,7 @@ dependencies = [ "async-trait", "cumulus-relay-chain-interface", "dyn-clone", - "futures 0.3.19", + "futures 0.3.21", "parity-scale-codec", "polkadot-primitives", "sc-client-api", @@ -1846,7 +1917,7 @@ dependencies = [ "async-trait", "cumulus-relay-chain-interface", "derive_more", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "parity-scale-codec", "parking_lot 0.11.2", @@ -1870,7 +1941,7 @@ source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.16#86f7 dependencies = [ "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "parity-scale-codec", "polkadot-node-primitives", @@ -2117,7 +2188,7 @@ dependencies = [ "async-trait", "cumulus-primitives-core", "derive_more", - "futures 0.3.19", + "futures 0.3.21", "parking_lot 0.11.2", "polkadot-overseer", "sc-client-api", @@ -2138,7 +2209,7 @@ dependencies = [ "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "parking_lot 0.11.2", "polkadot-client", @@ -2207,8 +2278,11 @@ checksum = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9" name = "dali-runtime" version = "0.1.0" dependencies = [ + "assets-runtime-api", "common", + "composable-support", "composable-traits", + "crowdloan-rewards-runtime-api", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -2372,7 +2446,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b" dependencies = [ - "block-buffer 0.10.0", + "block-buffer 0.10.2", "crypto-common", "generic-array 0.14.5", ] @@ -2576,19 +2650,6 @@ dependencies = [ "syn 1.0.86", ] -[[package]] -name = "env_logger" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" -dependencies = [ - "atty", - "humantime 1.3.0", - "log 0.4.14", - "regex", - "termcolor", -] - [[package]] name = "env_logger" version = "0.8.4" @@ -2596,7 +2657,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" dependencies = [ "atty", - "humantime 2.1.0", + "humantime", "log 0.4.14", "regex", "termcolor", @@ -2609,7 +2670,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" dependencies = [ "atty", - "humantime 2.1.0", + "humantime", "log 0.4.14", "regex", "termcolor", @@ -2699,7 +2760,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", ] [[package]] @@ -2754,11 +2815,11 @@ dependencies = [ [[package]] name = "file-per-thread-logger" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fdbe0d94371f9ce939b555dd342d0686cc4c0cadbcd4b61d70af5ff97eb4126" +checksum = "21e16290574b39ee41c71aeb90ae960c504ebaf1e2a1c87bd52aa56ed6e1a02f" dependencies = [ - "env_logger 0.7.1", + "env_logger 0.9.0", "log 0.4.14", ] @@ -2769,7 +2830,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8ac3ff5224ef91f3c97e03eb1de2db82743427e91aaa5ac635f454f0b164f5a" dependencies = [ "either", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "log 0.4.14", "num-traits", @@ -3168,9 +3229,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28560757fe2bb34e79f907794bb6b22ae8b0e5c669b638a1132f2592b19035b4" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" dependencies = [ "futures-channel", "futures-core", @@ -3183,9 +3244,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3dda0b6588335f360afc675d0564c17a77a2bda81ca178a4b6081bd86c7f0b" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" dependencies = [ "futures-core", "futures-sink", @@ -3193,15 +3254,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" [[package]] name = "futures-executor" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29d6d2ff5bb10fb95c85b8ce46538a2e5f5e7fdc755623a7d4529ab8a4ed9d2a" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" dependencies = [ "futures-core", "futures-task", @@ -3211,9 +3272,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" [[package]] name = "futures-lite" @@ -3232,9 +3293,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", @@ -3254,15 +3315,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3055baccb68d74ff6480350f8d6eb8fcfa3aa11bdc1a1ae3afdd0514617d508" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" [[package]] name = "futures-task" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee7c6485c30167ce4dfb83ac568a849fe53274c831081476ee13e0dce1aad72" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" [[package]] name = "futures-timer" @@ -3272,9 +3333,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.19" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5cf40b47a271f77a8b1bec03ca09044d99d2372c0de244e66430761127164" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" dependencies = [ "futures 0.1.31", "futures-channel", @@ -3593,9 +3654,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" +checksum = "9100414882e15fb7feccb4897e5f0ff0ff1ca7d1a86a23208ada4d7a18e6c6c4" [[package]] name = "httpdate" @@ -3603,15 +3664,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" -[[package]] -name = "humantime" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error 1.2.3", -] - [[package]] name = "humantime" version = "2.1.0" @@ -3741,7 +3793,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae8ab7f67bad3240049cb24fb9cb0b4c2c6af4c245840917fbbdededeee91179" dependencies = [ "async-io", - "futures 0.3.19", + "futures 0.3.21", "futures-lite", "if-addrs", "ipnet", @@ -3795,9 +3847,9 @@ dependencies = [ [[package]] name = "impl-trait-for-tuples" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5dacb10c5b3bb92d46ba347505a9041e676bb20ad220101326bffb0c93031ee" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ "proc-macro2 1.0.36", "quote 1.0.15", @@ -3816,7 +3868,7 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "hashbrown 0.11.2", "serde", ] @@ -3945,7 +3997,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2b99d4207e2a04fb4581746903c2bb7eb376f88de9c699d0f3e10feeac0cd3a" dependencies = [ "derive_more", - "futures 0.3.19", + "futures 0.3.21", "hyper 0.14.16", "hyper-tls", "jsonrpc-core", @@ -3964,7 +4016,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "futures-executor", "futures-util", "log 0.4.14", @@ -3979,7 +4031,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b51da17abecbdab3e3d4f26b01c5ec075e88d3abe3ab3b05dc9aa69392764ec0" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "jsonrpc-client-transports", ] @@ -4001,7 +4053,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1dea6e07251d9ce6a552abfb5d7ad6bc290a4596c8dcc3d795fae2bbdc1f3ff" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "hyper 0.14.16", "jsonrpc-core", "jsonrpc-server-utils", @@ -4017,7 +4069,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "382bb0206323ca7cda3dcd7e245cea86d37d02457a02a975e3378fb149a48845" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "jsonrpc-core", "jsonrpc-server-utils", "log 0.4.14", @@ -4032,7 +4084,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240f87695e6c6f62fb37f05c02c04953cf68d6408b8c1c89de85c7a0125b1011" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "jsonrpc-core", "lazy_static", "log 0.4.14", @@ -4048,7 +4100,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa4fdea130485b572c39a460d50888beb00afb3e35de23ccd7fad8ff19f0e0d4" dependencies = [ "bytes 1.1.0", - "futures 0.3.19", + "futures 0.3.21", "globset", "jsonrpc-core", "lazy_static", @@ -4065,7 +4117,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f892c7d766369475ab7b0669f417906302d7c0fb521285c0a0c92e52e7c8e946" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "jsonrpc-core", "jsonrpc-server-utils", "log 0.4.14", @@ -4104,7 +4156,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3303cdf246e6ab76e2866fb3d9acb6c76a068b1b28bd923a1b7a8122257ad7b5" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "http", "jsonrpsee-core", "jsonrpsee-types 0.8.0", @@ -4220,7 +4272,7 @@ dependencies = [ "arrayvec 0.7.2", "async-trait", "fnv", - "futures 0.3.19", + "futures 0.3.21", "http", "jsonrpsee-types 0.4.1", "log 0.4.14", @@ -4456,9 +4508,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" +checksum = "33a33a362ce288760ec6a508b94caaec573ae7d3bbbd91b87aa0bad4456839db" [[package]] name = "libp2p" @@ -4468,7 +4520,7 @@ checksum = "3bec54343492ba5940a6c555e512c6721139835d28c59bc22febece72dfd0d9d" dependencies = [ "atomic", "bytes 1.1.0", - "futures 0.3.19", + "futures 0.3.21", "lazy_static", "libp2p-core", "libp2p-deflate", @@ -4503,17 +4555,18 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.30.0" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef22d9bba1e8bcb7ec300073e6802943fe8abb8190431842262b5f1c30abba1" +checksum = "86aad7d54df283db817becded03e611137698a6509d4237a96881976a162340c" dependencies = [ "asn1_der", "bs58", "ed25519-dalek", "either", "fnv", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", + "instant", "lazy_static", "libsecp256k1", "log 0.4.14", @@ -4542,7 +4595,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51a800adb195f33de63f4b17b63fe64cfc23bf2c6a0d3d0d5321328664e65197" dependencies = [ "flate2", - "futures 0.3.19", + "futures 0.3.21", "libp2p-core", ] @@ -4553,7 +4606,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb8f89d15cb6e3c5bc22afff7513b11bab7856f2872d3cfba86f7f63a06bc498" dependencies = [ "async-std-resolver", - "futures 0.3.19", + "futures 0.3.21", "libp2p-core", "log 0.4.14", "smallvec 1.8.0", @@ -4568,7 +4621,7 @@ checksum = "aab3d7210901ea51b7bae2b581aa34521797af8c4ec738c980bda4a06434067f" dependencies = [ "cuckoofilter", "fnv", - "futures 0.3.19", + "futures 0.3.21", "libp2p-core", "libp2p-swarm", "log 0.4.14", @@ -4589,7 +4642,7 @@ dependencies = [ "byteorder", "bytes 1.1.0", "fnv", - "futures 0.3.19", + "futures 0.3.21", "hex_fmt", "libp2p-core", "libp2p-swarm", @@ -4610,7 +4663,7 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cca1275574183f288ff8b72d535d5ffa5ea9292ef7829af8b47dcb197c7b0dcd" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "libp2p-core", "libp2p-swarm", "log 0.4.14", @@ -4632,7 +4685,7 @@ dependencies = [ "bytes 1.1.0", "either", "fnv", - "futures 0.3.19", + "futures 0.3.21", "libp2p-core", "libp2p-swarm", "log 0.4.14", @@ -4656,7 +4709,7 @@ dependencies = [ "async-io", "data-encoding", "dns-parser", - "futures 0.3.19", + "futures 0.3.21", "if-watch", "lazy_static", "libp2p-core", @@ -4690,7 +4743,7 @@ checksum = "7f2cd64ef597f40e14bfce0497f50ecb63dd6d201c61796daeb4227078834fbf" dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.1.0", - "futures 0.3.19", + "futures 0.3.21", "libp2p-core", "log 0.4.14", "nohash-hasher", @@ -4708,7 +4761,7 @@ checksum = "a8772c7a99088221bb7ca9c5c0574bf55046a7ab4c319f3619b275f28c8fb87a" dependencies = [ "bytes 1.1.0", "curve25519-dalek 3.2.0", - "futures 0.3.19", + "futures 0.3.21", "lazy_static", "libp2p-core", "log 0.4.14", @@ -4728,7 +4781,7 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80ef7b0ec5cf06530d9eb6cf59ae49d46a2c45663bde31c25a12f682664adbcf" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "libp2p-core", "libp2p-swarm", "log 0.4.14", @@ -4745,7 +4798,7 @@ checksum = "5fba1a6ff33e4a274c89a3b1d78b9f34f32af13265cc5c46c16938262d4e945a" dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.1.0", - "futures 0.3.19", + "futures 0.3.21", "libp2p-core", "log 0.4.14", "prost", @@ -4760,7 +4813,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f1a458bbda880107b5b36fcb9b5a1ef0c329685da0e203ed692a8ebe64cc92c" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "log 0.4.14", "pin-project 1.0.10", "rand 0.7.3", @@ -4776,7 +4829,7 @@ checksum = "2852b61c90fa8ce3c8fcc2aba76e6cefc20d648f9df29157d6b3a916278ef3e3" dependencies = [ "asynchronous-codec 0.6.0", "bytes 1.1.0", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "libp2p-core", "libp2p-swarm", @@ -4799,7 +4852,7 @@ checksum = "14a6d2b9e7677eff61dc3d2854876aaf3976d84a01ef6664b610c77a0c9407c5" dependencies = [ "asynchronous-codec 0.6.0", "bimap", - "futures 0.3.19", + "futures 0.3.21", "libp2p-core", "libp2p-swarm", "log 0.4.14", @@ -4821,7 +4874,7 @@ checksum = "a877a4ced6d46bf84677e1974e8cf61fb434af73b2e96fb48d6cb6223a4634d8" dependencies = [ "async-trait", "bytes 1.1.0", - "futures 0.3.19", + "futures 0.3.21", "libp2p-core", "libp2p-swarm", "log 0.4.14", @@ -4839,7 +4892,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f5184a508f223bc100a12665517773fb8730e9f36fc09eefb670bf01b107ae9" dependencies = [ "either", - "futures 0.3.19", + "futures 0.3.21", "libp2p-core", "log 0.4.14", "rand 0.7.3", @@ -4865,7 +4918,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7399c5b6361ef525d41c11fcf51635724f832baf5819b30d3d873eabb4fbae4b" dependencies = [ "async-io", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "if-watch", "ipnet", @@ -4882,7 +4935,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8b7563e46218165dfd60f64b96f7ce84590d75f53ecbdc74a7dd01450dc5973" dependencies = [ "async-std", - "futures 0.3.19", + "futures 0.3.21", "libp2p-core", "log 0.4.14", ] @@ -4893,7 +4946,7 @@ version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1008a302b73c5020251f9708c653f5ed08368e530e247cc9cd2f109ff30042cf" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -4908,7 +4961,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22e12df82d1ed64969371a9e65ea92b91064658604cc2576c2757f18ead9a1cf" dependencies = [ "either", - "futures 0.3.19", + "futures 0.3.21", "futures-rustls", "libp2p-core", "log 0.4.14", @@ -4925,7 +4978,7 @@ version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e7362abb8867d7187e7e93df17f460d554c997fc5c8ac57dc1259057f6889af" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "libp2p-core", "parking_lot 0.11.2", "thiserror", @@ -5217,7 +5270,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", ] [[package]] @@ -5264,7 +5317,7 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "derive_more", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "thiserror", "tracing", @@ -5276,7 +5329,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd2c2cc134e57461f0898b0e921f0a7819b5e3f3a4335b9aa390ce81a5f36fb9" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "rand 0.8.4", "thrift", ] @@ -5328,7 +5381,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" dependencies = [ "adler", - "autocfg 1.0.1", + "autocfg 1.1.0", ] [[package]] @@ -5506,7 +5559,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56a336acba8bc87c8876f6425407dbbe6c417bf478b22015f8fb0994ef3bc0ab" dependencies = [ "bytes 1.1.0", - "futures 0.3.19", + "futures 0.3.21", "log 0.4.14", "pin-project 1.0.10", "smallvec 1.8.0", @@ -5618,7 +5671,7 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "num-integer", "num-traits", ] @@ -5638,7 +5691,7 @@ version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "num-traits", ] @@ -5648,7 +5701,7 @@ version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "num-integer", "num-traits", ] @@ -5659,7 +5712,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "num-bigint", "num-integer", "num-traits", @@ -5671,7 +5724,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "num-integer", "num-traits", ] @@ -5682,7 +5735,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "num-integer", "num-traits", ] @@ -5693,7 +5746,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "libm", ] @@ -5785,7 +5838,7 @@ version = "0.9.72" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "cc", "libc", "pkg-config", @@ -5930,7 +5983,6 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "num-traits", "orml-tokens", "orml-traits", "pallet-balances", @@ -5938,7 +5990,9 @@ dependencies = [ "parity-scale-codec", "proptest 0.9.6", "scale-info", + "sp-api", "sp-arithmetic", + "sp-blockchain", "sp-core", "sp-io", "sp-runtime", @@ -7383,7 +7437,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9981e32fb75e004cc148f5fb70342f393830e0a4aa62e3cc93b50976218d42b6" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "libc", "log 0.4.14", "rand 0.7.3", @@ -7671,8 +7725,11 @@ dependencies = [ name = "picasso-runtime" version = "0.1.0" dependencies = [ + "assets-runtime-api", "common", + "composable-support", "composable-traits", + "crowdloan-rewards-runtime-api", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", @@ -7879,7 +7936,7 @@ name = "polkadot-approval-distribution" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -7893,7 +7950,7 @@ name = "polkadot-availability-bitfield-distribution" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -7907,7 +7964,7 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "derive_more", - "futures 0.3.19", + "futures 0.3.21", "lru 0.7.2", "parity-scale-codec", "polkadot-erasure-coding", @@ -7928,7 +7985,7 @@ name = "polkadot-availability-recovery" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "lru 0.7.2", "parity-scale-codec", "polkadot-erasure-coding", @@ -7949,7 +8006,7 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "frame-benchmarking-cli", - "futures 0.3.19", + "futures 0.3.21", "log 0.4.14", "polkadot-node-core-pvf", "polkadot-node-metrics", @@ -8004,7 +8061,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab dependencies = [ "always-assert", "derive_more", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -8037,7 +8094,7 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "derive_more", - "futures 0.3.19", + "futures 0.3.21", "lru 0.7.2", "parity-scale-codec", "polkadot-erasure-coding", @@ -8072,7 +8129,7 @@ name = "polkadot-gossip-support" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "polkadot-node-network-protocol", "polkadot-node-subsystem", @@ -8093,7 +8150,7 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "async-trait", - "futures 0.3.19", + "futures 0.3.21", "parity-scale-codec", "parking_lot 0.11.2", "polkadot-node-network-protocol", @@ -8111,7 +8168,7 @@ name = "polkadot-node-collation-generation" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-primitives", @@ -8131,7 +8188,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab dependencies = [ "bitvec", "derive_more", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "kvdb", "lru 0.7.2", @@ -8158,7 +8215,7 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "bitvec", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "kvdb", "parity-scale-codec", @@ -8178,7 +8235,7 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "bitvec", - "futures 0.3.19", + "futures 0.3.21", "polkadot-erasure-coding", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -8195,7 +8252,7 @@ name = "polkadot-node-core-bitfield-signing" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", @@ -8211,7 +8268,7 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "async-trait", - "futures 0.3.19", + "futures 0.3.21", "parity-scale-codec", "polkadot-node-core-pvf", "polkadot-node-primitives", @@ -8228,7 +8285,7 @@ name = "polkadot-node-core-chain-api" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", @@ -8243,7 +8300,7 @@ name = "polkadot-node-core-chain-selection" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "kvdb", "parity-scale-codec", @@ -8260,7 +8317,7 @@ name = "polkadot-node-core-dispute-coordinator" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "kvdb", "lru 0.7.2", "parity-scale-codec", @@ -8279,7 +8336,7 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "async-trait", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "polkadot-node-subsystem", "polkadot-primitives", @@ -8296,7 +8353,7 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "bitvec", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -8316,7 +8373,7 @@ dependencies = [ "assert_matches", "async-process", "async-std", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "parity-scale-codec", "pin-project 1.0.10", @@ -8342,7 +8399,7 @@ name = "polkadot-node-core-pvf-checker" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -8358,7 +8415,7 @@ name = "polkadot-node-core-runtime-api" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "memory-lru", "parity-util-mem", "polkadot-node-subsystem", @@ -8395,7 +8452,7 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "bs58", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "log 0.4.14", "metered-channel", @@ -8415,7 +8472,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab dependencies = [ "async-trait", "derive_more", - "futures 0.3.19", + "futures 0.3.21", "parity-scale-codec", "polkadot-node-jaeger", "polkadot-node-primitives", @@ -8432,7 +8489,7 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "bounded-vec", - "futures 0.3.19", + "futures 0.3.21", "parity-scale-codec", "polkadot-parachain", "polkadot-primitives", @@ -8464,7 +8521,7 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "derive_more", - "futures 0.3.19", + "futures 0.3.21", "polkadot-node-jaeger", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -8484,7 +8541,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab dependencies = [ "async-trait", "derive_more", - "futures 0.3.19", + "futures 0.3.21", "itertools", "lru 0.7.2", "metered-channel", @@ -8510,7 +8567,7 @@ name = "polkadot-overseer" version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "lru 0.7.2", "parity-util-mem", @@ -8532,7 +8589,7 @@ version = "0.9.16" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab002d7451766324a9f314fee11c9c53314350" dependencies = [ "async-trait", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "metered-channel", "pin-project 1.0.10", @@ -8852,7 +8909,7 @@ dependencies = [ "beefy-gadget", "beefy-primitives", "frame-system-rpc-runtime-api", - "futures 0.3.19", + "futures 0.3.21", "hex-literal", "kusama-runtime", "kvdb", @@ -8951,7 +9008,7 @@ source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.16#41ab dependencies = [ "arrayvec 0.5.2", "derive_more", - "futures 0.3.19", + "futures 0.3.21", "indexmap", "parity-scale-codec", "polkadot-node-network-protocol", @@ -9027,7 +9084,7 @@ dependencies = [ "custom_derive", "enum_derive", "env_logger 0.9.0", - "futures 0.3.19", + "futures 0.3.21", "jsonrpc-client-transports", "jsonrpc-core", "lazy_static", @@ -9060,6 +9117,7 @@ dependencies = [ name = "primitives" version = "0.1.0" dependencies = [ + "composable-support", "composable-traits", "parity-scale-codec", "scale-info", @@ -9315,7 +9373,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" dependencies = [ - "autocfg 0.1.7", + "autocfg 0.1.8", "libc", "rand_chacha 0.1.1", "rand_core 0.4.2", @@ -9360,7 +9418,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" dependencies = [ - "autocfg 0.1.7", + "autocfg 0.1.8", "rand_core 0.3.1", ] @@ -9494,7 +9552,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" dependencies = [ - "autocfg 0.1.7", + "autocfg 0.1.8", "rand_core 0.4.2", ] @@ -9537,7 +9595,7 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.1.0", "crossbeam-deque", "either", "rayon-core", @@ -9551,7 +9609,7 @@ checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" dependencies = [ "crossbeam-channel", "crossbeam-deque", - "crossbeam-utils 0.8.6", + "crossbeam-utils 0.8.7", "lazy_static", "num_cpus", ] @@ -9924,7 +9982,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.4", + "semver 1.0.5", ] [[package]] @@ -10035,7 +10093,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "pin-project 0.4.29", "static_assertions", ] @@ -10097,7 +10155,7 @@ source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16# dependencies = [ "async-trait", "derive_more", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "ip_network", "libp2p", @@ -10122,7 +10180,7 @@ name = "sc-basic-authorship" version = "0.10.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "log 0.4.14", "parity-scale-codec", @@ -10191,7 +10249,7 @@ source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16# dependencies = [ "chrono", "fdlimit", - "futures 0.3.19", + "futures 0.3.21", "hex", "libp2p", "log 0.4.14", @@ -10228,7 +10286,7 @@ version = "4.0.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ "fnv", - "futures 0.3.19", + "futures 0.3.21", "hash-db", "log 0.4.14", "parity-scale-codec", @@ -10281,7 +10339,7 @@ version = "0.10.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ "async-trait", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "libp2p", "log 0.4.14", @@ -10306,7 +10364,7 @@ source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16# dependencies = [ "async-trait", "derive_more", - "futures 0.3.19", + "futures 0.3.21", "log 0.4.14", "parity-scale-codec", "sc-block-builder", @@ -10336,7 +10394,7 @@ dependencies = [ "async-trait", "derive_more", "fork-tree", - "futures 0.3.19", + "futures 0.3.21", "log 0.4.14", "merlin", "num-bigint", @@ -10377,7 +10435,7 @@ version = "0.10.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ "derive_more", - "futures 0.3.19", + "futures 0.3.21", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -10416,7 +10474,7 @@ dependencies = [ "assert_matches", "async-trait", "derive_more", - "futures 0.3.19", + "futures 0.3.21", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -10450,7 +10508,7 @@ version = "0.10.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ "async-trait", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "log 0.4.14", "parity-scale-codec", @@ -10570,7 +10628,7 @@ dependencies = [ "dyn-clone", "finality-grandpa", "fork-tree", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "log 0.4.14", "parity-scale-codec", @@ -10605,7 +10663,7 @@ source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16# dependencies = [ "derive_more", "finality-grandpa", - "futures 0.3.19", + "futures 0.3.21", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -10628,7 +10686,7 @@ version = "0.10.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ "ansi_term", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "log 0.4.14", "parity-util-mem", @@ -10669,7 +10727,7 @@ dependencies = [ "either", "fnv", "fork-tree", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "hex", "ip_network", @@ -10710,7 +10768,7 @@ name = "sc-network-gossip" version = "0.10.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "libp2p", "log 0.4.14", @@ -10728,7 +10786,7 @@ source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16# dependencies = [ "bytes 1.1.0", "fnv", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "hex", "hyper 0.14.16", @@ -10754,7 +10812,7 @@ name = "sc-peerset" version = "4.0.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "libp2p", "log 0.4.14", "sc-utils", @@ -10776,7 +10834,7 @@ name = "sc-rpc" version = "4.0.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "hash-db", "jsonrpc-core", "jsonrpc-pubsub", @@ -10807,7 +10865,7 @@ name = "sc-rpc-api" version = "0.10.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -10832,7 +10890,7 @@ name = "sc-rpc-server" version = "4.0.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "jsonrpc-core", "jsonrpc-http-server", "jsonrpc-ipc-server", @@ -10852,7 +10910,7 @@ dependencies = [ "async-trait", "directories", "exit-future", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "hash-db", "jsonrpc-core", @@ -10950,7 +11008,7 @@ version = "4.0.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ "chrono", - "futures 0.3.19", + "futures 0.3.21", "libp2p", "log 0.4.14", "parking_lot 0.11.2", @@ -11009,7 +11067,7 @@ name = "sc-transaction-pool" version = "4.0.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "linked-hash-map", "log 0.4.14", @@ -11037,7 +11095,7 @@ version = "4.0.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ "derive_more", - "futures 0.3.19", + "futures 0.3.21", "log 0.4.14", "serde", "sp-blockchain", @@ -11050,7 +11108,7 @@ name = "sc-utils" version = "4.0.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "lazy_static", "parking_lot 0.11.2", @@ -11154,9 +11212,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.6.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fed7948b6c68acbb6e20c334f55ad635dc0f75506963de4464289fbd3b051ac" +checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" dependencies = [ "bitflags", "core-foundation", @@ -11167,9 +11225,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a57321bf8bc2362081b2599912d2961fe899c0efadf1b4b2f8d48b3e253bb96c" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" dependencies = [ "core-foundation-sys", "libc", @@ -11204,9 +11262,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" +checksum = "0486718e92ec9a68fbed73bb5ef687d71103b142595b406835649bebd33f72c7" dependencies = [ "serde", ] @@ -11590,7 +11648,7 @@ dependencies = [ "base64 0.13.0", "bytes 1.1.0", "flate2", - "futures 0.3.19", + "futures 0.3.21", "httparse", "log 0.4.14", "rand 0.8.4", @@ -11702,7 +11760,7 @@ name = "sp-blockchain" version = "4.0.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "log 0.4.14", "lru 0.7.2", "parity-scale-codec", @@ -11721,7 +11779,7 @@ version = "0.10.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ "async-trait", - "futures 0.3.19", + "futures 0.3.21", "futures-timer", "log 0.4.14", "parity-scale-codec", @@ -11810,7 +11868,7 @@ dependencies = [ "byteorder", "dyn-clonable", "ed25519-dalek", - "futures 0.3.19", + "futures 0.3.21", "hash-db", "hash256-std-hasher", "hex", @@ -11938,7 +11996,7 @@ name = "sp-io" version = "4.0.0" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "hash-db", "libsecp256k1", "log 0.4.14", @@ -11975,7 +12033,7 @@ source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16# dependencies = [ "async-trait", "derive_more", - "futures 0.3.19", + "futures 0.3.21", "merlin", "parity-scale-codec", "parking_lot 0.11.2", @@ -12473,7 +12531,7 @@ version = "4.0.0-dev" source = "git+https://github.com/composableFi/substrate?branch=polkadot-v0.9.16#d78e92de5aeaea1b4df48c639eb88d5b93cf19ef" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.19", + "futures 0.3.21", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -12512,7 +12570,7 @@ dependencies = [ "cumulus-primitives-parachain-inherent", "cumulus-test-relay-sproof-builder", "frame-system", - "futures 0.3.19", + "futures 0.3.21", "jsonrpc-core", "log 0.4.14", "num-traits", @@ -12578,7 +12636,7 @@ version = "0.1.0" source = "git+https://github.com/polytope-labs/substrate-xt?branch=master#469a280526cac9a32a4bdae8280a0664080eb853" dependencies = [ "frame-system", - "futures 0.3.19", + "futures 0.3.21", "jsonrpsee 0.8.0", "parity-scale-codec", "sc-client-api", @@ -13047,9 +13105,9 @@ dependencies = [ [[package]] name = "tracing-serde" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28b" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" dependencies = [ "serde", "tracing-core", @@ -13065,7 +13123,7 @@ dependencies = [ "chrono", "lazy_static", "matchers", - "parking_lot 0.10.2", + "parking_lot 0.11.2", "regex", "serde", "serde_json", @@ -13316,9 +13374,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "unicode-width" @@ -13629,7 +13687,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "js-sys", "parking_lot 0.11.2", "pin-utils", @@ -14205,7 +14263,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7d9028f208dd5e63c614be69f115c1b53cacc1111437d4c765185856666c107" dependencies = [ - "futures 0.3.19", + "futures 0.3.21", "log 0.4.14", "nohash-hasher", "parking_lot 0.11.2", diff --git a/Cargo.toml b/Cargo.toml index 002621a7740..285b3e4df27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,28 +13,34 @@ edition = "2018" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -composable-node = { path = "node", features = [ "composable", "dali" ] } +composable-node = { path = "node", features = ["composable", "dali"] } color-eyre = { version = "0.5.11", default-features = false } [features] -runtime-benchmarks = [ "composable-node/runtime-benchmarks" ] -std = [ "composable-node/std" ] - - +runtime-benchmarks = ["composable-node/runtime-benchmarks"] +std = ["composable-node/std"] [workspace] exclude = ["frame/transaction-fee"] members = [ - "runtime/common", - "runtime/primitives", "frame/*", + "frame/assets/rpc", + "frame/assets/runtime-api", + "frame/crowdloan-rewards/rpc", + "frame/crowdloan-rewards/runtime-api", + "node", + + "runtime/common", + "runtime/primitives", "runtime/picasso", "runtime/dali", "runtime/composable", - "utils/price-feed", + "utils/parachain-utils", - "integration-tests/simnode" + "utils/price-feed", + + "integration-tests/simnode", ] [profile.release] @@ -46,161 +52,161 @@ inherits = "release" lto = true [patch."https://github.com/paritytech/substrate"] -frame-benchmarking ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -frame-support ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -frame-support-procedural ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -frame-support-procedural-tools ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -frame-support-procedural-tools-derive ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-arithmetic ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-debug-derive ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-std ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-core ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-core-hashing ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-externalities ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-storage ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-runtime-interface ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-runtime-interface-proc-macro ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-tracing ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-wasm-interface ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-io ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-keystore ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-state-machine ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-panic-handler ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-trie ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-runtime ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-application-crypto ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-api ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-api-proc-macro ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-version ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-version-proc-macro ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-block-builder ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-client-api ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -substrate-prometheus-endpoint ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-executor ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-executor-common ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-allocator ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-maybe-compressed-blob ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-serializer ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-executor-wasmi ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-executor-wasmtime ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-tasks ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -substrate-wasm-builder ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-core-hashing-proc-macro ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-tracing ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-rpc-server ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-tracing-proc-macro ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-blockchain ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-consensus ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-inherents ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-database ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-rpc ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -frame-system ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -frame-system-rpc-runtime-api ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-babe ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-authorship ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-authorship ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-session ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-timestamp ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-timestamp ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-session ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-staking ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-consensus-babe ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-consensus-slots ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-consensus-vrf ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -frame-election-provider-support ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-npos-elections ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-npos-elections-solution-type ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-service ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-chain-spec ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-chain-spec-derive ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-network ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -fork-tree ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-consensus ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-utils ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-peerset ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-finality-grandpa ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-telemetry ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-client-db ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-state-db ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-informant ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-transaction-pool-api ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-keystore ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-offchain ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-offchain ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-transaction-pool ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-transaction-pool ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-rpc ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-rpc-api ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-block-builder ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-transaction-storage-proof ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-balances ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-transaction-payment ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-offences ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-staking ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-bags-list ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-staking-reward-curve ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-consensus-aura ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-keyring ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -frame-benchmarking-cli ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-cli ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -frame-executive ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -frame-system-benchmarking ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-aura ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-grandpa ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-randomness-collective-flip ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-sudo ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-transaction-payment-rpc-runtime-api ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-transaction-payment-rpc ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-basic-authorship ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-proposer-metrics ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-consensus-aura ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-consensus-slots ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-finality-grandpa ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-network-gossip ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -substrate-frame-rpc-system ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -substrate-build-script-utils ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -frame-try-runtime ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-authority-discovery ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sp-authority-discovery ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-bounties ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-treasury ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-collective ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-utility ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-democracy ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-scheduler ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-election-provider-multi-phase ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-gilt ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-identity ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-im-online ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-indices ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-membership ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-mmr ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-preimage ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-mmr-primitives ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-multisig ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-offences-benchmarking ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-proxy ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-recovery ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-session-benchmarking ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-society ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-tips ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-vesting ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-mmr-rpc ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-consensus-babe ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-consensus-epochs ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-consensus-babe-rpc ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-finality-grandpa-rpc ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-sync-state-rpc ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-authority-discovery ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-consensus-uncles ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -try-runtime-cli ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -remote-externalities ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -beefy-gadget ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -beefy-primitives ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -beefy-gadget-rpc ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -sc-consensus-manual-seal ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-beefy ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-beefy-mmr ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -beefy-merkle-tree ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-nicks ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } -pallet-staking-reward-fn ={git = "https://github.com/composableFi/substrate" ,branch = "polkadot-v0.9.16" } +frame-benchmarking = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +frame-support = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +frame-support-procedural = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +frame-support-procedural-tools = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +frame-support-procedural-tools-derive = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-arithmetic = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-debug-derive = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-std = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-core = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-core-hashing = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-externalities = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-storage = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-runtime-interface = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-runtime-interface-proc-macro = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-tracing = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-wasm-interface = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-io = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-keystore = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-state-machine = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-panic-handler = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-trie = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-runtime = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-application-crypto = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-api = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-api-proc-macro = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-version = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-version-proc-macro = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-block-builder = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-client-api = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +substrate-prometheus-endpoint = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-executor = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-executor-common = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-allocator = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-maybe-compressed-blob = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-serializer = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-executor-wasmi = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-executor-wasmtime = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-tasks = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +substrate-wasm-builder = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-core-hashing-proc-macro = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-tracing = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-rpc-server = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-tracing-proc-macro = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-blockchain = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-consensus = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-inherents = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-database = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-rpc = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +frame-system = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +frame-system-rpc-runtime-api = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-babe = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-authorship = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-authorship = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-session = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-timestamp = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-timestamp = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-session = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-staking = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-consensus-babe = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-consensus-slots = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-consensus-vrf = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +frame-election-provider-support = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-npos-elections = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-npos-elections-solution-type = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-service = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-chain-spec = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-chain-spec-derive = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-network = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +fork-tree = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-consensus = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-utils = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-peerset = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-finality-grandpa = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-telemetry = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-client-db = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-state-db = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-informant = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-transaction-pool-api = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-keystore = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-offchain = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-offchain = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-transaction-pool = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-transaction-pool = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-rpc = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-rpc-api = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-block-builder = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-transaction-storage-proof = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-balances = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-transaction-payment = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-offences = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-staking = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-bags-list = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-staking-reward-curve = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-consensus-aura = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-keyring = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +frame-benchmarking-cli = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-cli = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +frame-executive = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +frame-system-benchmarking = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-aura = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-grandpa = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-randomness-collective-flip = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-sudo = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-transaction-payment-rpc = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-basic-authorship = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-proposer-metrics = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-consensus-aura = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-consensus-slots = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-finality-grandpa = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-network-gossip = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +substrate-frame-rpc-system = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +substrate-build-script-utils = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +frame-try-runtime = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-authority-discovery = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sp-authority-discovery = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-bounties = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-treasury = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-collective = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-utility = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-democracy = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-scheduler = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-election-provider-multi-phase = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-gilt = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-identity = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-im-online = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-indices = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-membership = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-mmr = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-preimage = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-mmr-primitives = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-multisig = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-offences-benchmarking = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-proxy = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-recovery = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-session-benchmarking = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-society = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-tips = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-vesting = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-mmr-rpc = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-consensus-babe = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-consensus-epochs = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-consensus-babe-rpc = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-finality-grandpa-rpc = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-sync-state-rpc = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-authority-discovery = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-consensus-uncles = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +try-runtime-cli = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +remote-externalities = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +beefy-gadget = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +beefy-primitives = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +beefy-gadget-rpc = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +sc-consensus-manual-seal = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-beefy = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-beefy-mmr = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +beefy-merkle-tree = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-nicks = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } +pallet-staking-reward-fn = { git = "https://github.com/composableFi/substrate", branch = "polkadot-v0.9.16" } diff --git a/docs/rpc.md b/docs/rpc.md new file mode 100644 index 00000000000..04515756cbc --- /dev/null +++ b/docs/rpc.md @@ -0,0 +1,279 @@ +# Adding an RPC interface to a pallet + +Create 2 new crates beside the `src/` folder of the pallet you want to add the RPC to: + +```plaintext +frame + pallet + src + Cargo.toml + rpc + src + Cargo.toml + runtime-api + src + Cargo.toml +``` + +Add the two new crates to the composable workspace file (top level Cargo.toml): + +```toml +members = [ + # add these lines + "frame/pallet-name/rpc", + "frame/pallet-name/runtime-api", +] +``` + +## Runtime API Crate + +### In `Cargo.toml` + +```toml +[package] +name = "pallet-name-runtime-api" +version = "0.0.1" +authors = ["Composable Developers"] +homepage = "https://composable.finance" +edition = "2021" +rust-version = "1.56" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +codec = { default-features = false, features = [ + "derive", +], package = "parity-scale-codec", version = "2.0.0" } + +# ...any other dependencies, as per usual + +[features] +default = ["std"] +std = ["sp-api/std"] + +``` + +### In `lib.rs` + +```rust +#![cfg_attr(not(feature = "std"), no_std)] +#![allow(clippy::too_many_arguments)] // REVIEW: I'm not sure if these are actually necessary +#![allow(clippy::unnecessary_mut_passed)] // REVIEW: I'm not sure if these are actually necessary + +sp_api::decl_runtime_apis! { + pub trait PalletNameRuntimeApi + where + GENERIC_PARAMETER: codec::Codec, // all parameters must implement `Codec` + { + fn rpc_function_name(/* ...parameters... */) -> ReturnType; + + // as many rpcs as are needed for the pallet can all be defined here in the same trait + } +} +``` + +## RPC Crate + +### In `Cargo.toml` + +```toml +[package] +name = "PALLET-NAME-rpc" +version = "0.0.1" +authors = ["Composable Developers"] +homepage = "https://composable.finance" +edition = "2021" +rust-version = "1.56" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +# substrate primitives +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } + +scale-info = { version = "1.0", default-features = false, features = ["derive"] } +codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "2.0.0" } + +pallet-name-runtime-api = { path = "../runtime-api", default-features = false } + +# rpc +jsonrpc-core = "18.0.0" +jsonrpc-core-client = "18.0.0" +jsonrpc-derive = "18.0.0" + +[features] +default = ["std"] +std = [ + "pallet-name-runtime-api/std", + "codec/std", + "sp-runtime/std", + "sp-api/std", +] +``` + +### In `lib.rs` + +Required imports: + +```rust +use PALLET_NAME_runtime_api::PALLET_NAME_RuntimeApi; +use codec::Codec; +use jsonrpc_core::{Error as RpcError, ErrorCode, Result as RpcResult}; +use jsonrpc_derive::rpc; +use sp_api::ProvideRuntimeApi; +use sp_blockchain::HeaderBackend; +use sp_runtime::{generic::BlockId, traits::Block as BlockT}; +use sp_std::sync::Arc; +``` + +This defines the RPC itself; the name of the RPC needs to follow the pattern of `moduleName_functionName`. + +```rust +#[rpc] +pub trait PALLET_NAME_Api +where + GENERIC_PARAMATER: Codec, +{ + // the name of the rpc must be module_function, where both module + // and function are camelCase and are seperated by an underscore. + #[rpc(name = "palletName_rpcFunctionName")] + fn rpc_function_name( + &self, + // any additional parameters here + at: Option, // `at` should be last + ) -> RpcResult; +} +``` + +This is a struct that will inplement the above API. It contains the client to make the RPC calls. + +If there are more generics, instead of adding more parameters (`Assets`), just use a tuple instead: `Assets { + client: Arc, + _marker: sp_std::marker::PhantomData, +} + +impl PalletName { + pub fn new(client: Arc) -> Self { + Self { client, _marker: Default::default() } + } +} +``` + +```rust +impl + AssetsApi<::Hash, /* ...any generic parameters... */> + for Assets +where + Block: BlockT, + GENERIC_PARAMETER: Codec + Send + Sync + 'static, // all generic parameters must have at least these bounds + C: Send + Sync + 'static, + C: ProvideRuntimeApi, + C: HeaderBackend, + C::Api: AssetsRuntimeApi, +{ + fn rpc_function_name( + &self, + // any additional parameters here + at: Option<::Hash>, // `at` must be last + ) -> RpcResult { + let api = self.client.runtime_api(); + let at = BlockId::hash(at.unwrap_or_else(|| { + // If the block hash is not supplied assume the best block. + self.client.info().best_hash + })); + + let runtime_api_result = api.rpc_function_name(&at, asset_id, account_id); + // TODO(benluelo): Review what error message & code to use + runtime_api_result.map_err(|e| { + RpcError { + code: ErrorCode::ServerError(9876), // No real reason for this value + message: "Something wrong".into(), + data: Some(format!("{:?}", e).into()), + } + }) + } +} +``` + +## In `node/` + +The RPC needs to be added to the node in order to be called. First, add both the above crates to `node/Cargo.toml`: + +```toml +[dependencies] +# ...stub... +pallet-name-rpc = { path = "../frame/pallet-name/rpc" } +pallet-name-runtime-api = { path = "../frame/pallet-name/runtime-api" } +``` + +Then, in `node/src/runtime.rs`, add a bound in both the definition and blanket impl for `HostRuntimeApis`: + +```rust +pub trait HostRuntimeApis: + // ...stub... + + pallet_name_runtime_api::PalletNameRuntimeApi, + // ...stub... + +impl HostRuntimeApis for Api +where + Api: // ...stub... + + pallet_name_runtime_api::PalletNameRuntimeApi, + // ...stub... +``` + +Then, in `node/src/rpc.rs`, in `fn create(...)`, add a bound to `C::Api`, and then within the function, add the RPC to the runtime: + +```rust +pub fn create(deps: FullDeps) -> jsonrpc_core::IoHandler +where + // ...stub... + C::Api: pallet_name_runtime_api::PalletNameRuntimeApi, + // ...stub... +{ + // ...stub... + io.extend_with(CrowdloanRewardsApi::to_delegate(CrowdloanRewards::new(client))); + + io +} +``` + +## Add to runtimes + +Within each runtime's `Cargo.toml`, add the runtime-api dependency: + +```toml +# ...stub... +[dependencies] +pallet-name-runtime-api = { path = '../../frame/pallet-name/runtime-api', default-features = false } +# ...stub... +``` + +And then in each runtime's `lib.rs`, in the `impl_runtime_apis!` macro, implement the API: + +```rust +impl_runtime_apis! { + impl pallet_name_runtime_api::PalletNameRuntimeApi for Runtime { + fn rpc_function_name(/* ...rpc parameters... */) -> ReturnType { + // actual implementation here + } + } + // ...stub... +} +``` + +Note that this assumes that the pallet has already been added to the runtime and the pallet's `Config` already implemented. + +## Integration Tests + +## Also see + +For a good overview of how custom RPCs work, see . diff --git a/frame/assets/Cargo.toml b/frame/assets/Cargo.toml index bc5256bf813..fa24ea01f85 100644 --- a/frame/assets/Cargo.toml +++ b/frame/assets/Cargo.toml @@ -14,26 +14,29 @@ frame-benchmarking = { default-features = false, optional = true, git = 'https:/ frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -composable-traits = { path = "../composable-traits", default-features = false } +# local +composable-traits = { path = "../composable-traits", default-features = false } orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "2b1c9fb367ccb8e13601b2da43d1c5d9737b93c6", default-features = false } -num-traits = { version = "0.2.14", default-features = false } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } +scale-info = { version = "1.0", default-features = false, features = [ + "derive", +] } -[dependencies.codec] -default-features = false -features = ["derive"] -package = "parity-scale-codec" -version = "2.0.0" +# misc +codec = { default-features = false, features = [ + "derive", +], package = "parity-scale-codec", version = "2.0.0" } [dev-dependencies] -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false } orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "2b1c9fb367ccb8e13601b2da43d1c5d9737b93c6", default-features = false } governance-registry = { package = "pallet-governance-registry", path = "../governance-registry", default-features = false } proptest = "0.9.6" @@ -49,8 +52,8 @@ std = [ "codec/std", "frame-support/std", "sp-runtime/std", + "sp-api/std", "orml-traits/std", - "num-traits/std", ] runtime-benchmarks = [ "frame-benchmarking", diff --git a/frame/assets/rpc/Cargo.toml b/frame/assets/rpc/Cargo.toml new file mode 100644 index 00000000000..10d75f0589c --- /dev/null +++ b/frame/assets/rpc/Cargo.toml @@ -0,0 +1,45 @@ +[package] +name = "assets-rpc" +version = "0.0.1" +authors = ["Composable Developers"] +homepage = "https://composable.finance" +edition = "2021" +rust-version = "1.56" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +# substrate primitives +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } + +# local +composable-support = { path = "../../composable-support", default-features = false } + +scale-info = { version = "1.0", default-features = false, features = [ + "derive", +] } + +assets-runtime-api = { path = "../runtime-api", default-features = false } + +# rpc +jsonrpc-core = "18.0.0" +jsonrpc-core-client = "18.0.0" +jsonrpc-derive = "18.0.0" + +codec = { default-features = false, features = [ + "derive", +], package = "parity-scale-codec", version = "2.0.0" } + +[features] +default = ["std"] +std = [ + "assets-runtime-api/std", + "composable-support/std", + "codec/std", + "sp-runtime/std", + "sp-api/std", +] diff --git a/frame/assets/rpc/src/lib.rs b/frame/assets/rpc/src/lib.rs new file mode 100644 index 00000000000..f18f9fc7bfb --- /dev/null +++ b/frame/assets/rpc/src/lib.rs @@ -0,0 +1,73 @@ +use assets_runtime_api::AssetsRuntimeApi; +use codec::Codec; +use composable_support::rpc_helpers::{SafeRpcWrapper, SafeRpcWrapperType}; +use jsonrpc_core::{Error as RpcError, ErrorCode, Result as RpcResult}; +use jsonrpc_derive::rpc; +use sp_api::ProvideRuntimeApi; +use sp_blockchain::HeaderBackend; +use sp_runtime::{generic::BlockId, traits::Block as BlockT}; +use sp_std::sync::Arc; + +#[rpc] +pub trait AssetsApi +where + AssetId: SafeRpcWrapperType, + Balance: SafeRpcWrapperType, +{ + #[rpc(name = "assets_balanceOf")] + fn balance_of( + &self, + currency: SafeRpcWrapper, + account: AccountId, + at: Option, + ) -> RpcResult>; +} + +pub struct Assets { + client: Arc, + _marker: sp_std::marker::PhantomData, +} + +impl Assets { + pub fn new(client: Arc) -> Self { + Self { client, _marker: Default::default() } + } +} + +impl + AssetsApi<::Hash, AssetId, AccountId, Balance> + for Assets +where + Block: BlockT, + AssetId: Codec + Send + Sync + 'static + SafeRpcWrapperType, + AccountId: Codec + Send + Sync + 'static, + Balance: Send + Sync + 'static + SafeRpcWrapperType, + C: Send + Sync + 'static, + C: ProvideRuntimeApi, + C: HeaderBackend, + C::Api: AssetsRuntimeApi, +{ + fn balance_of( + &self, + asset_id: SafeRpcWrapper, + account_id: AccountId, + at: Option<::Hash>, + ) -> RpcResult> { + let api = self.client.runtime_api(); + + let at = BlockId::hash(at.unwrap_or_else(|| { + // If the block hash is not supplied assume the best block. + self.client.info().best_hash + })); + + let runtime_api_result = api.balance_of(&at, asset_id, account_id); + // TODO(benluelo): Review what error message & code to use + runtime_api_result.map_err(|e| { + RpcError { + code: ErrorCode::ServerError(9876), // No real reason for this value + message: "Something wrong".into(), + data: Some(format!("{:?}", e).into()), + } + }) + } +} diff --git a/frame/assets/runtime-api/Cargo.toml b/frame/assets/runtime-api/Cargo.toml new file mode 100644 index 00000000000..d459090f4c4 --- /dev/null +++ b/frame/assets/runtime-api/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "assets-runtime-api" +version = "0.0.1" +authors = ["Composable Developers"] +homepage = "https://composable.finance" +edition = "2021" +rust-version = "1.56" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "2.0.0" } +composable-support = { path = "../../composable-support", default-features = false } + +[features] +default = ["std"] +std = ["sp-api/std", "codec/std", "composable-support/std"] diff --git a/frame/assets/runtime-api/src/lib.rs b/frame/assets/runtime-api/src/lib.rs new file mode 100644 index 00000000000..8229caec12e --- /dev/null +++ b/frame/assets/runtime-api/src/lib.rs @@ -0,0 +1,20 @@ +#![cfg_attr(not(feature = "std"), no_std)] +#![allow(clippy::too_many_arguments)] +#![allow(clippy::unnecessary_mut_passed)] + +use codec::Codec; +use composable_support::rpc_helpers::{SafeRpcWrapper, SafeRpcWrapperType}; + +// Here we declare the runtime API. It is implemented it the `impl` block in +// runtime amalgamator file (the `runtime/src/lib.rs`) +sp_api::decl_runtime_apis! { + // REVIEW(benluelo): Should the AssetId type parameter be removed and then just use CurencyId directly? + pub trait AssetsRuntimeApi + where + AssetId: SafeRpcWrapperType, + AccountId: Codec, + Balance: SafeRpcWrapperType, + { + fn balance_of(asset_id: SafeRpcWrapper, account_id: AccountId) -> SafeRpcWrapper /* Balance */; + } +} diff --git a/frame/assets/src/tests.rs b/frame/assets/src/tests.rs new file mode 100644 index 00000000000..7981ac93465 --- /dev/null +++ b/frame/assets/src/tests.rs @@ -0,0 +1,208 @@ +use crate::*; +use mocks::{new_test_ext, GovernanceRegistry, Origin, Test}; +use orml_traits::MultiCurrency; + +const FROM_ACCOUNT: u64 = 1; +const TO_ACCOUNT: u64 = 2; +const ASSET_ID: u64 = 1; +const INIT_AMOUNT: u64 = 1000; +const TRANSFER_AMOUNT: u64 = 500; + +#[test] +fn set_only_by_root() { + new_test_ext().execute_with(|| { + GovernanceRegistry::set(Origin::root(), 1, 1).unwrap(); + ensure_admin_or_governance::(Origin::root(), &2).unwrap(); + ensure_admin_or_governance::(Origin::signed(1), &2).unwrap_err(); + ensure_admin_or_governance::(Origin::signed(2), &1).unwrap_err(); + ensure_admin_or_governance::(Origin::signed(1), &1).unwrap(); + ensure_admin_or_governance::(Origin::none(), &1).unwrap_err(); + ensure_admin_or_governance::(Origin::none(), &2).unwrap_err(); + }); +} + +#[test] +fn test_transfer() { + new_test_ext().execute_with(|| { + Pallet::::transfer( + Origin::signed(FROM_ACCOUNT), + ASSET_ID, + TO_ACCOUNT, + TRANSFER_AMOUNT, + true, + ) + .expect("transfer should work"); + assert_eq!( + Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), + INIT_AMOUNT - TRANSFER_AMOUNT + ); + assert_eq!( + Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), + INIT_AMOUNT + TRANSFER_AMOUNT + ); + }); +} + +#[test] +fn test_transfer_native() { + new_test_ext().execute_with(|| { + Pallet::::transfer_native( + Origin::signed(FROM_ACCOUNT), + TO_ACCOUNT, + TRANSFER_AMOUNT, + true, + ) + .expect("transfer_native should work"); + assert_eq!( + Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), + INIT_AMOUNT - TRANSFER_AMOUNT + ); + assert_eq!( + Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), + INIT_AMOUNT + TRANSFER_AMOUNT + ); + }); +} + +#[test] +fn test_force_transfer() { + new_test_ext().execute_with(|| { + Pallet::::force_transfer( + Origin::root(), + ASSET_ID, + FROM_ACCOUNT, + TO_ACCOUNT, + TRANSFER_AMOUNT, + true, + ) + .expect("force_transfer should work"); + assert_eq!( + Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), + INIT_AMOUNT - TRANSFER_AMOUNT + ); + assert_eq!( + Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), + INIT_AMOUNT + TRANSFER_AMOUNT + ); + }); +} + +#[test] +fn test_force_transfer_native() { + new_test_ext().execute_with(|| { + Pallet::::force_transfer_native( + Origin::root(), + FROM_ACCOUNT, + TO_ACCOUNT, + TRANSFER_AMOUNT, + true, + ) + .expect("force_transfer_native should work"); + assert_eq!( + Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), + INIT_AMOUNT - TRANSFER_AMOUNT + ); + assert_eq!( + Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), + INIT_AMOUNT + TRANSFER_AMOUNT + ); + }); +} + +#[test] +fn test_transfer_all() { + new_test_ext().execute_with(|| { + Pallet::::transfer_all(Origin::signed(FROM_ACCOUNT), ASSET_ID, TO_ACCOUNT, true) + .expect("transfer_all should work"); + assert_eq!(Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), 1); + assert_eq!(Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), INIT_AMOUNT * 2 - 1); + }); +} + +#[test] +fn test_transfer_all_native() { + new_test_ext().execute_with(|| { + Pallet::::transfer_all_native(Origin::signed(FROM_ACCOUNT), TO_ACCOUNT, true) + .expect("transfer_all_native should work"); + assert_eq!(Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), 1); + assert_eq!(Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), INIT_AMOUNT * 2 - 1); + }); +} + +#[test] +fn test_mint_initialize() { + new_test_ext().execute_with(|| { + assert_eq!(Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), INIT_AMOUNT); + Pallet::::mint_initialize(Origin::root(), TRANSFER_AMOUNT, TO_ACCOUNT) + .expect("mint_initialize should work"); + assert_eq!( + Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), + INIT_AMOUNT + TRANSFER_AMOUNT + ); + }); +} + +#[test] +fn test_mint_initialize_with_governance() { + new_test_ext().execute_with(|| { + assert_eq!(Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), INIT_AMOUNT); + Pallet::::mint_initialize_with_governance( + Origin::root(), + TRANSFER_AMOUNT, + TO_ACCOUNT, + TO_ACCOUNT, + ) + .expect("mint_initialize_with_governance should work"); + assert_eq!( + Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), + INIT_AMOUNT + TRANSFER_AMOUNT + ); + ensure_admin_or_governance::(Origin::signed(TO_ACCOUNT), &ASSET_ID).expect( + "mint_initialize_with_governance should add governance_origin to GovernanceRegistry", + ); + }); +} + +#[test] +fn test_mint_into() { + new_test_ext().execute_with(|| { + GovernanceRegistry::set(Origin::root(), ASSET_ID, FROM_ACCOUNT).unwrap(); + assert_eq!(Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), INIT_AMOUNT); + assert_eq!(Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), INIT_AMOUNT); + + Pallet::::mint_into( + Origin::signed(FROM_ACCOUNT), + ASSET_ID, + TO_ACCOUNT, + TRANSFER_AMOUNT, + ) + .expect("mint_into should work"); + assert_eq!(Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), INIT_AMOUNT); + assert_eq!( + Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), + INIT_AMOUNT + TRANSFER_AMOUNT + ); + }); +} + +#[test] +fn test_burn_from() { + new_test_ext().execute_with(|| { + GovernanceRegistry::set(Origin::root(), ASSET_ID, FROM_ACCOUNT).unwrap(); + assert_eq!(Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), INIT_AMOUNT); + assert_eq!(Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), INIT_AMOUNT); + + Pallet::::burn_from( + Origin::signed(FROM_ACCOUNT), + ASSET_ID, + TO_ACCOUNT, + TRANSFER_AMOUNT, + ) + .expect("burn_from should work"); + assert_eq!(Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), INIT_AMOUNT); + assert_eq!( + Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), + INIT_AMOUNT - TRANSFER_AMOUNT + ); + }); +} diff --git a/frame/composable-support/Cargo.toml b/frame/composable-support/Cargo.toml index a6ea8f071f8..1f07b047050 100644 --- a/frame/composable-support/Cargo.toml +++ b/frame/composable-support/Cargo.toml @@ -9,34 +9,32 @@ rust-version = "1.56" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] -[dev-dependencies] -proptest = { version = "1.0" } -serde_json = "1.0.45" - [dependencies] frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } + sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } + +codec = { version = "2.0.0", package = "parity-scale-codec", default-features = false, features = ["derive"] } scale-info = { version = "1.0", default-features = false, features = ["derive"] } -sorted-vec = "0.7.0" + +sorted-vec = { version = "0.7.0", optional = true } serde = { version = "1.0.130", features = [ "derive" ], optional = true } is_sorted = { version = "0.1.1", default-features = false } -[dependencies.codec] -default-features = false -features = ["derive"] -package = "parity-scale-codec" -version = "2.0.0" +[dev-dependencies] +proptest = { version = "1.0" } +serde_json = "1.0.45" [features] default = ["std"] std = [ "codec/std", "frame-support/std", - "frame-system/std", - "sp-runtime/std", "sp-std/std", "scale-info/std", + "serde", + "sorted-vec", ] diff --git a/frame/composable-support/src/lib.rs b/frame/composable-support/src/lib.rs index 6c7d99386a4..3a79b33097b 100644 --- a/frame/composable-support/src/lib.rs +++ b/frame/composable-support/src/lib.rs @@ -14,3 +14,6 @@ pub mod collections; pub mod validation; + +// #[cfg(feature = "std")] +pub mod rpc_helpers; diff --git a/frame/composable-support/src/rpc_helpers.rs b/frame/composable-support/src/rpc_helpers.rs new file mode 100644 index 00000000000..7c1a701c735 --- /dev/null +++ b/frame/composable-support/src/rpc_helpers.rs @@ -0,0 +1,79 @@ +use codec::{Codec, Decode, Encode}; +#[cfg(feature = "std")] +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +/// https://github.com/interlay/interbtc/blob/a7c0e69ac041176a2531bafb1c4e35cbc2f7e192/crates/oracle/rpc/runtime-api/src/lib.rs#L10 +#[cfg_attr(feature = "std", derive(Serialize, Deserialize))] +#[derive(Debug, PartialEq, Eq, Encode, Decode)] +pub struct SafeRpcWrapper( + #[cfg_attr(feature = "std", serde(serialize_with = "serialize_to_hex"))] + #[cfg_attr(feature = "std", serde(deserialize_with = "deserialize_from_hex"))] + pub T, +); + +pub trait SafeRpcWrapperType +where + Self: sp_std::fmt::LowerHex + FromHexStr + Codec, +{ +} + +impl SafeRpcWrapperType for T where T: sp_std::fmt::LowerHex + FromHexStr + Codec {} + +pub trait FromHexStr: sp_std::marker::Sized { + type Err: sp_std::fmt::Display; + + fn from_hex_str(src: &str) -> sp_std::result::Result; +} + +#[derive(Debug)] +pub enum FromHexStrErr { + No0xPrefix, + ParseIntError(sp_std::num::ParseIntError), +} + +impl sp_std::fmt::Display for FromHexStrErr { + fn fmt(&self, f: &mut sp_std::fmt::Formatter<'_>) -> sp_std::fmt::Result { + match self { + FromHexStrErr::No0xPrefix => f.write_str("No `0x` prefix"), + FromHexStrErr::ParseIntError(parse_int_error) => + f.write_fmt(format_args!("{}", parse_int_error)), + } + } +} + +impl FromHexStr for u128 { + type Err = FromHexStrErr; + + fn from_hex_str(src: &str) -> sp_std::result::Result { + match src.strip_prefix("0x") { + Some(stripped) => + u128::from_str_radix(stripped, 16).map_err(FromHexStrErr::ParseIntError), + None => Err(FromHexStrErr::No0xPrefix), + } + } +} + +#[cfg(feature = "std")] +fn serialize_to_hex( + t: &T, + serializer: S, +) -> Result { + serializer.serialize_str(&format!("{:#x}", t)) +} + +#[cfg(feature = "std")] +fn deserialize_from_hex<'de, D: Deserializer<'de>, T: SafeRpcWrapperType>( + deserializer: D, +) -> Result { + use serde::de::Error; + let hex_string = String::deserialize(deserializer)?; + + T::from_hex_str(&hex_string).map_err(|err| { + D::Error::custom(format!( + "Unable to parse as 0x-prefixed hex string: {} (error: {})", + hex_string, err + )) + }) +} + +// TODO: tests? diff --git a/frame/composable-traits/Cargo.toml b/frame/composable-traits/Cargo.toml index 991cd5de616..3ad33a12fb0 100644 --- a/frame/composable-traits/Cargo.toml +++ b/frame/composable-traits/Cargo.toml @@ -5,23 +5,21 @@ authors = ["Composable Developers"] homepage = "https://composable.finance" edition = "2021" - [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies] -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -xcm = { default-features = false, package = "xcm", git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.16" } +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +xcm = { default-features = false, git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.16" } sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "2b1c9fb367ccb8e13601b2da43d1c5d9737b93c6", default-features = false } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -composable-support = {default-features = false, path = "../composable-support"} +composable-support = { default-features = false, path = "../composable-support" } scale-info = { version = "1.0", default-features = false, features = ["derive"] } serde = { version = '1', optional = true } -plotters = {version = "0.3.1", optional = true} +plotters = { version = "0.3.1", optional = true } bitflags = "1.3.2" [dev-dependencies] @@ -48,4 +46,4 @@ std = [ visualization = ["plotters"] [package.metadata.cargo-udeps.ignore] -normal = ["plotters"] \ No newline at end of file +normal = ["plotters"] diff --git a/frame/crowdloan-rewards/Cargo.toml b/frame/crowdloan-rewards/Cargo.toml index 1d27e34e9f6..d25b97ff1a9 100644 --- a/frame/crowdloan-rewards/Cargo.toml +++ b/frame/crowdloan-rewards/Cargo.toml @@ -26,26 +26,27 @@ hex-literal = "0.3" balances = { package = "pallet-balances", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false, features = [ "std" ]} [dependencies] -### Benchmarking +# Benchmarking hex-literal = { version = "0.3.3", optional = true } -libsecp256k1 = { version = "0.7.0", default-features = false, optional = true, features = [ - "hmac", - "static-context", -] } +libsecp256k1 = { version = "0.7.0", default-features = false, optional = true, features = ["hmac","static-context"] } frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-application-crypto = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +# FRAME frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +# substrate primitives sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -scale-info = { version = "1.0", default-features = false, features = [ - "derive", -] } + +# SCALE +scale-info = { version = "1.0", default-features = false, features = ["derive"] } + +# misc serde = { version = "1.0.130", optional = true } rustc-hex = { version = "2.1.0", default-features = false } hex = { version = "0.4", default-features = false, features = ["alloc"] } diff --git a/frame/crowdloan-rewards/rpc/Cargo.toml b/frame/crowdloan-rewards/rpc/Cargo.toml new file mode 100644 index 00000000000..27627fbbf73 --- /dev/null +++ b/frame/crowdloan-rewards/rpc/Cargo.toml @@ -0,0 +1,54 @@ +[package] +name = "crowdloan-rewards-rpc" +version = "0.0.1" +authors = ["Composable Developers"] +homepage = "https://composable.finance" +edition = "2021" +rust-version = "1.56" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +# FRAME +frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } + +# substrate primitives +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } + +# local +composable-traits = { path = "../../composable-traits", default-features = false } +composable-support = { path = "../../composable-support", default-features = false } + +num-traits = { version = "0.2.14", default-features = false } +scale-info = { version = "1.0", default-features = false, features = [ + "derive", +] } + +crowdloan-rewards-runtime-api = { path = "../runtime-api", default-features = false } + +# rpc +jsonrpc-core = "18.0.0" +jsonrpc-core-client = "18.0.0" +jsonrpc-derive = "18.0.0" + +# misc +codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "2.0.0" } + +[features] +default = ["std"] +std = [ + "composable-traits/std", + "composable-support/std", + "codec/std", + "frame-support/std", + "sp-runtime/std", + "sp-api/std", + "num-traits/std", +] diff --git a/frame/crowdloan-rewards/rpc/src/lib.rs b/frame/crowdloan-rewards/rpc/src/lib.rs new file mode 100644 index 00000000000..1cab53f8a7e --- /dev/null +++ b/frame/crowdloan-rewards/rpc/src/lib.rs @@ -0,0 +1,88 @@ +use codec::Codec; +use composable_support::rpc_helpers::{SafeRpcWrapper, SafeRpcWrapperType}; +use crowdloan_rewards_runtime_api::CrowdloanRewardsRuntimeApi; +use frame_support::{pallet_prelude::MaybeSerializeDeserialize, Parameter}; +use jsonrpc_core::{Error as RpcError, ErrorCode, Result as RpcResult}; +use jsonrpc_derive::rpc; +use num_traits::{CheckedAdd, CheckedMul, CheckedSub, Zero}; +use sp_api::ProvideRuntimeApi; +use sp_blockchain::HeaderBackend; +use sp_runtime::{ + generic::BlockId, + traits::{AtLeast32BitUnsigned, Block as BlockT}, +}; +use sp_std::sync::Arc; + +#[rpc] +pub trait CrowdloanRewardsApi +where + Balance: SafeRpcWrapperType, +{ + #[rpc(name = "crowdloanRewards_amountAvailableToClaimFor")] + fn amount_available_to_claim_for( + &self, + account: AccountId, + at: Option, + ) -> RpcResult>; +} + +/// A struct that implements the `CrowdloanRewardsApi`. +pub struct CrowdloanRewards { + // If you have more generics, no need to Assets + // just use a tuple like Assets + client: Arc, + _marker: sp_std::marker::PhantomData, +} + +impl CrowdloanRewards { + /// Create new `CrowdloanRewards` instance with the given reference to the client. + pub fn new(client: Arc) -> Self { + Self { client, _marker: Default::default() } + } +} + +impl CrowdloanRewardsApi<::Hash, AccountId, Balance> + for CrowdloanRewards +where + Block: BlockT, + AccountId: Send + Sync + Parameter + MaybeSerializeDeserialize + Ord + 'static, + Balance: Send + + Sync + + Default + + Parameter + + Codec + + Copy + + Ord + + CheckedAdd + + CheckedSub + + CheckedMul + + AtLeast32BitUnsigned + + MaybeSerializeDeserialize + + Zero + + 'static + + SafeRpcWrapperType, + C: Send + Sync + ProvideRuntimeApi + HeaderBackend + 'static, + C::Api: CrowdloanRewardsRuntimeApi, +{ + fn amount_available_to_claim_for( + &self, + remote_account: AccountId, + at: Option<::Hash>, + ) -> RpcResult> { + let api = self.client.runtime_api(); + let at = BlockId::hash(at.unwrap_or_else(|| { + // If the block hash is not supplied assume the best block. + self.client.info().best_hash + })); + + let runtime_api_result = api.amount_available_to_claim_for(&at, remote_account); + // TODO(benluelo): Review what error message & code to use + runtime_api_result.map_err(|e| { + RpcError { + code: ErrorCode::ServerError(9876), // No real reason for this value + message: "Something wrong".into(), + data: Some(format!("{:?}", e).into()), + } + }) + } +} diff --git a/frame/crowdloan-rewards/runtime-api/Cargo.toml b/frame/crowdloan-rewards/runtime-api/Cargo.toml new file mode 100644 index 00000000000..934dfb86da1 --- /dev/null +++ b/frame/crowdloan-rewards/runtime-api/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "crowdloan-rewards-runtime-api" +version = "0.0.1" +authors = ["Composable Developers"] +homepage = "https://composable.finance" +edition = "2021" +rust-version = "1.56" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +composable-support = { path = "../../composable-support", default-features = false } +sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "2.0.0" } + + +# REVIEW: Does the runtime API need features? +[features] +default = ["std"] +std = ["sp-api/std", "composable-support/std"] diff --git a/frame/crowdloan-rewards/runtime-api/src/lib.rs b/frame/crowdloan-rewards/runtime-api/src/lib.rs new file mode 100644 index 00000000000..609d96e44dd --- /dev/null +++ b/frame/crowdloan-rewards/runtime-api/src/lib.rs @@ -0,0 +1,18 @@ +#![cfg_attr(not(feature = "std"), no_std)] +#![allow(clippy::too_many_arguments)] +#![allow(clippy::unnecessary_mut_passed)] + +use codec::Codec; +use composable_support::rpc_helpers::{SafeRpcWrapper, SafeRpcWrapperType}; + +// Here we declare the runtime API. It is implemented it the `impl` block in +// runtime amalgamator file (the `runtime/src/lib.rs`) +sp_api::decl_runtime_apis! { + pub trait CrowdloanRewardsRuntimeApi + where + AccountId: Codec, + Balance: SafeRpcWrapperType, + { + fn amount_available_to_claim_for(account: AccountId) -> SafeRpcWrapper; + } +} diff --git a/frame/crowdloan-rewards/src/lib.rs b/frame/crowdloan-rewards/src/lib.rs index 8bd0565534b..cadeb1e8274 100644 --- a/frame/crowdloan-rewards/src/lib.rs +++ b/frame/crowdloan-rewards/src/lib.rs @@ -326,33 +326,11 @@ pub mod pallet { remote_account: RemoteAccountOf, reward_account: &T::AccountId, ) -> Result { - let start = VestingBlockStart::::get().ok_or(Error::::NotInitialized)?; Rewards::::try_mutate(remote_account, |reward| { reward .as_mut() .map(|reward| { - let upfront_payment = T::InitialPayment::get().mul_floor(reward.total); - let should_have_claimed = { - let current_block = frame_system::Pallet::::block_number(); - // Current point in time - let vesting_point = current_block.saturating_sub(start); - if vesting_point >= reward.vesting_period { - // If the user is claiming when the period is over, he should - // probably have already claimed everything. - reward.total - } else { - let vesting_step = T::VestingStep::get(); - // Current window, rounded to previous window. - let vesting_window = vesting_point - (vesting_point % vesting_step); - // The user should have claimed the upfront payment + the vested - // amount until this window point. - let vested_reward = reward.total - upfront_payment; - upfront_payment + - (vested_reward - .saturating_mul(T::Convert::convert(vesting_window)) / - T::Convert::convert(reward.vesting_period)) - } - }; + let should_have_claimed = should_have_claimed::(reward)?; let available_to_claim = should_have_claimed - reward.claimed; ensure!( available_to_claim > T::Balance::zero(), @@ -368,6 +346,32 @@ pub mod pallet { } } + pub fn should_have_claimed( + reward: &Reward<::Balance, ::BlockNumber>, + ) -> Result { + let start = VestingBlockStart::::get().ok_or(Error::::NotInitialized)?; + let upfront_payment = T::InitialPayment::get().mul_floor(reward.total); + + let current_block = frame_system::Pallet::::block_number(); + // Current point in time + let vesting_point = current_block.saturating_sub(start); + if vesting_point >= reward.vesting_period { + // If the user is claiming when the period is over, he should + // probably have already claimed everything. + Ok(reward.total) + } else { + let vesting_step = T::VestingStep::get(); + // Current window, rounded to previous window. + let vesting_window = vesting_point - (vesting_point % vesting_step); + // The user should have claimed the upfront payment + the vested + // amount until this window point. + let vested_reward = reward.total - upfront_payment; + Ok(upfront_payment + + (vested_reward.saturating_mul(T::Convert::convert(vesting_window)) / + T::Convert::convert(reward.vesting_period))) + } + } + pub fn get_remote_account( proof: Proof<::RelayChainAccountId>, reward_account: &::AccountId, diff --git a/frame/currency-factory/Cargo.toml b/frame/currency-factory/Cargo.toml index e02a7e8ee60..666e72992c0 100644 --- a/frame/currency-factory/Cargo.toml +++ b/frame/currency-factory/Cargo.toml @@ -16,20 +16,24 @@ package = "parity-scale-codec" version = "2.0.0" [dependencies] +# FRAME frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } frame-benchmarking = { default-features = false, optional = true, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.16' } +# substrate primitives sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -composable-traits = { path = "../composable-traits", default-features = false } scale-info = { version = "1.0", default-features = false, features = ["derive"] } +# local +composable-traits = { path = "../composable-traits", default-features = false } + [dev-dependencies] -pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" } +pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } proptest = "0.9.6" composable-tests-helpers = { version = "0.0.1", path = "../composable-tests-helpers", default-features = false } diff --git a/frame/dutch-auction/Cargo.toml b/frame/dutch-auction/Cargo.toml index 18c3a866a15..c5a88defc7a 100644 --- a/frame/dutch-auction/Cargo.toml +++ b/frame/dutch-auction/Cargo.toml @@ -22,7 +22,7 @@ sp-io = { default-features = false, git = "https://github.com/paritytech/substr sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } smallvec = "1.7.0" -serde = { version = "1.0.130", optional = true } +serde = { version = "1.0.130", optional = true } scale-info = { version = "1.0", default-features = false, features = ["derive"] } orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "2b1c9fb367ccb8e13601b2da43d1c5d9737b93c6", default-features = false } num-traits = { version = "0.2.14", default-features = false } @@ -58,11 +58,11 @@ std = [ "frame-system/std", "frame-support/std", "codec/std", - "composable-traits/std", + "composable-traits/std", ] runtime-benchmarks = [ "frame-benchmarking", - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", ] diff --git a/frame/lending/Cargo.toml b/frame/lending/Cargo.toml index 4e3e92b4dcd..e9a1fcddb36 100644 --- a/frame/lending/Cargo.toml +++ b/frame/lending/Cargo.toml @@ -53,7 +53,7 @@ pallet-currency-factory = { path = "../currency-factory" } pallet-liquidations = { path = "../liquidations" } pallet-dutch-auction = { path = "../dutch-auction", default-features = false } composable-tests-helpers = { path = "../composable-tests-helpers", default-features = false } -pallet-assets = { path = '../assets', default-features = false} +pallet-assets = { path = '../assets', default-features = false } [features] diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 3daf3f68097..417a792f522 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -14,7 +14,7 @@ normal = [ "pallet-bonded-finance", "pallet-vault", "session-benchmarking", - "vault" + "vault", ] [dependencies] @@ -61,11 +61,11 @@ primitives = { path = "../runtime/primitives", default-features = false } oracle = { package = "pallet-oracle", path = "../frame/oracle", default-features = false } vault = { package = "pallet-vault", path = "../frame/vault", default-features = false } currency-factory = { package = "pallet-currency-factory", path = "../frame/currency-factory", default-features = false } -composable-traits = { path = "../frame/composable-traits" , default-features = false} +composable-traits = { path = "../frame/composable-traits", default-features = false } call-filter = { package = "pallet-call-filter", path = "../frame/call-filter", default-features = false } -assets-registry = { package = "pallet-assets-registry", path = "../frame/assets-registry", default-features = false, optional = true} -governance-registry = { package = "pallet-governance-registry", path = "../frame/governance-registry", default-features = false, optional = true} -assets = { package = "pallet-assets", path = "../frame/assets", default-features = false, optional = true} +assets-registry = { package = "pallet-assets-registry", path = "../frame/assets-registry", default-features = false, optional = true } +governance-registry = { package = "pallet-governance-registry", path = "../frame/governance-registry", default-features = false, optional = true } +assets = { package = "pallet-assets", path = "../frame/assets", default-features = false, optional = true } # Used for the node template's RPCs system-rpc-runtime-api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false } @@ -75,7 +75,9 @@ transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rp benchmarking = { package = "frame-benchmarking", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false, optional = true } system-benchmarking = { package = "frame-system-benchmarking", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false, optional = true } hex-literal = { version = "0.3.1", optional = true } -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ + "derive", +] } # Parachain Utilities cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16", default-features = false } @@ -125,9 +127,9 @@ std = [ "sp-block-builder/std", "sp-transaction-pool/std", "sp-inherents/std", - "support/std", + "support/std", "executive/std", - "frame-system/std", + "frame-system/std", "utility/std", "authorship/std", "balances/std", @@ -198,8 +200,4 @@ runtime-benchmarks = [ "polkadot-runtime-parachains/runtime-benchmarks", ] -develop = [ - "assets", - "assets-registry", - "governance-registry", -] \ No newline at end of file +develop = ["assets", "assets-registry", "governance-registry"] diff --git a/integration-tests/runtime-tests/.mocharc.json b/integration-tests/runtime-tests/.mocharc.json index 2374a46832f..2975a964147 100644 --- a/integration-tests/runtime-tests/.mocharc.json +++ b/integration-tests/runtime-tests/.mocharc.json @@ -1,6 +1,5 @@ { "diff": true, - "extension": ["js", "cjs", "mjs"], "package": "./package.json", "reporter": "mochawesome", "reporterOptions": { @@ -14,9 +13,9 @@ "timeout": 2000, "retries": 0, "ui": "bdd", - "watch-files": ["src/**/*.js", "src/**/*.ts"], + "watch-files": ["src/**/*.ts"], "watch-ignore": ["lib/vendor"], - "require": "src/utils/testSetup.js", + "require": "src/utils/testSetup.ts", "full-trace": true, "parallel": false } diff --git a/integration-tests/runtime-tests/package-lock.json b/integration-tests/runtime-tests/package-lock.json index 882060b5329..78c14b95892 100644 --- a/integration-tests/runtime-tests/package-lock.json +++ b/integration-tests/runtime-tests/package-lock.json @@ -23,6 +23,7 @@ "@types/ramda": "^0.27.64", "chai": "^4.3.4", "chai-as-promised": "^7.1.1", + "chai-bn": "^0.3.1", "minimist": "^1.2.5", "mocha": "^8.4.0", "mochawesome": "^7.0.1", @@ -47,6 +48,18 @@ "node": ">=12.0.0" } }, + "node_modules/@ampproject/remapping": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.0.2.tgz", + "integrity": "sha512-sE8Gx+qSDMLoJvb3QarJJlDQK7SSY4rK3hxp4XsiANeFOmjU46ZI7Y9adAQRJrmbz8zbtZkp3mJTT+rGxtF0XA==", + "dependencies": { + "@jridgewell/trace-mapping": "^0.2.2", + "sourcemap-codec": "1.4.8" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@babel/code-frame": { "version": "7.16.7", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", @@ -67,25 +80,25 @@ } }, "node_modules/@babel/core": { - "version": "7.16.12", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.12.tgz", - "integrity": "sha512-dK5PtG1uiN2ikk++5OzSYsitZKny4wOCD0nrO4TqnW4BVBTQ2NGS3NgilvT/TEyxTST7LNyWV/T4tXDoD3fOgg==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.0.tgz", + "integrity": "sha512-x/5Ea+RO5MvF9ize5DeVICJoVrNv0Mi2RnIABrZEKYvPEpldXwauPkgvYA17cKa6WpU3LoYvYbuEMFtSNFsarA==", "dependencies": { + "@ampproject/remapping": "^2.0.0", "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.16.8", + "@babel/generator": "^7.17.0", "@babel/helper-compilation-targets": "^7.16.7", "@babel/helper-module-transforms": "^7.16.7", - "@babel/helpers": "^7.16.7", - "@babel/parser": "^7.16.12", + "@babel/helpers": "^7.17.0", + "@babel/parser": "^7.17.0", "@babel/template": "^7.16.7", - "@babel/traverse": "^7.16.10", - "@babel/types": "^7.16.8", + "@babel/traverse": "^7.17.0", + "@babel/types": "^7.17.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.1.2", - "semver": "^6.3.0", - "source-map": "^0.5.0" + "semver": "^6.3.0" }, "engines": { "node": ">=6.9.0" @@ -109,20 +122,12 @@ "node": ">=6" } }, - "node_modules/@babel/core/node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/@babel/generator": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.8.tgz", - "integrity": "sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.0.tgz", + "integrity": "sha512-I3Omiv6FGOC29dtlZhkfXO6pgkmukJSlT26QjVvS1DGZe/NzSVCPG41X0tS21oZkJYlovfj9qDWgKP+Cn4bXxw==", "dependencies": { - "@babel/types": "^7.16.8", + "@babel/types": "^7.17.0", "jsesc": "^2.5.1", "source-map": "^0.5.0" }, @@ -269,13 +274,13 @@ } }, "node_modules/@babel/helpers": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz", - "integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.0.tgz", + "integrity": "sha512-Xe/9NFxjPwELUvW2dsukcMZIp6XwPSbI4ojFBJuX5ramHuVE22SVcZIwqzdWo5uCgeTXW8qV97lMvSOjq+1+nQ==", "dependencies": { "@babel/template": "^7.16.7", - "@babel/traverse": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/traverse": "^7.17.0", + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" @@ -359,9 +364,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.16.12", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.12.tgz", - "integrity": "sha512-VfaV15po8RiZssrkPweyvbGVSe4x2y+aciFCgn0n0/SJMR22cwofRV1mtnJQYcSB1wUTaA/X1LnA3es66MCO5A==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.0.tgz", + "integrity": "sha512-VKXSCQx5D8S04ej+Dqsr1CzYvvWgf20jIw2D+YhQCrIlr2UZGaDds23Y0xg75/skOxpLCRpUZvk/1EAVkGoDOw==", "bin": { "parser": "bin/babel-parser.js" }, @@ -411,18 +416,18 @@ } }, "node_modules/@babel/traverse": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.10.tgz", - "integrity": "sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.0.tgz", + "integrity": "sha512-fpFIXvqD6kC7c7PUNnZ0Z8cQXlarCLtCUpt2S1Dx7PjoRtCFffvOkHHSom+m5HIxMZn5bIBVb71lhabcmjEsqg==", "dependencies": { "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.16.8", + "@babel/generator": "^7.17.0", "@babel/helper-environment-visitor": "^7.16.7", "@babel/helper-function-name": "^7.16.7", "@babel/helper-hoist-variables": "^7.16.7", "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.16.10", - "@babel/types": "^7.16.8", + "@babel/parser": "^7.17.0", + "@babel/types": "^7.17.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -439,9 +444,9 @@ } }, "node_modules/@babel/types": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.8.tgz", - "integrity": "sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", "dependencies": { "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" @@ -638,6 +643,11 @@ "bn.js": "^4.11.9" } }, + "node_modules/@ethersproject/bignumber/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/@ethersproject/bytes": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.5.0.tgz", @@ -811,6 +821,11 @@ "hash.js": "1.1.7" } }, + "node_modules/@ethersproject/signing-key/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/@ethersproject/strings": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.5.0.tgz", @@ -897,6 +912,23 @@ "dev": true, "license": "BSD-3-Clause" }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.4.tgz", + "integrity": "sha512-cz8HFjOFfUBtvN+NXYSFMHYRdxZMaEl0XypVrhzxBgadKIXhIkRd8aMeHhmF56Sl7SuS8OnUpQ73/k9LE4VnLg==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.2.5.tgz", + "integrity": "sha512-K+Eths78fXDFOvQ2hgJhCiI5s+g81r2yXmACBpbn+f2+Qt94PNoTgUcAXPT8DZkhXCsZRsHVWVtY5KIBMcpDqQ==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "sourcemap-codec": "1.4.8" + } + }, "node_modules/@noble/hashes": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-0.5.7.tgz", @@ -943,23 +975,23 @@ } }, "node_modules/@polkadot/api": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-7.5.1.tgz", - "integrity": "sha512-/3AI4Kbznt289+swtiFEYiX+XR9d+qzHhL8XxEzcqQudw2ElrfpLTAx3RzTUEEeEfwwPGmNVWPWaG4egUPsosQ==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-7.6.1.tgz", + "integrity": "sha512-0VvWn8TIKX3o922ZjomsJEkysica1ScnjNYBG3+801gWG3WbCI+IdzdqazTkIMZL8r8HipmA4cjfS3Tdk+R9eg==", "dependencies": { "@babel/runtime": "^7.16.7", - "@polkadot/api-augment": "7.5.1", - "@polkadot/api-base": "7.5.1", - "@polkadot/api-derive": "7.5.1", + "@polkadot/api-augment": "7.6.1", + "@polkadot/api-base": "7.6.1", + "@polkadot/api-derive": "7.6.1", "@polkadot/keyring": "^8.3.3", - "@polkadot/rpc-augment": "7.5.1", - "@polkadot/rpc-core": "7.5.1", - "@polkadot/rpc-provider": "7.5.1", - "@polkadot/types": "7.5.1", - "@polkadot/types-augment": "7.5.1", - "@polkadot/types-codec": "7.5.1", - "@polkadot/types-create": "7.5.1", - "@polkadot/types-known": "7.5.1", + "@polkadot/rpc-augment": "7.6.1", + "@polkadot/rpc-core": "7.6.1", + "@polkadot/rpc-provider": "7.6.1", + "@polkadot/types": "7.6.1", + "@polkadot/types-augment": "7.6.1", + "@polkadot/types-codec": "7.6.1", + "@polkadot/types-create": "7.6.1", + "@polkadot/types-known": "7.6.1", "@polkadot/util": "^8.3.3", "@polkadot/util-crypto": "^8.3.3", "eventemitter3": "^4.0.7", @@ -970,16 +1002,16 @@ } }, "node_modules/@polkadot/api-augment": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-augment/-/api-augment-7.5.1.tgz", - "integrity": "sha512-2sj+D8gvyo9ijqFFqJS5meaMVRllr5fWnE440nACsXIbcbHuXRWAF9tWdhESOIfue7hlFLo5plDdRfU7cSjIZQ==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-augment/-/api-augment-7.6.1.tgz", + "integrity": "sha512-elkAVDzkcW909phGQNOM2M2ksfnjNeY67EnwIB0xBdFlfM7mVPdxqnAWHrBwbIsD3TdWzxtrNzWzyi7hvILt+A==", "dependencies": { "@babel/runtime": "^7.16.7", - "@polkadot/api-base": "7.5.1", - "@polkadot/rpc-augment": "7.5.1", - "@polkadot/types": "7.5.1", - "@polkadot/types-augment": "7.5.1", - "@polkadot/types-codec": "7.5.1", + "@polkadot/api-base": "7.6.1", + "@polkadot/rpc-augment": "7.6.1", + "@polkadot/types": "7.6.1", + "@polkadot/types-augment": "7.6.1", + "@polkadot/types-codec": "7.6.1", "@polkadot/util": "^8.3.3" }, "engines": { @@ -987,13 +1019,13 @@ } }, "node_modules/@polkadot/api-base": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-base/-/api-base-7.5.1.tgz", - "integrity": "sha512-vqMjmMOQuYLSwfTHTgmvPBtF6eAgrlyuBw0t0IiaTDfjP6xRRGMDIVb7lJCqvYL0VrHmTC7X5MVbJn1SNUut9w==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-base/-/api-base-7.6.1.tgz", + "integrity": "sha512-HbbbQSzTc5W0QtV/5JMOHbINlrHeZ5w5Cdo2jmIkSZT8w8MxhnupzdvkjIX9B9F4/dFa0RdaP/J1FnLNFlUU1w==", "dependencies": { "@babel/runtime": "^7.16.7", - "@polkadot/rpc-core": "7.5.1", - "@polkadot/types": "7.5.1", + "@polkadot/rpc-core": "7.6.1", + "@polkadot/types": "7.6.1", "@polkadot/util": "^8.3.3", "rxjs": "^7.5.2" }, @@ -1002,17 +1034,17 @@ } }, "node_modules/@polkadot/api-derive": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-7.5.1.tgz", - "integrity": "sha512-O4x/DG+sSWgbXYGuYm4d3iYMTv5WTzoX5HX/xAIG+H+g7ob5RDdyLW9oQowrOX9ZOKt1cHPbHi0dLj+hDOD1CQ==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-7.6.1.tgz", + "integrity": "sha512-cRoc1LTTwvEH9QtHIp7vWYn34dczuqg4xQSbZn/IqEzvmcpU7wJC3gLfEOCrqTIFDofPVyBOd7Vv3gjuey/82g==", "dependencies": { "@babel/runtime": "^7.16.7", - "@polkadot/api": "7.5.1", - "@polkadot/api-augment": "7.5.1", - "@polkadot/api-base": "7.5.1", - "@polkadot/rpc-core": "7.5.1", - "@polkadot/types": "7.5.1", - "@polkadot/types-codec": "7.5.1", + "@polkadot/api": "7.6.1", + "@polkadot/api-augment": "7.6.1", + "@polkadot/api-base": "7.6.1", + "@polkadot/rpc-core": "7.6.1", + "@polkadot/types": "7.6.1", + "@polkadot/types-codec": "7.6.1", "@polkadot/util": "^8.3.3", "@polkadot/util-crypto": "^8.3.3", "rxjs": "^7.5.2" @@ -1051,14 +1083,14 @@ } }, "node_modules/@polkadot/rpc-augment": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-augment/-/rpc-augment-7.5.1.tgz", - "integrity": "sha512-LPTDjtBZJe5KIOErOW+h2HY85G57WZVOiwm+SOgJ6J5g+BnUD0Rv+VH9pGC8dfoUsYBHSSvFELLnoTIZw6jltg==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-augment/-/rpc-augment-7.6.1.tgz", + "integrity": "sha512-lNeTS8Ma/0sAk3pvGxliQOkE016WZKXyS5uQWtcF2CRn2rn265Fb4I29n3KjTL8CRYtafvH6IRS0DSkKgbnL3w==", "dependencies": { "@babel/runtime": "^7.16.7", - "@polkadot/rpc-core": "7.5.1", - "@polkadot/types": "7.5.1", - "@polkadot/types-codec": "7.5.1", + "@polkadot/rpc-core": "7.6.1", + "@polkadot/types": "7.6.1", + "@polkadot/types-codec": "7.6.1", "@polkadot/util": "^8.3.3" }, "engines": { @@ -1066,14 +1098,14 @@ } }, "node_modules/@polkadot/rpc-core": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-7.5.1.tgz", - "integrity": "sha512-/UN7fQSqGnyjd5W0fFZ2RDBxAYoS8UreIea0eu+Zz4t6D2Fjp1syHNkw710wuv6ALhaRUjW6USO8XNSHDBIz+w==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-7.6.1.tgz", + "integrity": "sha512-xq/GzUeBu1GsP4ngEYQeDrVnsullDBy/22yUY/ahNjkgAjXeOndrBFis+4lBiiksVQMgYZEzaHv89E0aCOBvAA==", "dependencies": { "@babel/runtime": "^7.16.7", - "@polkadot/rpc-augment": "7.5.1", - "@polkadot/rpc-provider": "7.5.1", - "@polkadot/types": "7.5.1", + "@polkadot/rpc-augment": "7.6.1", + "@polkadot/rpc-provider": "7.6.1", + "@polkadot/types": "7.6.1", "@polkadot/util": "^8.3.3", "rxjs": "^7.5.2" }, @@ -1082,21 +1114,21 @@ } }, "node_modules/@polkadot/rpc-provider": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-7.5.1.tgz", - "integrity": "sha512-6t5PyEDFBYJiK1/oegQkET4DnKdfk/mskELOVflDd4sLN+mXSAUW4DvS+KiVldHfUBtMQqX/w3p7x26xmWjmqQ==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-7.6.1.tgz", + "integrity": "sha512-jevBGp/n16ra+Y+JV8nnNRTtKPU1Oo3nBiyMhUla6crWLjMnLAYvcyteRq27aBmU3Olh4n/0xDVNCvTxfEghxQ==", "dependencies": { "@babel/runtime": "^7.16.7", "@polkadot/keyring": "^8.3.3", - "@polkadot/types": "7.5.1", - "@polkadot/types-support": "7.5.1", + "@polkadot/types": "7.6.1", + "@polkadot/types-support": "7.6.1", "@polkadot/util": "^8.3.3", "@polkadot/util-crypto": "^8.3.3", "@polkadot/x-fetch": "^8.3.3", "@polkadot/x-global": "^8.3.3", "@polkadot/x-ws": "^8.3.3", "eventemitter3": "^4.0.7", - "mock-socket": "^9.1.0", + "mock-socket": "^9.1.2", "nock": "^13.2.2" }, "engines": { @@ -1112,22 +1144,22 @@ } }, "node_modules/@polkadot/typegen": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/typegen/-/typegen-7.5.1.tgz", - "integrity": "sha512-0ma//yfYBEcpYftoqS3Jbl3mVGA/zl3WRfnW3KK3cQ8J1xqKXusjeQ/9egyuWSP8qn34XHXQcvE6T+rfX+ki4A==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/typegen/-/typegen-7.6.1.tgz", + "integrity": "sha512-RCtpQWTmPMTHFbK5AXTy7Ncgx2aj4FhxnYFZxmpm2bZpXsf66mTKDu2vQiKN2vwPtjG8WnxuyB1fqnyGtebHPg==", "dependencies": { "@babel/core": "^7.16.12", "@babel/register": "^7.16.9", "@babel/runtime": "^7.16.7", - "@polkadot/api": "7.5.1", - "@polkadot/api-augment": "7.5.1", - "@polkadot/rpc-augment": "7.5.1", - "@polkadot/rpc-provider": "7.5.1", - "@polkadot/types": "7.5.1", - "@polkadot/types-augment": "7.5.1", - "@polkadot/types-codec": "7.5.1", - "@polkadot/types-create": "7.5.1", - "@polkadot/types-support": "7.5.1", + "@polkadot/api": "7.6.1", + "@polkadot/api-augment": "7.6.1", + "@polkadot/rpc-augment": "7.6.1", + "@polkadot/rpc-provider": "7.6.1", + "@polkadot/types": "7.6.1", + "@polkadot/types-augment": "7.6.1", + "@polkadot/types-codec": "7.6.1", + "@polkadot/types-create": "7.6.1", + "@polkadot/types-support": "7.6.1", "@polkadot/util": "^8.3.3", "@polkadot/x-ws": "^8.3.3", "handlebars": "^4.7.7", @@ -1171,15 +1203,15 @@ } }, "node_modules/@polkadot/types": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-7.5.1.tgz", - "integrity": "sha512-71KY3Ia8AZywb0wWP0F588qFJbQMcgZqqP/dw6RP1A5ja2pR5SnqRP/zcaSena1cm9f24rAxgxiluOzzJxrfsA==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-7.6.1.tgz", + "integrity": "sha512-4GotmyT6h5n2qpgqPKqzVzgZKuPS9fNMeQBBbhxZxjyFmSTYtIqQeyqFw1bgIGcsZBH81WK7yE1U221l8gmj1Q==", "dependencies": { "@babel/runtime": "^7.16.7", "@polkadot/keyring": "^8.3.3", - "@polkadot/types-augment": "7.5.1", - "@polkadot/types-codec": "7.5.1", - "@polkadot/types-create": "7.5.1", + "@polkadot/types-augment": "7.6.1", + "@polkadot/types-codec": "7.6.1", + "@polkadot/types-create": "7.6.1", "@polkadot/util": "^8.3.3", "@polkadot/util-crypto": "^8.3.3", "rxjs": "^7.5.2" @@ -1189,13 +1221,13 @@ } }, "node_modules/@polkadot/types-augment": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-7.5.1.tgz", - "integrity": "sha512-YWXYfc0a2AOb2naG2uWAHkTuGvfPz8hrKv3UMTWUrCok/kVbUovqSXoBAORaX+tphpaKbEuBnBtBhk2cXP6KWA==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-7.6.1.tgz", + "integrity": "sha512-OLTVgMlSiZy37eXhUa6zYRHBUK7eJ2opovAKYpk+S8biA4nrq7LUXis2MnCP9C1TvsQozPlZ5q0M89WRVw96TA==", "dependencies": { "@babel/runtime": "^7.16.7", - "@polkadot/types": "7.5.1", - "@polkadot/types-codec": "7.5.1", + "@polkadot/types": "7.6.1", + "@polkadot/types-codec": "7.6.1", "@polkadot/util": "^8.3.3" }, "engines": { @@ -1203,9 +1235,9 @@ } }, "node_modules/@polkadot/types-codec": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-7.5.1.tgz", - "integrity": "sha512-+MClbgg0sbEIsPnqVf1wVzR5qPCE5Xb+QXkwawx86mIyxb4eptdBnU0CFgHVcrNnKx6EcaUZWQgz17UxtmTWaA==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-7.6.1.tgz", + "integrity": "sha512-Zm4oQJK4BeB3reElKCVfJm1tzVK2O+hfS9QlKJAHy+kYwPB20o0UYv1d0K1WOZedSmVIaoW/diOaxMePV1S55Q==", "dependencies": { "@babel/runtime": "^7.16.7", "@polkadot/util": "^8.3.3" @@ -1215,12 +1247,12 @@ } }, "node_modules/@polkadot/types-create": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-create/-/types-create-7.5.1.tgz", - "integrity": "sha512-OCsdDp4vd/6yNThTEmjbndHks4VHlfeuNwcQQN2NcM4Gs072LnuDTbRgFHAqvcSKB0SVOiWoy/UxkktLE+0w2Q==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-create/-/types-create-7.6.1.tgz", + "integrity": "sha512-vGUT5O3/bYpP/NOa/5TV8aCDoDE8DbeRSiykzQ8ceOrnmB4VrlJ+L4zklyiuRdAFXPYmi+7S9Dzr/IrNrf72wg==", "dependencies": { "@babel/runtime": "^7.16.7", - "@polkadot/types-codec": "7.5.1", + "@polkadot/types-codec": "7.6.1", "@polkadot/util": "^8.3.3" }, "engines": { @@ -1228,15 +1260,15 @@ } }, "node_modules/@polkadot/types-known": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-7.5.1.tgz", - "integrity": "sha512-mECocUHbvb/ly5KOu+nKfqXAEKzYxkflO4xQflaEpcCIxtqBmy8AXSvyD8Dl5LFrBwHqnRbtXaPETCOYn1LWPg==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-7.6.1.tgz", + "integrity": "sha512-qViRhHpnDNxS4lZhF7suUvevpvH3x9wEiAchQJg8jWHoS25EuLEV+jrqqZS+2kA01bdEDJYWMAowp68g1palCg==", "dependencies": { "@babel/runtime": "^7.16.7", "@polkadot/networks": "^8.3.3", - "@polkadot/types": "7.5.1", - "@polkadot/types-codec": "7.5.1", - "@polkadot/types-create": "7.5.1", + "@polkadot/types": "7.6.1", + "@polkadot/types-codec": "7.6.1", + "@polkadot/types-create": "7.6.1", "@polkadot/util": "^8.3.3" }, "engines": { @@ -1244,9 +1276,9 @@ } }, "node_modules/@polkadot/types-support": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-7.5.1.tgz", - "integrity": "sha512-6LrYMQVF6G9+r1mnYpSGX6irN0eG5OQQRb2YXX4wtYT3JIU+G9EK0NjLngSDf0KMMm80aD0hFKYF0DcuQSGk+A==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-7.6.1.tgz", + "integrity": "sha512-ssLpYW1bo535sQ2V0FqBag4egGZTObeP+dKlyEMP+MzF/xYLxf+jjJ0czyyjpyR0XR539KfSsdixa49wzgSnAg==", "dependencies": { "@babel/runtime": "^7.16.7", "@polkadot/util": "^8.3.3" @@ -1297,6 +1329,11 @@ "@polkadot/util": "8.3.3" } }, + "node_modules/@polkadot/util/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/@polkadot/wasm-crypto": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto/-/wasm-crypto-4.5.1.tgz", @@ -1571,14 +1608,14 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.1.tgz", - "integrity": "sha512-xN3CYqFlyE/qOcy978/L0xLR2HlcAGIyIK5sMOasxaaAPfQRj/MmMV6OC3I7NZO84oEUdWCOju34Z9W8E0pFDQ==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.2.tgz", + "integrity": "sha512-4W/9lLuE+v27O/oe7hXJKjNtBLnZE8tQAFpapdxwSVHqtmIoPB1gph3+ahNwVuNL37BX7YQHyGF9Xv6XCnIX2Q==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.10.1", - "@typescript-eslint/type-utils": "5.10.1", - "@typescript-eslint/utils": "5.10.1", + "@typescript-eslint/scope-manager": "5.10.2", + "@typescript-eslint/type-utils": "5.10.2", + "@typescript-eslint/utils": "5.10.2", "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", "ignore": "^5.1.8", @@ -1618,14 +1655,14 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.10.1.tgz", - "integrity": "sha512-GReo3tjNBwR5RnRO0K2wDIDN31cM3MmDtgyQ85oAxAmC5K3j/g85IjP+cDfcqDsDDBf1HNKQAD0WqOYL8jXqUA==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.10.2.tgz", + "integrity": "sha512-JaNYGkaQVhP6HNF+lkdOr2cAs2wdSZBoalE22uYWq8IEv/OVH0RksSGydk+sW8cLoSeYmC+OHvRyv2i4AQ7Czg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "5.10.1", - "@typescript-eslint/types": "5.10.1", - "@typescript-eslint/typescript-estree": "5.10.1", + "@typescript-eslint/scope-manager": "5.10.2", + "@typescript-eslint/types": "5.10.2", + "@typescript-eslint/typescript-estree": "5.10.2", "debug": "^4.3.2" }, "engines": { @@ -1645,13 +1682,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.10.1.tgz", - "integrity": "sha512-Lyvi559Gvpn94k7+ElXNMEnXu/iundV5uFmCUNnftbFrUbAJ1WBoaGgkbOBm07jVZa682oaBU37ao/NGGX4ZDg==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.10.2.tgz", + "integrity": "sha512-39Tm6f4RoZoVUWBYr3ekS75TYgpr5Y+X0xLZxXqcZNDWZdJdYbKd3q2IR4V9y5NxxiPu/jxJ8XP7EgHiEQtFnw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.10.1", - "@typescript-eslint/visitor-keys": "5.10.1" + "@typescript-eslint/types": "5.10.2", + "@typescript-eslint/visitor-keys": "5.10.2" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1662,12 +1699,12 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.10.1.tgz", - "integrity": "sha512-AfVJkV8uck/UIoDqhu+ptEdBoQATON9GXnhOpPLzkQRJcSChkvD//qsz9JVffl2goxX+ybs5klvacE9vmrQyCw==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.10.2.tgz", + "integrity": "sha512-uRKSvw/Ccs5FYEoXW04Z5VfzF2iiZcx8Fu7DGIB7RHozuP0VbKNzP1KfZkHBTM75pCpsWxIthEH1B33dmGBKHw==", "dev": true, "dependencies": { - "@typescript-eslint/utils": "5.10.1", + "@typescript-eslint/utils": "5.10.2", "debug": "^4.3.2", "tsutils": "^3.21.0" }, @@ -1688,9 +1725,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.10.1.tgz", - "integrity": "sha512-ZvxQ2QMy49bIIBpTqFiOenucqUyjTQ0WNLhBM6X1fh1NNlYAC6Kxsx8bRTY3jdYsYg44a0Z/uEgQkohbR0H87Q==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.10.2.tgz", + "integrity": "sha512-Qfp0qk/5j2Rz3p3/WhWgu4S1JtMcPgFLnmAKAW061uXxKSa7VWKZsDXVaMXh2N60CX9h6YLaBoy9PJAfCOjk3w==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1701,13 +1738,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.1.tgz", - "integrity": "sha512-PwIGnH7jIueXv4opcwEbVGDATjGPO1dx9RkUl5LlHDSe+FXxPwFL5W/qYd5/NHr7f6lo/vvTrAzd0KlQtRusJQ==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.2.tgz", + "integrity": "sha512-WHHw6a9vvZls6JkTgGljwCsMkv8wu8XU8WaYKeYhxhWXH/atZeiMW6uDFPLZOvzNOGmuSMvHtZKd6AuC8PrwKQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.10.1", - "@typescript-eslint/visitor-keys": "5.10.1", + "@typescript-eslint/types": "5.10.2", + "@typescript-eslint/visitor-keys": "5.10.2", "debug": "^4.3.2", "globby": "^11.0.4", "is-glob": "^4.0.3", @@ -1743,15 +1780,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.10.1.tgz", - "integrity": "sha512-RRmlITiUbLuTRtn/gcPRi4202niF+q7ylFLCKu4c+O/PcpRvZ/nAUwQ2G00bZgpWkhrNLNnvhZLbDn8Ml0qsQw==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.10.2.tgz", + "integrity": "sha512-vuJaBeig1NnBRkf7q9tgMLREiYD7zsMrsN1DA3wcoMDvr3BTFiIpKjGiYZoKPllfEwN7spUjv7ZqD+JhbVjEPg==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.10.1", - "@typescript-eslint/types": "5.10.1", - "@typescript-eslint/typescript-estree": "5.10.1", + "@typescript-eslint/scope-manager": "5.10.2", + "@typescript-eslint/types": "5.10.2", + "@typescript-eslint/typescript-estree": "5.10.2", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, @@ -1767,12 +1804,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.1.tgz", - "integrity": "sha512-NjQ0Xinhy9IL979tpoTRuLKxMc0zJC7QVSdeerXs2/QvOy2yRkzX5dRb10X5woNUdJgU8G3nYRDlI33sq1K4YQ==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.2.tgz", + "integrity": "sha512-zHIhYGGGrFJvvyfwHk5M08C5B5K4bewkm+rrvNTKk1/S15YHR+SA/QUF8ZWscXSfEaB8Nn2puZj+iHcoxVOD/Q==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.10.1", + "@typescript-eslint/types": "5.10.2", "eslint-visitor-keys": "^3.0.0" }, "engines": { @@ -1931,6 +1968,11 @@ "safer-buffer": "^2.1.0" } }, + "node_modules/asn1.js/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/assert": { "version": "2.0.0", "dev": true, @@ -2061,9 +2103,9 @@ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" }, "node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "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/body-parser": { "version": "1.19.1", @@ -2168,11 +2210,6 @@ "randombytes": "^2.0.1" } }, - "node_modules/browserify-rsa/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/browserify-sign": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", @@ -2189,11 +2226,6 @@ "safe-buffer": "^5.2.0" } }, - "node_modules/browserify-sign/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/browserslist": { "version": "4.19.1", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", @@ -2397,6 +2429,15 @@ "chai": ">= 2.1.2 < 5" } }, + "node_modules/chai-bn": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/chai-bn/-/chai-bn-0.3.1.tgz", + "integrity": "sha512-vuzEy0Cb+k8zqi2SHOmvZdRSbKcSOJfS1Nv8+6YDJIyCzfxkTCHLNRyjRIoRJ3WJtYb/c7OHjrvLoGeyO4A/gA==", + "peerDependencies": { + "bn.js": "^5.0.0", + "chai": "^4.0.0" + } + }, "node_modules/chalk": { "version": "4.1.2", "license": "MIT", @@ -2659,6 +2700,11 @@ "elliptic": "^6.5.3" } }, + "node_modules/create-ecdh/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/create-hash": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", @@ -2874,6 +2920,11 @@ "randombytes": "^2.0.0" } }, + "node_modules/diffie-hellman/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -2948,6 +2999,11 @@ "minimalistic-crypto-utils": "^1.0.1" } }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/emoji-regex": { "version": "8.0.0", "license": "MIT" @@ -3068,9 +3124,9 @@ } }, "node_modules/eslint": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.7.0.tgz", - "integrity": "sha512-ifHYzkBGrzS2iDU7KjhCAVMGCvF6M3Xfs8X8b37cgrUlDt6bWRTpRh6T/gtSXv1HJ/BUGgmjvNvOEGu85Iif7w==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.8.0.tgz", + "integrity": "sha512-H3KXAzQGBH1plhYS3okDix2ZthuYJlQQEGE5k0IKuEqUSiyu4AmxxlJ2MtTYeJ3xB4jDhcYCwGOg2TXYdnDXlQ==", "dev": true, "dependencies": { "@eslint/eslintrc": "^1.0.5", @@ -3311,6 +3367,11 @@ "xhr-request-promise": "^0.1.2" } }, + "node_modules/eth-lib/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/ethereum-bloom-filters": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.0.10.tgz", @@ -3364,11 +3425,6 @@ "@types/node": "*" } }, - "node_modules/ethereumjs-util/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/ethjs-unit": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", @@ -4821,6 +4877,11 @@ "miller-rabin": "bin/miller-rabin" } }, + "node_modules/miller-rabin/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/mime": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", @@ -5198,9 +5259,9 @@ "license": "MIT" }, "node_modules/nock": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/nock/-/nock-13.2.2.tgz", - "integrity": "sha512-PcBHuvl9i6zfaJ50A7LS55oU+nFLv8htXIhffJO+FxyfibdZ4jEvd9kTuvkrJireBFIGMZ+oUIRpMK5gU9h//g==", + "version": "13.2.3", + "resolved": "https://registry.npmjs.org/nock/-/nock-13.2.3.tgz", + "integrity": "sha512-91wGYjHrjSvrnSUwpiopbmowbIx5s+QSkqj801edTMtrFY4mAiZXP1mKlk5ZG2oZclB8/PcxJ9TJviG+akmrdw==", "dependencies": { "debug": "^4.1.0", "json-stringify-safe": "^5.0.1", @@ -5732,6 +5793,11 @@ "safe-buffer": "^5.1.2" } }, + "node_modules/public-encrypt/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/pump": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", @@ -6011,11 +6077,6 @@ "rlp": "bin/rlp" } }, - "node_modules/rlp/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/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -6287,6 +6348,11 @@ "source-map": "^0.6.0" } }, + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" + }, "node_modules/sshpk": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", @@ -7218,6 +7284,11 @@ "node": ">=8.0.0" } }, + "node_modules/web3-eth-accounts/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/web3-eth-accounts/node_modules/eth-lib": { "version": "0.2.8", "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", @@ -7285,6 +7356,11 @@ "node": ">=8.0.0" } }, + "node_modules/web3-eth-iban/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/web3-eth-personal": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/web3-eth-personal/-/web3-eth-personal-1.7.0.tgz", @@ -7393,6 +7469,11 @@ "node": ">=8.0.0" } }, + "node_modules/web3-utils/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -7701,6 +7782,15 @@ } }, "dependencies": { + "@ampproject/remapping": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.0.2.tgz", + "integrity": "sha512-sE8Gx+qSDMLoJvb3QarJJlDQK7SSY4rK3hxp4XsiANeFOmjU46ZI7Y9adAQRJrmbz8zbtZkp3mJTT+rGxtF0XA==", + "requires": { + "@jridgewell/trace-mapping": "^0.2.2", + "sourcemap-codec": "1.4.8" + } + }, "@babel/code-frame": { "version": "7.16.7", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", @@ -7715,25 +7805,25 @@ "integrity": "sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q==" }, "@babel/core": { - "version": "7.16.12", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.12.tgz", - "integrity": "sha512-dK5PtG1uiN2ikk++5OzSYsitZKny4wOCD0nrO4TqnW4BVBTQ2NGS3NgilvT/TEyxTST7LNyWV/T4tXDoD3fOgg==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.17.0.tgz", + "integrity": "sha512-x/5Ea+RO5MvF9ize5DeVICJoVrNv0Mi2RnIABrZEKYvPEpldXwauPkgvYA17cKa6WpU3LoYvYbuEMFtSNFsarA==", "requires": { + "@ampproject/remapping": "^2.0.0", "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.16.8", + "@babel/generator": "^7.17.0", "@babel/helper-compilation-targets": "^7.16.7", "@babel/helper-module-transforms": "^7.16.7", - "@babel/helpers": "^7.16.7", - "@babel/parser": "^7.16.12", + "@babel/helpers": "^7.17.0", + "@babel/parser": "^7.17.0", "@babel/template": "^7.16.7", - "@babel/traverse": "^7.16.10", - "@babel/types": "^7.16.8", + "@babel/traverse": "^7.17.0", + "@babel/types": "^7.17.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.1.2", - "semver": "^6.3.0", - "source-map": "^0.5.0" + "semver": "^6.3.0" }, "dependencies": { "json5": { @@ -7743,20 +7833,15 @@ "requires": { "minimist": "^1.2.5" } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" } } }, "@babel/generator": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.8.tgz", - "integrity": "sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.0.tgz", + "integrity": "sha512-I3Omiv6FGOC29dtlZhkfXO6pgkmukJSlT26QjVvS1DGZe/NzSVCPG41X0tS21oZkJYlovfj9qDWgKP+Cn4bXxw==", "requires": { - "@babel/types": "^7.16.8", + "@babel/types": "^7.17.0", "jsesc": "^2.5.1", "source-map": "^0.5.0" }, @@ -7863,13 +7948,13 @@ "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==" }, "@babel/helpers": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz", - "integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.17.0.tgz", + "integrity": "sha512-Xe/9NFxjPwELUvW2dsukcMZIp6XwPSbI4ojFBJuX5ramHuVE22SVcZIwqzdWo5uCgeTXW8qV97lMvSOjq+1+nQ==", "requires": { "@babel/template": "^7.16.7", - "@babel/traverse": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/traverse": "^7.17.0", + "@babel/types": "^7.17.0" } }, "@babel/highlight": { @@ -7934,9 +8019,9 @@ } }, "@babel/parser": { - "version": "7.16.12", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.12.tgz", - "integrity": "sha512-VfaV15po8RiZssrkPweyvbGVSe4x2y+aciFCgn0n0/SJMR22cwofRV1mtnJQYcSB1wUTaA/X1LnA3es66MCO5A==" + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.0.tgz", + "integrity": "sha512-VKXSCQx5D8S04ej+Dqsr1CzYvvWgf20jIw2D+YhQCrIlr2UZGaDds23Y0xg75/skOxpLCRpUZvk/1EAVkGoDOw==" }, "@babel/register": { "version": "7.16.9", @@ -7967,18 +8052,18 @@ } }, "@babel/traverse": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.10.tgz", - "integrity": "sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.0.tgz", + "integrity": "sha512-fpFIXvqD6kC7c7PUNnZ0Z8cQXlarCLtCUpt2S1Dx7PjoRtCFffvOkHHSom+m5HIxMZn5bIBVb71lhabcmjEsqg==", "requires": { "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.16.8", + "@babel/generator": "^7.17.0", "@babel/helper-environment-visitor": "^7.16.7", "@babel/helper-function-name": "^7.16.7", "@babel/helper-hoist-variables": "^7.16.7", "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.16.10", - "@babel/types": "^7.16.8", + "@babel/parser": "^7.17.0", + "@babel/types": "^7.17.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -7991,9 +8076,9 @@ } }, "@babel/types": { - "version": "7.16.8", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.8.tgz", - "integrity": "sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg==", + "version": "7.17.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", + "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", "requires": { "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" @@ -8123,6 +8208,13 @@ "@ethersproject/bytes": "^5.5.0", "@ethersproject/logger": "^5.5.0", "bn.js": "^4.11.9" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } } }, "@ethersproject/bytes": { @@ -8206,6 +8298,13 @@ "bn.js": "^4.11.9", "elliptic": "6.5.4", "hash.js": "1.1.7" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } } }, "@ethersproject/strings": { @@ -8259,6 +8358,20 @@ "version": "1.2.1", "dev": true }, + "@jridgewell/resolve-uri": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.4.tgz", + "integrity": "sha512-cz8HFjOFfUBtvN+NXYSFMHYRdxZMaEl0XypVrhzxBgadKIXhIkRd8aMeHhmF56Sl7SuS8OnUpQ73/k9LE4VnLg==" + }, + "@jridgewell/trace-mapping": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.2.5.tgz", + "integrity": "sha512-K+Eths78fXDFOvQ2hgJhCiI5s+g81r2yXmACBpbn+f2+Qt94PNoTgUcAXPT8DZkhXCsZRsHVWVtY5KIBMcpDqQ==", + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "sourcemap-codec": "1.4.8" + } + }, "@noble/hashes": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-0.5.7.tgz", @@ -8296,23 +8409,23 @@ } }, "@polkadot/api": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-7.5.1.tgz", - "integrity": "sha512-/3AI4Kbznt289+swtiFEYiX+XR9d+qzHhL8XxEzcqQudw2ElrfpLTAx3RzTUEEeEfwwPGmNVWPWaG4egUPsosQ==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-7.6.1.tgz", + "integrity": "sha512-0VvWn8TIKX3o922ZjomsJEkysica1ScnjNYBG3+801gWG3WbCI+IdzdqazTkIMZL8r8HipmA4cjfS3Tdk+R9eg==", "requires": { "@babel/runtime": "^7.16.7", - "@polkadot/api-augment": "7.5.1", - "@polkadot/api-base": "7.5.1", - "@polkadot/api-derive": "7.5.1", + "@polkadot/api-augment": "7.6.1", + "@polkadot/api-base": "7.6.1", + "@polkadot/api-derive": "7.6.1", "@polkadot/keyring": "^8.3.3", - "@polkadot/rpc-augment": "7.5.1", - "@polkadot/rpc-core": "7.5.1", - "@polkadot/rpc-provider": "7.5.1", - "@polkadot/types": "7.5.1", - "@polkadot/types-augment": "7.5.1", - "@polkadot/types-codec": "7.5.1", - "@polkadot/types-create": "7.5.1", - "@polkadot/types-known": "7.5.1", + "@polkadot/rpc-augment": "7.6.1", + "@polkadot/rpc-core": "7.6.1", + "@polkadot/rpc-provider": "7.6.1", + "@polkadot/types": "7.6.1", + "@polkadot/types-augment": "7.6.1", + "@polkadot/types-codec": "7.6.1", + "@polkadot/types-create": "7.6.1", + "@polkadot/types-known": "7.6.1", "@polkadot/util": "^8.3.3", "@polkadot/util-crypto": "^8.3.3", "eventemitter3": "^4.0.7", @@ -8320,43 +8433,43 @@ } }, "@polkadot/api-augment": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-augment/-/api-augment-7.5.1.tgz", - "integrity": "sha512-2sj+D8gvyo9ijqFFqJS5meaMVRllr5fWnE440nACsXIbcbHuXRWAF9tWdhESOIfue7hlFLo5plDdRfU7cSjIZQ==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-augment/-/api-augment-7.6.1.tgz", + "integrity": "sha512-elkAVDzkcW909phGQNOM2M2ksfnjNeY67EnwIB0xBdFlfM7mVPdxqnAWHrBwbIsD3TdWzxtrNzWzyi7hvILt+A==", "requires": { "@babel/runtime": "^7.16.7", - "@polkadot/api-base": "7.5.1", - "@polkadot/rpc-augment": "7.5.1", - "@polkadot/types": "7.5.1", - "@polkadot/types-augment": "7.5.1", - "@polkadot/types-codec": "7.5.1", + "@polkadot/api-base": "7.6.1", + "@polkadot/rpc-augment": "7.6.1", + "@polkadot/types": "7.6.1", + "@polkadot/types-augment": "7.6.1", + "@polkadot/types-codec": "7.6.1", "@polkadot/util": "^8.3.3" } }, "@polkadot/api-base": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-base/-/api-base-7.5.1.tgz", - "integrity": "sha512-vqMjmMOQuYLSwfTHTgmvPBtF6eAgrlyuBw0t0IiaTDfjP6xRRGMDIVb7lJCqvYL0VrHmTC7X5MVbJn1SNUut9w==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-base/-/api-base-7.6.1.tgz", + "integrity": "sha512-HbbbQSzTc5W0QtV/5JMOHbINlrHeZ5w5Cdo2jmIkSZT8w8MxhnupzdvkjIX9B9F4/dFa0RdaP/J1FnLNFlUU1w==", "requires": { "@babel/runtime": "^7.16.7", - "@polkadot/rpc-core": "7.5.1", - "@polkadot/types": "7.5.1", + "@polkadot/rpc-core": "7.6.1", + "@polkadot/types": "7.6.1", "@polkadot/util": "^8.3.3", "rxjs": "^7.5.2" } }, "@polkadot/api-derive": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-7.5.1.tgz", - "integrity": "sha512-O4x/DG+sSWgbXYGuYm4d3iYMTv5WTzoX5HX/xAIG+H+g7ob5RDdyLW9oQowrOX9ZOKt1cHPbHi0dLj+hDOD1CQ==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-7.6.1.tgz", + "integrity": "sha512-cRoc1LTTwvEH9QtHIp7vWYn34dczuqg4xQSbZn/IqEzvmcpU7wJC3gLfEOCrqTIFDofPVyBOd7Vv3gjuey/82g==", "requires": { "@babel/runtime": "^7.16.7", - "@polkadot/api": "7.5.1", - "@polkadot/api-augment": "7.5.1", - "@polkadot/api-base": "7.5.1", - "@polkadot/rpc-core": "7.5.1", - "@polkadot/types": "7.5.1", - "@polkadot/types-codec": "7.5.1", + "@polkadot/api": "7.6.1", + "@polkadot/api-augment": "7.6.1", + "@polkadot/api-base": "7.6.1", + "@polkadot/rpc-core": "7.6.1", + "@polkadot/types": "7.6.1", + "@polkadot/types-codec": "7.6.1", "@polkadot/util": "^8.3.3", "@polkadot/util-crypto": "^8.3.3", "rxjs": "^7.5.2" @@ -8382,46 +8495,46 @@ } }, "@polkadot/rpc-augment": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-augment/-/rpc-augment-7.5.1.tgz", - "integrity": "sha512-LPTDjtBZJe5KIOErOW+h2HY85G57WZVOiwm+SOgJ6J5g+BnUD0Rv+VH9pGC8dfoUsYBHSSvFELLnoTIZw6jltg==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-augment/-/rpc-augment-7.6.1.tgz", + "integrity": "sha512-lNeTS8Ma/0sAk3pvGxliQOkE016WZKXyS5uQWtcF2CRn2rn265Fb4I29n3KjTL8CRYtafvH6IRS0DSkKgbnL3w==", "requires": { "@babel/runtime": "^7.16.7", - "@polkadot/rpc-core": "7.5.1", - "@polkadot/types": "7.5.1", - "@polkadot/types-codec": "7.5.1", + "@polkadot/rpc-core": "7.6.1", + "@polkadot/types": "7.6.1", + "@polkadot/types-codec": "7.6.1", "@polkadot/util": "^8.3.3" } }, "@polkadot/rpc-core": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-7.5.1.tgz", - "integrity": "sha512-/UN7fQSqGnyjd5W0fFZ2RDBxAYoS8UreIea0eu+Zz4t6D2Fjp1syHNkw710wuv6ALhaRUjW6USO8XNSHDBIz+w==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-7.6.1.tgz", + "integrity": "sha512-xq/GzUeBu1GsP4ngEYQeDrVnsullDBy/22yUY/ahNjkgAjXeOndrBFis+4lBiiksVQMgYZEzaHv89E0aCOBvAA==", "requires": { "@babel/runtime": "^7.16.7", - "@polkadot/rpc-augment": "7.5.1", - "@polkadot/rpc-provider": "7.5.1", - "@polkadot/types": "7.5.1", + "@polkadot/rpc-augment": "7.6.1", + "@polkadot/rpc-provider": "7.6.1", + "@polkadot/types": "7.6.1", "@polkadot/util": "^8.3.3", "rxjs": "^7.5.2" } }, "@polkadot/rpc-provider": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-7.5.1.tgz", - "integrity": "sha512-6t5PyEDFBYJiK1/oegQkET4DnKdfk/mskELOVflDd4sLN+mXSAUW4DvS+KiVldHfUBtMQqX/w3p7x26xmWjmqQ==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-7.6.1.tgz", + "integrity": "sha512-jevBGp/n16ra+Y+JV8nnNRTtKPU1Oo3nBiyMhUla6crWLjMnLAYvcyteRq27aBmU3Olh4n/0xDVNCvTxfEghxQ==", "requires": { "@babel/runtime": "^7.16.7", "@polkadot/keyring": "^8.3.3", - "@polkadot/types": "7.5.1", - "@polkadot/types-support": "7.5.1", + "@polkadot/types": "7.6.1", + "@polkadot/types-support": "7.6.1", "@polkadot/util": "^8.3.3", "@polkadot/util-crypto": "^8.3.3", "@polkadot/x-fetch": "^8.3.3", "@polkadot/x-global": "^8.3.3", "@polkadot/x-ws": "^8.3.3", "eventemitter3": "^4.0.7", - "mock-socket": "^9.1.0", + "mock-socket": "^9.1.2", "nock": "^13.2.2" } }, @@ -8434,22 +8547,22 @@ } }, "@polkadot/typegen": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/typegen/-/typegen-7.5.1.tgz", - "integrity": "sha512-0ma//yfYBEcpYftoqS3Jbl3mVGA/zl3WRfnW3KK3cQ8J1xqKXusjeQ/9egyuWSP8qn34XHXQcvE6T+rfX+ki4A==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/typegen/-/typegen-7.6.1.tgz", + "integrity": "sha512-RCtpQWTmPMTHFbK5AXTy7Ncgx2aj4FhxnYFZxmpm2bZpXsf66mTKDu2vQiKN2vwPtjG8WnxuyB1fqnyGtebHPg==", "requires": { "@babel/core": "^7.16.12", "@babel/register": "^7.16.9", "@babel/runtime": "^7.16.7", - "@polkadot/api": "7.5.1", - "@polkadot/api-augment": "7.5.1", - "@polkadot/rpc-augment": "7.5.1", - "@polkadot/rpc-provider": "7.5.1", - "@polkadot/types": "7.5.1", - "@polkadot/types-augment": "7.5.1", - "@polkadot/types-codec": "7.5.1", - "@polkadot/types-create": "7.5.1", - "@polkadot/types-support": "7.5.1", + "@polkadot/api": "7.6.1", + "@polkadot/api-augment": "7.6.1", + "@polkadot/rpc-augment": "7.6.1", + "@polkadot/rpc-provider": "7.6.1", + "@polkadot/types": "7.6.1", + "@polkadot/types-augment": "7.6.1", + "@polkadot/types-codec": "7.6.1", + "@polkadot/types-create": "7.6.1", + "@polkadot/types-support": "7.6.1", "@polkadot/util": "^8.3.3", "@polkadot/x-ws": "^8.3.3", "handlebars": "^4.7.7", @@ -8479,67 +8592,67 @@ } }, "@polkadot/types": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-7.5.1.tgz", - "integrity": "sha512-71KY3Ia8AZywb0wWP0F588qFJbQMcgZqqP/dw6RP1A5ja2pR5SnqRP/zcaSena1cm9f24rAxgxiluOzzJxrfsA==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-7.6.1.tgz", + "integrity": "sha512-4GotmyT6h5n2qpgqPKqzVzgZKuPS9fNMeQBBbhxZxjyFmSTYtIqQeyqFw1bgIGcsZBH81WK7yE1U221l8gmj1Q==", "requires": { "@babel/runtime": "^7.16.7", "@polkadot/keyring": "^8.3.3", - "@polkadot/types-augment": "7.5.1", - "@polkadot/types-codec": "7.5.1", - "@polkadot/types-create": "7.5.1", + "@polkadot/types-augment": "7.6.1", + "@polkadot/types-codec": "7.6.1", + "@polkadot/types-create": "7.6.1", "@polkadot/util": "^8.3.3", "@polkadot/util-crypto": "^8.3.3", "rxjs": "^7.5.2" } }, "@polkadot/types-augment": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-7.5.1.tgz", - "integrity": "sha512-YWXYfc0a2AOb2naG2uWAHkTuGvfPz8hrKv3UMTWUrCok/kVbUovqSXoBAORaX+tphpaKbEuBnBtBhk2cXP6KWA==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-7.6.1.tgz", + "integrity": "sha512-OLTVgMlSiZy37eXhUa6zYRHBUK7eJ2opovAKYpk+S8biA4nrq7LUXis2MnCP9C1TvsQozPlZ5q0M89WRVw96TA==", "requires": { "@babel/runtime": "^7.16.7", - "@polkadot/types": "7.5.1", - "@polkadot/types-codec": "7.5.1", + "@polkadot/types": "7.6.1", + "@polkadot/types-codec": "7.6.1", "@polkadot/util": "^8.3.3" } }, "@polkadot/types-codec": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-7.5.1.tgz", - "integrity": "sha512-+MClbgg0sbEIsPnqVf1wVzR5qPCE5Xb+QXkwawx86mIyxb4eptdBnU0CFgHVcrNnKx6EcaUZWQgz17UxtmTWaA==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-7.6.1.tgz", + "integrity": "sha512-Zm4oQJK4BeB3reElKCVfJm1tzVK2O+hfS9QlKJAHy+kYwPB20o0UYv1d0K1WOZedSmVIaoW/diOaxMePV1S55Q==", "requires": { "@babel/runtime": "^7.16.7", "@polkadot/util": "^8.3.3" } }, "@polkadot/types-create": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-create/-/types-create-7.5.1.tgz", - "integrity": "sha512-OCsdDp4vd/6yNThTEmjbndHks4VHlfeuNwcQQN2NcM4Gs072LnuDTbRgFHAqvcSKB0SVOiWoy/UxkktLE+0w2Q==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-create/-/types-create-7.6.1.tgz", + "integrity": "sha512-vGUT5O3/bYpP/NOa/5TV8aCDoDE8DbeRSiykzQ8ceOrnmB4VrlJ+L4zklyiuRdAFXPYmi+7S9Dzr/IrNrf72wg==", "requires": { "@babel/runtime": "^7.16.7", - "@polkadot/types-codec": "7.5.1", + "@polkadot/types-codec": "7.6.1", "@polkadot/util": "^8.3.3" } }, "@polkadot/types-known": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-7.5.1.tgz", - "integrity": "sha512-mECocUHbvb/ly5KOu+nKfqXAEKzYxkflO4xQflaEpcCIxtqBmy8AXSvyD8Dl5LFrBwHqnRbtXaPETCOYn1LWPg==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-7.6.1.tgz", + "integrity": "sha512-qViRhHpnDNxS4lZhF7suUvevpvH3x9wEiAchQJg8jWHoS25EuLEV+jrqqZS+2kA01bdEDJYWMAowp68g1palCg==", "requires": { "@babel/runtime": "^7.16.7", "@polkadot/networks": "^8.3.3", - "@polkadot/types": "7.5.1", - "@polkadot/types-codec": "7.5.1", - "@polkadot/types-create": "7.5.1", + "@polkadot/types": "7.6.1", + "@polkadot/types-codec": "7.6.1", + "@polkadot/types-create": "7.6.1", "@polkadot/util": "^8.3.3" } }, "@polkadot/types-support": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-7.5.1.tgz", - "integrity": "sha512-6LrYMQVF6G9+r1mnYpSGX6irN0eG5OQQRb2YXX4wtYT3JIU+G9EK0NjLngSDf0KMMm80aD0hFKYF0DcuQSGk+A==", + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-7.6.1.tgz", + "integrity": "sha512-ssLpYW1bo535sQ2V0FqBag4egGZTObeP+dKlyEMP+MzF/xYLxf+jjJ0czyyjpyR0XR539KfSsdixa49wzgSnAg==", "requires": { "@babel/runtime": "^7.16.7", "@polkadot/util": "^8.3.3" @@ -8558,6 +8671,13 @@ "@types/bn.js": "^4.11.6", "bn.js": "^4.12.0", "ip-regex": "^4.3.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } } }, "@polkadot/util-crypto": { @@ -8807,14 +8927,14 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.1.tgz", - "integrity": "sha512-xN3CYqFlyE/qOcy978/L0xLR2HlcAGIyIK5sMOasxaaAPfQRj/MmMV6OC3I7NZO84oEUdWCOju34Z9W8E0pFDQ==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.10.2.tgz", + "integrity": "sha512-4W/9lLuE+v27O/oe7hXJKjNtBLnZE8tQAFpapdxwSVHqtmIoPB1gph3+ahNwVuNL37BX7YQHyGF9Xv6XCnIX2Q==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.10.1", - "@typescript-eslint/type-utils": "5.10.1", - "@typescript-eslint/utils": "5.10.1", + "@typescript-eslint/scope-manager": "5.10.2", + "@typescript-eslint/type-utils": "5.10.2", + "@typescript-eslint/utils": "5.10.2", "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", "ignore": "^5.1.8", @@ -8833,52 +8953,52 @@ } }, "@typescript-eslint/parser": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.10.1.tgz", - "integrity": "sha512-GReo3tjNBwR5RnRO0K2wDIDN31cM3MmDtgyQ85oAxAmC5K3j/g85IjP+cDfcqDsDDBf1HNKQAD0WqOYL8jXqUA==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.10.2.tgz", + "integrity": "sha512-JaNYGkaQVhP6HNF+lkdOr2cAs2wdSZBoalE22uYWq8IEv/OVH0RksSGydk+sW8cLoSeYmC+OHvRyv2i4AQ7Czg==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.10.1", - "@typescript-eslint/types": "5.10.1", - "@typescript-eslint/typescript-estree": "5.10.1", + "@typescript-eslint/scope-manager": "5.10.2", + "@typescript-eslint/types": "5.10.2", + "@typescript-eslint/typescript-estree": "5.10.2", "debug": "^4.3.2" } }, "@typescript-eslint/scope-manager": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.10.1.tgz", - "integrity": "sha512-Lyvi559Gvpn94k7+ElXNMEnXu/iundV5uFmCUNnftbFrUbAJ1WBoaGgkbOBm07jVZa682oaBU37ao/NGGX4ZDg==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.10.2.tgz", + "integrity": "sha512-39Tm6f4RoZoVUWBYr3ekS75TYgpr5Y+X0xLZxXqcZNDWZdJdYbKd3q2IR4V9y5NxxiPu/jxJ8XP7EgHiEQtFnw==", "dev": true, "requires": { - "@typescript-eslint/types": "5.10.1", - "@typescript-eslint/visitor-keys": "5.10.1" + "@typescript-eslint/types": "5.10.2", + "@typescript-eslint/visitor-keys": "5.10.2" } }, "@typescript-eslint/type-utils": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.10.1.tgz", - "integrity": "sha512-AfVJkV8uck/UIoDqhu+ptEdBoQATON9GXnhOpPLzkQRJcSChkvD//qsz9JVffl2goxX+ybs5klvacE9vmrQyCw==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.10.2.tgz", + "integrity": "sha512-uRKSvw/Ccs5FYEoXW04Z5VfzF2iiZcx8Fu7DGIB7RHozuP0VbKNzP1KfZkHBTM75pCpsWxIthEH1B33dmGBKHw==", "dev": true, "requires": { - "@typescript-eslint/utils": "5.10.1", + "@typescript-eslint/utils": "5.10.2", "debug": "^4.3.2", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.10.1.tgz", - "integrity": "sha512-ZvxQ2QMy49bIIBpTqFiOenucqUyjTQ0WNLhBM6X1fh1NNlYAC6Kxsx8bRTY3jdYsYg44a0Z/uEgQkohbR0H87Q==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.10.2.tgz", + "integrity": "sha512-Qfp0qk/5j2Rz3p3/WhWgu4S1JtMcPgFLnmAKAW061uXxKSa7VWKZsDXVaMXh2N60CX9h6YLaBoy9PJAfCOjk3w==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.1.tgz", - "integrity": "sha512-PwIGnH7jIueXv4opcwEbVGDATjGPO1dx9RkUl5LlHDSe+FXxPwFL5W/qYd5/NHr7f6lo/vvTrAzd0KlQtRusJQ==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.10.2.tgz", + "integrity": "sha512-WHHw6a9vvZls6JkTgGljwCsMkv8wu8XU8WaYKeYhxhWXH/atZeiMW6uDFPLZOvzNOGmuSMvHtZKd6AuC8PrwKQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.10.1", - "@typescript-eslint/visitor-keys": "5.10.1", + "@typescript-eslint/types": "5.10.2", + "@typescript-eslint/visitor-keys": "5.10.2", "debug": "^4.3.2", "globby": "^11.0.4", "is-glob": "^4.0.3", @@ -8898,26 +9018,26 @@ } }, "@typescript-eslint/utils": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.10.1.tgz", - "integrity": "sha512-RRmlITiUbLuTRtn/gcPRi4202niF+q7ylFLCKu4c+O/PcpRvZ/nAUwQ2G00bZgpWkhrNLNnvhZLbDn8Ml0qsQw==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.10.2.tgz", + "integrity": "sha512-vuJaBeig1NnBRkf7q9tgMLREiYD7zsMrsN1DA3wcoMDvr3BTFiIpKjGiYZoKPllfEwN7spUjv7ZqD+JhbVjEPg==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.10.1", - "@typescript-eslint/types": "5.10.1", - "@typescript-eslint/typescript-estree": "5.10.1", + "@typescript-eslint/scope-manager": "5.10.2", + "@typescript-eslint/types": "5.10.2", + "@typescript-eslint/typescript-estree": "5.10.2", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" } }, "@typescript-eslint/visitor-keys": { - "version": "5.10.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.1.tgz", - "integrity": "sha512-NjQ0Xinhy9IL979tpoTRuLKxMc0zJC7QVSdeerXs2/QvOy2yRkzX5dRb10X5woNUdJgU8G3nYRDlI33sq1K4YQ==", + "version": "5.10.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.10.2.tgz", + "integrity": "sha512-zHIhYGGGrFJvvyfwHk5M08C5B5K4bewkm+rrvNTKk1/S15YHR+SA/QUF8ZWscXSfEaB8Nn2puZj+iHcoxVOD/Q==", "dev": true, "requires": { - "@typescript-eslint/types": "5.10.1", + "@typescript-eslint/types": "5.10.2", "eslint-visitor-keys": "^3.0.0" } }, @@ -9019,6 +9139,13 @@ "inherits": "^2.0.1", "minimalistic-assert": "^1.0.0", "safer-buffer": "^2.1.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } } }, "assert": { @@ -9114,9 +9241,9 @@ "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" }, "bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" }, "body-parser": { "version": "1.19.1", @@ -9212,13 +9339,6 @@ "requires": { "bn.js": "^5.0.0", "randombytes": "^2.0.1" - }, - "dependencies": { - "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==" - } } }, "browserify-sign": { @@ -9235,13 +9355,6 @@ "parse-asn1": "^5.1.5", "readable-stream": "^3.6.0", "safe-buffer": "^5.2.0" - }, - "dependencies": { - "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==" - } } }, "browserslist": { @@ -9377,6 +9490,12 @@ "check-error": "^1.0.2" } }, + "chai-bn": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/chai-bn/-/chai-bn-0.3.1.tgz", + "integrity": "sha512-vuzEy0Cb+k8zqi2SHOmvZdRSbKcSOJfS1Nv8+6YDJIyCzfxkTCHLNRyjRIoRJ3WJtYb/c7OHjrvLoGeyO4A/gA==", + "requires": {} + }, "chalk": { "version": "4.1.2", "requires": { @@ -9586,6 +9705,13 @@ "requires": { "bn.js": "^4.1.0", "elliptic": "^6.5.3" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } } }, "create-hash": { @@ -9745,6 +9871,13 @@ "bn.js": "^4.1.0", "miller-rabin": "^4.0.0", "randombytes": "^2.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } } }, "dir-glob": { @@ -9812,6 +9945,13 @@ "inherits": "^2.0.4", "minimalistic-assert": "^1.0.1", "minimalistic-crypto-utils": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } } }, "emoji-regex": { @@ -9900,9 +10040,9 @@ "version": "4.0.0" }, "eslint": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.7.0.tgz", - "integrity": "sha512-ifHYzkBGrzS2iDU7KjhCAVMGCvF6M3Xfs8X8b37cgrUlDt6bWRTpRh6T/gtSXv1HJ/BUGgmjvNvOEGu85Iif7w==", + "version": "8.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.8.0.tgz", + "integrity": "sha512-H3KXAzQGBH1plhYS3okDix2ZthuYJlQQEGE5k0IKuEqUSiyu4AmxxlJ2MtTYeJ3xB4jDhcYCwGOg2TXYdnDXlQ==", "dev": true, "requires": { "@eslint/eslintrc": "^1.0.5", @@ -10074,6 +10214,13 @@ "servify": "^0.1.12", "ws": "^3.0.0", "xhr-request-promise": "^0.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } } }, "ethereum-bloom-filters": { @@ -10125,11 +10272,6 @@ "requires": { "@types/node": "*" } - }, - "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==" } } }, @@ -11122,6 +11264,13 @@ "requires": { "bn.js": "^4.0.0", "brorand": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } } }, "mime": { @@ -11421,9 +11570,9 @@ "version": "1.0.0" }, "nock": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/nock/-/nock-13.2.2.tgz", - "integrity": "sha512-PcBHuvl9i6zfaJ50A7LS55oU+nFLv8htXIhffJO+FxyfibdZ4jEvd9kTuvkrJireBFIGMZ+oUIRpMK5gU9h//g==", + "version": "13.2.3", + "resolved": "https://registry.npmjs.org/nock/-/nock-13.2.3.tgz", + "integrity": "sha512-91wGYjHrjSvrnSUwpiopbmowbIx5s+QSkqj801edTMtrFY4mAiZXP1mKlk5ZG2oZclB8/PcxJ9TJviG+akmrdw==", "requires": { "debug": "^4.1.0", "json-stringify-safe": "^5.0.1", @@ -11774,6 +11923,13 @@ "parse-asn1": "^5.0.0", "randombytes": "^2.0.1", "safe-buffer": "^5.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } } }, "pump": { @@ -11967,13 +12123,6 @@ "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", "requires": { "bn.js": "^5.2.0" - }, - "dependencies": { - "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==" - } } }, "run-parallel": { @@ -12166,6 +12315,11 @@ "source-map": "^0.6.0" } }, + "sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==" + }, "sshpk": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", @@ -12852,6 +13006,11 @@ "web3-utils": "1.7.0" }, "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + }, "eth-lib": { "version": "0.2.8", "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.8.tgz", @@ -12906,6 +13065,13 @@ "requires": { "bn.js": "^4.11.9", "web3-utils": "1.7.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } } }, "web3-eth-personal": { @@ -12996,6 +13162,13 @@ "number-to-bn": "1.7.0", "randombytes": "^2.1.0", "utf8": "3.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" + } } }, "webidl-conversions": { diff --git a/integration-tests/runtime-tests/package.json b/integration-tests/runtime-tests/package.json index a8928b60715..115f86de665 100644 --- a/integration-tests/runtime-tests/package.json +++ b/integration-tests/runtime-tests/package.json @@ -53,6 +53,7 @@ "@types/ramda": "^0.27.64", "chai": "^4.3.4", "chai-as-promised": "^7.1.1", + "chai-bn": "^0.3.1", "minimist": "^1.2.5", "mocha": "^8.4.0", "mochawesome": "^7.0.1", diff --git a/integration-tests/runtime-tests/src/test.ts b/integration-tests/runtime-tests/src/test.ts index 7d752b82529..3426b0d80d1 100644 --- a/integration-tests/runtime-tests/src/test.ts +++ b/integration-tests/runtime-tests/src/test.ts @@ -3,11 +3,13 @@ * All tests can be found in the ./tests/ folder. **/ -import { QueryCrowdloanRewardsTests } from './tests/query/crowdloanRewards/queryCrowdloanRewardsTests'; -import { TxCrowdloanRewardsTests } from './tests/tx/crowdloanRewards/txCrowdloanRewardsTests'; +import { QueryCrowdloanRewardsTests } from '@composable/tests/query/crowdloanRewards/queryCrowdloanRewardsTests'; +import { TxCrowdloanRewardsTests } from '@composable/tests/tx/crowdloanRewards/txCrowdloanRewardsTests'; import { TxBondedFinanceTests } from "@composable/tests/tx/bondedFinance/txBondedFinanceTests"; import { runBefore, runAfter } from "@composable/utils/testSetup"; import { TxOracleTests } from "@composable/tests/tx/oracle/txOracleTests"; +import { RpcAssetsTests } from './tests/rpc/assets/rpcAssetsTests'; +import { RpcCrowdloanRewardsTests } from './tests/rpc/crowdloanRewards/rpcCrowdloanRewardsTests'; describe('Picasso Runtime Tests', function() { @@ -43,10 +45,8 @@ describe('Picasso Runtime Tests', function() { // RPC Tests describe('RPC Tests', function () { + RpcAssetsTests.runRpcAssetsTests() + RpcCrowdloanRewardsTests.runRpcCrowdloanRewardsTests() // No RPC tests implemented yet! }); }); - - - - diff --git a/integration-tests/runtime-tests/src/tests/rpc/assets/rpcAssetsTests.ts b/integration-tests/runtime-tests/src/tests/rpc/assets/rpcAssetsTests.ts new file mode 100644 index 00000000000..2754d404536 --- /dev/null +++ b/integration-tests/runtime-tests/src/tests/rpc/assets/rpcAssetsTests.ts @@ -0,0 +1,32 @@ +/* eslint-disable no-trailing-spaces */ +import { CurrencyId } from '@composable/types/interfaces'; +import { ApiPromise } from '@polkadot/api'; +import { AnyNumber } from '@polkadot/types-codec/types'; +import { expect } from 'chai'; + + +export class RpcAssetsTests { + /** + * + */ + public static runRpcAssetsTests() { + describe('rpc.assets.balanceOf Tests', function () { + it('STUB', async () => { + const asset_id = api.createType('CurrencyId', '123456789123456789'); + const publicKey = walletAlice.address; + const result = await RpcAssetsTests.rpcAssetsTest(asset_id, publicKey); + expect(result).to.be.a["bignumber"].that.equals('0'); + }); + }); + } + + /** + * + */ + private static async rpcAssetsTest(asset_id: CurrencyId | AnyNumber, publicKey: string | Uint8Array) { + return await api.rpc.assets.balanceOf(asset_id, publicKey); + } +} + +// Uncomment to debug +// RpcAssetsTests.runRpcAssetsTests(); diff --git a/integration-tests/runtime-tests/src/tests/rpc/crowdloanRewards/rpcCrowdloanRewardsTests.ts b/integration-tests/runtime-tests/src/tests/rpc/crowdloanRewards/rpcCrowdloanRewardsTests.ts index 22f8579deeb..30898d76101 100644 --- a/integration-tests/runtime-tests/src/tests/rpc/crowdloanRewards/rpcCrowdloanRewardsTests.ts +++ b/integration-tests/runtime-tests/src/tests/rpc/crowdloanRewards/rpcCrowdloanRewardsTests.ts @@ -8,9 +8,11 @@ export class RpcCrowdloanRewardsTests { * */ public static runRpcCrowdloanRewardsTests() { - describe('query.crowdloanRewards.account Tests', function () { + describe('rpc.crowdloanRewards.account Tests', function () { it('STUB', async () => { - RpcCrowdloanRewardsTests.rpcCrowdloanRewardsTest(); + const accountId = walletAlice.derive('/contributor-1/reward').publicKey; + const result = await RpcCrowdloanRewardsTests.rpcCrowdloanRewardsTest(accountId); + expect(result).to.be.a["bignumber"].that.equals('0'); }); }); } @@ -18,11 +20,12 @@ export class RpcCrowdloanRewardsTests { /** * */ - private static async rpcCrowdloanRewardsTest() { - // ToDo (D. Roth): STUB - expect(true).to.equal(true); + private static async rpcCrowdloanRewardsTest(accountId: string | Uint8Array) { + return await api.rpc.crowdloanRewards.amountAvailableToClaimFor( + accountId, + ); } } // Uncomment to debug -// RpcCrowdloanRewardsTests.runRpcCrowdloanRewardsTests(); \ No newline at end of file +// RpcCrowdloanRewardsTests.runRpcCrowdloanRewardsTests(); diff --git a/integration-tests/runtime-tests/src/tests/tx/bondedFinance/txBondedFinanceTests.ts b/integration-tests/runtime-tests/src/tests/tx/bondedFinance/txBondedFinanceTests.ts index cf1b79bbc07..ed275d77ce7 100644 --- a/integration-tests/runtime-tests/src/tests/tx/bondedFinance/txBondedFinanceTests.ts +++ b/integration-tests/runtime-tests/src/tests/tx/bondedFinance/txBondedFinanceTests.ts @@ -1,5 +1,5 @@ /* eslint-disable no-trailing-spaces */ -import {expect} from "chai"; +import { expect } from "chai"; import { txBondedFinanceCancelSudoSuccessTest, txBondedFinanceCancelFailureTest, @@ -9,7 +9,7 @@ import { txBondedFinanceOfferFailureTest, txBondedFinanceOfferSuccessTest } from "@composable/tests/tx/bondedFinance/testHandlers/offerTests"; -import {txBondedFinanceBondSuccessTest} from "@composable/tests/tx/bondedFinance/testHandlers/bondTests"; +import { txBondedFinanceBondSuccessTest } from "@composable/tests/tx/bondedFinance/testHandlers/bondTests"; /** * Contains all TX tests for the pallet: @@ -22,13 +22,13 @@ export class TxBondedFinanceTests { * ToDo (D. Roth): The tests assume you're running them on a fresh chain. Instead of assuming, use the test returns. */ public static runTxBondedFinanceTests() { - describe('tx.bondedFinance Tests', function() { + describe('tx.bondedFinance Tests', function () { /** * bondedFinance.offer(...) Success Tests */ describe('tx.bondedFinance.offer & .bond Success Tests', function () { // Timeout set to 2 minutes - this.timeout(2*60*1000); + this.timeout(2 * 60 * 1000); // #1 Create offer using Alice's wallet. it('Can create a new offer', async function () { const requestParameters = { @@ -81,22 +81,22 @@ export class TxBondedFinanceTests { */ describe('tx.bondedFinance.offer Failure Tests', function () { // Timeout set to 2 minutes - this.timeout(2*60*1000); + this.timeout(2 * 60 * 1000); // #4 Alice can't create am offer with the bond price too low. it('Should not be able to create offer (bondPrice < MIN_VESTED_TRANSFER)', async function () { const requestParameters = { beneficiary: walletAlice.publicKey, asset: api.createType('u128', 1), - bondPrice: api.createType('u128', api.consts.bondedFinance.stake.toNumber()-1), + bondPrice: api.createType('u128', api.consts.bondedFinance.stake.toNumber() - 1), nbOfBonds: api.createType('u128', 10), - maturity: {Finite: {returnIn: api.createType('u32', 16)}}, + maturity: { Finite: { returnIn: api.createType('u32', 16) } }, reward: { asset: api.createType('u128', 1), amount: api.consts.bondedFinance.minReward, maturity: api.createType('u32', 1) } }; - const {data: [result],} = await txBondedFinanceOfferFailureTest(walletAlice, requestParameters); + const { data: [result], } = await txBondedFinanceOfferFailureTest(walletAlice, requestParameters); expect(result.toNumber()).to.be.a('number'); }); @@ -107,14 +107,14 @@ export class TxBondedFinanceTests { asset: api.createType('u128', 1), bondPrice: api.consts.bondedFinance.stake, nbOfBonds: api.createType('u128', 10), - maturity: {Finite: {returnIn: api.createType('u32', 16)}}, + maturity: { Finite: { returnIn: api.createType('u32', 16) } }, reward: { asset: api.createType('u128', 1), - amount: api.createType('u128', api.consts.bondedFinance.minReward.toNumber()-1), + amount: api.createType('u128', api.consts.bondedFinance.minReward.toNumber() - 1), maturity: api.createType('u32', 1) } }; - const {data: [result],} = await txBondedFinanceOfferFailureTest(walletAlice, requestParameters); + const { data: [result], } = await txBondedFinanceOfferFailureTest(walletAlice, requestParameters); expect(result.toNumber()).to.be.a('number'); }); @@ -125,14 +125,14 @@ export class TxBondedFinanceTests { asset: api.createType('u128', 1), bondPrice: api.consts.bondedFinance.stake, nbOfBonds: api.createType('u128', 10), - maturity: {Finite: {returnIn: api.createType('u32', 16)}}, + maturity: { Finite: { returnIn: api.createType('u32', 16) } }, reward: { asset: api.createType('u128', 1337), amount: api.consts.bondedFinance.minReward, maturity: api.createType('u32', 1) } }; - const {data: [result],} = await txBondedFinanceOfferFailureTest(walletAlice, requestParameters); + const { data: [result], } = await txBondedFinanceOfferFailureTest(walletAlice, requestParameters); expect(result.toNumber()).to.be.a('number'); }); }); @@ -142,7 +142,7 @@ export class TxBondedFinanceTests { */ describe('tx.bondedFinance.cancel Failure Tests', function () { // Timeout set to 2 minutes - this.timeout(2*60*1000); + this.timeout(2 * 60 * 1000); it('Should not be able to cancel offer that doesn\'t exist', async function () { const offerId = 1337; const { data: [result], } = await txBondedFinanceCancelFailureTest(walletAlice, offerId); @@ -155,7 +155,7 @@ export class TxBondedFinanceTests { */ describe('tx.bondedFinance.cancel Success Tests', function () { // Timeout set to 2 minutes - this.timeout(2*60*1000); + this.timeout(2 * 60 * 1000); // #6 Alice should be able to cancel her offer. it('Can cancel offer created in first bondedFinance.offer test by creator', async function () { const offerId = 1; diff --git a/integration-tests/runtime-tests/src/types/interfaces/assets/definitions.ts b/integration-tests/runtime-tests/src/types/interfaces/assets/definitions.ts new file mode 100644 index 00000000000..9760fca4255 --- /dev/null +++ b/integration-tests/runtime-tests/src/types/interfaces/assets/definitions.ts @@ -0,0 +1,28 @@ +export default { + rpc: { + balanceOf: { + description: "Balance available for the specified account for the specified asset.", + params: [ + { + name: "asset", + type: "CurrencyId" + }, + { + name: "account", + type: "AccountId32" + }, + { + name: "at", + type: "Hash", + isOptional: true, + }, + ], + type: "AssetsBalance" + }, + }, + types: { + CurrencyId: "u128", + AssetsBalance: "u128", + // Balance: "u128", + }, +}; diff --git a/integration-tests/runtime-tests/src/types/interfaces/default/index.ts b/integration-tests/runtime-tests/src/types/interfaces/assets/index.ts similarity index 100% rename from integration-tests/runtime-tests/src/types/interfaces/default/index.ts rename to integration-tests/runtime-tests/src/types/interfaces/assets/index.ts diff --git a/integration-tests/runtime-tests/src/types/interfaces/assets/types.ts b/integration-tests/runtime-tests/src/types/interfaces/assets/types.ts new file mode 100644 index 00000000000..7766ed204ea --- /dev/null +++ b/integration-tests/runtime-tests/src/types/interfaces/assets/types.ts @@ -0,0 +1,12 @@ +// Auto-generated via `yarn polkadot-types-from-defs`, do not edit +/* eslint-disable */ + +import type { u128 } from '@polkadot/types-codec'; + +/** @name AssetsBalance */ +export interface AssetsBalance extends u128 {} + +/** @name CurrencyId */ +export interface CurrencyId extends u128 {} + +export type PHANTOM_ASSETS = 'assets'; diff --git a/integration-tests/runtime-tests/src/types/interfaces/augment-api-errors.ts b/integration-tests/runtime-tests/src/types/interfaces/augment-api-errors.ts index da915f5d6ef..9622549d087 100644 --- a/integration-tests/runtime-tests/src/types/interfaces/augment-api-errors.ts +++ b/integration-tests/runtime-tests/src/types/interfaces/augment-api-errors.ts @@ -16,6 +16,7 @@ declare module '@polkadot/api-base/types/errors' { assetsRegistry: { ForeignAssetIdAlreadyUsed: AugmentedError; LocalAssetIdAlreadyUsed: AugmentedError; + LocalAssetIdNotFound: AugmentedError; OnlyAllowedForAdmins: AugmentedError; /** * Generic error @@ -385,6 +386,7 @@ declare module '@polkadot/api-base/types/errors' { [key: string]: AugmentedError; }; dutchAuction: { + NotEnoughNativeCurrentyToPayForAuction: AugmentedError; OrderNotFound: AugmentedError; OrderParametersIsInvalid: AugmentedError; RequestedOrderDoesNotExists: AugmentedError; diff --git a/integration-tests/runtime-tests/src/types/interfaces/augment-api-events.ts b/integration-tests/runtime-tests/src/types/interfaces/augment-api-events.ts index 1ca01b2168b..17d0665fe87 100644 --- a/integration-tests/runtime-tests/src/types/interfaces/augment-api-events.ts +++ b/integration-tests/runtime-tests/src/types/interfaces/augment-api-events.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import type { ComposableTraitsAssetsXcmAssetLocation, ComposableTraitsCallFilterCallFilterEntry, ComposableTraitsVestingVestingSchedule, PalletCrowdloanRewardsModelsRemoteAccount, PalletDemocracyVoteThreshold, PalletDutchAuctionSellOrder } from '@composable/types/interfaces/default'; +import type { ComposableTraitsAssetsXcmAssetLocation, ComposableTraitsCallFilterCallFilterEntry, ComposableTraitsVestingVestingSchedule, PalletCrowdloanRewardsModelsRemoteAccount, PalletDemocracyVoteThreshold, PalletDutchAuctionSellOrder } from '@composable/types/interfaces/crowdloanRewards'; import type { ApiTypes } from '@polkadot/api-base/types'; import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u32, u64, u8 } from '@polkadot/types-codec'; import type { ITuple } from '@polkadot/types-codec/types'; @@ -11,6 +11,7 @@ import type { FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchIn declare module '@polkadot/api-base/types/events' { export interface AugmentedEvents { assetsRegistry: { + AssetMetadataUpdated: AugmentedEvent; AssetsMappingCandidateUpdated: AugmentedEvent; ForeignAdminUpdated: AugmentedEvent; LocalAdminUpdated: AugmentedEvent; diff --git a/integration-tests/runtime-tests/src/types/interfaces/augment-api-query.ts b/integration-tests/runtime-tests/src/types/interfaces/augment-api-query.ts index c68045b75dc..452bbcf1518 100644 --- a/integration-tests/runtime-tests/src/types/interfaces/augment-api-query.ts +++ b/integration-tests/runtime-tests/src/types/interfaces/augment-api-query.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import type { ComposableTraitsAssetsXcmAssetLocation, ComposableTraitsBondedFinanceBondOffer, ComposableTraitsCallFilterCallFilterEntry, ComposableTraitsGovernanceSignedRawOrigin, ComposableTraitsVestingVestingSchedule, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundStatus, CumulusPalletXcmpQueueOutboundStatus, CumulusPalletXcmpQueueQueueConfigData, DaliRuntimeOpaqueSessionKeys, OrmlTokensAccountData, OrmlTokensBalanceLock, PalletAssetsRegistryCandidateStatus, PalletCollatorSelectionCandidateInfo, PalletCrowdloanRewardsModelsRemoteAccount, PalletCrowdloanRewardsReward, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletDutchAuctionSellOrder, PalletDutchAuctionTakeOrder, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletOracleAssetInfo, PalletOraclePrePrice, PalletOraclePrice, PalletOracleWithdraw, PalletSchedulerReleases, PalletSchedulerScheduledV2, PalletTreasuryProposal, PalletVaultModelsStrategyOverview, PalletVaultModelsVaultInfo, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV1AbridgedHostConfiguration, PolkadotPrimitivesV1PersistedValidationData, SpConsensusAuraSr25519AppSr25519Public } from '@composable/types/interfaces/default'; +import type { ComposableTraitsAssetsXcmAssetLocation, ComposableTraitsBondedFinanceBondOffer, ComposableTraitsCallFilterCallFilterEntry, ComposableTraitsGovernanceSignedRawOrigin, ComposableTraitsVestingVestingSchedule, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundStatus, CumulusPalletXcmpQueueOutboundStatus, CumulusPalletXcmpQueueQueueConfigData, DaliRuntimeOpaqueSessionKeys, OrmlTokensAccountData, OrmlTokensBalanceLock, PalletAssetsRegistryCandidateStatus, PalletAssetsRegistryForeignMetadata, PalletCollatorSelectionCandidateInfo, PalletCrowdloanRewardsModelsRemoteAccount, PalletCrowdloanRewardsReward, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletDutchAuctionSellOrder, PalletDutchAuctionTakeOrder, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletOracleAssetInfo, PalletOraclePrePrice, PalletOraclePrice, PalletOracleWithdraw, PalletSchedulerReleases, PalletSchedulerScheduledV2, PalletTreasuryProposal, PalletVaultModelsStrategyOverview, PalletVaultModelsVaultInfo, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV1AbridgedHostConfiguration, PolkadotPrimitivesV1PersistedValidationData, SpConsensusAuraSr25519AppSr25519Public } from '@composable/types/interfaces/crowdloanRewards'; import type { ApiTypes } from '@polkadot/api-base/types'; import type { Data } from '@polkadot/types'; import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64 } from '@polkadot/types-codec'; @@ -27,6 +27,10 @@ declare module '@polkadot/api-base/types/storage' { * Foreign admin account **/ foreignAdmin: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Mapping local asset to foreign asset metadata. + **/ + foreignAssetMetadata: AugmentedQuery Observable>, [u128]> & QueryableStorageEntry; /** * Mapping foreign asset to local asset. **/ diff --git a/integration-tests/runtime-tests/src/types/interfaces/augment-api-rpc.ts b/integration-tests/runtime-tests/src/types/interfaces/augment-api-rpc.ts index 0c7a5cc5d17..88a3ded8680 100644 --- a/integration-tests/runtime-tests/src/types/interfaces/augment-api-rpc.ts +++ b/integration-tests/runtime-tests/src/types/interfaces/augment-api-rpc.ts @@ -1,6 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ +import type { AssetsBalance, CurrencyId } from '@composable/types/interfaces/assets'; import type { AugmentedRpc } from '@polkadot/rpc-core/types'; import type { Metadata, StorageKey } from '@polkadot/types'; import type { Bytes, HashMap, Json, Null, Option, Text, U256, U64, Vec, bool, u32, u64 } from '@polkadot/types-codec'; @@ -11,7 +12,7 @@ import type { BeefySignedCommitment } from '@polkadot/types/interfaces/beefy'; import type { BlockHash } from '@polkadot/types/interfaces/chain'; import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; import type { AuthorityId } from '@polkadot/types/interfaces/consensus'; -import type { ContractCallRequest, ContractExecResult, ContractInstantiateResult, InstantiateRequest } from '@polkadot/types/interfaces/contracts'; +import type { CodeUploadRequest, CodeUploadResult, ContractCallRequest, ContractExecResult, ContractInstantiateResult, InstantiateRequest } from '@polkadot/types/interfaces/contracts'; import type { CreatedBlock } from '@polkadot/types/interfaces/engine'; import type { EthAccount, EthCallRequest, EthFilter, EthFilterChanges, EthLog, EthReceipt, EthRichBlock, EthSubKind, EthSubParams, EthSyncStatus, EthTransaction, EthTransactionRequest, EthWork } from '@polkadot/types/interfaces/eth'; import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics'; @@ -20,13 +21,19 @@ import type { MmrLeafProof } from '@polkadot/types/interfaces/mmr'; import type { StorageKind } from '@polkadot/types/interfaces/offchain'; import type { FeeDetails, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; import type { RpcMethods } from '@polkadot/types/interfaces/rpc'; -import type { AccountId, BlockNumber, H160, H256, H64, Hash, Header, Index, Justification, KeyValue, SignedBlock, StorageData } from '@polkadot/types/interfaces/runtime'; +import type { AccountId, AccountId32, Balance, BlockNumber, H160, H256, H64, Hash, Header, Index, Justification, KeyValue, SignedBlock, StorageData } from '@polkadot/types/interfaces/runtime'; import type { ReadProof, RuntimeVersion, TraceBlockResponse } from '@polkadot/types/interfaces/state'; import type { ApplyExtrinsicResult, ChainProperties, ChainType, Health, NetworkState, NodeRole, PeerInfo, SyncState } from '@polkadot/types/interfaces/system'; import type { IExtrinsic, Observable } from '@polkadot/types/types'; declare module '@polkadot/rpc-core/types/jsonrpc' { export interface RpcInterface { + assets: { + /** + * Balance available for the specified account for the specified asset. + **/ + balanceOf: AugmentedRpc<(asset: CurrencyId | AnyNumber | Uint8Array, account: AccountId32 | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; + }; author: { /** * Returns true if the keystore has private keys for the given public key and key type. @@ -146,6 +153,16 @@ declare module '@polkadot/rpc-core/types/jsonrpc' { * Returns the projected time a given contract will be able to sustain paying its rent **/ rentProjection: AugmentedRpc<(address: AccountId | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable>>; + /** + * Upload new code without instantiating a contract from it + **/ + uploadCode: AugmentedRpc<(uploadRequest: CodeUploadRequest | { origin?: any; code?: any; storageDepositLimit?: any } | string | Uint8Array, at?: BlockHash | string | Uint8Array) => Observable>; + }; + crowdloanRewards: { + /** + * The unclaimed amount + **/ + amountAvailableToClaimFor: AugmentedRpc<(accountId: AccountId | string | Uint8Array, at?: Hash | string | Uint8Array) => Observable>; }; engine: { /** diff --git a/integration-tests/runtime-tests/src/types/interfaces/augment-api-tx.ts b/integration-tests/runtime-tests/src/types/interfaces/augment-api-tx.ts index 061463026f4..fb25e1b6d58 100644 --- a/integration-tests/runtime-tests/src/types/interfaces/augment-api-tx.ts +++ b/integration-tests/runtime-tests/src/types/interfaces/augment-api-tx.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import type { ComposableTraitsAssetsXcmAssetLocation, ComposableTraitsBondedFinanceBondOffer, ComposableTraitsCallFilterCallFilterEntry, ComposableTraitsDefiSell, ComposableTraitsDefiTake, ComposableTraitsTimeTimeReleaseFunction, ComposableTraitsVaultVaultConfig, ComposableTraitsVestingVestingSchedule, CumulusPrimitivesParachainInherentParachainInherentData, DaliRuntimeOpaqueSessionKeys, DaliRuntimeOriginCaller, PalletCrowdloanRewardsModelsProof, PalletCrowdloanRewardsModelsRemoteAccount, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, XcmVersionedMultiAsset } from '@composable/types/interfaces/default'; +import type { ComposableTraitsAssetsXcmAssetLocation, ComposableTraitsBondedFinanceBondOffer, ComposableTraitsCallFilterCallFilterEntry, ComposableTraitsDefiSell, ComposableTraitsDefiTake, ComposableTraitsTimeTimeReleaseFunction, ComposableTraitsVaultVaultConfig, ComposableTraitsVestingVestingSchedule, CumulusPrimitivesParachainInherentParachainInherentData, DaliRuntimeOpaqueSessionKeys, DaliRuntimeOriginCaller, PalletAssetsRegistryForeignMetadata, PalletCrowdloanRewardsModelsProof, PalletCrowdloanRewardsModelsRemoteAccount, PalletDemocracyConviction, PalletDemocracyVoteAccountVote, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, XcmVersionedMultiAsset } from '@composable/types/interfaces/crowdloanRewards'; import type { ApiTypes } from '@polkadot/api-base/types'; import type { Data } from '@polkadot/types'; import type { Bytes, Compact, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; @@ -98,6 +98,7 @@ declare module '@polkadot/api-base/types/submittable' { approveAssetsMappingCandidate: AugmentedSubmittable<(localAssetId: u128 | AnyNumber | Uint8Array, foreignAssetId: ComposableTraitsAssetsXcmAssetLocation | { parents?: any; interior?: any } | string | Uint8Array) => SubmittableExtrinsic, [u128, ComposableTraitsAssetsXcmAssetLocation]>; setForeignAdmin: AugmentedSubmittable<(foreignAdmin: AccountId32 | string | Uint8Array) => SubmittableExtrinsic, [AccountId32]>; setLocalAdmin: AugmentedSubmittable<(localAdmin: AccountId32 | string | Uint8Array) => SubmittableExtrinsic, [AccountId32]>; + setMetadata: AugmentedSubmittable<(localAssetId: u128 | AnyNumber | Uint8Array, metadata: PalletAssetsRegistryForeignMetadata | { decimals?: any } | string | Uint8Array) => SubmittableExtrinsic, [u128, PalletAssetsRegistryForeignMetadata]>; /** * Generic tx **/ @@ -206,6 +207,9 @@ declare module '@polkadot/api-base/types/submittable' { bondedFinance: { /** * Bond to an offer. + * And user should provide the number of contracts she is willing to buy. + * On offer completion (a.k.a. no more contract on the offer), the `stake` put by the + * creator is refunded. * * The dispatch origin for this call must be _Signed_ and the sender must have the * appropriate funds. @@ -215,15 +219,15 @@ declare module '@polkadot/api-base/types/submittable' { **/ bond: AugmentedSubmittable<(offerId: u64 | AnyNumber | Uint8Array, nbOfBonds: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u64, u128]>; /** - * Cancel an offer. - * + * Cancel a running offer. Blocking further bond but not cancelling the + * currently vested rewards. The `stake` put by the creator is refunded. * The dispatch origin for this call must be _Signed_ and the sender must be `AdminOrigin` * * Emits a `OfferCancelled`. **/ cancel: AugmentedSubmittable<(offerId: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u64]>; /** - * Create a new offer. + * Create a new offer. So later can `bond` it. * * The dispatch origin for this call must be _Signed_ and the sender must have the * appropriate funds. diff --git a/integration-tests/runtime-tests/src/types/interfaces/augment-types.ts b/integration-tests/runtime-tests/src/types/interfaces/augment-types.ts index 857a1703901..fe148e2f8fe 100644 --- a/integration-tests/runtime-tests/src/types/interfaces/augment-types.ts +++ b/integration-tests/runtime-tests/src/types/interfaces/augment-types.ts @@ -1,10 +1,10 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { ComposableTraitsAssetsXcmAssetLocation, ComposableTraitsAuctionAuctionStepFunction, ComposableTraitsBondedFinanceBondOffer, ComposableTraitsCallFilterCallFilterEntry, ComposableTraitsDefiSell, ComposableTraitsDefiTake, ComposableTraitsGovernanceSignedRawOrigin, ComposableTraitsTimeTimeReleaseFunction, ComposableTraitsVaultVaultConfig, ComposableTraitsVestingVestingSchedule, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundStatus, CumulusPalletXcmpQueueOutboundStatus, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, DaliRuntimeOpaqueSessionKeys, DaliRuntimeOriginCaller, OrmlTokensAccountData, OrmlTokensBalanceLock, PalletAssetsRegistryCandidateStatus, PalletCollatorSelectionCandidateInfo, PalletCrowdloanRewardsModelsProof, PalletCrowdloanRewardsModelsRemoteAccount, PalletCrowdloanRewardsReward, PalletDemocracyConviction, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletDutchAuctionSellOrder, PalletDutchAuctionTakeOrder, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletOracleAssetInfo, PalletOraclePrePrice, PalletOraclePrice, PalletOracleWithdraw, PalletSchedulerReleases, PalletSchedulerScheduledV2, PalletTreasuryProposal, PalletVaultModelsStrategyOverview, PalletVaultModelsVaultInfo, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV1AbridgedHostConfiguration, PolkadotPrimitivesV1PersistedValidationData, SpConsensusAuraSr25519AppSr25519Public, XcmVersionedMultiAsset } from '@composable/types/interfaces/default'; +import type { AssetsBalance, CurrencyId } from '@composable/types/interfaces/assets'; +import type { ComposableTraitsAssetsXcmAssetLocation, ComposableTraitsAuctionAuctionStepFunction, ComposableTraitsBondedFinanceBondOffer, ComposableTraitsCallFilterCallFilterEntry, ComposableTraitsDefiSell, ComposableTraitsDefiTake, ComposableTraitsGovernanceSignedRawOrigin, ComposableTraitsTimeTimeReleaseFunction, ComposableTraitsVaultVaultConfig, ComposableTraitsVestingVestingSchedule, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundStatus, CumulusPalletXcmpQueueOutboundStatus, CumulusPalletXcmpQueueQueueConfigData, CumulusPrimitivesParachainInherentParachainInherentData, DaliRuntimeOpaqueSessionKeys, DaliRuntimeOriginCaller, OrmlTokensAccountData, OrmlTokensBalanceLock, PalletAssetsRegistryCandidateStatus, PalletAssetsRegistryForeignMetadata, PalletCollatorSelectionCandidateInfo, PalletCrowdloanRewardsModelsProof, PalletCrowdloanRewardsModelsRemoteAccount, PalletCrowdloanRewardsReward, PalletDemocracyConviction, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletDutchAuctionSellOrder, PalletDutchAuctionTakeOrder, PalletIdentityBitFlags, PalletIdentityIdentityInfo, PalletIdentityJudgement, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletOracleAssetInfo, PalletOraclePrePrice, PalletOraclePrice, PalletOracleWithdraw, PalletSchedulerReleases, PalletSchedulerScheduledV2, PalletTreasuryProposal, PalletVaultModelsStrategyOverview, PalletVaultModelsVaultInfo, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV1AbridgedHostConfiguration, PolkadotPrimitivesV1PersistedValidationData, SpConsensusAuraSr25519AppSr25519Public, XcmVersionedMultiAsset } from '@composable/types/interfaces/crowdloanRewards'; import type { Data, StorageKey } from '@polkadot/types'; import type { BitVec, Bool, Bytes, I128, I16, I256, I32, I64, I8, Json, Null, Raw, Text, Type, U128, U16, U256, U32, U64, U8, USize, bool, i128, i16, i256, i32, i64, i8, u128, u16, u256, u32, u64, u8, usize } from '@polkadot/types-codec'; -import type { AssetApproval, AssetApprovalKey, AssetBalance, AssetDestroyWitness, AssetDetails, AssetMetadata, TAssetBalance, TAssetDepositBalance } from '@polkadot/types/interfaces/assets'; import type { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations'; import type { RawAuraPreDigest } from '@polkadot/types/interfaces/aura'; import type { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; @@ -18,7 +18,7 @@ import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; import type { StatementKind } from '@polkadot/types/interfaces/claims'; import type { CollectiveOrigin, MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective'; import type { AuthorityId, RawVRFOutput } from '@polkadot/types/interfaces/consensus'; -import type { AliveContractInfo, CodeHash, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateReturnValue, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts'; +import type { AliveContractInfo, CodeHash, CodeUploadRequest, CodeUploadResult, CodeUploadResultValue, ContractCallFlags, ContractCallRequest, ContractExecResult, ContractExecResultErr, ContractExecResultErrModule, ContractExecResultOk, ContractExecResultResult, ContractExecResultSuccessTo255, ContractExecResultSuccessTo260, ContractExecResultTo255, ContractExecResultTo260, ContractExecResultTo267, ContractInfo, ContractInstantiateResult, ContractInstantiateResultTo267, ContractReturnFlags, ContractStorageKey, DeletedContract, ExecReturnValue, Gas, HostFnWeights, HostFnWeightsTo264, InstantiateRequest, InstantiateReturnValue, InstantiateReturnValueTo267, InstructionWeights, Limits, LimitsTo264, PrefabWasmModule, RentProjection, Schedule, ScheduleTo212, ScheduleTo258, ScheduleTo264, SeedOf, StorageDeposit, TombstoneContractInfo, TrieId } from '@polkadot/types/interfaces/contracts'; import type { ContractConstructorSpecLatest, ContractConstructorSpecV0, ContractConstructorSpecV1, ContractConstructorSpecV2, ContractConstructorSpecV3, ContractContractSpecV0, ContractContractSpecV1, ContractContractSpecV2, ContractContractSpecV3, ContractCryptoHasher, ContractDiscriminant, ContractDisplayName, ContractEventParamSpecLatest, ContractEventParamSpecV0, ContractEventParamSpecV2, ContractEventSpecLatest, ContractEventSpecV0, ContractEventSpecV1, ContractEventSpecV2, ContractLayoutArray, ContractLayoutCell, ContractLayoutEnum, ContractLayoutHash, ContractLayoutHashingStrategy, ContractLayoutKey, ContractLayoutStruct, ContractLayoutStructField, ContractMessageParamSpecLatest, ContractMessageParamSpecV0, ContractMessageParamSpecV2, ContractMessageSpecLatest, ContractMessageSpecV0, ContractMessageSpecV1, ContractMessageSpecV2, ContractMetadata, ContractMetadataLatest, ContractMetadataV0, ContractMetadataV1, ContractMetadataV2, ContractMetadataV3, ContractProject, ContractProjectContract, ContractProjectInfo, ContractProjectSource, ContractProjectV0, ContractSelector, ContractStorageLayout, ContractTypeSpec } from '@polkadot/types/interfaces/contractsAbi'; import type { FundIndex, FundInfo, LastContribution, TrieIndex } from '@polkadot/types/interfaces/crowdloan'; import type { ConfigData, MessageId, OverweightIndex, PageCounter, PageIndexData } from '@polkadot/types/interfaces/cumulus'; @@ -38,7 +38,7 @@ import type { ErrorMetadataLatest, ErrorMetadataV10, ErrorMetadataV11, ErrorMeta import type { MmrLeafProof } from '@polkadot/types/interfaces/mmr'; import type { StorageKind } from '@polkadot/types/interfaces/offchain'; import type { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences'; -import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, Scheduling, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersDataTuple, WinningData, WinningDataEntry } from '@polkadot/types/interfaces/parachains'; +import type { AbridgedCandidateReceipt, AbridgedHostConfiguration, AbridgedHrmpChannel, AssignmentId, AssignmentKind, AttestedCandidate, AuctionIndex, AuthorityDiscoveryId, AvailabilityBitfield, AvailabilityBitfieldRecord, BackedCandidate, Bidder, BufferedSessionChange, CandidateCommitments, CandidateDescriptor, CandidateHash, CandidateInfo, CandidatePendingAvailability, CandidateReceipt, CollatorId, CollatorSignature, CommittedCandidateReceipt, CoreAssignment, CoreIndex, CoreOccupied, DisputeLocation, DisputeResult, DisputeState, DisputeStatement, DisputeStatementSet, DoubleVoteReport, DownwardMessage, ExplicitDisputeStatement, GlobalValidationData, GlobalValidationSchedule, GroupIndex, HeadData, HostConfiguration, HrmpChannel, HrmpChannelId, HrmpOpenChannelRequest, InboundDownwardMessage, InboundHrmpMessage, InboundHrmpMessages, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, InvalidDisputeStatementKind, LeasePeriod, LeasePeriodOf, LocalValidationData, MessageIngestionType, MessageQueueChain, MessagingStateSnapshot, MessagingStateSnapshotEgressEntry, MultiDisputeStatementSet, NewBidder, OutboundHrmpMessage, ParaGenesisArgs, ParaId, ParaInfo, ParaLifecycle, ParaPastCodeMeta, ParaScheduling, ParaValidatorIndex, ParachainDispatchOrigin, ParachainInherentData, ParachainProposal, ParachainsInherentData, ParathreadClaim, ParathreadClaimQueue, ParathreadEntry, PersistedValidationData, QueuedParathread, RegisteredParachainInfo, RelayBlockNumber, RelayChainBlockNumber, RelayChainHash, RelayHash, Remark, ReplacementTimes, Retriable, Scheduling, ServiceQuality, SessionInfo, SessionInfoValidatorGroup, SignedAvailabilityBitfield, SignedAvailabilityBitfields, SigningContext, SlotRange, SlotRange10, Statement, SubId, SystemInherentData, TransientValidationData, UpgradeGoAhead, UpgradeRestriction, UpwardMessage, ValidDisputeStatementKind, ValidationCode, ValidationCodeHash, ValidationData, ValidationDataType, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, VecInboundHrmpMessage, WinnersData, WinnersData10, WinnersDataTuple, WinnersDataTuple10, WinningData, WinningData10, WinningDataEntry } from '@polkadot/types/interfaces/parachains'; import type { FeeDetails, InclusionFee, RuntimeDispatchInfo } from '@polkadot/types/interfaces/payment'; import type { Approvals } from '@polkadot/types/interfaces/poll'; import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/types/interfaces/proxy'; @@ -97,18 +97,13 @@ declare module '@polkadot/types/types/registry' { ApprovalFlag: ApprovalFlag; Approvals: Approvals; ArithmeticError: ArithmeticError; - AssetApproval: AssetApproval; - AssetApprovalKey: AssetApprovalKey; - AssetBalance: AssetBalance; - AssetDestroyWitness: AssetDestroyWitness; - AssetDetails: AssetDetails; AssetId: AssetId; AssetInstance: AssetInstance; AssetInstanceV0: AssetInstanceV0; AssetInstanceV1: AssetInstanceV1; AssetInstanceV2: AssetInstanceV2; - AssetMetadata: AssetMetadata; AssetOptions: AssetOptions; + AssetsBalance: AssetsBalance; AssignmentId: AssignmentId; AssignmentKind: AssignmentKind; AttestedCandidate: AttestedCandidate; @@ -198,6 +193,9 @@ declare module '@polkadot/types/types/registry' { ClassMetadata: ClassMetadata; CodecHash: CodecHash; CodeHash: CodeHash; + CodeUploadRequest: CodeUploadRequest; + CodeUploadResult: CodeUploadResult; + CodeUploadResultValue: CodeUploadResultValue; CollatorId: CollatorId; CollatorSignature: CollatorSignature; CollectiveOrigin: CollectiveOrigin; @@ -301,6 +299,7 @@ declare module '@polkadot/types/types/registry' { CumulusPalletXcmpQueueOutboundStatus: CumulusPalletXcmpQueueOutboundStatus; CumulusPalletXcmpQueueQueueConfigData: CumulusPalletXcmpQueueQueueConfigData; CumulusPrimitivesParachainInherentParachainInherentData: CumulusPrimitivesParachainInherentParachainInherentData; + CurrencyId: CurrencyId; DaliRuntimeOpaqueSessionKeys: DaliRuntimeOpaqueSessionKeys; DaliRuntimeOriginCaller: DaliRuntimeOriginCaller; Data: Data; @@ -686,6 +685,7 @@ declare module '@polkadot/types/types/registry' { PageCounter: PageCounter; PageIndexData: PageIndexData; PalletAssetsRegistryCandidateStatus: PalletAssetsRegistryCandidateStatus; + PalletAssetsRegistryForeignMetadata: PalletAssetsRegistryForeignMetadata; PalletCallMetadataLatest: PalletCallMetadataLatest; PalletCallMetadataV14: PalletCallMetadataV14; PalletCollatorSelectionCandidateInfo: PalletCollatorSelectionCandidateInfo; @@ -960,6 +960,7 @@ declare module '@polkadot/types/types/registry' { Slot: Slot; SlotNumber: SlotNumber; SlotRange: SlotRange; + SlotRange10: SlotRange10; SocietyJudgement: SocietyJudgement; SocietyVote: SocietyVote; SolutionOrSnapshotSize: SolutionOrSnapshotSize; @@ -1025,8 +1026,6 @@ declare module '@polkadot/types/types/registry' { SystemOrigin: SystemOrigin; Tally: Tally; TaskAddress: TaskAddress; - TAssetBalance: TAssetBalance; - TAssetDepositBalance: TAssetDepositBalance; Text: Text; Timepoint: Timepoint; TokenError: TokenError; @@ -1127,8 +1126,11 @@ declare module '@polkadot/types/types/registry' { WildMultiAssetV1: WildMultiAssetV1; WildMultiAssetV2: WildMultiAssetV2; WinnersData: WinnersData; + WinnersData10: WinnersData10; WinnersDataTuple: WinnersDataTuple; + WinnersDataTuple10: WinnersDataTuple10; WinningData: WinningData; + WinningData10: WinningData10; WinningDataEntry: WinningDataEntry; WithdrawReasons: WithdrawReasons; Xcm: Xcm; diff --git a/integration-tests/runtime-tests/src/types/interfaces/crowdloanRewards/definitions.ts b/integration-tests/runtime-tests/src/types/interfaces/crowdloanRewards/definitions.ts new file mode 100644 index 00000000000..03ca8c3b374 --- /dev/null +++ b/integration-tests/runtime-tests/src/types/interfaces/crowdloanRewards/definitions.ts @@ -0,0 +1,95 @@ +import { DefinitionRpc } from "@polkadot/types/types"; + +export default { + rpc: { + amountAvailableToClaimFor: { + description: "The unclaimed amount", + params: [ + { + name: "accountId", + type: "AccountId" + }, + { + name: "at", + type: "Hash", + isOptional: true, + } + ], + type: "Balance" + }, + }, + types: { + PalletCrowdloanRewardsModelsRemoteAccount: { + _enum: { + RelayChain: 'AccountId32', + Ethereum: 'EthereumAccountId' + } + }, + PalletCrowdloanRewardsModelsProof: { + _enum: { + RelayChain: '(AccountId32, MultiSignature)', + Ethereum: 'EcdsaSignature' + } + }, + PalletCrowdloanRewardsReward: "Null", + PalletAssetsRegistryCandidateStatus: "Null", + SpConsensusAuraSr25519AppSr25519Public: "Null", + PalletCollatorSelectionCandidateInfo: "Null", + PalletDemocracyVoteThreshold: "Null", + PalletDemocracyPreimageStatus: "Null", + PalletDemocracyReferendumInfo: "Null", + PalletDemocracyReleases: "Null", + PalletDemocracyVoteVoting: "Null", + CumulusPalletDmpQueueConfigData: "Null", + CumulusPalletDmpQueuePageIndexData: "Null", + PalletAssetsRegistryForeignMetadata: { + decimals: 'u32' + }, + PalletIdentityRegistration: "Null", + PalletIdentityRegistrarInfo: "Null", + PalletOracleAssetInfo: "Null", + PalletOracleWithdraw: { + stake: 'u128', + unlockBlock: 'u32' + }, + PalletOraclePrePrice: "Null", + PalletOraclePrice: "Null", + PolkadotPrimitivesV1AbridgedHostConfiguration: "Null", + CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: "Null", + PolkadotPrimitivesV1PersistedValidationData: "PersistedValidationData", + PalletSchedulerScheduledV2: "Null", + PalletSchedulerReleases: "Null", + DaliRuntimeOpaqueSessionKeys: "Null", + OrmlTokensAccountData: "Null", + OrmlTokensBalanceLock: "Null", + PalletTreasuryProposal: "Null", + PalletVaultModelsStrategyOverview: "Null", + PalletVaultModelsVaultInfo: "Null", + CumulusPalletXcmpQueueInboundStatus: "Null", + PolkadotParachainPrimitivesXcmpMessageFormat: "Null", + CumulusPalletXcmpQueueOutboundStatus: "Null", + CumulusPalletXcmpQueueQueueConfigData: "Null", + PalletDemocracyConviction: "Null", + PalletDemocracyVoteAccountVote: "Null", + PalletIdentityJudgement: "Null", + PalletIdentityBitFlags: "Null", + PalletIdentityIdentityInfo: "Null", + CumulusPrimitivesParachainInherentParachainInherentData: 'ParachainInherentData', + DaliRuntimeOriginCaller: "Null", + XcmVersionedMultiAsset: "Null", + + ComposableTraitsAssetsXcmAssetLocation: "Null", + ComposableTraitsCallFilterCallFilterEntry: "Null", + ComposableTraitsBondedFinanceBondOffer: "Null", + ComposableTraitsVestingVestingSchedule: "Null", + ComposableTraitsGovernanceSignedRawOrigin: "Null", + ComposableTraitsVaultVaultConfig: "Null", + ComposableTraitsDefiSell: "Null", + ComposableTraitsAuctionAuctionStepFunction: "Null", + ComposableTraitsDefiTake: "Null", + ComposableTraitsTimeTimeReleaseFunction: "Null", + + PalletDutchAuctionSellOrder: "Null", + PalletDutchAuctionTakeOrder: "Null", + }, +}; diff --git a/integration-tests/runtime-tests/src/types/interfaces/crowdloanRewards/index.ts b/integration-tests/runtime-tests/src/types/interfaces/crowdloanRewards/index.ts new file mode 100644 index 00000000000..2d307291c39 --- /dev/null +++ b/integration-tests/runtime-tests/src/types/interfaces/crowdloanRewards/index.ts @@ -0,0 +1,4 @@ +// Auto-generated via `yarn polkadot-types-from-defs`, do not edit +/* eslint-disable */ + +export * from './types'; diff --git a/integration-tests/runtime-tests/src/types/interfaces/default/types.ts b/integration-tests/runtime-tests/src/types/interfaces/crowdloanRewards/types.ts similarity index 97% rename from integration-tests/runtime-tests/src/types/interfaces/default/types.ts rename to integration-tests/runtime-tests/src/types/interfaces/crowdloanRewards/types.ts index 78dcce5616a..6e688e3afd3 100644 --- a/integration-tests/runtime-tests/src/types/interfaces/default/types.ts +++ b/integration-tests/runtime-tests/src/types/interfaces/crowdloanRewards/types.ts @@ -74,6 +74,11 @@ export interface OrmlTokensBalanceLock extends Null {} /** @name PalletAssetsRegistryCandidateStatus */ export interface PalletAssetsRegistryCandidateStatus extends Null {} +/** @name PalletAssetsRegistryForeignMetadata */ +export interface PalletAssetsRegistryForeignMetadata extends Struct { + readonly decimals: u32; +} + /** @name PalletCollatorSelectionCandidateInfo */ export interface PalletCollatorSelectionCandidateInfo extends Null {} @@ -185,4 +190,4 @@ export interface SpConsensusAuraSr25519AppSr25519Public extends Null {} /** @name XcmVersionedMultiAsset */ export interface XcmVersionedMultiAsset extends Null {} -export type PHANTOM_DEFAULT = 'default'; +export type PHANTOM_CROWDLOANREWARDS = 'crowdloanRewards'; diff --git a/integration-tests/runtime-tests/src/types/interfaces/definitions.ts b/integration-tests/runtime-tests/src/types/interfaces/definitions.ts index e33ff1a2fad..d445fd1fb37 100644 --- a/integration-tests/runtime-tests/src/types/interfaces/definitions.ts +++ b/integration-tests/runtime-tests/src/types/interfaces/definitions.ts @@ -1,71 +1,4 @@ -export default { - types: { - ComposableTraitsAssetsXcmAssetLocation: "Null", - PalletCrowdloanRewardsModelsRemoteAccount: { - _enum: { - RelayChain: 'AccountId32', - Ethereum: 'EthereumAccountId' - } - }, - ComposableTraitsCallFilterCallFilterEntry: "Null", - PalletAssetsRegistryCandidateStatus: "Null", - SpConsensusAuraSr25519AppSr25519Public: "Null", - ComposableTraitsBondedFinanceBondOffer: "Null", - PalletCollatorSelectionCandidateInfo: "Null", - PalletCrowdloanRewardsReward: "Null", - PalletDemocracyVoteThreshold: "Null", - PalletDemocracyPreimageStatus: "Null", - PalletDemocracyReferendumInfo: "Null", - PalletDemocracyReleases: "Null", - PalletDemocracyVoteVoting: "Null", - CumulusPalletDmpQueueConfigData: "Null", - PalletDutchAuctionSellOrder: "Null", - ComposableTraitsVestingVestingSchedule: "Null", - CumulusPalletDmpQueuePageIndexData: "Null", - PalletDutchAuctionTakeOrder: "Null", - ComposableTraitsGovernanceSignedRawOrigin: "Null", - PalletIdentityRegistration: "Null", - PalletIdentityRegistrarInfo: "Null", - PalletOracleAssetInfo: "Null", - PalletOracleWithdraw: { - stake: 'u128', - unlockBlock: 'u32' - }, - PalletOraclePrePrice: "Null", - PalletOraclePrice: "Null", - PolkadotPrimitivesV1AbridgedHostConfiguration: "Null", - CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot: "Null", - PolkadotPrimitivesV1PersistedValidationData: "PersistedValidationData", - PalletSchedulerScheduledV2: "Null", - PalletSchedulerReleases: "Null", - DaliRuntimeOpaqueSessionKeys: "Null", - OrmlTokensAccountData: "Null", - OrmlTokensBalanceLock: "Null", - PalletTreasuryProposal: "Null", - PalletVaultModelsStrategyOverview: "Null", - PalletVaultModelsVaultInfo: "Null", - CumulusPalletXcmpQueueInboundStatus: "Null", - PolkadotParachainPrimitivesXcmpMessageFormat: "Null", - CumulusPalletXcmpQueueOutboundStatus: "Null", - CumulusPalletXcmpQueueQueueConfigData: "Null", - PalletCrowdloanRewardsModelsProof: { - _enum: { - RelayChain: '(AccountId32, MultiSignature)', - Ethereum: 'EcdsaSignature' - } - }, - PalletDemocracyConviction: "Null", - PalletDemocracyVoteAccountVote: "Null", - ComposableTraitsDefiSell: "Null", - ComposableTraitsAuctionAuctionStepFunction: "Null", - ComposableTraitsDefiTake: "Null", - ComposableTraitsTimeTimeReleaseFunction: "Null", - PalletIdentityJudgement: "Null", - PalletIdentityBitFlags: "Null", - PalletIdentityIdentityInfo: "Null", - CumulusPrimitivesParachainInherentParachainInherentData: 'ParachainInherentData', - DaliRuntimeOriginCaller: "Null", - ComposableTraitsVaultVaultConfig: "Null", - XcmVersionedMultiAsset: "Null", - } -}; +export { default as crowdloanRewards } from "./crowdloanRewards/definitions"; +export { default as assets } from "./assets/definitions"; +// export { default as composableTraits } from "./composableTraits/definitions"; +// export { default as dutchAuction } from "./dutchAuction/definitions"; diff --git a/integration-tests/runtime-tests/src/types/interfaces/types.ts b/integration-tests/runtime-tests/src/types/interfaces/types.ts index d8d4cf80d33..f582241cf01 100644 --- a/integration-tests/runtime-tests/src/types/interfaces/types.ts +++ b/integration-tests/runtime-tests/src/types/interfaces/types.ts @@ -1,4 +1,5 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -export * from './default/types'; +export * from './crowdloanRewards/types'; +export * from './assets/types'; diff --git a/integration-tests/runtime-tests/src/utils/testSetup.ts b/integration-tests/runtime-tests/src/utils/testSetup.ts index 1da004e82b2..8aa1c4327ea 100644 --- a/integration-tests/runtime-tests/src/utils/testSetup.ts +++ b/integration-tests/runtime-tests/src/utils/testSetup.ts @@ -2,8 +2,8 @@ import '@composable/types/interfaces/augment-api'; import '@composable/types/interfaces/augment-types'; import * as definitions from '@composable/types/interfaces/definitions'; - import { ApiPromise, Keyring, WsProvider } from "@polkadot/api"; +import { ApiOptions } from '@polkadot/api/types'; import Web3 from 'web3'; import { args } from "./args"; @@ -13,19 +13,31 @@ global.testSudoCommands = true; // and ability to specify keys using env variables or using run parameters. export async function runBefore() { - // extract all types from definitions - fast and dirty approach, flatted on 'types' - const types = Object.values(definitions).reduce((res, {types}): object => ({...res, ...types}), {}); + const chai = require('chai'); + const BN = require('bn.js'); + + // Enable and inject BN dependency + chai.use(require('chai-bn')(BN)); + + // console.log(JSON.stringify(definitions, null, 4)); + const rpc = Object.keys(definitions).reduce((accumulator, key) => ({ ...accumulator, [key]: definitions[key].rpc }), {}); + const types = Object.values(definitions).reduce((accumulator, { types }) => ({ ...accumulator, ...types }), {}); + // console.log("rpc: ", JSON.stringify(rpc, null, 4)); + // console.log("types: ", JSON.stringify(types, null, 4)); global.endpoint = `ws://${args.h}:${args.p}`; const provider = new WsProvider(global.endpoint); console.debug(`Establishing connection to ${global.endpoint}...`); - // async or Promise-returning functions allowed - global.api = await ApiPromise.create({provider, types}); + const apiOptions: ApiOptions = { + provider, types, rpc + }; + global.api = await ApiPromise.create(apiOptions); + global.web3 = new Web3(); // do something before every test, // then run the next hook in this array - global.keyring = new Keyring({type: 'sr25519'}); + global.keyring = new Keyring({ type: 'sr25519' }); if (global.useTestnetWallets === true) { global.walletAlice = global.keyring.addFromUri('//Alice'); @@ -38,6 +50,6 @@ export async function runBefore() { return; } -export async function runAfter () { - await global.api.disconnect(); -} +export async function runAfter() { + await global.api.disconnect(); +} \ No newline at end of file diff --git a/node/Cargo.toml b/node/Cargo.toml index 8291abdb5fa..6d6dd6fce11 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -20,7 +20,14 @@ structopt = "0.3.8" picasso-runtime = { path = "../runtime/picasso" } composable-runtime = { path = "../runtime/composable", optional = true } dali-runtime = { path = "../runtime/dali", optional = true } -common = { path = "../runtime/common" } +common = { path = "../runtime/common" } +primitives = { path = "../runtime/primitives" } +pallet-assets = { path = "../frame/assets" } +assets-rpc = { path = "../frame/assets/rpc" } +assets-runtime-api = { path = "../frame/assets/runtime-api" } +pallet-crowdloan-rewards = { path = "../frame/crowdloan-rewards" } +crowdloan-rewards-rpc = { path = "../frame/crowdloan-rewards/rpc" } +crowdloan-rewards-runtime-api = { path = "../frame/crowdloan-rewards/runtime-api" } # FRAME Dependencies frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } @@ -93,7 +100,12 @@ hex = "0.4.3" [features] default = [] -runtime-benchmarks = ["polkadot-service/runtime-benchmarks", "picasso-runtime/runtime-benchmarks", "composable-runtime/runtime-benchmarks", "dali-runtime/runtime-benchmarks"] +runtime-benchmarks = [ + "polkadot-service/runtime-benchmarks", + "picasso-runtime/runtime-benchmarks", + "composable-runtime/runtime-benchmarks", + "dali-runtime/runtime-benchmarks", +] ocw = [] dali = ["dali-runtime"] composable = ["composable-runtime"] diff --git a/node/src/rpc.rs b/node/src/rpc.rs index b7efaa65bf0..5face7be0c2 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -5,9 +5,12 @@ #![warn(missing_docs)] +use primitives::currency::CurrencyId; use std::sync::Arc; +use assets_rpc::{Assets, AssetsApi}; use common::{AccountId, AccountIndex, Balance}; +use crowdloan_rewards_rpc::{CrowdloanRewards, CrowdloanRewardsApi}; pub use sc_rpc_api::DenyUnsafe; use sc_transaction_pool_api::TransactionPool; use sp_api::ProvideRuntimeApi; @@ -34,6 +37,8 @@ where C: Send + Sync + 'static, C::Api: substrate_frame_rpc_system::AccountNonceApi, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, + C::Api: assets_runtime_api::AssetsRuntimeApi, + C::Api: crowdloan_rewards_runtime_api::CrowdloanRewardsRuntimeApi, C::Api: BlockBuilder, P: TransactionPool + 'static, { @@ -45,7 +50,11 @@ where io.extend_with(SystemApi::to_delegate(FullSystem::new(client.clone(), pool, deny_unsafe))); - io.extend_with(TransactionPaymentApi::to_delegate(TransactionPayment::new(client))); + io.extend_with(TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone()))); + + io.extend_with(AssetsApi::to_delegate(Assets::new(client.clone()))); + + io.extend_with(CrowdloanRewardsApi::to_delegate(CrowdloanRewards::new(client))); // Extend this RPC with a custom API by using the following syntax. // `YourRpcStruct` should have a reference to a client, which is needed diff --git a/node/src/runtime.rs b/node/src/runtime.rs index b8fff9e4afe..429bc3e4b7c 100644 --- a/node/src/runtime.rs +++ b/node/src/runtime.rs @@ -1,4 +1,5 @@ use common::{AccountId, Balance, Index, OpaqueBlock as Block}; +use primitives::currency::CurrencyId; use sp_runtime::traits::BlakeTwo256; /// Consider this a trait alias. @@ -8,6 +9,8 @@ pub trait HostRuntimeApis: + sp_block_builder::BlockBuilder + substrate_frame_rpc_system::AccountNonceApi + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + + assets_runtime_api::AssetsRuntimeApi + + crowdloan_rewards_runtime_api::CrowdloanRewardsRuntimeApi + sp_api::Metadata + sp_consensus_aura::AuraApi + sp_offchain::OffchainWorkerApi @@ -26,6 +29,8 @@ where + sp_block_builder::BlockBuilder + substrate_frame_rpc_system::AccountNonceApi + pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi + + assets_runtime_api::AssetsRuntimeApi + + crowdloan_rewards_runtime_api::CrowdloanRewardsRuntimeApi + sp_api::Metadata + sp_consensus_aura::AuraApi + sp_offchain::OffchainWorkerApi diff --git a/runtime/composable/Cargo.toml b/runtime/composable/Cargo.toml index 9078ea3758b..8e38fd30a5e 100644 --- a/runtime/composable/Cargo.toml +++ b/runtime/composable/Cargo.toml @@ -62,29 +62,35 @@ preimage = { package = "pallet-preimage", git = "https://github.com/paritytech/s orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "2b1c9fb367ccb8e13601b2da43d1c5d9737b93c6", default-features = false } orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "2b1c9fb367ccb8e13601b2da43d1c5d9737b93c6", default-features = false } smallvec = "1.6.1" +crowdloan-rewards = { package = "pallet-crowdloan-rewards", path = '../../frame/crowdloan-rewards', default-features = false } # local modules assets-registry = { package = "pallet-assets-registry", path = '../../frame/assets-registry', default-features = false, optional = true } -assets = { package = "pallet-assets", path = '../../frame/assets', default-features = false, optional = true } +assets = { package = "pallet-assets", path = '../../frame/assets', default-features = false } common = { path = "../common", default-features = false } primitives = { path = "../primitives", default-features = false } oracle = { package = "pallet-oracle", path = "../../frame/oracle", default-features = false, optional = true } vault = { package = "pallet-vault", path = "../../frame/vault", default-features = false, optional = true } -governance-registry = { package = "pallet-governance-registry", path = "../../frame/governance-registry", default-features = false, optional = true } -currency-factory = { package = "pallet-currency-factory", path = "../../frame/currency-factory", default-features = false, optional = true} -composable-traits = { path = "../../frame/composable-traits" , default-features = false} +governance-registry = { package = "pallet-governance-registry", path = "../../frame/governance-registry", default-features = false } +currency-factory = { package = "pallet-currency-factory", path = "../../frame/currency-factory", default-features = false } +composable-traits = { path = "../../frame/composable-traits", default-features = false } +composable-support = { path = "../../frame/composable-support", default-features = false } call-filter = { package = "pallet-call-filter", path = "../../frame/call-filter", default-features = false } # Used for the node template's RPCs system-rpc-runtime-api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false } transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false } +assets-runtime-api = { path = '../../frame/assets/runtime-api', default-features = false } +crowdloan-rewards-runtime-api = { path = '../../frame/crowdloan-rewards/runtime-api', default-features = false } # Used for runtime benchmarking frame-benchmarking = { package = "frame-benchmarking", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false, optional = true } system-benchmarking = { package = "frame-system-benchmarking", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false, optional = true } hex-literal = { version = "0.3.1", optional = true } -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ + "derive", +] } # Parachain Utilities cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16", default-features = false } @@ -118,6 +124,7 @@ substrate-wasm-builder = { git = "https://github.com/paritytech/substrate", bran default = ["std"] std = [ "codec/std", + "composable-support/std", "sp-api/std", "sp-std/std", "sp-core/std", @@ -173,7 +180,6 @@ std = [ "orml-xcm-support/std", "orml-unknown-tokens/std", "assets-registry/std", - "assets/std", "governance-registry/std", "preimage/std", "membership/std", @@ -206,4 +212,4 @@ runtime-benchmarks = [ "democracy/runtime-benchmarks", "utility/runtime-benchmarks", "vault/runtime-benchmarks", -] \ No newline at end of file +] diff --git a/runtime/composable/src/lib.rs b/runtime/composable/src/lib.rs index 967fcfabab9..bbbf5f43a1f 100644 --- a/runtime/composable/src/lib.rs +++ b/runtime/composable/src/lib.rs @@ -37,6 +37,7 @@ use sp_runtime::{ ApplyExtrinsicResult, }; +use composable_support::rpc_helpers::SafeRpcWrapper; use sp_std::prelude::*; #[cfg(feature = "std")] use sp_version::NativeVersion; @@ -464,6 +465,18 @@ impl collator_selection::Config for Runtime { type WeightInfo = weights::collator_selection::WeightInfo; } +impl assets::Config for Runtime { + type NativeAssetId = NativeAssetId; + type GenerateCurrencyId = Factory; + type AssetId = CurrencyId; + type Balance = Balance; + type NativeCurrency = Balances; + type MultiCurrency = Tokens; + type WeightInfo = (); + type AdminOrigin = EnsureRootOrHalfCouncil; + type GovernanceRegistry = GovernanceRegistry; +} + parameter_type_with_key! { // TODO: pub ExistentialDeposits: |_currency_id: CurrencyId| -> Balance { @@ -602,6 +615,8 @@ impl utility::Config for Runtime { } parameter_types! { + pub const DynamicCurrencyIdInitial: CurrencyId = CurrencyId::LOCAL_LP_TOKEN_START; + pub const LaunchPeriod: BlockNumber = 5 * DAYS; pub const VotingPeriod: BlockNumber = 5 * DAYS; pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS; @@ -616,6 +631,18 @@ parameter_types! { pub const MaxProposals: u32 = 100; } +impl governance_registry::Config for Runtime { + type Event = Event; + type AssetId = CurrencyId; + type WeightInfo = (); +} + +impl currency_factory::Config for Runtime { + type Event = Event; + type DynamicCurrencyId = CurrencyId; + type DynamicCurrencyIdInitial = DynamicCurrencyIdInitial; +} + impl democracy::Config for Runtime { type Proposal = Call; type Event = Event; @@ -653,6 +680,36 @@ impl democracy::Config for Runtime { type WeightInfo = weights::democracy::WeightInfo; } +parameter_types! { + pub const InitialPayment: Perbill = Perbill::from_percent(50); + pub const VestingStep: BlockNumber = 7 * DAYS; + pub const Prefix: &'static [u8] = b"composable-"; +} + +impl crowdloan_rewards::Config for Runtime { + type Event = Event; + type Balance = Balance; + type Currency = Assets; + type AdminOrigin = EnsureRootOrHalfCouncil; + type Convert = sp_runtime::traits::ConvertInto; + type RelayChainAccountId = [u8; 32]; + type InitialPayment = InitialPayment; + type VestingStep = VestingStep; + type Prefix = Prefix; + type WeightInfo = (); +} + +parameter_types! { + pub const MaxStrategies: usize = 255; + pub NativeAssetId: CurrencyId = CurrencyId::PICA; + pub CreationDeposit: Balance = 10 * CurrencyId::PICA.unit::(); + pub VaultExistentialDeposit: Balance = 1000 * CurrencyId::PICA.unit::(); + pub RentPerBlock: Balance = CurrencyId::PICA.milli::(); + pub const VaultMinimumDeposit: Balance = 10_000; + pub const VaultMinimumWithdrawal: Balance = 10_000; + pub const VaultPalletId: PalletId = PalletId(*b"cubic___"); +} + /// The calls we permit to be executed by extrinsics pub struct BaseCallFilter; @@ -707,6 +764,9 @@ construct_runtime!( DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 43, Tokens: orml_tokens::{Pallet, Call, Storage, Event} = 52, + + CrowdloanRewards: crowdloan_rewards::{Pallet, Call, Storage, Event, ValidateUnsigned} = 56, + Assets: assets::{Pallet, Call, Storage} = 57, } ); @@ -771,6 +831,26 @@ mod benches { } impl_runtime_apis! { + impl assets_runtime_api::AssetsRuntimeApi for Runtime { + fn balance_of(SafeRpcWrapper(asset_id): SafeRpcWrapper, account_id: AccountId) -> SafeRpcWrapper /* Balance */ { + SafeRpcWrapper(>::balance(asset_id, &account_id)) + } + } + + impl crowdloan_rewards_runtime_api::CrowdloanRewardsRuntimeApi for Runtime { + fn amount_available_to_claim_for(account_id: AccountId) -> SafeRpcWrapper { + SafeRpcWrapper( + crowdloan_rewards::Associations::::get(account_id) + .map(crowdloan_rewards::Rewards::::get) + .flatten() + .as_ref() + .map(crowdloan_rewards::should_have_claimed::) + .unwrap_or_else(|| Ok(Balance::zero())) + .unwrap_or_else(|_| Balance::zero()) + ) + } + } + impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { VERSION diff --git a/runtime/dali/Cargo.toml b/runtime/dali/Cargo.toml index 0884c6bbcfd..c31ec612090 100644 --- a/runtime/dali/Cargo.toml +++ b/runtime/dali/Cargo.toml @@ -10,7 +10,19 @@ authors = ["Seun Lanlege "] targets = ["x86_64-unknown-linux-gnu"] [package.metadata.cargo-udeps.ignore] -normal = ["pallet-vault", "session-benchmarking", "assets-registry", "currency-factory", "oracle", "vault", "assets", "governance-registry", "call-filter", "orml-unknown-tokens", "orml-xtokens"] +normal = [ + "pallet-vault", + "session-benchmarking", + "assets-registry", + "currency-factory", + "oracle", + "vault", + "assets", + "governance-registry", + "call-filter", + "orml-unknown-tokens", + "orml-xtokens", +] [dependencies] frame-system = { package = "frame-system", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false } @@ -67,19 +79,24 @@ oracle = { package = "pallet-oracle", path = "../../frame/oracle", default-featu vault = { package = "pallet-vault", path = "../../frame/vault", default-features = false } governance-registry = { package = "pallet-governance-registry", path = "../../frame/governance-registry", default-features = false } currency-factory = { package = "pallet-currency-factory", path = "../../frame/currency-factory", default-features = false } -composable-traits = { path = "../../frame/composable-traits" , default-features = false} +composable-traits = { path = "../../frame/composable-traits", default-features = false } call-filter = { package = "pallet-call-filter", path = "../../frame/call-filter", default-features = false } mosaic = { package = "pallet-mosaic", path = "../../frame/mosaic", default-features = false } +composable-support = { path = '../../frame/composable-support', default-features = false } # Used for the node template's RPCs system-rpc-runtime-api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false } transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false } +assets-runtime-api = { path = '../../frame/assets/runtime-api', default-features = false } +crowdloan-rewards-runtime-api = { path = '../../frame/crowdloan-rewards/runtime-api', default-features = false } # Used for runtime benchmarking frame-benchmarking = { package = "frame-benchmarking", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false, optional = true } system-benchmarking = { package = "frame-system-benchmarking", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false, optional = true } hex-literal = { version = "0.3.1", optional = true } -codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] } +codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ + "derive", +] } # Parachain Utilities cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.16", default-features = false } @@ -126,9 +143,9 @@ std = [ "sp-block-builder/std", "sp-transaction-pool/std", "sp-inherents/std", - "frame-support/std", + "frame-support/std", "executive/std", - "frame-system/std", + "frame-system/std", "utility/std", "authorship/std", "balances/std", @@ -141,7 +158,7 @@ std = [ "identity/std", "multisig/std", "vault/std", - "assets/std", + "assets/std", "governance-registry/std", "call-filter/std", "currency-factory/std", @@ -174,7 +191,6 @@ std = [ "orml-unknown-tokens/std", "assets-registry/std", "assets/std", - "governance-registry/std", "composable-traits/std", "crowdloan-rewards/std", "bonded-finance/std", diff --git a/runtime/dali/src/lib.rs b/runtime/dali/src/lib.rs index fa2b779b7d3..87a952cec54 100644 --- a/runtime/dali/src/lib.rs +++ b/runtime/dali/src/lib.rs @@ -26,6 +26,7 @@ use common::{ HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use cumulus_primitives_core::ParaId; +use composable_support::rpc_helpers::{SafeRpcWrapper, SafeRpcWrapperType}; use orml_traits::parameter_type_with_key; use primitives::currency::CurrencyId; use sp_api::impl_runtime_apis; @@ -55,7 +56,7 @@ pub use frame_support::{ }; use codec::Encode; -use frame_support::traits::{EqualPrivilegeOnly, OnRuntimeUpgrade}; +use frame_support::traits::{fungibles, EqualPrivilegeOnly, OnRuntimeUpgrade}; use frame_system as system; use scale_info::TypeInfo; #[cfg(any(feature = "std", test))] @@ -802,7 +803,7 @@ impl crowdloan_rewards::Config for Runtime { type Currency = Assets; type AdminOrigin = EnsureRootOrHalfCouncil; type Convert = sp_runtime::traits::ConvertInto; - type RelayChainAccountId = [u8; 32]; + type RelayChainAccountId = sp_runtime::AccountId32; type InitialPayment = InitialPayment; type VestingStep = VestingStep; type Prefix = Prefix; @@ -1056,6 +1057,26 @@ mod benches { } impl_runtime_apis! { + impl assets_runtime_api::AssetsRuntimeApi for Runtime { + fn balance_of(asset_id: SafeRpcWrapper, account_id: AccountId) -> SafeRpcWrapper /* Balance */ { + SafeRpcWrapper(>::balance(asset_id.0, &account_id)) + } + } + + impl crowdloan_rewards_runtime_api::CrowdloanRewardsRuntimeApi for Runtime { + fn amount_available_to_claim_for(account_id: AccountId) -> SafeRpcWrapper { + SafeRpcWrapper ( + crowdloan_rewards::Associations::::get(account_id) + .map(crowdloan_rewards::Rewards::::get) + .flatten() + .as_ref() + .map(crowdloan_rewards::should_have_claimed::) + .unwrap_or_else(|| Ok(Balance::zero())) + .unwrap_or_else(|_| Balance::zero()) + ) + } + } + impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { VERSION diff --git a/runtime/picasso/Cargo.toml b/runtime/picasso/Cargo.toml index 3872c0bb704..0aff18de667 100644 --- a/runtime/picasso/Cargo.toml +++ b/runtime/picasso/Cargo.toml @@ -67,7 +67,6 @@ orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-li smallvec = "1.6.1" # local modules - common = { path = "../common", default-features = false } primitives = { path = "../primitives", default-features = false } composable-traits = { path = "../../frame/composable-traits", default-features = false } @@ -78,11 +77,16 @@ assets = { package = "pallet-assets", path = '../../frame/assets', default-featu crowdloan-rewards = { package = "pallet-crowdloan-rewards", path = '../../frame/crowdloan-rewards', default-features = false } vesting = { package = "pallet-vesting", path = "../../frame/vesting", default-features = false } bonded-finance = { package = "pallet-bonded-finance", path = "../../frame/bonded-finance", default-features = false } +composable-support = { path = "../../frame/composable-support", default-features = false } # Used for the node template's RPCs system-rpc-runtime-api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false } transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false } +# local RPCs +assets-runtime-api = { path = '../../frame/assets/runtime-api', default-features = false } +crowdloan-rewards-runtime-api = { path = '../../frame/crowdloan-rewards/runtime-api', default-features = false } + # Used for runtime benchmarking frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false, optional = true } system-benchmarking = { package = "frame-system-benchmarking", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false, optional = true } @@ -175,6 +179,7 @@ std = [ "orml-xcm-support/std", "orml-unknown-tokens/std", "composable-traits/std", + "composable-support/std", "governance-registry/std", "currency-factory/std", "assets/std", diff --git a/runtime/picasso/src/lib.rs b/runtime/picasso/src/lib.rs index fa7ff18c135..c4df11c6074 100644 --- a/runtime/picasso/src/lib.rs +++ b/runtime/picasso/src/lib.rs @@ -37,6 +37,7 @@ use sp_runtime::{ ApplyExtrinsicResult, }; +use composable_support::rpc_helpers::SafeRpcWrapper; use sp_std::prelude::*; #[cfg(feature = "std")] use sp_version::NativeVersion; @@ -55,7 +56,7 @@ pub use frame_support::{ }; use codec::Encode; -use frame_support::traits::{EqualPrivilegeOnly, OnRuntimeUpgrade}; +use frame_support::traits::{fungibles, EqualPrivilegeOnly, OnRuntimeUpgrade}; use frame_system as system; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -198,6 +199,38 @@ impl system::Config for Runtime { impl randomness_collective_flip::Config for Runtime {} +parameter_types! { + pub const DynamicCurrencyIdInitial: CurrencyId = CurrencyId::LOCAL_LP_TOKEN_START; +} + +impl currency_factory::Config for Runtime { + type Event = Event; + type DynamicCurrencyId = CurrencyId; + type DynamicCurrencyIdInitial = DynamicCurrencyIdInitial; +} + +parameter_types! { + pub NativeAssetId: CurrencyId = CurrencyId::PICA; +} + +impl assets::Config for Runtime { + type NativeAssetId = NativeAssetId; + type GenerateCurrencyId = Factory; + type AssetId = CurrencyId; + type Balance = Balance; + type NativeCurrency = Balances; + type MultiCurrency = Tokens; + type WeightInfo = (); + type AdminOrigin = EnsureRootOrHalfCouncil; + type GovernanceRegistry = GovernanceRegistry; +} + +impl governance_registry::Config for Runtime { + type Event = Event; + type AssetId = CurrencyId; + type WeightInfo = (); +} + parameter_types! { // Maximum authorities/collators for aura pub const MaxAuthorities: u32 = 100; @@ -735,7 +768,7 @@ impl crowdloan_rewards::Config for Runtime { type Currency = Assets; type AdminOrigin = EnsureRootOrHalfCouncil; type Convert = sp_runtime::traits::ConvertInto; - type RelayChainAccountId = [u8; 32]; + type RelayChainAccountId = sp_runtime::AccountId32; type InitialPayment = InitialPayment; type VestingStep = VestingStep; type Prefix = Prefix; @@ -907,6 +940,26 @@ mod benches { } impl_runtime_apis! { + impl assets_runtime_api::AssetsRuntimeApi for Runtime { + fn balance_of(asset_id: SafeRpcWrapper, account_id: AccountId) -> SafeRpcWrapper /* Balance */ { + SafeRpcWrapper(>::balance(asset_id.0, &account_id)) + } + } + + impl crowdloan_rewards_runtime_api::CrowdloanRewardsRuntimeApi for Runtime { + fn amount_available_to_claim_for(account_id: AccountId) -> SafeRpcWrapper { + SafeRpcWrapper ( + crowdloan_rewards::Associations::::get(account_id) + .map(crowdloan_rewards::Rewards::::get) + .flatten() + .as_ref() + .map(crowdloan_rewards::should_have_claimed::) + .unwrap_or_else(|| Ok(Balance::zero())) + .unwrap_or_else(|_| Balance::zero()) + ) + } + } + impl sp_api::Core for Runtime { fn version() -> RuntimeVersion { VERSION diff --git a/runtime/primitives/Cargo.toml b/runtime/primitives/Cargo.toml index aeecb175f42..3b048a03c07 100644 --- a/runtime/primitives/Cargo.toml +++ b/runtime/primitives/Cargo.toml @@ -13,6 +13,7 @@ codec = { package = "parity-scale-codec", version = "2.0.0", default-features = serde = { version = '1.0.130', features = ['derive'], optional = true } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false } composable-traits = { path = "../../frame/composable-traits", default-features = false } +composable-support = { path = "../../frame/composable-support", default-features = false } scale-info = { version = "1.0", default-features = false, features = ["derive"] } xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.16", default-features = false, optional = true} @@ -24,8 +25,7 @@ std = [ "codec/std", "sp-runtime/std", "composable-traits/std", - "scale-info/std", -] -develop = [ - "xcm" + "composable-support/std", + "scale-info/std", ] +develop = ["xcm"] diff --git a/runtime/primitives/src/currency.rs b/runtime/primitives/src/currency.rs index 6d2e0f5115c..941de713576 100644 --- a/runtime/primitives/src/currency.rs +++ b/runtime/primitives/src/currency.rs @@ -5,6 +5,7 @@ use core::ops::Div; use scale_info::TypeInfo; use sp_runtime::RuntimeDebug; +use composable_support::rpc_helpers::FromHexStr; #[cfg(feature = "std")] use serde::{Deserialize, Serialize}; use sp_runtime::sp_std::ops::Deref; @@ -46,6 +47,32 @@ impl CurrencyId { } } +impl FromHexStr for CurrencyId { + type Err = ::Err; + + fn from_hex_str(src: &str) -> core::result::Result { + u128::from_hex_str(src).map(CurrencyId) + } +} + +impl core::fmt::LowerHex for CurrencyId { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + core::fmt::LowerHex::fmt(&self.0, f) + } +} + +// NOTE(hussein-aitlahcen): we could add an index to DynamicCurrency to differentiate sub-ranges +// This implementation is only valid if the initial value used to step using next is +// LOCAL_LP_TOKEN_START +impl DynamicCurrencyId for CurrencyId { + #[inline] + fn next(self) -> Result { + let CurrencyId(x) = self; + let y = x.checked_add(1).ok_or(DispatchError::Arithmetic(ArithmeticError::Overflow))?; + Ok(CurrencyId(y)) + } +} + impl Default for CurrencyId { #[inline] fn default() -> Self { From e5e618ba293f548b10aaeaa356151e4473c6b228 Mon Sep 17 00:00:00 2001 From: Ben Luelo Date: Thu, 10 Feb 2022 11:31:24 -0500 Subject: [PATCH 02/15] Formatting --- Cargo.lock | 2 +- frame/assets/Cargo.toml | 13 ++++++------ node/Cargo.toml | 4 +++- runtime/composable/Cargo.toml | 2 ++ runtime/composable/src/lib.rs | 15 +++++++------ runtime/dali/Cargo.toml | 2 ++ runtime/dali/src/lib.rs | 2 +- runtime/picasso/src/lib.rs | 34 +----------------------------- runtime/primitives/src/currency.rs | 12 ----------- 9 files changed, 25 insertions(+), 61 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7120242de99..63f9d56d951 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5983,6 +5983,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "num-traits", "orml-tokens", "orml-traits", "pallet-balances", @@ -5992,7 +5993,6 @@ dependencies = [ "scale-info", "sp-api", "sp-arithmetic", - "sp-blockchain", "sp-core", "sp-io", "sp-runtime", diff --git a/frame/assets/Cargo.toml b/frame/assets/Cargo.toml index fa24ea01f85..829ae97f476 100644 --- a/frame/assets/Cargo.toml +++ b/frame/assets/Cargo.toml @@ -15,7 +15,7 @@ frame-support = { default-features = false, git = "https://github.com/paritytech frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +# sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } @@ -26,14 +26,11 @@ sp-std = { default-features = false, git = "https://github.com/paritytech/substr composable-traits = { path = "../composable-traits", default-features = false } orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "2b1c9fb367ccb8e13601b2da43d1c5d9737b93c6", default-features = false } -scale-info = { version = "1.0", default-features = false, features = [ - "derive", -] } +scale-info = { version = "1.0", default-features = false, features = ["derive"] } # misc -codec = { default-features = false, features = [ - "derive", -], package = "parity-scale-codec", version = "2.0.0" } +codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "2.0.0" } +num-traits = { version = "0.2.14", default-features = false } [dev-dependencies] pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false } @@ -52,8 +49,10 @@ std = [ "codec/std", "frame-support/std", "sp-runtime/std", + # "sp-blockchain/std", "sp-api/std", "orml-traits/std", + "num-traits/std", ] runtime-benchmarks = [ "frame-benchmarking", diff --git a/node/Cargo.toml b/node/Cargo.toml index 6d6dd6fce11..2a03f536b34 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -22,10 +22,12 @@ composable-runtime = { path = "../runtime/composable", optional = true } dali-runtime = { path = "../runtime/dali", optional = true } common = { path = "../runtime/common" } primitives = { path = "../runtime/primitives" } + +pallet-crowdloan-rewards = { path = "../frame/crowdloan-rewards" } pallet-assets = { path = "../frame/assets" } + assets-rpc = { path = "../frame/assets/rpc" } assets-runtime-api = { path = "../frame/assets/runtime-api" } -pallet-crowdloan-rewards = { path = "../frame/crowdloan-rewards" } crowdloan-rewards-rpc = { path = "../frame/crowdloan-rewards/rpc" } crowdloan-rewards-runtime-api = { path = "../frame/crowdloan-rewards/runtime-api" } diff --git a/runtime/composable/Cargo.toml b/runtime/composable/Cargo.toml index 8e38fd30a5e..db6b0b7c27a 100644 --- a/runtime/composable/Cargo.toml +++ b/runtime/composable/Cargo.toml @@ -81,6 +81,8 @@ call-filter = { package = "pallet-call-filter", path = "../../frame/call-filter" # Used for the node template's RPCs system-rpc-runtime-api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false } transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false } + +# local RPCs assets-runtime-api = { path = '../../frame/assets/runtime-api', default-features = false } crowdloan-rewards-runtime-api = { path = '../../frame/crowdloan-rewards/runtime-api', default-features = false } diff --git a/runtime/composable/src/lib.rs b/runtime/composable/src/lib.rs index bbbf5f43a1f..dd8bedaf205 100644 --- a/runtime/composable/src/lib.rs +++ b/runtime/composable/src/lib.rs @@ -467,7 +467,7 @@ impl collator_selection::Config for Runtime { impl assets::Config for Runtime { type NativeAssetId = NativeAssetId; - type GenerateCurrencyId = Factory; + type GenerateCurrencyId = CurrencyFactory; type AssetId = CurrencyId; type Balance = Balance; type NativeCurrency = Balances; @@ -615,8 +615,6 @@ impl utility::Config for Runtime { } parameter_types! { - pub const DynamicCurrencyIdInitial: CurrencyId = CurrencyId::LOCAL_LP_TOKEN_START; - pub const LaunchPeriod: BlockNumber = 5 * DAYS; pub const VotingPeriod: BlockNumber = 5 * DAYS; pub const FastTrackVotingPeriod: BlockNumber = 3 * HOURS; @@ -639,8 +637,11 @@ impl governance_registry::Config for Runtime { impl currency_factory::Config for Runtime { type Event = Event; - type DynamicCurrencyId = CurrencyId; - type DynamicCurrencyIdInitial = DynamicCurrencyIdInitial; + type AssetId = CurrencyId; + type AddOrigin = EnsureRootOrHalfCouncil; + type ReserveOrigin = EnsureRootOrHalfCouncil; + type WeightInfo = (); + // type WeightInfo = weights::currency_factory::WeightInfo; } impl democracy::Config for Runtime { @@ -755,7 +756,7 @@ construct_runtime!( Democracy: democracy::{Pallet, Call, Storage, Config, Event} = 33, Scheduler: scheduler::{Pallet, Call, Storage, Event} = 34, Utility: utility::{Pallet, Call, Event} = 35, - Preimage: preimage::{Pallet, Call, Storage, Event} = 36, + Preimage: preimage::{Pallet, Call, Storage, Event} = 36, // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 40, @@ -765,8 +766,10 @@ construct_runtime!( Tokens: orml_tokens::{Pallet, Call, Storage, Event} = 52, + CurrencyFactory: currency_factory::{Pallet, Storage, Event} = 53, CrowdloanRewards: crowdloan_rewards::{Pallet, Call, Storage, Event, ValidateUnsigned} = 56, Assets: assets::{Pallet, Call, Storage} = 57, + GovernanceRegistry: governance_registry::{Pallet, Call, Storage, Event} = 58, } ); diff --git a/runtime/dali/Cargo.toml b/runtime/dali/Cargo.toml index c31ec612090..189feb3aba8 100644 --- a/runtime/dali/Cargo.toml +++ b/runtime/dali/Cargo.toml @@ -87,6 +87,8 @@ composable-support = { path = '../../frame/composable-support', default-features # Used for the node template's RPCs system-rpc-runtime-api = { package = "frame-system-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false } transaction-payment-rpc-runtime-api = { package = "pallet-transaction-payment-rpc-runtime-api", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16", default-features = false } + +# local RPCs assets-runtime-api = { path = '../../frame/assets/runtime-api', default-features = false } crowdloan-rewards-runtime-api = { path = '../../frame/crowdloan-rewards/runtime-api', default-features = false } diff --git a/runtime/dali/src/lib.rs b/runtime/dali/src/lib.rs index 87a952cec54..3d8b8ad86c2 100644 --- a/runtime/dali/src/lib.rs +++ b/runtime/dali/src/lib.rs @@ -25,8 +25,8 @@ use common::{ CouncilInstance, EnsureRootOrHalfCouncil, Hash, Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; +use composable_support::rpc_helpers::SafeRpcWrapper; use cumulus_primitives_core::ParaId; -use composable_support::rpc_helpers::{SafeRpcWrapper, SafeRpcWrapperType}; use orml_traits::parameter_type_with_key; use primitives::currency::CurrencyId; use sp_api::impl_runtime_apis; diff --git a/runtime/picasso/src/lib.rs b/runtime/picasso/src/lib.rs index c4df11c6074..8be6f7bde3b 100644 --- a/runtime/picasso/src/lib.rs +++ b/runtime/picasso/src/lib.rs @@ -199,23 +199,13 @@ impl system::Config for Runtime { impl randomness_collective_flip::Config for Runtime {} -parameter_types! { - pub const DynamicCurrencyIdInitial: CurrencyId = CurrencyId::LOCAL_LP_TOKEN_START; -} - -impl currency_factory::Config for Runtime { - type Event = Event; - type DynamicCurrencyId = CurrencyId; - type DynamicCurrencyIdInitial = DynamicCurrencyIdInitial; -} - parameter_types! { pub NativeAssetId: CurrencyId = CurrencyId::PICA; } impl assets::Config for Runtime { type NativeAssetId = NativeAssetId; - type GenerateCurrencyId = Factory; + type GenerateCurrencyId = CurrencyFactory; type AssetId = CurrencyId; type Balance = Balance; type NativeCurrency = Balances; @@ -734,28 +724,6 @@ impl currency_factory::Config for Runtime { type WeightInfo = weights::currency_factory::WeightInfo; } -impl governance_registry::Config for Runtime { - type Event = Event; - type AssetId = CurrencyId; - type WeightInfo = (); -} - -parameter_types! { - pub NativeAssetId: CurrencyId = CurrencyId::PICA; -} - -impl assets::Config for Runtime { - type NativeAssetId = NativeAssetId; - type GenerateCurrencyId = CurrencyFactory; - type AssetId = CurrencyId; - type Balance = Balance; - type NativeCurrency = Balances; - type MultiCurrency = Tokens; - type WeightInfo = (); - type AdminOrigin = EnsureRootOrHalfCouncil; - type GovernanceRegistry = GovernanceRegistry; -} - parameter_types! { pub const InitialPayment: Perbill = Perbill::from_percent(25); pub const VestingStep: BlockNumber = 7 * DAYS; diff --git a/runtime/primitives/src/currency.rs b/runtime/primitives/src/currency.rs index 941de713576..ca3b064faf4 100644 --- a/runtime/primitives/src/currency.rs +++ b/runtime/primitives/src/currency.rs @@ -61,18 +61,6 @@ impl core::fmt::LowerHex for CurrencyId { } } -// NOTE(hussein-aitlahcen): we could add an index to DynamicCurrency to differentiate sub-ranges -// This implementation is only valid if the initial value used to step using next is -// LOCAL_LP_TOKEN_START -impl DynamicCurrencyId for CurrencyId { - #[inline] - fn next(self) -> Result { - let CurrencyId(x) = self; - let y = x.checked_add(1).ok_or(DispatchError::Arithmetic(ArithmeticError::Overflow))?; - Ok(CurrencyId(y)) - } -} - impl Default for CurrencyId { #[inline] fn default() -> Self { From 8d5cc634803e1cc5f003545e7840a82e7dd8b6bf Mon Sep 17 00:00:00 2001 From: Ben Luelo Date: Thu, 10 Feb 2022 12:16:35 -0500 Subject: [PATCH 03/15] Remove assets tests.rs file --- frame/assets/src/tests.rs | 208 -------------------------------------- 1 file changed, 208 deletions(-) delete mode 100644 frame/assets/src/tests.rs diff --git a/frame/assets/src/tests.rs b/frame/assets/src/tests.rs deleted file mode 100644 index 7981ac93465..00000000000 --- a/frame/assets/src/tests.rs +++ /dev/null @@ -1,208 +0,0 @@ -use crate::*; -use mocks::{new_test_ext, GovernanceRegistry, Origin, Test}; -use orml_traits::MultiCurrency; - -const FROM_ACCOUNT: u64 = 1; -const TO_ACCOUNT: u64 = 2; -const ASSET_ID: u64 = 1; -const INIT_AMOUNT: u64 = 1000; -const TRANSFER_AMOUNT: u64 = 500; - -#[test] -fn set_only_by_root() { - new_test_ext().execute_with(|| { - GovernanceRegistry::set(Origin::root(), 1, 1).unwrap(); - ensure_admin_or_governance::(Origin::root(), &2).unwrap(); - ensure_admin_or_governance::(Origin::signed(1), &2).unwrap_err(); - ensure_admin_or_governance::(Origin::signed(2), &1).unwrap_err(); - ensure_admin_or_governance::(Origin::signed(1), &1).unwrap(); - ensure_admin_or_governance::(Origin::none(), &1).unwrap_err(); - ensure_admin_or_governance::(Origin::none(), &2).unwrap_err(); - }); -} - -#[test] -fn test_transfer() { - new_test_ext().execute_with(|| { - Pallet::::transfer( - Origin::signed(FROM_ACCOUNT), - ASSET_ID, - TO_ACCOUNT, - TRANSFER_AMOUNT, - true, - ) - .expect("transfer should work"); - assert_eq!( - Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), - INIT_AMOUNT - TRANSFER_AMOUNT - ); - assert_eq!( - Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), - INIT_AMOUNT + TRANSFER_AMOUNT - ); - }); -} - -#[test] -fn test_transfer_native() { - new_test_ext().execute_with(|| { - Pallet::::transfer_native( - Origin::signed(FROM_ACCOUNT), - TO_ACCOUNT, - TRANSFER_AMOUNT, - true, - ) - .expect("transfer_native should work"); - assert_eq!( - Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), - INIT_AMOUNT - TRANSFER_AMOUNT - ); - assert_eq!( - Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), - INIT_AMOUNT + TRANSFER_AMOUNT - ); - }); -} - -#[test] -fn test_force_transfer() { - new_test_ext().execute_with(|| { - Pallet::::force_transfer( - Origin::root(), - ASSET_ID, - FROM_ACCOUNT, - TO_ACCOUNT, - TRANSFER_AMOUNT, - true, - ) - .expect("force_transfer should work"); - assert_eq!( - Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), - INIT_AMOUNT - TRANSFER_AMOUNT - ); - assert_eq!( - Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), - INIT_AMOUNT + TRANSFER_AMOUNT - ); - }); -} - -#[test] -fn test_force_transfer_native() { - new_test_ext().execute_with(|| { - Pallet::::force_transfer_native( - Origin::root(), - FROM_ACCOUNT, - TO_ACCOUNT, - TRANSFER_AMOUNT, - true, - ) - .expect("force_transfer_native should work"); - assert_eq!( - Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), - INIT_AMOUNT - TRANSFER_AMOUNT - ); - assert_eq!( - Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), - INIT_AMOUNT + TRANSFER_AMOUNT - ); - }); -} - -#[test] -fn test_transfer_all() { - new_test_ext().execute_with(|| { - Pallet::::transfer_all(Origin::signed(FROM_ACCOUNT), ASSET_ID, TO_ACCOUNT, true) - .expect("transfer_all should work"); - assert_eq!(Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), 1); - assert_eq!(Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), INIT_AMOUNT * 2 - 1); - }); -} - -#[test] -fn test_transfer_all_native() { - new_test_ext().execute_with(|| { - Pallet::::transfer_all_native(Origin::signed(FROM_ACCOUNT), TO_ACCOUNT, true) - .expect("transfer_all_native should work"); - assert_eq!(Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), 1); - assert_eq!(Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), INIT_AMOUNT * 2 - 1); - }); -} - -#[test] -fn test_mint_initialize() { - new_test_ext().execute_with(|| { - assert_eq!(Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), INIT_AMOUNT); - Pallet::::mint_initialize(Origin::root(), TRANSFER_AMOUNT, TO_ACCOUNT) - .expect("mint_initialize should work"); - assert_eq!( - Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), - INIT_AMOUNT + TRANSFER_AMOUNT - ); - }); -} - -#[test] -fn test_mint_initialize_with_governance() { - new_test_ext().execute_with(|| { - assert_eq!(Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), INIT_AMOUNT); - Pallet::::mint_initialize_with_governance( - Origin::root(), - TRANSFER_AMOUNT, - TO_ACCOUNT, - TO_ACCOUNT, - ) - .expect("mint_initialize_with_governance should work"); - assert_eq!( - Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), - INIT_AMOUNT + TRANSFER_AMOUNT - ); - ensure_admin_or_governance::(Origin::signed(TO_ACCOUNT), &ASSET_ID).expect( - "mint_initialize_with_governance should add governance_origin to GovernanceRegistry", - ); - }); -} - -#[test] -fn test_mint_into() { - new_test_ext().execute_with(|| { - GovernanceRegistry::set(Origin::root(), ASSET_ID, FROM_ACCOUNT).unwrap(); - assert_eq!(Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), INIT_AMOUNT); - assert_eq!(Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), INIT_AMOUNT); - - Pallet::::mint_into( - Origin::signed(FROM_ACCOUNT), - ASSET_ID, - TO_ACCOUNT, - TRANSFER_AMOUNT, - ) - .expect("mint_into should work"); - assert_eq!(Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), INIT_AMOUNT); - assert_eq!( - Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), - INIT_AMOUNT + TRANSFER_AMOUNT - ); - }); -} - -#[test] -fn test_burn_from() { - new_test_ext().execute_with(|| { - GovernanceRegistry::set(Origin::root(), ASSET_ID, FROM_ACCOUNT).unwrap(); - assert_eq!(Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), INIT_AMOUNT); - assert_eq!(Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), INIT_AMOUNT); - - Pallet::::burn_from( - Origin::signed(FROM_ACCOUNT), - ASSET_ID, - TO_ACCOUNT, - TRANSFER_AMOUNT, - ) - .expect("burn_from should work"); - assert_eq!(Pallet::::total_balance(ASSET_ID, &FROM_ACCOUNT), INIT_AMOUNT); - assert_eq!( - Pallet::::total_balance(ASSET_ID, &TO_ACCOUNT), - INIT_AMOUNT - TRANSFER_AMOUNT - ); - }); -} From 15d041464e3af37c96714d92a440b33674accf9f Mon Sep 17 00:00:00 2001 From: Ben Luelo Date: Fri, 11 Feb 2022 10:31:24 -0500 Subject: [PATCH 04/15] Remove commented-out code --- frame/assets/Cargo.toml | 1 - frame/composable-support/src/lib.rs | 4 +--- .../runtime-tests/src/types/interfaces/assets/definitions.ts | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/frame/assets/Cargo.toml b/frame/assets/Cargo.toml index 829ae97f476..c3455e996f5 100644 --- a/frame/assets/Cargo.toml +++ b/frame/assets/Cargo.toml @@ -49,7 +49,6 @@ std = [ "codec/std", "frame-support/std", "sp-runtime/std", - # "sp-blockchain/std", "sp-api/std", "orml-traits/std", "num-traits/std", diff --git a/frame/composable-support/src/lib.rs b/frame/composable-support/src/lib.rs index 3a79b33097b..7b8b3feed54 100644 --- a/frame/composable-support/src/lib.rs +++ b/frame/composable-support/src/lib.rs @@ -13,7 +13,5 @@ #![cfg_attr(not(feature = "std"), no_std)] pub mod collections; -pub mod validation; - -// #[cfg(feature = "std")] pub mod rpc_helpers; +pub mod validation; diff --git a/integration-tests/runtime-tests/src/types/interfaces/assets/definitions.ts b/integration-tests/runtime-tests/src/types/interfaces/assets/definitions.ts index 9760fca4255..e67a07f107f 100644 --- a/integration-tests/runtime-tests/src/types/interfaces/assets/definitions.ts +++ b/integration-tests/runtime-tests/src/types/interfaces/assets/definitions.ts @@ -23,6 +23,5 @@ export default { types: { CurrencyId: "u128", AssetsBalance: "u128", - // Balance: "u128", }, }; From cf233202889f4cd378f5f49031923db46c3f46cb Mon Sep 17 00:00:00 2001 From: Ben Luelo Date: Fri, 11 Feb 2022 10:39:45 -0500 Subject: [PATCH 05/15] Remove specific RPC crate entries in workspace Cargo.toml --- Cargo.lock | 2 +- Cargo.toml | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 63f9d56d951..b1ab8c6b321 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6512,7 +6512,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "frame-benchmarking", "frame-support", diff --git a/Cargo.toml b/Cargo.toml index 285b3e4df27..b16dc328bce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,10 +24,6 @@ std = ["composable-node/std"] exclude = ["frame/transaction-fee"] members = [ "frame/*", - "frame/assets/rpc", - "frame/assets/runtime-api", - "frame/crowdloan-rewards/rpc", - "frame/crowdloan-rewards/runtime-api", "node", From 3ed19ea019ffdc76968d5c1a5fcbcc28b38e40af Mon Sep 17 00:00:00 2001 From: Ben Luelo Date: Fri, 11 Feb 2022 12:49:22 -0500 Subject: [PATCH 06/15] Remove std feature from assets-rpc --- frame/assets/rpc/Cargo.toml | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/frame/assets/rpc/Cargo.toml b/frame/assets/rpc/Cargo.toml index 10d75f0589c..8904d41b5e6 100644 --- a/frame/assets/rpc/Cargo.toml +++ b/frame/assets/rpc/Cargo.toml @@ -11,35 +11,20 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] # substrate primitives -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } # local -composable-support = { path = "../../composable-support", default-features = false } +composable-support = { path = "../../composable-support" } +assets-runtime-api = { path = "../runtime-api" } -scale-info = { version = "1.0", default-features = false, features = [ - "derive", -] } - -assets-runtime-api = { path = "../runtime-api", default-features = false } +# SCALE +scale-info = { version = "1.0", default-features = false, features = ["derive"] } +codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "2.0.0" } # rpc jsonrpc-core = "18.0.0" jsonrpc-core-client = "18.0.0" -jsonrpc-derive = "18.0.0" - -codec = { default-features = false, features = [ - "derive", -], package = "parity-scale-codec", version = "2.0.0" } - -[features] -default = ["std"] -std = [ - "assets-runtime-api/std", - "composable-support/std", - "codec/std", - "sp-runtime/std", - "sp-api/std", -] +jsonrpc-derive = "18.0.0" \ No newline at end of file From 37ef4af1a5fb9956ce63a8628fcb2c8b2e221413 Mon Sep 17 00:00:00 2001 From: Ben Luelo Date: Fri, 11 Feb 2022 12:50:21 -0500 Subject: [PATCH 07/15] Update Cargo.lock --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index b1ab8c6b321..63f9d56d951 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6512,7 +6512,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "frame-benchmarking", "frame-support", From c640eeddbf72629dbee364e3dbe102caa07fd8ef Mon Sep 17 00:00:00 2001 From: Ben Luelo Date: Fri, 11 Feb 2022 12:50:41 -0500 Subject: [PATCH 08/15] Update generated api types --- .../types/interfaces/augment-api-consts.ts | 40 +++- .../types/interfaces/augment-api-errors.ts | 92 +++++++- .../types/interfaces/augment-api-events.ts | 178 +++++++++++---- .../src/types/interfaces/augment-api-query.ts | 105 ++++++--- .../src/types/interfaces/augment-api-tx.ts | 212 +++++++++++++++++- 5 files changed, 530 insertions(+), 97 deletions(-) diff --git a/integration-tests/runtime-tests/src/types/interfaces/augment-api-consts.ts b/integration-tests/runtime-tests/src/types/interfaces/augment-api-consts.ts index 404fe6d2eae..d3f89f5ea5b 100644 --- a/integration-tests/runtime-tests/src/types/interfaces/augment-api-consts.ts +++ b/integration-tests/runtime-tests/src/types/interfaces/augment-api-consts.ts @@ -2,7 +2,7 @@ /* eslint-disable */ import type { ApiTypes } from '@polkadot/api-base/types'; -import type { Bytes, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; +import type { Bytes, Option, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec'; import type { Codec } from '@polkadot/types-codec/types'; import type { Perbill, Permill } from '@polkadot/types/interfaces/runtime'; import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion, XcmV1MultiLocation } from '@polkadot/types/lookup'; @@ -60,6 +60,13 @@ declare module '@polkadot/api-base/types/consts' { **/ [key: string]: Codec; }; + callFilter: { + maxStringSize: u32 & AugmentedConst; + /** + * Generic const + **/ + [key: string]: Codec; + }; crowdloanRewards: { /** * The upfront liquidity unlocked at first claim. @@ -147,16 +154,6 @@ declare module '@polkadot/api-base/types/consts' { **/ [key: string]: Codec; }; - factory: { - /** - * The initial currency id from which we are able to generate the next. - **/ - dynamicCurrencyIdInitial: u128 & AugmentedConst; - /** - * Generic const - **/ - [key: string]: Codec; - }; identity: { /** * The amount held on deposit for a registered identity @@ -201,6 +198,15 @@ declare module '@polkadot/api-base/types/consts' { **/ [key: string]: Codec; }; + mosaic: { + minimumTimeLockPeriod: u32 & AugmentedConst; + minimumTTL: u32 & AugmentedConst; + timelockPeriod: u32 & AugmentedConst; + /** + * Generic const + **/ + [key: string]: Codec; + }; multisig: { /** * The base amount of currency needed to reserve for creating a multisig execution or to @@ -226,6 +232,14 @@ declare module '@polkadot/api-base/types/consts' { **/ [key: string]: Codec; }; + oracle: { + maxHistory: u32 & AugmentedConst; + maxPrePrices: u32 & AugmentedConst; + /** + * Generic const + **/ + [key: string]: Codec; + }; scheduler: { /** * The maximum weight that may be scheduled per block for any dispatchables of less @@ -352,6 +366,10 @@ declare module '@polkadot/api-base/types/consts' { * An accepted proposal gets these back. A rejected proposal does not. **/ proposalBond: Permill & AugmentedConst; + /** + * Maximum amount of funds that should be placed in a deposit for making a proposal. + **/ + proposalBondMaximum: Option & AugmentedConst; /** * Minimum amount of funds that should be placed in a deposit for making a proposal. **/ diff --git a/integration-tests/runtime-tests/src/types/interfaces/augment-api-errors.ts b/integration-tests/runtime-tests/src/types/interfaces/augment-api-errors.ts index 9622549d087..f54a309339e 100644 --- a/integration-tests/runtime-tests/src/types/interfaces/augment-api-errors.ts +++ b/integration-tests/runtime-tests/src/types/interfaces/augment-api-errors.ts @@ -252,6 +252,12 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; + currencyFactory: { + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; democracy: { /** * Cannot cancel the same proposal twice @@ -397,12 +403,6 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; - factory: { - /** - * Generic error - **/ - [key: string]: AugmentedError; - }; governanceRegistry: { /** * Not found @@ -509,6 +509,33 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; + liquidations: { + NoLiquidationEngineFound: AugmentedError; + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; + mosaic: { + AmountMismatch: AugmentedError; + BadTimelockPeriod: AugmentedError; + BadTTL: AugmentedError; + ExceedsMaxTransferSize: AugmentedError; + InsufficientBudget: AugmentedError; + NetworkDisabled: AugmentedError; + NoClaimableTx: AugmentedError; + NoOutgoingTx: AugmentedError; + NoStaleTransactions: AugmentedError; + Overflow: AugmentedError; + RelayerNotSet: AugmentedError; + TxStillLocked: AugmentedError; + UnsupportedAsset: AugmentedError; + UnsupportedNetwork: AugmentedError; + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; multisig: { /** * Call is already approved by this signatory. @@ -622,6 +649,8 @@ declare module '@polkadot/api-base/types/errors' { **/ InvalidMinAnswers: AugmentedError; MaxAnswersLessThanMinAnswers: AugmentedError; + MaxHistory: AugmentedError; + MaxPrePrices: AugmentedError; /** * Max prices already reached **/ @@ -722,6 +751,36 @@ declare module '@polkadot/api-base/types/errors' { **/ [key: string]: AugmentedError; }; + preimage: { + /** + * Preimage has already been noted on-chain. + **/ + AlreadyNoted: AugmentedError; + /** + * The user is not authorized to perform this action. + **/ + NotAuthorized: AugmentedError; + /** + * The preimage cannot be removed since it has not yet been noted. + **/ + NotNoted: AugmentedError; + /** + * The preimage request cannot be removed since no outstanding requests exist. + **/ + NotRequested: AugmentedError; + /** + * A preimage may not be removed when there are outstanding requests. + **/ + Requested: AugmentedError; + /** + * Preimage is too large to store on-chain. + **/ + TooLarge: AugmentedError; + /** + * Generic error + **/ + [key: string]: AugmentedError; + }; relayerXcm: { /** * The location is invalid since it already has a subscription from us. @@ -1089,6 +1148,10 @@ declare module '@polkadot/api-base/types/errors' { [key: string]: AugmentedError; }; xcmpQueue: { + /** + * Bad overweight index. + **/ + BadOverweightIndex: AugmentedError; /** * Bad XCM data. **/ @@ -1101,6 +1164,10 @@ declare module '@polkadot/api-base/types/errors' { * Failed to send XCM message. **/ FailedToSend: AugmentedError; + /** + * Provided weight is possibly not enough to execute the message. + **/ + WeightOverLimit: AugmentedError; /** * Generic error **/ @@ -1111,6 +1178,10 @@ declare module '@polkadot/api-base/types/errors' { * Asset has no reserve location. **/ AssetHasNoReserve: AugmentedError; + /** + * The specified index does not exist in a MultiAssets struct + **/ + AssetIndexNonExistent: AugmentedError; /** * The version of the `Versioned` value used is not able to be * interpreted. @@ -1126,9 +1197,10 @@ declare module '@polkadot/api-base/types/errors' { **/ DestinationNotInvertible: AugmentedError; /** - * The fee MultiAsset is of different type than the asset to transfer. + * We tried sending distinct asset and fee but they have different + * reserve chains **/ - DistincAssetAndFeeId: AugmentedError; + DistinctReserveForAssetAndFee: AugmentedError; /** * The fee amount was zero when the fee specification extrinsic is * being used. @@ -1154,6 +1226,10 @@ declare module '@polkadot/api-base/types/errors' { * Not fungible asset. **/ NotFungible: AugmentedError; + /** + * The number of assets to be sent is over the maximum + **/ + TooManyAssetsBeingSent: AugmentedError; /** * The message's weight could not be determined. **/ diff --git a/integration-tests/runtime-tests/src/types/interfaces/augment-api-events.ts b/integration-tests/runtime-tests/src/types/interfaces/augment-api-events.ts index 17d0665fe87..40b2a2dbe57 100644 --- a/integration-tests/runtime-tests/src/types/interfaces/augment-api-events.ts +++ b/integration-tests/runtime-tests/src/types/interfaces/augment-api-events.ts @@ -1,12 +1,12 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import type { ComposableTraitsAssetsXcmAssetLocation, ComposableTraitsCallFilterCallFilterEntry, ComposableTraitsVestingVestingSchedule, PalletCrowdloanRewardsModelsRemoteAccount, PalletDemocracyVoteThreshold, PalletDutchAuctionSellOrder } from '@composable/types/interfaces/crowdloanRewards'; +import type { ComposableTraitsAssetsXcmAssetLocation, ComposableTraitsCallFilterCallFilterEntry, ComposableTraitsVestingVestingSchedule, PalletCrowdloanRewardsModelsRemoteAccount, PalletDemocracyVoteAccountVote, PalletDemocracyVoteThreshold, PalletDutchAuctionSellOrder } from '@composable/types/interfaces/crowdloanRewards'; import type { ApiTypes } from '@polkadot/api-base/types'; import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u32, u64, u8 } from '@polkadot/types-codec'; import type { ITuple } from '@polkadot/types-codec/types'; import type { AccountId32, H256, Percent } from '@polkadot/types/interfaces/runtime'; -import type { FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, PalletMultisigTimepoint, SpRuntimeDispatchError, XcmV1MultiAsset, XcmV1MultiLocation, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; +import type { FrameSupportTokensMiscBalanceStatus, FrameSupportWeightsDispatchInfo, PalletMultisigTimepoint, SpRuntimeDispatchError, XcmV1MultiAsset, XcmV1MultiLocation, XcmV1MultiassetMultiAssets, XcmV2Response, XcmV2TraitsError, XcmV2TraitsOutcome, XcmV2Xcm, XcmVersionedMultiAssets, XcmVersionedMultiLocation } from '@polkadot/types/lookup'; declare module '@polkadot/api-base/types/events' { export interface AugmentedEvents { @@ -210,6 +210,13 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; + currencyFactory: { + RangeCreated: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; democracy: { /** * A proposal_hash has been blacklisted permanently. @@ -263,6 +270,10 @@ declare module '@polkadot/api-base/types/events' { * A motion has been proposed by a public account. **/ Proposed: AugmentedEvent; + /** + * An account has secconded a proposal + **/ + Seconded: AugmentedEvent; /** * A referendum has begun. **/ @@ -279,6 +290,10 @@ declare module '@polkadot/api-base/types/events' { * An external proposal has been vetoed. **/ Vetoed: AugmentedEvent; + /** + * An account has voted in a referendum + **/ + Voted: AugmentedEvent; /** * Generic event **/ @@ -328,12 +343,6 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; - factory: { - /** - * Generic event - **/ - [key: string]: AugmentedEvent; - }; governanceRegistry: { GrantRoot: AugmentedEvent; Remove: AugmentedEvent; @@ -408,6 +417,61 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; + liquidations: { + PositionWasSentToLiquidation: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; + mosaic: { + BudgetUpdated: AugmentedEvent; + /** + * The `NetworkInfos` `network_info` was updated for `network_id`. + **/ + NetworksUpdated: AugmentedEvent; + /** + * The relayer partially accepted the user's `OutgoingTransaction`. + **/ + PartialTransferAccepted: AugmentedEvent; + /** + * The relayer has been rotated to `account_id`. + **/ + RelayerRotated: AugmentedEvent; + /** + * The account of the relayer has been set. + **/ + RelayerSet: AugmentedEvent; + /** + * User claimed outgoing tx that was not (yet) picked up by the relayer + **/ + StaleTxClaimed: AugmentedEvent; + /** + * The relayer accepted the user's `OutgoingTransaction`. + **/ + TransferAccepted: AugmentedEvent; + /** + * The user claims his `IncomingTransaction` and unlocks the locked amount. + **/ + TransferClaimed: AugmentedEvent; + /** + * An incoming tx is created and waiting for the user to claim. + **/ + TransferInto: AugmentedEvent; + /** + * When we have finality issues occur on the Ethereum chain, + * we burn the locked `IncomingTransaction` for which we know that it is invalid. + **/ + TransferIntoRescined: AugmentedEvent; + /** + * An outgoing tx is created, and locked in the outgoing tx pool. + **/ + TransferOut: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; multisig: { /** * A multisig operation has been approved by someone. @@ -505,6 +569,24 @@ declare module '@polkadot/api-base/types/events' { **/ [key: string]: AugmentedEvent; }; + preimage: { + /** + * A preimage has ben cleared. + **/ + Cleared: AugmentedEvent; + /** + * A preimage has been noted. + **/ + Noted: AugmentedEvent; + /** + * A preimage has been requested. + **/ + Requested: AugmentedEvent; + /** + * Generic event + **/ + [key: string]: AugmentedEvent; + }; relayerXcm: { /** * Some assets have been placed in an asset trap. @@ -629,15 +711,19 @@ declare module '@polkadot/api-base/types/events' { }; scheduler: { /** - * Canceled some task. \[when, index\] + * The call for the provided hash was not found so the task has been aborted. + **/ + CallLookupFailed: AugmentedEvent, Option, FrameSupportScheduleLookupError]>; + /** + * Canceled some task. **/ Canceled: AugmentedEvent; /** - * Dispatched some task. \[task, id, result\] + * Dispatched some task. **/ Dispatched: AugmentedEvent, Option, Result]>; /** - * Scheduled some task. \[when, index\] + * Scheduled some task. **/ Scheduled: AugmentedEvent; /** @@ -658,9 +744,9 @@ declare module '@polkadot/api-base/types/events' { }; sudo: { /** - * The \[sudoer\] just switched identity; the old key is supplied. + * The \[sudoer\] just switched identity; the old key is supplied if one existed. **/ - KeyChanged: AugmentedEvent; + KeyChanged: AugmentedEvent]>; /** * A sudo just took place. \[result\] **/ @@ -680,23 +766,23 @@ declare module '@polkadot/api-base/types/events' { **/ CodeUpdated: AugmentedEvent; /** - * An extrinsic failed. \[error, info\] + * An extrinsic failed. **/ ExtrinsicFailed: AugmentedEvent; /** - * An extrinsic completed successfully. \[info\] + * An extrinsic completed successfully. **/ ExtrinsicSuccess: AugmentedEvent; /** - * An \[account\] was reaped. + * An account was reaped. **/ KilledAccount: AugmentedEvent; /** - * A new \[account\] was created. + * A new account was created. **/ NewAccount: AugmentedEvent; /** - * On on-chain remark happened. \[origin, remark_hash\] + * On on-chain remark happened. **/ Remarked: AugmentedEvent; /** @@ -706,38 +792,33 @@ declare module '@polkadot/api-base/types/events' { }; tokens: { /** - * A balance was set by root. \[who, free, reserved\] + * A balance was set by root. **/ BalanceSet: AugmentedEvent; /** * An account was removed whose balance was non-zero but below - * ExistentialDeposit, resulting in an outright loss. \[currency_id, - * account, balance\] + * ExistentialDeposit, resulting in an outright loss. **/ DustLost: AugmentedEvent; /** - * An account was created with some free balance. \[currency_id, - * account, free_balance\] + * An account was created with some free balance. **/ Endowed: AugmentedEvent; /** * Some reserved balance was repatriated (moved from reserved to * another account). - * \[currency_id, from, to, amount_actually_moved, status\] **/ RepatriatedReserve: AugmentedEvent; /** * Some balance was reserved (moved from free to reserved). - * \[currency_id, who, value\] **/ Reserved: AugmentedEvent; /** - * Transfer succeeded. \[currency_id, from, to, value\] + * Transfer succeeded. **/ Transfer: AugmentedEvent; /** * Some balance was unreserved (moved from reserved to free). - * \[currency_id, who, value\] **/ Unreserved: AugmentedEvent; /** @@ -747,32 +828,31 @@ declare module '@polkadot/api-base/types/events' { }; treasury: { /** - * Some funds have been allocated. \[proposal_index, award, beneficiary\] + * Some funds have been allocated. **/ Awarded: AugmentedEvent; /** - * Some of our funds have been burnt. \[burn\] + * Some of our funds have been burnt. **/ Burnt: AugmentedEvent; /** - * Some funds have been deposited. \[deposit\] + * Some funds have been deposited. **/ Deposit: AugmentedEvent; /** - * New proposal. \[proposal_index\] + * New proposal. **/ Proposed: AugmentedEvent; /** - * A proposal was rejected; funds were slashed. \[proposal_index, slashed\] + * A proposal was rejected; funds were slashed. **/ Rejected: AugmentedEvent; /** * Spending has finished; this is the amount that rolls over until next spend. - * \[budget_remaining\] **/ Rollover: AugmentedEvent; /** - * We have ended a spend period and will now allocate funds. \[budget_remaining\] + * We have ended a spend period and will now allocate funds. **/ Spending: AugmentedEvent; /** @@ -782,11 +862,11 @@ declare module '@polkadot/api-base/types/events' { }; unknownTokens: { /** - * Deposit success. [asset, to] + * Deposit success. **/ Deposited: AugmentedEvent; /** - * Withdraw success. [asset, from] + * Withdraw success. **/ Withdrawn: AugmentedEvent; /** @@ -805,7 +885,7 @@ declare module '@polkadot/api-base/types/events' { **/ BatchInterrupted: AugmentedEvent; /** - * A call was dispatched. \[result\] + * A call was dispatched. **/ DispatchedAs: AugmentedEvent]>; /** @@ -875,6 +955,14 @@ declare module '@polkadot/api-base/types/events' { * Some XCM failed. **/ Fail: AugmentedEvent, XcmV2TraitsError]>; + /** + * An XCM exceeded the individual message weight budget. + **/ + OverweightEnqueued: AugmentedEvent; + /** + * An XCM from the overweight queue was executed with the given actual weight used. + **/ + OverweightServiced: AugmentedEvent; /** * Some XCM was executed ok. **/ @@ -894,19 +982,27 @@ declare module '@polkadot/api-base/types/events' { }; xTokens: { /** - * Transferred. \[sender, currency_id, amount, dest\] + * Transferred. **/ Transferred: AugmentedEvent; /** - * Transferred `MultiAsset`. \[sender, asset, dest\] + * Transferred `MultiAsset`. **/ TransferredMultiAsset: AugmentedEvent; /** - * Transferred `MultiAsset` with fee. \[sender, asset, fee, dest\] + * Transferred `MultiAsset` with fee. + **/ + TransferredMultiAssets: AugmentedEvent; + /** + * Transferred `MultiAsset` with fee. **/ TransferredMultiAssetWithFee: AugmentedEvent; /** - * Transferred with fee. \[sender, currency_id, amount, fee, dest\] + * Transferred `MultiAsset` with fee. + **/ + TransferredMultiCurrencies: AugmentedEvent>, XcmV1MultiLocation]>; + /** + * Transferred with fee. **/ TransferredWithFee: AugmentedEvent; /** diff --git a/integration-tests/runtime-tests/src/types/interfaces/augment-api-query.ts b/integration-tests/runtime-tests/src/types/interfaces/augment-api-query.ts index 452bbcf1518..4a1a9346574 100644 --- a/integration-tests/runtime-tests/src/types/interfaces/augment-api-query.ts +++ b/integration-tests/runtime-tests/src/types/interfaces/augment-api-query.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-chain`, do not edit /* eslint-disable */ -import type { ComposableTraitsAssetsXcmAssetLocation, ComposableTraitsBondedFinanceBondOffer, ComposableTraitsCallFilterCallFilterEntry, ComposableTraitsGovernanceSignedRawOrigin, ComposableTraitsVestingVestingSchedule, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundStatus, CumulusPalletXcmpQueueOutboundStatus, CumulusPalletXcmpQueueQueueConfigData, DaliRuntimeOpaqueSessionKeys, OrmlTokensAccountData, OrmlTokensBalanceLock, PalletAssetsRegistryCandidateStatus, PalletAssetsRegistryForeignMetadata, PalletCollatorSelectionCandidateInfo, PalletCrowdloanRewardsModelsRemoteAccount, PalletCrowdloanRewardsReward, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletDutchAuctionSellOrder, PalletDutchAuctionTakeOrder, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletOracleAssetInfo, PalletOraclePrePrice, PalletOraclePrice, PalletOracleWithdraw, PalletSchedulerReleases, PalletSchedulerScheduledV2, PalletTreasuryProposal, PalletVaultModelsStrategyOverview, PalletVaultModelsVaultInfo, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV1AbridgedHostConfiguration, PolkadotPrimitivesV1PersistedValidationData, SpConsensusAuraSr25519AppSr25519Public } from '@composable/types/interfaces/crowdloanRewards'; +import type { ComposableTraitsAssetsXcmAssetLocation, ComposableTraitsBondedFinanceBondOffer, ComposableTraitsCallFilterCallFilterEntry, ComposableTraitsGovernanceSignedRawOrigin, ComposableTraitsVestingVestingSchedule, CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueQueueConfigData, DaliRuntimeOpaqueSessionKeys, OrmlTokensAccountData, OrmlTokensBalanceLock, PalletAssetsRegistryCandidateStatus, PalletAssetsRegistryForeignMetadata, PalletCollatorSelectionCandidateInfo, PalletCrowdloanRewardsModelsRemoteAccount, PalletDemocracyPreimageStatus, PalletDemocracyReferendumInfo, PalletDemocracyReleases, PalletDemocracyVoteThreshold, PalletDemocracyVoteVoting, PalletDutchAuctionSellOrder, PalletDutchAuctionTakeOrder, PalletIdentityRegistrarInfo, PalletIdentityRegistration, PalletOracleAssetInfo, PalletOraclePrePrice, PalletOraclePrice, PalletOracleWithdraw, PalletTreasuryProposal, PalletVaultModelsStrategyOverview, PalletVaultModelsVaultInfo, PolkadotPrimitivesV1AbridgedHostConfiguration, PolkadotPrimitivesV1PersistedValidationData, SpConsensusAuraSr25519AppSr25519Public } from '@composable/types/interfaces/crowdloanRewards'; import type { ApiTypes } from '@polkadot/api-base/types'; import type { Data } from '@polkadot/types'; import type { BTreeMap, Bytes, Null, Option, U8aFixed, Vec, WrapperKeepOpaque, bool, u128, u16, u32, u64 } from '@polkadot/types-codec'; @@ -26,7 +26,7 @@ declare module '@polkadot/api-base/types/storage' { /** * Foreign admin account **/ - foreignAdmin: AugmentedQuery Observable, []> & QueryableStorageEntry; + foreignAdmin: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Mapping local asset to foreign asset metadata. **/ @@ -38,7 +38,7 @@ declare module '@polkadot/api-base/types/storage' { /** * Local admin account **/ - localAdmin: AugmentedQuery Observable, []> & QueryableStorageEntry; + localAdmin: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Mapping local asset to foreign asset. **/ @@ -130,8 +130,6 @@ declare module '@polkadot/api-base/types/storage' { callFilter: { /** * The list of disabled extrinsics. - * - * CallFilterEntry -> () **/ disabledCalls: AugmentedQuery Observable>, [ComposableTraitsCallFilterCallFilterEntry]> & QueryableStorageEntry; /** @@ -141,7 +139,9 @@ declare module '@polkadot/api-base/types/storage' { }; collatorSelection: { /** - * Fixed deposit bond for each candidate. + * Fixed amount to deposit to become a collator. + * + * When a collator calls `leave_intent` they immediately receive the deposit back. **/ candidacyBond: AugmentedQuery Observable, []> & QueryableStorageEntry; /** @@ -220,7 +220,7 @@ declare module '@polkadot/api-base/types/storage' { * The rewards claimed so far. **/ claimedRewards: AugmentedQuery Observable, []> & QueryableStorageEntry; - rewards: AugmentedQuery Observable>, [PalletCrowdloanRewardsModelsRemoteAccount]> & QueryableStorageEntry; + rewards: AugmentedQuery Observable>, [PalletCrowdloanRewardsModelsRemoteAccount]> & QueryableStorageEntry; /** * The total number of contributors. **/ @@ -238,6 +238,13 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; + currencyFactory: { + assetIdRanges: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; democracy: { /** * A record of who vetoed what. Maps proposal hash to a possible existent block number @@ -354,16 +361,6 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; - factory: { - /** - * The counter that track the latest generated currency id. - **/ - currencyCounter: AugmentedQuery Observable, []> & QueryableStorageEntry; - /** - * Generic query - **/ - [key: string]: QueryableStorageEntry; - }; governanceRegistry: { originsByAssetId: AugmentedQuery Observable>, [u128]> & QueryableStorageEntry; /** @@ -413,6 +410,34 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; + liquidations: { + defaultStrategyIndex: AugmentedQuery Observable, []> & QueryableStorageEntry; + strategies: AugmentedQuery Observable>, [u32]> & QueryableStorageEntry; + strategyIndex: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; + mosaic: { + assetsInfo: AugmentedQuery Observable>, [u128]> & QueryableStorageEntry; + /** + * Locked incoming tx into Picasso that the user needs to claim. + **/ + incomingTransactions: AugmentedQuery Observable>>, [AccountId32, u128]> & QueryableStorageEntry; + networkInfos: AugmentedQuery Observable>, [u32]> & QueryableStorageEntry; + nonce: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Locked outgoing tx out of Picasso, that a relayer needs to process. + **/ + outgoingTransactions: AugmentedQuery Observable>>, [AccountId32, u128]> & QueryableStorageEntry; + relayer: AugmentedQuery Observable>, []> & QueryableStorageEntry; + timeLockPeriod: AugmentedQuery Observable, []> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; multisig: { calls: AugmentedQuery Observable, AccountId32, u128]>>>, [U8aFixed]> & QueryableStorageEntry; /** @@ -487,6 +512,12 @@ declare module '@polkadot/api-base/types/storage' { * The next authorized upgrade, if there is one. **/ authorizedUpgrade: AugmentedQuery Observable>, []> & QueryableStorageEntry; + /** + * A custom head data that should be returned as result of `validate_block`. + * + * See [`Pallet::set_custom_validation_head_data`] for more information. + **/ + customValidationHeadData: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Were the validation data set to notify the relay chain? **/ @@ -600,6 +631,20 @@ declare module '@polkadot/api-base/types/storage' { **/ [key: string]: QueryableStorageEntry; }; + preimage: { + /** + * The preimages stored by this pallet. + **/ + preimageFor: AugmentedQuery Observable>, [H256]> & QueryableStorageEntry; + /** + * The request status of a given hash. + **/ + statusFor: AugmentedQuery Observable>, [H256]> & QueryableStorageEntry; + /** + * Generic query + **/ + [key: string]: QueryableStorageEntry; + }; randomnessCollectiveFlip: { /** * Series of block headers from the last 81 blocks that acts as random seed material. This @@ -616,17 +661,11 @@ declare module '@polkadot/api-base/types/storage' { /** * Items to be executed, indexed by the block number that they should be executed on. **/ - agenda: AugmentedQuery Observable>>, [u32]> & QueryableStorageEntry; + agenda: AugmentedQuery Observable>>, [u32]> & QueryableStorageEntry; /** * Lookup from identity to the block number and index of the task. **/ lookup: AugmentedQuery Observable>>, [Bytes]> & QueryableStorageEntry; - /** - * Storage version of the pallet. - * - * New networks start with last version. - **/ - storageVersion: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * Generic query **/ @@ -676,7 +715,7 @@ declare module '@polkadot/api-base/types/storage' { /** * The `AccountId` of the sudo key. **/ - key: AugmentedQuery Observable, []> & QueryableStorageEntry; + key: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * Generic query **/ @@ -896,7 +935,7 @@ declare module '@polkadot/api-base/types/storage' { /** * Status of the inbound XCMP channels. **/ - inboundXcmpStatus: AugmentedQuery Observable>]>>>, []> & QueryableStorageEntry; + inboundXcmpStatus: AugmentedQuery Observable>, []> & QueryableStorageEntry; /** * The messages outbound in a given XCMP channel. **/ @@ -909,7 +948,19 @@ declare module '@polkadot/api-base/types/storage' { * case of the need to send a high-priority signal message this block. * The bool is true if there is a signal message waiting to be sent. **/ - outboundXcmpStatus: AugmentedQuery Observable>>, []> & QueryableStorageEntry; + outboundXcmpStatus: AugmentedQuery Observable>, []> & QueryableStorageEntry; + /** + * The messages that exceeded max individual message weight budget. + * + * These message stay in this storage map until they are manually dispatched via + * `service_overweight`. + **/ + overweight: AugmentedQuery Observable>>, [u64]> & QueryableStorageEntry; + /** + * The number of overweight messages ever recorded in `Overweight`. Also doubles as the next + * available free overweight index. + **/ + overweightCount: AugmentedQuery Observable, []> & QueryableStorageEntry; /** * The configuration which controls the dynamics of the outbound queue. **/ diff --git a/integration-tests/runtime-tests/src/types/interfaces/augment-api-tx.ts b/integration-tests/runtime-tests/src/types/interfaces/augment-api-tx.ts index fb25e1b6d58..b76239d0243 100644 --- a/integration-tests/runtime-tests/src/types/interfaces/augment-api-tx.ts +++ b/integration-tests/runtime-tests/src/types/interfaces/augment-api-tx.ts @@ -134,7 +134,7 @@ declare module '@polkadot/api-base/types/submittable' { * Set the balances of a given account. * * This will alter `FreeBalance` and `ReservedBalance` in storage. it will - * also decrease the total issuance of the system (`TotalIssuance`). + * also alter the total issuance of the system (`TotalIssuance`) appropriately. * If the new free or reserved balance is below the existential deposit, * it will reset the account nonce (`frame_system::AccountNonce`). * @@ -145,7 +145,6 @@ declare module '@polkadot/api-base/types/submittable' { * Transfer some liquid free balance to another account. * * `transfer` will set the `FreeBalance` of the sender and receiver. - * It will decrease the total issuance of the system by the `TransferFee`. * If the sender's account is below the existential deposit as a result * of the transfer, the account will be reaped. * @@ -265,10 +264,35 @@ declare module '@polkadot/api-base/types/submittable' { [key: string]: SubmittableExtrinsicFunction; }; collatorSelection: { + /** + * Deregister `origin` as a collator candidate. Note that the collator can only leave on + * session change. The `CandidacyBond` will be unreserved immediately. + * + * This call will fail if the total number of candidates would drop below `MinCandidates`. + * + * This call is not available to `Invulnerable` collators. + **/ leaveIntent: AugmentedSubmittable<() => SubmittableExtrinsic, []>; + /** + * Register this account as a collator candidate. The account must (a) already have + * registered session keys and (b) be able to reserve the `CandidacyBond`. + * + * This call is not available to `Invulnerable` collators. + **/ registerAsCandidate: AugmentedSubmittable<() => SubmittableExtrinsic, []>; + /** + * Set the candidacy bond amount. + **/ setCandidacyBond: AugmentedSubmittable<(bond: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128]>; + /** + * Set the ideal number of collators (not including the invulnerables). + * If lowering this number, then the number of running collators could be higher than this figure. + * Aside from that edge case, there should be no other way to have more collators than the desired number. + **/ setDesiredCandidates: AugmentedSubmittable<(max: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; + /** + * Set the list of invulnerable (fixed) collators. + **/ setInvulnerables: AugmentedSubmittable<(updated: Vec | (AccountId32 | string | Uint8Array)[]) => SubmittableExtrinsic, [Vec]>; /** * Generic tx @@ -1300,6 +1324,92 @@ declare module '@polkadot/api-base/types/submittable' { **/ [key: string]: SubmittableExtrinsicFunction; }; + liquidations: { + addLiqudationStrategy: AugmentedSubmittable<(configuraiton: PalletLiquidationsLiquidationStrategyConfiguration | { DutchAuction: any } | { UniswapV2: any } | { XcmDex: any } | string | Uint8Array) => SubmittableExtrinsic, [PalletLiquidationsLiquidationStrategyConfiguration]>; + /** + * Generic tx + **/ + [key: string]: SubmittableExtrinsicFunction; + }; + mosaic: { + /** + * Called by the relayer to confirm that it will relay a transaction, disabling the user + * from reclaiming their tokens. + * + * # Restrictions + * - Origin must be relayer + * - Outgoing transaction must exist for the user + * - Amount must be equal or lower than what the user has locked + * + * # Note + * - Reclaim period is not reset if not all the funds are moved; menaing that the clock + * remains ticking for the relayer to pick up the rest of the transaction. + **/ + acceptTransfer: AugmentedSubmittable<(from: AccountId32 | string | Uint8Array, assetId: u128 | AnyNumber | Uint8Array, amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [AccountId32, u128, u128]>; + /** + * Claims user funds from the `OutgoingTransactions`, in case that the relayer has not + * picked them up. + **/ + claimStaleTo: AugmentedSubmittable<(assetId: u128 | AnyNumber | Uint8Array, to: AccountId32 | string | Uint8Array) => SubmittableExtrinsic, [u128, AccountId32]>; + /** + * Collects funds deposited by the relayer into the owner's account + **/ + claimTo: AugmentedSubmittable<(assetId: u128 | AnyNumber | Uint8Array, to: AccountId32 | string | Uint8Array) => SubmittableExtrinsic, [u128, AccountId32]>; + /** + * Burns funds waiting in incoming_transactions that are still unclaimed. May be used by + * the relayer in case of finality issues on the other side of the bridge. + **/ + rescindTimelockedMint: AugmentedSubmittable<(assetId: u128 | AnyNumber | Uint8Array, account: AccountId32 | string | Uint8Array, untrustedAmount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u128, AccountId32, u128]>; + /** + * Rotates the Relayer Account + * + * # Restrictions + * - Only callable by the current relayer. + * - TTL must be sufficiently long. + **/ + rotateRelayer: AugmentedSubmittable<(updated: AccountId32 | string | Uint8Array, ttl: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [AccountId32, u32]>; + /** + * Sets the relayer budget for _incoming_ transactions for specific assets. Does not reset + * the current `penalty`. + * + * # Restrictions + * - Only callable by root + **/ + setBudget: AugmentedSubmittable<(assetId: u128 | AnyNumber | Uint8Array, amount: u128 | AnyNumber | Uint8Array, decay: PalletMosaicDecayBudgetPenaltyDecayer | { Linear: any } | string | Uint8Array) => SubmittableExtrinsic, [u128, u128, PalletMosaicDecayBudgetPenaltyDecayer]>; + /** + * Sets supported networks and maximum transaction sizes accepted by the relayer. + **/ + setNetwork: AugmentedSubmittable<(networkId: u32 | AnyNumber | Uint8Array, networkInfo: PalletMosaicNetworkInfo | { enabled?: any; maxTransferSize?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, PalletMosaicNetworkInfo]>; + /** + * Sets the current relayer configuration. This is enacted immediately and invalidates + * inflight, incoming transactions from the previous relayer. Budgets remain in place + * however. + **/ + setRelayer: AugmentedSubmittable<(relayer: AccountId32 | string | Uint8Array) => SubmittableExtrinsic, [AccountId32]>; + setTimelockDuration: AugmentedSubmittable<(period: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u32]>; + /** + * Mints new tokens into the pallet's wallet, ready for the user to be picked up after + * `lock_time` blocks have expired. + **/ + timelockedMint: AugmentedSubmittable<(assetId: u128 | AnyNumber | Uint8Array, to: AccountId32 | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array, lockTime: u32 | AnyNumber | Uint8Array, id: H256 | string | Uint8Array) => SubmittableExtrinsic, [u128, AccountId32, u128, u32, H256]>; + /** + * Creates an outgoing transaction request, locking the funds locally until picked up by + * the relayer. + * + * # Restrictions + * - Network must be supported. + * - AssetId must be supported. + * - Amount must be lower than the networks `max_transfer_size`. + * - Origin must have sufficient funds. + * - Transfers near Balance::max may result in overflows, which are caught and returned as + * an error. + **/ + transferTo: AugmentedSubmittable<(networkId: u32 | AnyNumber | Uint8Array, assetId: u128 | AnyNumber | Uint8Array, address: U8aFixed | string | Uint8Array, amount: u128 | AnyNumber | Uint8Array, keepAlive: bool | boolean | Uint8Array) => SubmittableExtrinsic, [u32, u128, U8aFixed, u128, bool]>; + /** + * Generic tx + **/ + [key: string]: SubmittableExtrinsicFunction; + }; multisig: { /** * Register approval for a dispatch to be made from a deterministic composite account if @@ -1520,6 +1630,36 @@ declare module '@polkadot/api-base/types/submittable' { **/ [key: string]: SubmittableExtrinsicFunction; }; + preimage: { + /** + * Register a preimage on-chain. + * + * If the preimage was previously requested, no fees or deposits are taken for providing + * the preimage. Otherwise, a deposit is taken proportional to the size of the preimage. + **/ + notePreimage: AugmentedSubmittable<(bytes: Bytes | string | Uint8Array) => SubmittableExtrinsic, [Bytes]>; + /** + * Request a preimage be uploaded to the chain without paying any fees or deposits. + * + * If the preimage requests has already been provided on-chain, we unreserve any deposit + * a user may have paid, and take the control of the preimage out of their hands. + **/ + requestPreimage: AugmentedSubmittable<(hash: H256 | string | Uint8Array) => SubmittableExtrinsic, [H256]>; + /** + * Clear an unrequested preimage from the runtime storage. + **/ + unnotePreimage: AugmentedSubmittable<(hash: H256 | string | Uint8Array) => SubmittableExtrinsic, [H256]>; + /** + * Clear a previously made request for a preimage. + * + * NOTE: THIS MUST NOT BE CALLED ON `hash` MORE TIMES THAN `request_preimage`. + **/ + unrequestPreimage: AugmentedSubmittable<(hash: H256 | string | Uint8Array) => SubmittableExtrinsic, [H256]>; + /** + * Generic tx + **/ + [key: string]: SubmittableExtrinsicFunction; + }; relayerXcm: { /** * Execute an XCM message from a local, signed, origin. @@ -1598,8 +1738,8 @@ declare module '@polkadot/api-base/types/submittable' { * an `AccountId32` value. * - `assets`: The assets to be withdrawn. The first item should be the currency used to to pay the fee on the * `dest` side. May not be empty. - * - `dest_weight`: Equal to the total weight on `dest` of the XCM message - * `Teleport { assets, effects: [ BuyExecution{..}, DepositAsset{..} ] }`. + * - `fee_asset_item`: The index into `assets` of the item which should be used to pay + * fees. * - `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase. **/ limitedTeleportAssets: AugmentedSubmittable<(dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, beneficiary: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, assets: XcmVersionedMultiAssets | { V0: any } | { V1: any } | string | Uint8Array, feeAssetItem: u32 | AnyNumber | Uint8Array, weightLimit: XcmV2WeightLimit | { Unlimited: any } | { Limited: any } | string | Uint8Array) => SubmittableExtrinsic, [XcmVersionedMultiLocation, XcmVersionedMultiLocation, XcmVersionedMultiAssets, u32, XcmV2WeightLimit]>; @@ -1637,8 +1777,8 @@ declare module '@polkadot/api-base/types/submittable' { * an `AccountId32` value. * - `assets`: The assets to be withdrawn. The first item should be the currency used to to pay the fee on the * `dest` side. May not be empty. - * - `dest_weight`: Equal to the total weight on `dest` of the XCM message - * `Teleport { assets, effects: [ BuyExecution{..}, DepositAsset{..} ] }`. + * - `fee_asset_item`: The index into `assets` of the item which should be used to pay + * fees. **/ teleportAssets: AugmentedSubmittable<(dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, beneficiary: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, assets: XcmVersionedMultiAssets | { V0: any } | { V1: any } | string | Uint8Array, feeAssetItem: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [XcmVersionedMultiLocation, XcmVersionedMultiLocation, XcmVersionedMultiAssets, u32]>; /** @@ -1658,7 +1798,7 @@ declare module '@polkadot/api-base/types/submittable' { /** * Anonymously schedule a task. **/ - schedule: AugmentedSubmittable<(when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, Option>, u8, Call]>; + schedule: AugmentedSubmittable<(when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Anonymously schedule a task after a delay. * @@ -1666,11 +1806,11 @@ declare module '@polkadot/api-base/types/submittable' { * Same as [`schedule`]. * # **/ - scheduleAfter: AugmentedSubmittable<(after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, Option>, u8, Call]>; + scheduleAfter: AugmentedSubmittable<(after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Schedule a named task. **/ - scheduleNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, u32, Option>, u8, Call]>; + scheduleNamed: AugmentedSubmittable<(id: Bytes | string | Uint8Array, when: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Schedule a named task after a delay. * @@ -1678,7 +1818,7 @@ declare module '@polkadot/api-base/types/submittable' { * Same as [`schedule_named`](Self::schedule_named). * # **/ - scheduleNamedAfter: AugmentedSubmittable<(id: Bytes | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: Call | { callIndex?: any; args?: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, u32, Option>, u8, Call]>; + scheduleNamedAfter: AugmentedSubmittable<(id: Bytes | string | Uint8Array, after: u32 | AnyNumber | Uint8Array, maybePeriodic: Option> | null | object | string | Uint8Array, priority: u8 | AnyNumber | Uint8Array, call: FrameSupportScheduleMaybeHashed | { Value: any } | { Hash: any } | string | Uint8Array) => SubmittableExtrinsic, [Bytes, u32, Option>, u8, FrameSupportScheduleMaybeHashed]>; /** * Generic tx **/ @@ -2178,6 +2318,22 @@ declare module '@polkadot/api-base/types/submittable' { [key: string]: SubmittableExtrinsicFunction; }; xcmpQueue: { + /** + * Services a single overweight XCM. + * + * - `origin`: Must pass `ExecuteOverweightOrigin`. + * - `index`: The index of the overweight XCM to service + * - `weight_limit`: The amount of weight that XCM execution may take. + * + * Errors: + * - `BadOverweightIndex`: XCM under `index` is not found in the `Overweight` storage map. + * - `BadXcm`: XCM under `index` cannot be properly decoded into a valid XCM format. + * - `WeightOverLimit`: XCM execution may use greater `weight_limit`. + * + * Events: + * - `OverweightServiced`: On success. + **/ + serviceOverweight: AugmentedSubmittable<(index: u64 | AnyNumber | Uint8Array, weightLimit: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [u64, u64]>; /** * Generic tx **/ @@ -2214,6 +2370,24 @@ declare module '@polkadot/api-base/types/submittable' { * messages correctly. **/ transferMultiasset: AugmentedSubmittable<(asset: XcmVersionedMultiAsset | { V0: any } | { V1: any } | string | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [XcmVersionedMultiAsset, XcmVersionedMultiLocation, u64]>; + /** + * Transfer several `MultiAsset` specifying the item to be used as fee + * + * `dest_weight` is the weight for XCM execution on the dest chain, and + * it would be charged from the transferred assets. If set below + * requirements, the execution may fail and assets wouldn't be + * received. + * + * `fee_item` is index of the MultiAssets that we want to use for + * payment + * + * It's a no-op if any error on local XCM execution or message sending. + * Note sending assets out per se doesn't guarantee they would be + * received. Receiving depends on if the XCM message could be delivered + * by the network, and if the receiving chain would handle + * messages correctly. + **/ + transferMultiassets: AugmentedSubmittable<(assets: XcmVersionedMultiAssets | { V0: any } | { V1: any } | string | Uint8Array, feeItem: u32 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [XcmVersionedMultiAssets, u32, XcmVersionedMultiLocation, u64]>; /** * Transfer `MultiAsset` specifying the fee and amount as separate. * @@ -2238,6 +2412,24 @@ declare module '@polkadot/api-base/types/submittable' { * messages correctly. **/ transferMultiassetWithFee: AugmentedSubmittable<(asset: XcmVersionedMultiAsset | { V0: any } | { V1: any } | string | Uint8Array, fee: XcmVersionedMultiAsset | { V0: any } | { V1: any } | string | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [XcmVersionedMultiAsset, XcmVersionedMultiAsset, XcmVersionedMultiLocation, u64]>; + /** + * Transfer several currencies specifying the item to be used as fee + * + * `dest_weight` is the weight for XCM execution on the dest chain, and + * it would be charged from the transferred assets. If set below + * requirements, the execution may fail and assets wouldn't be + * received. + * + * `fee_item` is index of the currencies tuple that we want to use for + * payment + * + * It's a no-op if any error on local XCM execution or message sending. + * Note sending assets out per se doesn't guarantee they would be + * received. Receiving depends on if the XCM message could be delivered + * by the network, and if the receiving chain would handle + * messages correctly. + **/ + transferMulticurrencies: AugmentedSubmittable<(currencies: Vec> | ([u128 | AnyNumber | Uint8Array, u128 | AnyNumber | Uint8Array])[], feeItem: u32 | AnyNumber | Uint8Array, dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, destWeight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic, [Vec>, u32, XcmVersionedMultiLocation, u64]>; /** * Transfer native currencies specifying the fee and amount as * separate. From af74eecfbad0fb62b3fb98edcff3da6269b68b25 Mon Sep 17 00:00:00 2001 From: Ben Luelo Date: Fri, 11 Feb 2022 14:31:40 -0500 Subject: [PATCH 09/15] Remove std feature from crowdloan-rewards-rpc --- frame/crowdloan-rewards/rpc/Cargo.toml | 42 +++++++------------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/frame/crowdloan-rewards/rpc/Cargo.toml b/frame/crowdloan-rewards/rpc/Cargo.toml index 27627fbbf73..dcfbaebdd02 100644 --- a/frame/crowdloan-rewards/rpc/Cargo.toml +++ b/frame/crowdloan-rewards/rpc/Cargo.toml @@ -11,44 +11,24 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] # FRAME -frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } # substrate primitives -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -sp-arithmetic = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } # local -composable-traits = { path = "../../composable-traits", default-features = false } -composable-support = { path = "../../composable-support", default-features = false } +composable-traits = { path = "../../composable-traits" } +composable-support = { path = "../../composable-support" } +crowdloan-rewards-runtime-api = { path = "../runtime-api" } -num-traits = { version = "0.2.14", default-features = false } -scale-info = { version = "1.0", default-features = false, features = [ - "derive", -] } - -crowdloan-rewards-runtime-api = { path = "../runtime-api", default-features = false } +# SCALE +codec = { features = ["derive"], package = "parity-scale-codec", version = "2.0.0" } +scale-info = { version = "1.0", features = ["derive"] } # rpc jsonrpc-core = "18.0.0" jsonrpc-core-client = "18.0.0" jsonrpc-derive = "18.0.0" - -# misc -codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "2.0.0" } - -[features] -default = ["std"] -std = [ - "composable-traits/std", - "composable-support/std", - "codec/std", - "frame-support/std", - "sp-runtime/std", - "sp-api/std", - "num-traits/std", -] From b6c7bcb0617f969ae49fe721e5a64d52f3ec0426 Mon Sep 17 00:00:00 2001 From: Ben Luelo Date: Fri, 11 Feb 2022 14:32:05 -0500 Subject: [PATCH 10/15] Clean up crowdloan-rewards-rpc --- frame/crowdloan-rewards/rpc/src/lib.rs | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/frame/crowdloan-rewards/rpc/src/lib.rs b/frame/crowdloan-rewards/rpc/src/lib.rs index 1cab53f8a7e..3f59fd45b1c 100644 --- a/frame/crowdloan-rewards/rpc/src/lib.rs +++ b/frame/crowdloan-rewards/rpc/src/lib.rs @@ -4,14 +4,13 @@ use crowdloan_rewards_runtime_api::CrowdloanRewardsRuntimeApi; use frame_support::{pallet_prelude::MaybeSerializeDeserialize, Parameter}; use jsonrpc_core::{Error as RpcError, ErrorCode, Result as RpcResult}; use jsonrpc_derive::rpc; -use num_traits::{CheckedAdd, CheckedMul, CheckedSub, Zero}; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; use sp_runtime::{ generic::BlockId, traits::{AtLeast32BitUnsigned, Block as BlockT}, }; -use sp_std::sync::Arc; +use sp_std::{marker::PhantomData, sync::Arc}; #[rpc] pub trait CrowdloanRewardsApi @@ -28,10 +27,8 @@ where /// A struct that implements the `CrowdloanRewardsApi`. pub struct CrowdloanRewards { - // If you have more generics, no need to Assets - // just use a tuple like Assets client: Arc, - _marker: sp_std::marker::PhantomData, + _marker: PhantomData, } impl CrowdloanRewards { @@ -46,21 +43,7 @@ impl CrowdloanRewardsApi<::Hash, where Block: BlockT, AccountId: Send + Sync + Parameter + MaybeSerializeDeserialize + Ord + 'static, - Balance: Send - + Sync - + Default - + Parameter - + Codec - + Copy - + Ord - + CheckedAdd - + CheckedSub - + CheckedMul - + AtLeast32BitUnsigned - + MaybeSerializeDeserialize - + Zero - + 'static - + SafeRpcWrapperType, + Balance: Send + Sync + 'static + SafeRpcWrapperType, C: Send + Sync + ProvideRuntimeApi + HeaderBackend + 'static, C::Api: CrowdloanRewardsRuntimeApi, { From 1c565d4f18c784cea3eb56942e6c90fb230b7e06 Mon Sep 17 00:00:00 2001 From: Ben Luelo Date: Fri, 11 Feb 2022 14:32:14 -0500 Subject: [PATCH 11/15] Update Cargo.lock --- Cargo.lock | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 63f9d56d951..934268c768c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1730,14 +1730,10 @@ dependencies = [ "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", - "num-traits", "parity-scale-codec", "scale-info", "sp-api", - "sp-arithmetic", "sp-blockchain", - "sp-core", - "sp-io", "sp-runtime", "sp-std", ] From 09190ef98e8960690e7992d99f517912f246f3a5 Mon Sep 17 00:00:00 2001 From: Ben Luelo Date: Fri, 11 Feb 2022 16:27:54 -0500 Subject: [PATCH 12/15] Update RPC docs --- docs/rpc.md | 209 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 165 insertions(+), 44 deletions(-) diff --git a/docs/rpc.md b/docs/rpc.md index 04515756cbc..0302d622f36 100644 --- a/docs/rpc.md +++ b/docs/rpc.md @@ -15,16 +15,6 @@ frame Cargo.toml ``` -Add the two new crates to the composable workspace file (top level Cargo.toml): - -```toml -members = [ - # add these lines - "frame/pallet-name/rpc", - "frame/pallet-name/runtime-api", -] -``` - ## Runtime API Crate ### In `Cargo.toml` @@ -43,9 +33,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -codec = { default-features = false, features = [ - "derive", -], package = "parity-scale-codec", version = "2.0.0" } +codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "2.0.0" } # ...any other dependencies, as per usual @@ -92,73 +80,72 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] # substrate primitives -sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -sp-blockchain = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } +sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.16" } -scale-info = { version = "1.0", default-features = false, features = ["derive"] } -codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "2.0.0" } +# SCALE +scale-info = { version = "1.0", features = ["derive"] } +codec = { version = "2.0.0", package = "parity-scale-codec", features = ["derive"] } -pallet-name-runtime-api = { path = "../runtime-api", default-features = false } +# local +pallet-name-runtime-api = { path = "../runtime-api" } # rpc jsonrpc-core = "18.0.0" jsonrpc-core-client = "18.0.0" jsonrpc-derive = "18.0.0" - -[features] -default = ["std"] -std = [ - "pallet-name-runtime-api/std", - "codec/std", - "sp-runtime/std", - "sp-api/std", -] ``` +Note that this crate will only be included in the node and not the runtime, so there is no need for a `std` feature. + ### In `lib.rs` Required imports: ```rust -use PALLET_NAME_runtime_api::PALLET_NAME_RuntimeApi; +use pallet_name_runtime_api::PalletNameRuntimeApi; use codec::Codec; use jsonrpc_core::{Error as RpcError, ErrorCode, Result as RpcResult}; use jsonrpc_derive::rpc; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; use sp_runtime::{generic::BlockId, traits::Block as BlockT}; -use sp_std::sync::Arc; +use sp_std::{sync::Arc, marker::PhantomData}; ``` -This defines the RPC itself; the name of the RPC needs to follow the pattern of `moduleName_functionName`. +This defines the RPC itself. The name of the RPC needs to follow the pattern of `moduleName_functionName`. + +**Note**: Any types that either are or are a wrapper type around `u128/i128` will need to be wrapped in `composable_support::rpc_helpers::SafeRpcWrapper`. ```rust #[rpc] -pub trait PALLET_NAME_Api +pub trait PalletNameApi where - GENERIC_PARAMATER: Codec, + GENERIC_PARAMETER: Codec, // if the type is a u128/i128, this should be SafeRpcWrapperType instead of Codec (Codec is a supertrait of SafeRpcWrapperType) { - // the name of the rpc must be module_function, where both module + // the name of the rpc must be moduleName_functionName, where both module // and function are camelCase and are seperated by an underscore. #[rpc(name = "palletName_rpcFunctionName")] fn rpc_function_name( &self, // any additional parameters here + // if the type is or wraps a 128 bit integer, it should be declared as follows: + u128_ish: SafeRpcWrapper at: Option, // `at` should be last ) -> RpcResult; } ``` -This is a struct that will inplement the above API. It contains the client to make the RPC calls. +This is a struct that will implement the above API. It contains the client to make the RPC calls. -If there are more generics, instead of adding more parameters (`Assets`), just use a tuple instead: `Assets`), just use a tuple instead: `PalletName { client: Arc, - _marker: sp_std::marker::PhantomData, + _marker: PhantomData, } impl PalletName { @@ -170,20 +157,24 @@ impl PalletName { ```rust impl - AssetsApi<::Hash, /* ...any generic parameters... */> - for Assets + PalletNameApi<::Hash, /* ...any generic parameters... */> + for PalletName where Block: BlockT, - GENERIC_PARAMETER: Codec + Send + Sync + 'static, // all generic parameters must have at least these bounds + // all generic parameters must have at least these bounds + // if the type is a u128/i128, this should be SafeRpcWrapperType instead of Codec (Codec is a supertrait of SafeRpcWrapperType) + GENERIC_PARAMETER: Codec + Send + Sync + 'static, C: Send + Sync + 'static, C: ProvideRuntimeApi, C: HeaderBackend, - C::Api: AssetsRuntimeApi, + C::Api: PalletNameRuntimeApi, { fn rpc_function_name( &self, // any additional parameters here - at: Option<::Hash>, // `at` must be last + // if the type is or wraps a 128 bit integer, it should be declared as follows: + u128_ish: SafeRpcWrapper + at: Option<::Hash>, // `at` should be last ) -> RpcResult { let api = self.client.runtime_api(); let at = BlockId::hash(at.unwrap_or_else(|| { @@ -274,6 +265,136 @@ Note that this assumes that the pallet has already been added to the runtime and ## Integration Tests -## Also see +/home/ben/codeprojects/composable/integration-tests/runtime-tests/src/types/interfaces/definitions.ts + +### Type Definitions + +Create a folder here: `integration-tests/runtime-tests/src/types/interfaces/pallet-name` + +And then within that folder, create a file `defintions.ts` with the following structure: + +```typescript +export default { + rpc: { + // the functionName part of the RPC call as defined in the `#[rpc(name="")]` annotation on the rust definition + rpcFunctionName: { + description: "Provide a short description of the RPC here.", + params: [ + // define the paramaters in the same order as defined in the rust RPC + { + name: "parameter_name", + type: "ParameterType" + }, + // see note below + { + name: "at", + type: "Hash", + isOptional: true, + }, + ], + type: "ReturnType" + }, + // if there are multiple RPCs, they can all be defined here + }, + types: { + // define any custom types for the pallet here + // see the note below for more information + }, +}; +``` + +Then, in `integration-tests/runtime-tests/src/types/interfaces/definitions.ts`, add the following line: + +```typescript +export { default as palletName } from "./palletName/definitions"; +``` + +Notes: + +* `at` is mandatory, and is defined as the last parameter in the rust RPC definition for a reason: + Most of the time when calling an RPC the block hash can be omitted, and the best hash will be assumed if one is not provided. + + Having it as the last parameter makes calling the RPC simpler: + + ```typescript + palletName.rpcFunctionName(param1, param2) + ``` + + Instead of: + + ```typescript + palletName.rpcFunctionName(null, param1, param2) + ``` + + If `at` were defined first. + + Technically, it is possible to define `at` anywhere in the RPC definition, but putting it last for all of them makes the RPCs simpler and more consistent. + +* If this is a preexisting pallet, they are most likely already defined in the type definitions for `crowdloanRewards` (for reasons that don't need to be covered in this document) and can just be moved over to this file. + + Even if there are no types to declare, still define an empty object or else everything will explode. + +### Tests + +Create a folder here: `integration-tests/runtime-tests/src/tests/rpc/pallet-name` + +And then within that folder, create a file `rpcPalletName.ts` with the following structure: + +```typescript +/* eslint-disable no-trailing-spaces */ +import { /* any custom defined types that are needed for the RPC */ } from '@composable/types/interfaces'; +import { expect } from 'chai'; + + +export class RpcPalletNameTests { + /** + * + */ + public static runRpcPalletNameTests() { + describe('rpc.palletName.functionName Tests', function () { + it('STUB', async () => { + const result = await RpcPalletNameTests.rpcPalletNameTest(/* parameters */); + // see note below about bignumbers + // (this is just an example assertion) + expect(result).to.be.a["bignumber"].that.equals('0'); + }); + }); + } + + /** + * + */ + private static async rpcPalletNameTest(/* parameters */) { + // api is a global variable + return await api.rpc.palletName.functionName(/* parameters */); + } +} + +// Uncomment to debug +// RpcPalletNameTests.runRpcPalletNameTests(); +``` + +Finally, in `integration-tests/runtime-tests/src/test.ts`, import the above class and add it's tests to the `RPC Tests` test suite: + +```typescript +// ...stub... +import { RpcPalletNameTests } from '@composable/tests/rpc/palletName/rpcPalletNameTests'; // <- add this + +describe('Picasso Runtime Tests', function () { + // ...stub... + describe('RPC Tests', function () { + // ...stub... + RpcPalletNameTests.runRpcPalletNameTests() // <- add this + }); +}); +``` + +Notes: + +* If the type being compared against is a `u128`/`i128` on the rust side and has been wrapped in `SafeRpcWrapper`, it will be a bn.js `BN` (big number) here. `chai-bn` is used for asssertions with `BN`s but typescript can't quite figure out that it's being used; using `["bignumber"]` instead of `.bignumber` circumvents the typechecker a bit and allows it to pass without a `@ts-ignore` comment. + + Thanks Dominik for figuring this one out! + +## Additional Resources For a good overview of how custom RPCs work, see . From ce4b7951cf0188f5f44a80f3b1cc8085043c13ea Mon Sep 17 00:00:00 2001 From: Ben Luelo Date: Fri, 11 Feb 2022 16:28:45 -0500 Subject: [PATCH 13/15] Clean up RPC tests --- integration-tests/runtime-tests/src/test.ts | 14 +++++++------- .../crowdloanRewards/rpcCrowdloanRewardsTests.ts | 1 - .../src/types/interfaces/definitions.ts | 4 +--- .../runtime-tests/src/utils/testSetup.ts | 4 ---- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/integration-tests/runtime-tests/src/test.ts b/integration-tests/runtime-tests/src/test.ts index 3426b0d80d1..b3f486ee739 100644 --- a/integration-tests/runtime-tests/src/test.ts +++ b/integration-tests/runtime-tests/src/test.ts @@ -8,25 +8,25 @@ import { TxCrowdloanRewardsTests } from '@composable/tests/tx/crowdloanRewards/t import { TxBondedFinanceTests } from "@composable/tests/tx/bondedFinance/txBondedFinanceTests"; import { runBefore, runAfter } from "@composable/utils/testSetup"; import { TxOracleTests } from "@composable/tests/tx/oracle/txOracleTests"; -import { RpcAssetsTests } from './tests/rpc/assets/rpcAssetsTests'; -import { RpcCrowdloanRewardsTests } from './tests/rpc/crowdloanRewards/rpcCrowdloanRewardsTests'; +import { RpcAssetsTests } from '@composable/tests/rpc/assets/rpcAssetsTests'; +import { RpcCrowdloanRewardsTests } from '@composable/tests/rpc/crowdloanRewards/rpcCrowdloanRewardsTests'; -describe('Picasso Runtime Tests', function() { +describe('Picasso Runtime Tests', function () { before(async function () { // Set timeout to 1 minute. - this.timeout(60*1000); + this.timeout(60 * 1000); await runBefore(); }); - after(async function() { + after(async function () { // Set timeout to 1 minute. - this.timeout(60*1000); + this.timeout(60 * 1000); await runAfter(); }); // Query Tests - describe('Query Tests', function() { + describe('Query Tests', function () { // Query Crowdloan Rewards Tests QueryCrowdloanRewardsTests.runQueryCrowdloanRewardsTests(); }); diff --git a/integration-tests/runtime-tests/src/tests/rpc/crowdloanRewards/rpcCrowdloanRewardsTests.ts b/integration-tests/runtime-tests/src/tests/rpc/crowdloanRewards/rpcCrowdloanRewardsTests.ts index 30898d76101..0eb8e755390 100644 --- a/integration-tests/runtime-tests/src/tests/rpc/crowdloanRewards/rpcCrowdloanRewardsTests.ts +++ b/integration-tests/runtime-tests/src/tests/rpc/crowdloanRewards/rpcCrowdloanRewardsTests.ts @@ -1,5 +1,4 @@ /* eslint-disable no-trailing-spaces */ -import { ApiPromise } from '@polkadot/api'; import { expect } from 'chai'; diff --git a/integration-tests/runtime-tests/src/types/interfaces/definitions.ts b/integration-tests/runtime-tests/src/types/interfaces/definitions.ts index d445fd1fb37..81fe2c7247c 100644 --- a/integration-tests/runtime-tests/src/types/interfaces/definitions.ts +++ b/integration-tests/runtime-tests/src/types/interfaces/definitions.ts @@ -1,4 +1,2 @@ export { default as crowdloanRewards } from "./crowdloanRewards/definitions"; -export { default as assets } from "./assets/definitions"; -// export { default as composableTraits } from "./composableTraits/definitions"; -// export { default as dutchAuction } from "./dutchAuction/definitions"; +export { default as assets } from "./assets/definitions"; \ No newline at end of file diff --git a/integration-tests/runtime-tests/src/utils/testSetup.ts b/integration-tests/runtime-tests/src/utils/testSetup.ts index 8aa1c4327ea..053d5407c48 100644 --- a/integration-tests/runtime-tests/src/utils/testSetup.ts +++ b/integration-tests/runtime-tests/src/utils/testSetup.ts @@ -18,12 +18,8 @@ export async function runBefore() { // Enable and inject BN dependency chai.use(require('chai-bn')(BN)); - - // console.log(JSON.stringify(definitions, null, 4)); const rpc = Object.keys(definitions).reduce((accumulator, key) => ({ ...accumulator, [key]: definitions[key].rpc }), {}); const types = Object.values(definitions).reduce((accumulator, { types }) => ({ ...accumulator, ...types }), {}); - // console.log("rpc: ", JSON.stringify(rpc, null, 4)); - // console.log("types: ", JSON.stringify(types, null, 4)); global.endpoint = `ws://${args.h}:${args.p}`; const provider = new WsProvider(global.endpoint); From 8068e40c39e446a7ddad53a9361c4b763e63e32f Mon Sep 17 00:00:00 2001 From: Ben Luelo Date: Fri, 11 Feb 2022 19:38:07 -0500 Subject: [PATCH 14/15] Remove unused imports in crowdloan-rewards-rpc --- frame/crowdloan-rewards/rpc/src/lib.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/frame/crowdloan-rewards/rpc/src/lib.rs b/frame/crowdloan-rewards/rpc/src/lib.rs index 3f59fd45b1c..c0439e320d0 100644 --- a/frame/crowdloan-rewards/rpc/src/lib.rs +++ b/frame/crowdloan-rewards/rpc/src/lib.rs @@ -1,4 +1,3 @@ -use codec::Codec; use composable_support::rpc_helpers::{SafeRpcWrapper, SafeRpcWrapperType}; use crowdloan_rewards_runtime_api::CrowdloanRewardsRuntimeApi; use frame_support::{pallet_prelude::MaybeSerializeDeserialize, Parameter}; @@ -6,10 +5,7 @@ use jsonrpc_core::{Error as RpcError, ErrorCode, Result as RpcResult}; use jsonrpc_derive::rpc; use sp_api::ProvideRuntimeApi; use sp_blockchain::HeaderBackend; -use sp_runtime::{ - generic::BlockId, - traits::{AtLeast32BitUnsigned, Block as BlockT}, -}; +use sp_runtime::{generic::BlockId, traits::Block as BlockT}; use sp_std::{marker::PhantomData, sync::Arc}; #[rpc] From f5592d5983cff7f2a986ff4c62e82931709d75ed Mon Sep 17 00:00:00 2001 From: Ben Luelo Date: Mon, 14 Feb 2022 08:35:08 -0500 Subject: [PATCH 15/15] Update Cargo.lock --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 934268c768c..48edf7636da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6508,7 +6508,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" +source = "git+https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.16#4aeb95f7f38fcd519e2628f32f79044a8fef99d5" dependencies = [ "frame-benchmarking", "frame-support",