From 35c2346e1bb263b4b2d777170d721442538d5255 Mon Sep 17 00:00:00 2001 From: Matthew Orris <1466844+mattheworris@users.noreply.github.com> Date: Fri, 5 Jan 2024 13:07:48 -0700 Subject: [PATCH] Replace Currency->fungible trait migration for time-release pallet (#1818) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Goal The goal of this PR is to replace the `Currency` trait with the `fungible` trait in the `time-release` pallet. This work was split from PR #1779. Closes #942 Closes #1833 # Discussion The following Parity issues/PRs were used as references for changes: [Deprecate Currency - PR 12951](https://github.com/paritytech/substrate/pull/12951) (Explanation of necessary changes.) [FRAME: Move pallets over to use fungible traits](https://github.com/paritytech/polkadot-sdk/issues/226) (Issue to track Parity's efforts to update their pallets.) [pallet vesting / update to use fungible](https://github.com/paritytech/polkadot-sdk/pull/1760/files) (Example of some necessary changes.) [Fungibles: migrate Democracy pallet](https://github.com/paritytech/polkadot-sdk/pull/1861) (Example of storage migration for Locks->Freezes.) # Changes - Replaced traits as needed: Use `tokens::fungible::` - `InspectFungible` for `balance()` and `reducible_balance()` - `InspectFreeze` for `balance_frozen()` - `Mutate` for `set_balance()`, `mint_into()` - `MutateFreeze` for `set_freeze()`, and `thaw()` - Added `pub enum FreezeReason` to support `freezes` - Updated error handling as `set_freeze()` and `thaw()` can fail, so errors needed to be propagated. - Updated runtime pallet configs to use BalancesMaxXXXXXs - Updated tests with `.expect()` where `set_freeze()` or `thaw()` can fail. - `FreezeIdentifier` and `RuntimeFreezeReason` configured with defaults. - Updated time-release pallet to propagate errors from set_freeze/thaw. - Added v2 migration to TimeRelease. # Storage Migrations The value of `BalancesMaxFreezes` has been updated, which will impact the storage of the Balances pallet by changing `T::MaxFreezes`, see the code here: [substrate/frame/balances/src/lib.rs:480](https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.1.0/substrate/frame/balances/src/lib.rs#L480) ```rust /// Freeze locks on account balances. #[pallet::storage] pub type Freezes, I: 'static = ()> = StorageMap< _, Blake2_128Concat, T::AccountId, BoundedVec, T::MaxFreezes>, ValueQuery, >; ``` The previous value of `T::MaxFreezes` was `0` so no data could be stored in `Freezes`, therefore no storage migration for `Freezes` is needed for this change. Even if there was data in storage, it would only need to be migrated if `T::MaxFreezes` is *decreased*. However, the current chain has data in `Locks` that needs to migrated to `Freezes`. Testing has shown that these `Locks` will no longer be accessible once the new traits are in place. The `Balances` pallet is configured to store account data using the `System` pallet. Therefore, these two pallets must be included when using `try-runtime` for testing. The migration for `TimeRelease` will access its storage to determine which accounts have `Locks` that need to be translated to `Freezes`. Then, the old `Currency` trait is used to remove the `Locks` and the new `fungible` trait is used to set the `Freeze`. # How to Review - [x] Read through [Deprecate Currency - PR 12951](https://github.com/paritytech/substrate/pull/12951) to understand context and check that Currency traits were properly replaced with fungible traits. - [ ] Check impact of changing to `set_freeze()` and `thaw()` which can now fail and make sure all error states are propagated correctly without possibility for `panic` - [ ] Check if `balance()` is used correctly, or should be changed to `reducible_balance()`. The calculations evaluating the Existential Deposit (ED) have been updated and Parity comments indicate that `reducible_balance()` is most likely the value needed. - [ ] Ensure that the migration weights calculations are correct. (Please let me know if you would like to walk through the migration code path together). # How to Test Runtime Migrations [Install the CLI version of try-runtime](https://paritytech.github.io/try-runtime-cli/try_runtime/#installation), then run try-runtime to test the migration against Frequency Rococo: ```bash cargo build --release --features frequency-rococo-testnet,try-runtime && \ try-runtime --runtime ./target/release/wbuild/frequency-runtime/frequency_runtime.wasm on-runtime-upgrade live --uri wss://rpc.rococo.frequency.xyz:443 --pallet TimeRelease --pallet Balances --pallet System ``` Alternatively, you can use the non-release version for faster compiles: ```bash cargo build --features frequency-rococo-testnet,try-runtime && \ try-runtime --runtime ./target/debug/wbuild/frequency-runtime/frequency_runtime.wasm on-runtime-upgrade live --uri wss://rpc.rococo.frequency.xyz:443 --pallet TimeRelease --pallet Balances --pallet System ``` And for testing on main-net: ```bash cargo build --features frequency,try-runtime && \ try-runtime --runtime ./target/debug/wbuild/frequency-runtime/frequency_runtime.wasm on-runtime-upgrade live --uri wss://1.rpc.frequency.xyz:443 --pallet Balances --pallet System --pallet TimeRelease ``` Testing with a snapshot: ```bash # create a snapshot (or use existing one) try-runtime create-snapshot --uri https:://rpc.rococo.frequency.xyz:443 testnet-all-pallets.state # use the testnet snapshot cargo build --features frequency-rococo-testnet,try-runtime && \ try-runtime --runtime ./target/debug/wbuild/frequency-runtime/frequency_runtime.wasm on-runtime-upgrade \ snap --path testnet-all-pallets.state # use the mainnet snapshot cargo build --features frequency,try-runtime && \ try-runtime --runtime ./target/debug/wbuild/frequency-runtime/frequency_runtime.wasm on-runtime-upgrade \ snap --path mainnet-all-pallets.state ``` You should see output like this: ```bash [2023-12-20T22:06:50Z INFO runtime::time-release] Running pre_upgrade... [2023-12-20T22:06:50Z INFO runtime::time-release] Finish pre_upgrade for 6 records [2023-12-20T22:06:50Z INFO runtime::time-release] Running storage migration... [2023-12-20T22:06:50Z INFO runtime::time-release] 🔄 Time Release Locks->Freezes migration started [2023-12-20T22:06:50Z INFO runtime::time-release] 🔄 migrated account 0x702cfcc9149d3c6f65728d3a5312d66a83fb70ed942cedb8e6450f4198ce7a77, amount:1000000000 [2023-12-20T22:06:50Z INFO runtime::time-release] 🔄 migrated account 0xce3bcb8ac19cdeb3ee14173be5f474292ff11ae56d4d0fa3f2bdaf24b4ef5842, amount:10000000000000 [2023-12-20T22:06:50Z INFO runtime::time-release] 🔄 migrated account 0x041a99f3614052bdd5b0aed6ed5805f592aacbcc0d5a443821f3b4339c44c11f, amount:400000050 [2023-12-20T22:06:50Z INFO runtime::time-release] 🔄 migrated account 0x26db9b4eeb5b5d511abd26903a25578f355e34e33316aeb2d34e846045cc7e45, amount:10000000000 [2023-12-20T22:06:50Z INFO runtime::time-release] 🔄 migrated account 0xc8d6262ff9fc322e59bcd36a36e310cfc7c50134e309a82f4330648e2eff7368, amount:1411 [2023-12-20T22:06:50Z INFO runtime::time-release] 🔄 migrated account 0x485dc3b17bcebba3013e47150e588c941a1f9778378367125e98a2e8f140325e, amount:3000000000 [2023-12-20T22:06:50Z INFO runtime::time-release] total accounts migrated from locks to frozen 6 [2023-12-20T22:06:50Z INFO runtime::time-release] 🔄 Time Release migration finished [2023-12-20T22:06:50Z INFO runtime::time-release] Time Release Migration calculated weight = Weight { ref_time: 4525000000, proof_size: 0 } [2023-12-20T22:06:50Z INFO runtime::time-release] ✅ migration post_upgrade checks passed ``` The total weight calculated for the TimeRelease migration on testnet: ```bash [2023-12-18T14:50:36Z INFO runtime::time-release] total accounts migrated from locks to frozen 6 [2023-12-18T14:50:36Z INFO runtime::time-release] 🔄 Time Release migration finished [2023-12-18T14:50:36Z INFO runtime::time-release] Time Release Migration calculated weight = Weight { ref_time: 4525000000, proof_size: 0 } [2023-12-18T14:50:36Z INFO runtime::time-release] ✅ migration post_upgrade checks passed ``` The total weight calculated for the TimeRelease migration on mainnet: ```bash [2023-12-18T14:57:04Z INFO runtime::time-release] 🔄 Time Release migration finished [2023-12-18T14:57:04Z INFO runtime::time-release] Time Release Migration calculated weight = Weight { ref_time: 16525000000, proof_size: 0 } [2023-12-18T14:57:04Z INFO runtime::time-release] ✅ migration post_upgrade checks passed ``` # Upgrade Notes 1. `scripts/upgrade_accounts.py` should be executed to ensure that all accounts have been upgraded before running the migration. This step may be a no-op, if all accounts have previously been upgraded. # Checklist - [x] Chain spec updated - [ ] Custom RPC OR Runtime API added/changed? Updated js/api-augment. - [ ] Design doc(s) updated - [ ] Tests added - [ ] Benchmarks added - [ ] Weights updated --------- Co-authored-by: Matthew Orris <--help> Co-authored-by: Aramik Co-authored-by: Robert La Ferla --- Cargo.lock | 237 +++-- Makefile | 2 +- e2e/package-lock.json | 1128 +++++++++++++-------- pallets/time-release/Cargo.toml | 5 +- pallets/time-release/README.md | 4 +- pallets/time-release/src/benchmarking.rs | 10 +- pallets/time-release/src/lib.rs | 143 +-- pallets/time-release/src/migration/mod.rs | 2 + pallets/time-release/src/migration/v2.rs | 278 +++++ pallets/time-release/src/mock.rs | 18 +- pallets/time-release/src/tests.rs | 258 +++-- pallets/time-release/src/types.rs | 6 +- runtime/frequency/src/lib.rs | 12 +- 13 files changed, 1394 insertions(+), 709 deletions(-) create mode 100644 pallets/time-release/src/migration/mod.rs create mode 100644 pallets/time-release/src/migration/v2.rs diff --git a/Cargo.lock b/Cargo.lock index a25b3e2444..ffbfa0ef77 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -98,7 +98,7 @@ dependencies = [ "getrandom 0.2.11", "once_cell", "version_check", - "zerocopy 0.7.31", + "zerocopy 0.7.32", ] [[package]] @@ -196,9 +196,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "59d2a3357dde987206219e78ecfbbb6e8dad06cbb65292758d3270e6254f7355" [[package]] name = "apache-avro" @@ -531,7 +531,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" dependencies = [ "concurrent-queue", - "event-listener 4.0.0", + "event-listener 4.0.1", "event-listener-strategy", "futures-core", "pin-project-lite 0.2.13", @@ -617,7 +617,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c" dependencies = [ - "event-listener 4.0.0", + "event-listener 4.0.1", "event-listener-strategy", "pin-project-lite 0.2.13", ] @@ -658,7 +658,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -687,13 +687,13 @@ checksum = "e1d90cd0b264dfdd8eb5bad0a2c217c1f88fa96a8573f40e7b12de23fb468f46" [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "fdf6721fb0140e4f897002dd086c06f6c27775df19cfe1fccb21181a48fd2c98" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -749,7 +749,7 @@ dependencies = [ "cfg-if", "libc", "miniz_oxide", - "object 0.32.1", + "object 0.32.2", "rustc-demangle", ] @@ -850,7 +850,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -1298,7 +1298,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -1673,21 +1673,20 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.16" +version = "0.9.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" +checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset 0.9.0", ] [[package]] name = "crossbeam-queue" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9bcf5bdbfdd6030fb4a1c497b5d5fc5921aa2f60d359a17e249c0e6df3de153" +checksum = "adc6598521bb5a83d491e8c1fe51db7296019d2ca3cb93cc6c2a20369a4d78a2" dependencies = [ "cfg-if", "crossbeam-utils", @@ -1695,9 +1694,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.17" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" +checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" dependencies = [ "cfg-if", ] @@ -2023,7 +2022,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -2287,7 +2286,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -2327,7 +2326,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -2344,7 +2343,7 @@ checksum = "5c6888cd161769d65134846d4d4981d5a6654307cc46ec83fb917e530aea5f84" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -2545,7 +2544,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -2586,7 +2585,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.41", + "syn 2.0.43", "termcolor", "toml 0.8.2", "walkdir", @@ -2765,7 +2764,7 @@ checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -2776,7 +2775,7 @@ checksum = "c2ad8cef1d801a4686bfd8919f0b30eac4c8e48968c437a6405ded4fb5272d2b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -2846,9 +2845,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770d968249b5d99410d61f5bf89057f3199a077a04d087092f58e7d10692baae" +checksum = "84f2cdcf274580f2d63697192d744727b3198894b1bf02923643bf59e2c26712" dependencies = [ "concurrent-queue", "parking", @@ -2861,7 +2860,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ - "event-listener 4.0.0", + "event-listener 4.0.1", "pin-project-lite 0.2.13", ] @@ -2908,7 +2907,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -3187,7 +3186,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -3314,7 +3313,7 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -3326,7 +3325,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -3336,7 +3335,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -3659,9 +3658,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -3674,9 +3673,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -3684,15 +3683,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -3702,9 +3701,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -3736,13 +3735,13 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -3758,15 +3757,15 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" @@ -3776,9 +3775,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -5362,7 +5361,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -5376,7 +5375,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -5387,7 +5386,7 @@ checksum = "d710e1214dffbab3b5dacb21475dde7d6ed84c69ff722b3a47a782668d44fbac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -5398,7 +5397,7 @@ checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -5471,15 +5470,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - [[package]] name = "memory-db" version = "0.32.0" @@ -5953,9 +5943,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] @@ -7108,7 +7098,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -7221,6 +7211,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "pallet-balances", "parity-scale-codec", "scale-info", @@ -7633,7 +7624,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -7687,7 +7678,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -7716,7 +7707,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -7760,9 +7751,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" [[package]] name = "platforms" @@ -9086,7 +9077,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -9170,14 +9161,14 @@ checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" dependencies = [ "unicode-ident", ] @@ -9216,7 +9207,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -9537,7 +9528,7 @@ checksum = "2566c4bf6845f2c2e83b27043c3f5dfcd5ba8f2937d6c00dc009bfb51a079dc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -10102,7 +10093,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -11062,7 +11053,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -11329,7 +11320,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -11345,9 +11336,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -11729,7 +11720,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -11968,7 +11959,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot dependencies = [ "quote", "sp-core-hashing", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -11987,7 +11978,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -12204,7 +12195,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -12396,7 +12387,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -12724,7 +12715,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -12936,9 +12927,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.41" +version = "2.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c8b28c477cc3bf0e7966561e3460130e1255f7a1cf71931075f1c5e7a7e269" +checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" dependencies = [ "proc-macro2", "quote", @@ -13033,9 +13024,9 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.51" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7" +checksum = "83a48fd946b02c0a526b2e9481c8e2a17755e47039164a86c4070446e3a4614d" dependencies = [ "thiserror-impl", ] @@ -13057,18 +13048,18 @@ checksum = "e4c60d69f36615a077cc7663b9cb8e42275722d23e58a7fa3d2c7f2915d09d04" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] name = "thiserror-impl" -version = "1.0.51" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" +checksum = "e7fbe9b594d6568a6a1443250a7e67d80b74e1e96f6d1715e1e21cc1888291d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -13132,9 +13123,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", @@ -13152,9 +13143,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -13204,9 +13195,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -13229,7 +13220,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -13409,7 +13400,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -13453,7 +13444,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -13838,7 +13829,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", "wasm-bindgen-shared", ] @@ -13872,7 +13863,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -14170,7 +14161,7 @@ dependencies = [ "log", "mach", "memfd", - "memoffset 0.8.0", + "memoffset", "paste", "rand 0.8.5", "rustix 0.36.17", @@ -14618,9 +14609,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.28" +version = "0.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c830786f7720c2fd27a1a0e27a709dbd3c4d009b56d098fc742d4f4eab91fe2" +checksum = "9b5c3db89721d50d0e2a673f5043fc4722f76dcc352d7b1ab8b8288bed4ed2c5" dependencies = [ "memchr", ] @@ -14693,7 +14684,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -14737,11 +14728,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.31" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ - "zerocopy-derive 0.7.31", + "zerocopy-derive 0.7.32", ] [[package]] @@ -14752,18 +14743,18 @@ checksum = "125139de3f6b9d625c39e2efdd73d41bdac468ccd556556440e322be0e1bbd91" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] name = "zerocopy-derive" -version = "0.7.31" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] @@ -14783,7 +14774,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.43", ] [[package]] diff --git a/Makefile b/Makefile index a70d849750..6216defc9c 100644 --- a/Makefile +++ b/Makefile @@ -81,7 +81,7 @@ lint-audit: format-lint: format lint .PHONY: ci-local -ci-local: check lint lint-audit test e2e-tests +ci-local: check lint lint-audit test js e2e-tests .PHONY: upgrade upgrade-local: diff --git a/e2e/package-lock.json b/e2e/package-lock.json index f7ffbdae0c..9519ceaf1f 100644 --- a/e2e/package-lock.json +++ b/e2e/package-lock.json @@ -60,29 +60,35 @@ } }, "node_modules/@achingbrain/nat-port-mapper/node_modules/@libp2p/interface": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-1.0.2.tgz", - "integrity": "sha512-z/3Yyg+7cVyzRXwzdrDkJd7YmNaLE9iZjQaixo5luI/n9uk5OFFjb9ulAsNqpq8V1xylCo2DXIC7f94KClwzVw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-1.1.0.tgz", + "integrity": "sha512-URIKSFtaliBGA8sIg/MGfyjIo5h4jAdfuZl6dXXXmtdfC3X0rry95YuLNYzXtGMuxG/X+pbVht3fykHvPiXUhg==", "dependencies": { "@multiformats/multiaddr": "^12.1.10", "it-pushable": "^3.2.1", "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", + "multiformats": "^13.0.0", + "progress-events": "^1.0.0", "uint8arraylist": "^2.4.3" } }, "node_modules/@achingbrain/nat-port-mapper/node_modules/@libp2p/logger": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-4.0.2.tgz", - "integrity": "sha512-J9UMtMU9BKXNp+3c5kcI7HyWOPYg2B2E6sn1gEQckiSexTaz0wKJSlgTZ89f9F8bkC3AaC8ybXYuHbFQhwpTIg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-4.0.3.tgz", + "integrity": "sha512-AydOzxLfJtfu7K/kjCRkO15llrr8Pc6BXVSOWVGFBCZ9e5+YHDuj8z5Pyc0YsXElMb/6hClGDJhw7nM8/EVqDA==", "dependencies": { - "@libp2p/interface": "^1.0.2", + "@libp2p/interface": "^1.1.0", "@multiformats/multiaddr": "^12.1.10", "debug": "^4.3.4", "interface-datastore": "^8.2.0", - "multiformats": "^12.1.3" + "multiformats": "^13.0.0" } }, + "node_modules/@achingbrain/nat-port-mapper/node_modules/multiformats": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.0.0.tgz", + "integrity": "sha512-xiIB0p7EKmETm3wyKedOg/xuyQ18PoWwXCzzgpZAiDxL9ktl3XTh8AqoDT5kAqRg+DU48XAGPsUJL2Rn6Bx3Lw==" + }, "node_modules/@achingbrain/ssdp": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/@achingbrain/ssdp/-/ssdp-4.0.6.tgz", @@ -140,6 +146,14 @@ "npm": ">=8.7.0" } }, + "node_modules/@chainsafe/libp2p-gossipsub/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/@chainsafe/libp2p-noise": { "version": "13.0.5", "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-13.0.5.tgz", @@ -170,6 +184,14 @@ "npm": ">=7.0.0" } }, + "node_modules/@chainsafe/libp2p-noise/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/@chainsafe/libp2p-yamux": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@chainsafe/libp2p-yamux/-/libp2p-yamux-5.0.4.tgz", @@ -251,10 +273,32 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@eslint/js": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.55.0.tgz", - "integrity": "sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", + "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -263,7 +307,7 @@ "node_modules/@frequency-chain/api-augment": { "version": "0.0.0", "resolved": "file:../js/api-augment/dist/frequency-chain-api-augment-0.0.0.tgz", - "integrity": "sha512-APYNkdACbNLXSluVIML0V2rrQKlDTAh7bWNlKyZ6VuMXL8MY9wTQPHfTrdktccpYxkjZ8G4yD6i5rWjr9FB2ow==", + "integrity": "sha512-ZL96v2F9K9ycMJvh32AmEbZPSm+RTxWqPxbSJx48Pm2yM5owJ09Z7xBv3LrqMsK8gtBpKav+mmS/o87oVqD9ag==", "license": "Apache-2.0", "dependencies": { "@polkadot/api": "^10.9.1", @@ -292,6 +336,14 @@ "uint8arrays": "^4.0.6" } }, + "node_modules/@helia/delegated-routing-v1-http-api-client/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/@helia/interface": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@helia/interface/-/interface-2.1.0.tgz", @@ -344,6 +396,28 @@ "node": ">=10.10.0" } }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -364,43 +438,58 @@ "dev": true }, "node_modules/@ipld/dag-cbor": { - "version": "9.0.6", - "resolved": "https://registry.npmjs.org/@ipld/dag-cbor/-/dag-cbor-9.0.6.tgz", - "integrity": "sha512-3kNab5xMppgWw6DVYx2BzmFq8t7I56AGWfp5kaU1fIPkwHVpBRglJJTYsGtbVluCi/s/q97HZM3bC+aDW4sxbQ==", + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/@ipld/dag-cbor/-/dag-cbor-9.0.7.tgz", + "integrity": "sha512-bZMZWTtrJnIm2YjWijIB2EIGdba8kZRO55i+7RMnCHkazQ5hCqif3RrywIjDmnACSBvkhIPuQkefvxlxzogIEQ==", "dependencies": { "cborg": "^4.0.0", - "multiformats": "^12.0.1" + "multiformats": "^13.0.0" }, "engines": { "node": ">=16.0.0", "npm": ">=7.0.0" } }, + "node_modules/@ipld/dag-cbor/node_modules/multiformats": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.0.0.tgz", + "integrity": "sha512-xiIB0p7EKmETm3wyKedOg/xuyQ18PoWwXCzzgpZAiDxL9ktl3XTh8AqoDT5kAqRg+DU48XAGPsUJL2Rn6Bx3Lw==" + }, "node_modules/@ipld/dag-json": { - "version": "10.1.5", - "resolved": "https://registry.npmjs.org/@ipld/dag-json/-/dag-json-10.1.5.tgz", - "integrity": "sha512-AIIDRGPgIqVG2K1O42dPDzNOfP0YWV/suGApzpF+YWZLwkwdGVsxjmXcJ/+rwOhRGdjpuq/xQBKPCu1Ao6rdOQ==", + "version": "10.1.6", + "resolved": "https://registry.npmjs.org/@ipld/dag-json/-/dag-json-10.1.6.tgz", + "integrity": "sha512-y3KHYEzUUMPduJEZiy9fe89dG8Or1fYiYM8fPPlec1BE7gUWcZVtJmVQKodluT5N4O8S8xi5iTF83pcN9GXZTA==", "dependencies": { "cborg": "^4.0.0", - "multiformats": "^12.0.1" + "multiformats": "^13.0.0" }, "engines": { "node": ">=16.0.0", "npm": ">=7.0.0" } }, + "node_modules/@ipld/dag-json/node_modules/multiformats": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.0.0.tgz", + "integrity": "sha512-xiIB0p7EKmETm3wyKedOg/xuyQ18PoWwXCzzgpZAiDxL9ktl3XTh8AqoDT5kAqRg+DU48XAGPsUJL2Rn6Bx3Lw==" + }, "node_modules/@ipld/dag-pb": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@ipld/dag-pb/-/dag-pb-4.0.6.tgz", - "integrity": "sha512-wOij3jfDKZsb9yjhQeHp+TQy0pu1vmUkGv324xciFFZ7xGbDfAGTQW03lSA5aJ/7HBBNYgjEE0nvHmNW1Qjfag==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@ipld/dag-pb/-/dag-pb-4.0.7.tgz", + "integrity": "sha512-EqJtSAcELiYbp9K0Y5ckbg+W0pD5cSy5PnE/QsCrpKvoq+u0E8Vi07chNGDLaShd5AjDq0AMtnuudKUUuEuSjg==", "dependencies": { - "multiformats": "^12.0.1" + "multiformats": "^13.0.0" }, "engines": { "node": ">=16.0.0", "npm": ">=7.0.0" } }, + "node_modules/@ipld/dag-pb/node_modules/multiformats": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.0.0.tgz", + "integrity": "sha512-xiIB0p7EKmETm3wyKedOg/xuyQ18PoWwXCzzgpZAiDxL9ktl3XTh8AqoDT5kAqRg+DU48XAGPsUJL2Rn6Bx3Lw==" + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", @@ -458,6 +547,14 @@ "uint8arrays": "^4.0.6" } }, + "node_modules/@libp2p/crypto/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/@libp2p/interface": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-0.1.6.tgz", @@ -526,6 +623,14 @@ "uint8arrays": "^4.0.6" } }, + "node_modules/@libp2p/kad-dht/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/@libp2p/keychain": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/@libp2p/keychain/-/keychain-3.0.8.tgz", @@ -541,6 +646,14 @@ "uint8arrays": "^4.0.6" } }, + "node_modules/@libp2p/keychain/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/@libp2p/logger": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-3.1.0.tgz", @@ -586,6 +699,14 @@ "uint8arrays": "^4.0.6" } }, + "node_modules/@libp2p/mplex/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/@libp2p/multistream-select": { "version": "4.0.10", "resolved": "https://registry.npmjs.org/@libp2p/multistream-select/-/multistream-select-4.0.10.tgz", @@ -607,6 +728,14 @@ "uint8arrays": "^4.0.6" } }, + "node_modules/@libp2p/multistream-select/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/@libp2p/peer-collections": { "version": "4.0.11", "resolved": "https://registry.npmjs.org/@libp2p/peer-collections/-/peer-collections-4.0.11.tgz", @@ -640,6 +769,22 @@ "uint8arrays": "^4.0.6" } }, + "node_modules/@libp2p/peer-id-factory/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, + "node_modules/@libp2p/peer-id/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/@libp2p/peer-record": { "version": "6.0.12", "resolved": "https://registry.npmjs.org/@libp2p/peer-record/-/peer-record-6.0.12.tgz", @@ -656,6 +801,14 @@ "uint8arrays": "^4.0.6" } }, + "node_modules/@libp2p/peer-record/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/@libp2p/peer-store": { "version": "9.0.12", "resolved": "https://registry.npmjs.org/@libp2p/peer-store/-/peer-store-9.0.12.tgz", @@ -677,6 +830,14 @@ "uint8arrays": "^4.0.6" } }, + "node_modules/@libp2p/peer-store/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/@libp2p/pubsub": { "version": "8.0.14", "resolved": "https://registry.npmjs.org/@libp2p/pubsub/-/pubsub-8.0.14.tgz", @@ -698,6 +859,14 @@ "uint8arrays": "^4.0.6" } }, + "node_modules/@libp2p/pubsub/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/@libp2p/tcp": { "version": "8.0.13", "resolved": "https://registry.npmjs.org/@libp2p/tcp/-/tcp-8.0.13.tgz", @@ -762,6 +931,14 @@ "uint8arrays": "^4.0.6" } }, + "node_modules/@libp2p/webrtc/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/@libp2p/websockets": { "version": "7.0.13", "resolved": "https://registry.npmjs.org/@libp2p/websockets/-/websockets-7.0.13.tgz", @@ -798,6 +975,14 @@ "uint8arrays": "^4.0.6" } }, + "node_modules/@libp2p/webtransport/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/@multiformats/base-x": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/@multiformats/base-x/-/base-x-4.0.1.tgz", @@ -812,17 +997,17 @@ } }, "node_modules/@multiformats/multiaddr": { - "version": "12.1.11", - "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-12.1.11.tgz", - "integrity": "sha512-CWG9kETEGTTMdr1T+/JEuMwFld3r3fHNP8LkLoUcLvHRy6yr8sWdotVGEDNEdDO/vrKhuD7bQBws3xMSMMyylg==", + "version": "12.1.12", + "resolved": "https://registry.npmjs.org/@multiformats/multiaddr/-/multiaddr-12.1.12.tgz", + "integrity": "sha512-hrY4uN/oeYhn410jBSpVXn37eenn4djKOj6Dh20Yh4xzGgqmS6u+/X08zQfHgWNjk7NJejPUcRfHEfs8e/MOcw==", "dependencies": { "@chainsafe/is-ip": "^2.0.1", "@chainsafe/netmask": "^2.0.0", "@libp2p/interface": "^1.0.0", "dns-over-http-resolver": "3.0.0", - "multiformats": "^12.0.1", + "multiformats": "^13.0.0", "uint8-varint": "^2.0.1", - "uint8arrays": "^4.0.2" + "uint8arrays": "^5.0.0" } }, "node_modules/@multiformats/multiaddr-matcher": { @@ -848,23 +1033,29 @@ } }, "node_modules/@multiformats/multiaddr/node_modules/@libp2p/interface": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-1.0.2.tgz", - "integrity": "sha512-z/3Yyg+7cVyzRXwzdrDkJd7YmNaLE9iZjQaixo5luI/n9uk5OFFjb9ulAsNqpq8V1xylCo2DXIC7f94KClwzVw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-1.1.0.tgz", + "integrity": "sha512-URIKSFtaliBGA8sIg/MGfyjIo5h4jAdfuZl6dXXXmtdfC3X0rry95YuLNYzXtGMuxG/X+pbVht3fykHvPiXUhg==", "dependencies": { "@multiformats/multiaddr": "^12.1.10", "it-pushable": "^3.2.1", "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", + "multiformats": "^13.0.0", + "progress-events": "^1.0.0", "uint8arraylist": "^2.4.3" } }, + "node_modules/@multiformats/multiaddr/node_modules/multiformats": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.0.0.tgz", + "integrity": "sha512-xiIB0p7EKmETm3wyKedOg/xuyQ18PoWwXCzzgpZAiDxL9ktl3XTh8AqoDT5kAqRg+DU48XAGPsUJL2Rn6Bx3Lw==" + }, "node_modules/@multiformats/murmur3": { - "version": "2.1.7", - "resolved": "https://registry.npmjs.org/@multiformats/murmur3/-/murmur3-2.1.7.tgz", - "integrity": "sha512-Yf0UpAaONjed+8PTt5NM/GG4Z4Ai4m1qfT7bqevjnkwRQ12K+0jxtRomirz+VJx4PokpA2St1ZSD1iMkZTqPRQ==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@multiformats/murmur3/-/murmur3-2.1.8.tgz", + "integrity": "sha512-6vId1C46ra3R1sbJUOFCZnsUIveR9oF20yhPmAFxPm0JfrX3/ZRCgP3YDrBzlGoEppOXnA9czHeYc0T9mB6hbA==", "dependencies": { - "multiformats": "^12.0.1", + "multiformats": "^13.0.0", "murmurhash3js-revisited": "^3.0.0" }, "engines": { @@ -872,6 +1063,11 @@ "npm": ">=7.0.0" } }, + "node_modules/@multiformats/murmur3/node_modules/multiformats": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.0.0.tgz", + "integrity": "sha512-xiIB0p7EKmETm3wyKedOg/xuyQ18PoWwXCzzgpZAiDxL9ktl3XTh8AqoDT5kAqRg+DU48XAGPsUJL2Rn6Bx3Lw==" + }, "node_modules/@noble/ciphers": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.4.1.tgz", @@ -1081,31 +1277,31 @@ } }, "node_modules/@polkadot/keyring": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-12.6.1.tgz", - "integrity": "sha512-cicTctZr5Jy5vgNT2FsNiKoTZnz6zQkgDoIYv79NI+p1Fhwc9C+DN/iMCnk3Cm9vR2gSAd2fSV+Y5iKVDhAmUw==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-12.6.2.tgz", + "integrity": "sha512-O3Q7GVmRYm8q7HuB3S0+Yf/q/EB2egKRRU3fv9b3B7V+A52tKzA+vIwEmNVaD1g5FKW9oB97rmpggs0zaKFqHw==", "dependencies": { - "@polkadot/util": "12.6.1", - "@polkadot/util-crypto": "12.6.1", + "@polkadot/util": "12.6.2", + "@polkadot/util-crypto": "12.6.2", "tslib": "^2.6.2" }, "engines": { "node": ">=18" }, "peerDependencies": { - "@polkadot/util": "12.6.1", - "@polkadot/util-crypto": "12.6.1" + "@polkadot/util": "12.6.2", + "@polkadot/util-crypto": "12.6.2" } }, "node_modules/@polkadot/keyring/node_modules/@polkadot/util": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-12.6.1.tgz", - "integrity": "sha512-10ra3VfXtK8ZSnWI7zjhvRrhupg3rd4iFC3zCaXmRpOU+AmfIoCFVEmuUuC66gyXiz2/g6k5E6j0lWQCOProSQ==", - "dependencies": { - "@polkadot/x-bigint": "12.6.1", - "@polkadot/x-global": "12.6.1", - "@polkadot/x-textdecoder": "12.6.1", - "@polkadot/x-textencoder": "12.6.1", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-12.6.2.tgz", + "integrity": "sha512-l8TubR7CLEY47240uki0TQzFvtnxFIO7uI/0GoWzpYD/O62EIAMRsuY01N4DuwgKq2ZWD59WhzsLYmA5K6ksdw==", + "dependencies": { + "@polkadot/x-bigint": "12.6.2", + "@polkadot/x-global": "12.6.2", + "@polkadot/x-textdecoder": "12.6.2", + "@polkadot/x-textencoder": "12.6.2", "@types/bn.js": "^5.1.5", "bn.js": "^5.2.1", "tslib": "^2.6.2" @@ -1115,11 +1311,11 @@ } }, "node_modules/@polkadot/keyring/node_modules/@polkadot/x-textdecoder": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-12.6.1.tgz", - "integrity": "sha512-IasodJeV1f2Nr/VtA207+LXCQEqYcG8y9qB/EQcRsrEP58NbwwxM5Z2obV0lSjJOxRTJ4/OlhUwnLHwcbIp6+g==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-12.6.2.tgz", + "integrity": "sha512-M1Bir7tYvNappfpFWXOJcnxUhBUFWkUFIdJSyH0zs5LmFtFdbKAeiDXxSp2Swp5ddOZdZgPac294/o2TnQKN1w==", "dependencies": { - "@polkadot/x-global": "12.6.1", + "@polkadot/x-global": "12.6.2", "tslib": "^2.6.2" }, "engines": { @@ -1127,11 +1323,11 @@ } }, "node_modules/@polkadot/keyring/node_modules/@polkadot/x-textencoder": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-12.6.1.tgz", - "integrity": "sha512-sTq/+tXqBhGe01a1rjieSHFh3y935vuRgtahVgVJZnfqh5SmLPgSN5tTPxZWzyx7gHIfotle8laTJbJarv7V1A==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-12.6.2.tgz", + "integrity": "sha512-4N+3UVCpI489tUJ6cv3uf0PjOHvgGp9Dl+SZRLgFGt9mvxnvpW/7+XBADRMtlG4xi5gaRK7bgl5bmY6OMDsNdw==", "dependencies": { - "@polkadot/x-global": "12.6.1", + "@polkadot/x-global": "12.6.2", "tslib": "^2.6.2" }, "engines": { @@ -1139,11 +1335,11 @@ } }, "node_modules/@polkadot/networks": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-12.6.1.tgz", - "integrity": "sha512-pzyirxTYAnsx+6kyLYcUk26e4TLz3cX6p2KhTgAVW77YnpGX5VTKTbYykyXC8fXFd/migeQsLaa2raFN47mwoA==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-12.6.2.tgz", + "integrity": "sha512-1oWtZm1IvPWqvMrldVH6NI2gBoCndl5GEwx7lAuQWGr7eNL+6Bdc5K3Z9T0MzFvDGoi2/CBqjX9dRKo39pDC/w==", "dependencies": { - "@polkadot/util": "12.6.1", + "@polkadot/util": "12.6.2", "@substrate/ss58-registry": "^1.44.0", "tslib": "^2.6.2" }, @@ -1152,14 +1348,14 @@ } }, "node_modules/@polkadot/networks/node_modules/@polkadot/util": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-12.6.1.tgz", - "integrity": "sha512-10ra3VfXtK8ZSnWI7zjhvRrhupg3rd4iFC3zCaXmRpOU+AmfIoCFVEmuUuC66gyXiz2/g6k5E6j0lWQCOProSQ==", - "dependencies": { - "@polkadot/x-bigint": "12.6.1", - "@polkadot/x-global": "12.6.1", - "@polkadot/x-textdecoder": "12.6.1", - "@polkadot/x-textencoder": "12.6.1", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-12.6.2.tgz", + "integrity": "sha512-l8TubR7CLEY47240uki0TQzFvtnxFIO7uI/0GoWzpYD/O62EIAMRsuY01N4DuwgKq2ZWD59WhzsLYmA5K6ksdw==", + "dependencies": { + "@polkadot/x-bigint": "12.6.2", + "@polkadot/x-global": "12.6.2", + "@polkadot/x-textdecoder": "12.6.2", + "@polkadot/x-textencoder": "12.6.2", "@types/bn.js": "^5.1.5", "bn.js": "^5.2.1", "tslib": "^2.6.2" @@ -1169,11 +1365,11 @@ } }, "node_modules/@polkadot/networks/node_modules/@polkadot/x-textdecoder": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-12.6.1.tgz", - "integrity": "sha512-IasodJeV1f2Nr/VtA207+LXCQEqYcG8y9qB/EQcRsrEP58NbwwxM5Z2obV0lSjJOxRTJ4/OlhUwnLHwcbIp6+g==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-12.6.2.tgz", + "integrity": "sha512-M1Bir7tYvNappfpFWXOJcnxUhBUFWkUFIdJSyH0zs5LmFtFdbKAeiDXxSp2Swp5ddOZdZgPac294/o2TnQKN1w==", "dependencies": { - "@polkadot/x-global": "12.6.1", + "@polkadot/x-global": "12.6.2", "tslib": "^2.6.2" }, "engines": { @@ -1181,11 +1377,11 @@ } }, "node_modules/@polkadot/networks/node_modules/@polkadot/x-textencoder": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-12.6.1.tgz", - "integrity": "sha512-sTq/+tXqBhGe01a1rjieSHFh3y935vuRgtahVgVJZnfqh5SmLPgSN5tTPxZWzyx7gHIfotle8laTJbJarv7V1A==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-12.6.2.tgz", + "integrity": "sha512-4N+3UVCpI489tUJ6cv3uf0PjOHvgGp9Dl+SZRLgFGt9mvxnvpW/7+XBADRMtlG4xi5gaRK7bgl5bmY6OMDsNdw==", "dependencies": { - "@polkadot/x-global": "12.6.1", + "@polkadot/x-global": "12.6.2", "tslib": "^2.6.2" }, "engines": { @@ -1288,21 +1484,21 @@ } }, "node_modules/@polkadot/rpc-provider": { - "version": "10.11.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-10.11.1.tgz", - "integrity": "sha512-86aDUOnaG42si0jSOAgn6Fs3F3rz57x+iNBK1JpM0PLL2XvmPuoMZL5dZwzqSIey3nVdGJqRYfnFquWuyQpnOQ==", - "dependencies": { - "@polkadot/keyring": "^12.6.1", - "@polkadot/types": "10.11.1", - "@polkadot/types-support": "10.11.1", - "@polkadot/util": "^12.6.1", - "@polkadot/util-crypto": "^12.6.1", - "@polkadot/x-fetch": "^12.6.1", - "@polkadot/x-global": "^12.6.1", - "@polkadot/x-ws": "^12.6.1", + "version": "10.11.2", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-10.11.2.tgz", + "integrity": "sha512-he5jWMpDJp7e+vUzTZDzpkB7ps3H8psRally+/ZvZZScPvFEjfczT7I1WWY9h58s8+ImeVP/lkXjL9h/gUOt3Q==", + "dependencies": { + "@polkadot/keyring": "^12.6.2", + "@polkadot/types": "10.11.2", + "@polkadot/types-support": "10.11.2", + "@polkadot/util": "^12.6.2", + "@polkadot/util-crypto": "^12.6.2", + "@polkadot/x-fetch": "^12.6.2", + "@polkadot/x-global": "^12.6.2", + "@polkadot/x-ws": "^12.6.2", "eventemitter3": "^5.0.1", "mock-socket": "^9.3.1", - "nock": "^13.3.8", + "nock": "^13.4.0", "tslib": "^2.6.2" }, "engines": { @@ -1313,16 +1509,16 @@ } }, "node_modules/@polkadot/rpc-provider/node_modules/@polkadot/types": { - "version": "10.11.1", - "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-10.11.1.tgz", - "integrity": "sha512-4uKnzW2GZqNA5qRZpTPJ7z+G/ARTvXI89etv9xXXVttUdfTaYZsMf4rMuMThOAE/mAUn70LoH0JKthZLwzVgNQ==", - "dependencies": { - "@polkadot/keyring": "^12.6.1", - "@polkadot/types-augment": "10.11.1", - "@polkadot/types-codec": "10.11.1", - "@polkadot/types-create": "10.11.1", - "@polkadot/util": "^12.6.1", - "@polkadot/util-crypto": "^12.6.1", + "version": "10.11.2", + "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-10.11.2.tgz", + "integrity": "sha512-d52j3xXni+C8GdYZVTSfu8ROAnzXFMlyRvXtor0PudUc8UQHOaC4+mYAkTBGA2gKdmL8MHSfRSbhcxHhsikY6Q==", + "dependencies": { + "@polkadot/keyring": "^12.6.2", + "@polkadot/types-augment": "10.11.2", + "@polkadot/types-codec": "10.11.2", + "@polkadot/types-create": "10.11.2", + "@polkadot/util": "^12.6.2", + "@polkadot/util-crypto": "^12.6.2", "rxjs": "^7.8.1", "tslib": "^2.6.2" }, @@ -1331,13 +1527,13 @@ } }, "node_modules/@polkadot/rpc-provider/node_modules/@polkadot/types-augment": { - "version": "10.11.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-10.11.1.tgz", - "integrity": "sha512-Exd5mMCuSOXXz73iWqy8ocScWTrwAPqHz0Kxpz5OWlAu+5usipMuhjoeaZA803FHQntZh9lHUN31fuc50Exhew==", + "version": "10.11.2", + "resolved": "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-10.11.2.tgz", + "integrity": "sha512-8eB8ew04wZiE5GnmFvEFW1euJWmF62SGxb1O+8wL3zoUtB9Xgo1vB6w6xbTrd+HLV6jNSeXXnbbF1BEUvi9cNg==", "dependencies": { - "@polkadot/types": "10.11.1", - "@polkadot/types-codec": "10.11.1", - "@polkadot/util": "^12.6.1", + "@polkadot/types": "10.11.2", + "@polkadot/types-codec": "10.11.2", + "@polkadot/util": "^12.6.2", "tslib": "^2.6.2" }, "engines": { @@ -1345,12 +1541,12 @@ } }, "node_modules/@polkadot/rpc-provider/node_modules/@polkadot/types-codec": { - "version": "10.11.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-10.11.1.tgz", - "integrity": "sha512-B9Fu2hq3cRpJpGPcgfZ8Qi1OSX9u82J46adlbIG95ktoA+70eZ83VS3Zvtt9ACsdLVGETCJfDjSO25XptjhZKQ==", + "version": "10.11.2", + "resolved": "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-10.11.2.tgz", + "integrity": "sha512-3xjOQL+LOOMzYqlgP9ROL0FQnzU8lGflgYewzau7AsDlFziSEtb49a9BpYo6zil4koC+QB8zQ9OHGFumG08T8w==", "dependencies": { - "@polkadot/util": "^12.6.1", - "@polkadot/x-bigint": "^12.6.1", + "@polkadot/util": "^12.6.2", + "@polkadot/x-bigint": "^12.6.2", "tslib": "^2.6.2" }, "engines": { @@ -1358,12 +1554,12 @@ } }, "node_modules/@polkadot/rpc-provider/node_modules/@polkadot/types-create": { - "version": "10.11.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-create/-/types-create-10.11.1.tgz", - "integrity": "sha512-oeaI185F3XeWSz9/fe//qZ0KsQyE6C6c13WuOa+5cX/Yuz7cSAXawrhl58HRaU+fueaE/ijEHLcuK1sdM6e1JQ==", + "version": "10.11.2", + "resolved": "https://registry.npmjs.org/@polkadot/types-create/-/types-create-10.11.2.tgz", + "integrity": "sha512-SJt23NxYvefRxVZZm6mT9ed1pR6FDoIGQ3xUpbjhTLfU2wuhpKjekMVorYQ6z/gK2JLMu2kV92Ardsz+6GX5XQ==", "dependencies": { - "@polkadot/types-codec": "10.11.1", - "@polkadot/util": "^12.6.1", + "@polkadot/types-codec": "10.11.2", + "@polkadot/util": "^12.6.2", "tslib": "^2.6.2" }, "engines": { @@ -1371,14 +1567,14 @@ } }, "node_modules/@polkadot/rpc-provider/node_modules/@polkadot/util": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-12.6.1.tgz", - "integrity": "sha512-10ra3VfXtK8ZSnWI7zjhvRrhupg3rd4iFC3zCaXmRpOU+AmfIoCFVEmuUuC66gyXiz2/g6k5E6j0lWQCOProSQ==", - "dependencies": { - "@polkadot/x-bigint": "12.6.1", - "@polkadot/x-global": "12.6.1", - "@polkadot/x-textdecoder": "12.6.1", - "@polkadot/x-textencoder": "12.6.1", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-12.6.2.tgz", + "integrity": "sha512-l8TubR7CLEY47240uki0TQzFvtnxFIO7uI/0GoWzpYD/O62EIAMRsuY01N4DuwgKq2ZWD59WhzsLYmA5K6ksdw==", + "dependencies": { + "@polkadot/x-bigint": "12.6.2", + "@polkadot/x-global": "12.6.2", + "@polkadot/x-textdecoder": "12.6.2", + "@polkadot/x-textencoder": "12.6.2", "@types/bn.js": "^5.1.5", "bn.js": "^5.2.1", "tslib": "^2.6.2" @@ -1388,11 +1584,11 @@ } }, "node_modules/@polkadot/rpc-provider/node_modules/@polkadot/x-textdecoder": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-12.6.1.tgz", - "integrity": "sha512-IasodJeV1f2Nr/VtA207+LXCQEqYcG8y9qB/EQcRsrEP58NbwwxM5Z2obV0lSjJOxRTJ4/OlhUwnLHwcbIp6+g==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-12.6.2.tgz", + "integrity": "sha512-M1Bir7tYvNappfpFWXOJcnxUhBUFWkUFIdJSyH0zs5LmFtFdbKAeiDXxSp2Swp5ddOZdZgPac294/o2TnQKN1w==", "dependencies": { - "@polkadot/x-global": "12.6.1", + "@polkadot/x-global": "12.6.2", "tslib": "^2.6.2" }, "engines": { @@ -1400,11 +1596,11 @@ } }, "node_modules/@polkadot/rpc-provider/node_modules/@polkadot/x-textencoder": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-12.6.1.tgz", - "integrity": "sha512-sTq/+tXqBhGe01a1rjieSHFh3y935vuRgtahVgVJZnfqh5SmLPgSN5tTPxZWzyx7gHIfotle8laTJbJarv7V1A==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-12.6.2.tgz", + "integrity": "sha512-4N+3UVCpI489tUJ6cv3uf0PjOHvgGp9Dl+SZRLgFGt9mvxnvpW/7+XBADRMtlG4xi5gaRK7bgl5bmY6OMDsNdw==", "dependencies": { - "@polkadot/x-global": "12.6.1", + "@polkadot/x-global": "12.6.2", "tslib": "^2.6.2" }, "engines": { @@ -1588,11 +1784,11 @@ } }, "node_modules/@polkadot/types-support": { - "version": "10.11.1", - "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-10.11.1.tgz", - "integrity": "sha512-eCvWjdpELsHvXiTq201DdbIeOIaEr53zTD7HqC2wR/Z1bkQuw79Z+CyIU4sp79GL1vZ1PxS7vUH9M3FKNaTl1Q==", + "version": "10.11.2", + "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-10.11.2.tgz", + "integrity": "sha512-X11hoykFYv/3efg4coZy2hUOUc97JhjQMJLzDhHniFwGLlYU8MeLnPdCVGkXx0xDDjTo4/ptS1XpZ5HYcg+gRw==", "dependencies": { - "@polkadot/util": "^12.6.1", + "@polkadot/util": "^12.6.2", "tslib": "^2.6.2" }, "engines": { @@ -1600,14 +1796,14 @@ } }, "node_modules/@polkadot/types-support/node_modules/@polkadot/util": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-12.6.1.tgz", - "integrity": "sha512-10ra3VfXtK8ZSnWI7zjhvRrhupg3rd4iFC3zCaXmRpOU+AmfIoCFVEmuUuC66gyXiz2/g6k5E6j0lWQCOProSQ==", - "dependencies": { - "@polkadot/x-bigint": "12.6.1", - "@polkadot/x-global": "12.6.1", - "@polkadot/x-textdecoder": "12.6.1", - "@polkadot/x-textencoder": "12.6.1", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-12.6.2.tgz", + "integrity": "sha512-l8TubR7CLEY47240uki0TQzFvtnxFIO7uI/0GoWzpYD/O62EIAMRsuY01N4DuwgKq2ZWD59WhzsLYmA5K6ksdw==", + "dependencies": { + "@polkadot/x-bigint": "12.6.2", + "@polkadot/x-global": "12.6.2", + "@polkadot/x-textdecoder": "12.6.2", + "@polkadot/x-textencoder": "12.6.2", "@types/bn.js": "^5.1.5", "bn.js": "^5.2.1", "tslib": "^2.6.2" @@ -1617,11 +1813,11 @@ } }, "node_modules/@polkadot/types-support/node_modules/@polkadot/x-textdecoder": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-12.6.1.tgz", - "integrity": "sha512-IasodJeV1f2Nr/VtA207+LXCQEqYcG8y9qB/EQcRsrEP58NbwwxM5Z2obV0lSjJOxRTJ4/OlhUwnLHwcbIp6+g==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-12.6.2.tgz", + "integrity": "sha512-M1Bir7tYvNappfpFWXOJcnxUhBUFWkUFIdJSyH0zs5LmFtFdbKAeiDXxSp2Swp5ddOZdZgPac294/o2TnQKN1w==", "dependencies": { - "@polkadot/x-global": "12.6.1", + "@polkadot/x-global": "12.6.2", "tslib": "^2.6.2" }, "engines": { @@ -1629,11 +1825,11 @@ } }, "node_modules/@polkadot/types-support/node_modules/@polkadot/x-textencoder": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-12.6.1.tgz", - "integrity": "sha512-sTq/+tXqBhGe01a1rjieSHFh3y935vuRgtahVgVJZnfqh5SmLPgSN5tTPxZWzyx7gHIfotle8laTJbJarv7V1A==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-12.6.2.tgz", + "integrity": "sha512-4N+3UVCpI489tUJ6cv3uf0PjOHvgGp9Dl+SZRLgFGt9mvxnvpW/7+XBADRMtlG4xi5gaRK7bgl5bmY6OMDsNdw==", "dependencies": { - "@polkadot/x-global": "12.6.1", + "@polkadot/x-global": "12.6.2", "tslib": "^2.6.2" }, "engines": { @@ -1658,37 +1854,37 @@ } }, "node_modules/@polkadot/util-crypto": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-12.6.1.tgz", - "integrity": "sha512-2ezWFLmdgeDXqB9NAUdgpp3s2rQztNrZLY+y0SJYNOG4ch+PyodTW/qSksnOrVGVdRhZ5OESRE9xvo9LYV5UAw==", - "dependencies": { - "@noble/curves": "^1.2.0", - "@noble/hashes": "^1.3.2", - "@polkadot/networks": "12.6.1", - "@polkadot/util": "12.6.1", - "@polkadot/wasm-crypto": "^7.3.1", - "@polkadot/wasm-util": "^7.3.1", - "@polkadot/x-bigint": "12.6.1", - "@polkadot/x-randomvalues": "12.6.1", - "@scure/base": "^1.1.3", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-12.6.2.tgz", + "integrity": "sha512-FEWI/dJ7wDMNN1WOzZAjQoIcCP/3vz3wvAp5QQm+lOrzOLj0iDmaIGIcBkz8HVm3ErfSe/uKP0KS4jgV/ib+Mg==", + "dependencies": { + "@noble/curves": "^1.3.0", + "@noble/hashes": "^1.3.3", + "@polkadot/networks": "12.6.2", + "@polkadot/util": "12.6.2", + "@polkadot/wasm-crypto": "^7.3.2", + "@polkadot/wasm-util": "^7.3.2", + "@polkadot/x-bigint": "12.6.2", + "@polkadot/x-randomvalues": "12.6.2", + "@scure/base": "^1.1.5", "tslib": "^2.6.2" }, "engines": { "node": ">=18" }, "peerDependencies": { - "@polkadot/util": "12.6.1" + "@polkadot/util": "12.6.2" } }, "node_modules/@polkadot/util-crypto/node_modules/@polkadot/util": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-12.6.1.tgz", - "integrity": "sha512-10ra3VfXtK8ZSnWI7zjhvRrhupg3rd4iFC3zCaXmRpOU+AmfIoCFVEmuUuC66gyXiz2/g6k5E6j0lWQCOProSQ==", - "dependencies": { - "@polkadot/x-bigint": "12.6.1", - "@polkadot/x-global": "12.6.1", - "@polkadot/x-textdecoder": "12.6.1", - "@polkadot/x-textencoder": "12.6.1", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-12.6.2.tgz", + "integrity": "sha512-l8TubR7CLEY47240uki0TQzFvtnxFIO7uI/0GoWzpYD/O62EIAMRsuY01N4DuwgKq2ZWD59WhzsLYmA5K6ksdw==", + "dependencies": { + "@polkadot/x-bigint": "12.6.2", + "@polkadot/x-global": "12.6.2", + "@polkadot/x-textdecoder": "12.6.2", + "@polkadot/x-textencoder": "12.6.2", "@types/bn.js": "^5.1.5", "bn.js": "^5.2.1", "tslib": "^2.6.2" @@ -1753,27 +1949,27 @@ } }, "node_modules/@polkadot/util-crypto/node_modules/@polkadot/x-randomvalues": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-12.6.1.tgz", - "integrity": "sha512-1uVKlfYYbgIgGV5v1Dgn960cGovenWm5pmg+aTMeUGXVYiJwRD2zOpLyC1i/tP454iA74j74pmWb8Nkn0tJZUQ==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-12.6.2.tgz", + "integrity": "sha512-Vr8uG7rH2IcNJwtyf5ebdODMcr0XjoCpUbI91Zv6AlKVYOGKZlKLYJHIwpTaKKB+7KPWyQrk4Mlym/rS7v9feg==", "dependencies": { - "@polkadot/x-global": "12.6.1", + "@polkadot/x-global": "12.6.2", "tslib": "^2.6.2" }, "engines": { "node": ">=18" }, "peerDependencies": { - "@polkadot/util": "12.6.1", + "@polkadot/util": "12.6.2", "@polkadot/wasm-util": "*" } }, "node_modules/@polkadot/util-crypto/node_modules/@polkadot/x-textdecoder": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-12.6.1.tgz", - "integrity": "sha512-IasodJeV1f2Nr/VtA207+LXCQEqYcG8y9qB/EQcRsrEP58NbwwxM5Z2obV0lSjJOxRTJ4/OlhUwnLHwcbIp6+g==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-12.6.2.tgz", + "integrity": "sha512-M1Bir7tYvNappfpFWXOJcnxUhBUFWkUFIdJSyH0zs5LmFtFdbKAeiDXxSp2Swp5ddOZdZgPac294/o2TnQKN1w==", "dependencies": { - "@polkadot/x-global": "12.6.1", + "@polkadot/x-global": "12.6.2", "tslib": "^2.6.2" }, "engines": { @@ -1781,11 +1977,11 @@ } }, "node_modules/@polkadot/util-crypto/node_modules/@polkadot/x-textencoder": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-12.6.1.tgz", - "integrity": "sha512-sTq/+tXqBhGe01a1rjieSHFh3y935vuRgtahVgVJZnfqh5SmLPgSN5tTPxZWzyx7gHIfotle8laTJbJarv7V1A==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-12.6.2.tgz", + "integrity": "sha512-4N+3UVCpI489tUJ6cv3uf0PjOHvgGp9Dl+SZRLgFGt9mvxnvpW/7+XBADRMtlG4xi5gaRK7bgl5bmY6OMDsNdw==", "dependencies": { - "@polkadot/x-global": "12.6.1", + "@polkadot/x-global": "12.6.2", "tslib": "^2.6.2" }, "engines": { @@ -1859,11 +2055,11 @@ } }, "node_modules/@polkadot/x-bigint": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-12.6.1.tgz", - "integrity": "sha512-YlABeVIlgYQZJ4ZpW/+akFGGxw5jMGt4g5vaP7EumlORGneJHzzWJYDmI5v2y7j1zvC9ofOle7z4tRmtN/QDew==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-12.6.2.tgz", + "integrity": "sha512-HSIk60uFPX4GOFZSnIF7VYJz7WZA7tpFJsne7SzxOooRwMTWEtw3fUpFy5cYYOeLh17/kHH1Y7SVcuxzVLc74Q==", "dependencies": { - "@polkadot/x-global": "12.6.1", + "@polkadot/x-global": "12.6.2", "tslib": "^2.6.2" }, "engines": { @@ -1871,11 +2067,11 @@ } }, "node_modules/@polkadot/x-fetch": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-12.6.1.tgz", - "integrity": "sha512-iyBv0ecfCsqGSv26CPJk9vSoKtry/Fn7x549ysA4hlc9KboraMHxOHTpcNZYC/OdgvbFZl40zIXCY0SA1ai8aw==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-12.6.2.tgz", + "integrity": "sha512-8wM/Z9JJPWN1pzSpU7XxTI1ldj/AfC8hKioBlUahZ8gUiJaOF7K9XEFCrCDLis/A1BoOu7Ne6WMx/vsJJIbDWw==", "dependencies": { - "@polkadot/x-global": "12.6.1", + "@polkadot/x-global": "12.6.2", "node-fetch": "^3.3.2", "tslib": "^2.6.2" }, @@ -1884,9 +2080,9 @@ } }, "node_modules/@polkadot/x-global": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-12.6.1.tgz", - "integrity": "sha512-w5t19HIdBPuyu7X/AiCyH2DsKqxBF0KpF4Ymolnx8PfcSIgnq9ZOmgs74McPR6FgEmeEkr9uNKujZrsfURi1ug==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-12.6.2.tgz", + "integrity": "sha512-a8d6m+PW98jmsYDtAWp88qS4dl8DyqUBsd0S+WgyfSMtpEXu6v9nXDgPZgwF5xdDvXhm+P0ZfVkVTnIGrScb5g==", "dependencies": { "tslib": "^2.6.2" }, @@ -1941,13 +2137,13 @@ } }, "node_modules/@polkadot/x-ws": { - "version": "12.6.1", - "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-12.6.1.tgz", - "integrity": "sha512-fs9V+XekjJLpVLLwxnqq3llqSZu2T/b9brvld8anvzS/htDLPbi7+c5W3VGJ9Po8fS67IsU3HCt0Gu6F6mGrMA==", + "version": "12.6.2", + "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-12.6.2.tgz", + "integrity": "sha512-cGZWo7K5eRRQCRl2LrcyCYsrc3lRbTlixZh3AzgU8uX4wASVGRlNWi/Hf4TtHNe1ExCDmxabJzdIsABIfrr7xw==", "dependencies": { - "@polkadot/x-global": "12.6.1", + "@polkadot/x-global": "12.6.2", "tslib": "^2.6.2", - "ws": "^8.14.2" + "ws": "^8.15.1" }, "engines": { "node": ">=18" @@ -2143,9 +2339,9 @@ } }, "node_modules/@types/node": { - "version": "20.10.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.4.tgz", - "integrity": "sha512-D08YG6rr8X90YB56tSIuBaddy/UXAA9RKJoFvrsnogAum/0pmjkgi4+2nx96A330FmioegBWmEYQ+syqCFaveg==", + "version": "20.10.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.6.tgz", + "integrity": "sha512-Vac8H+NlRNNlAmDfGUP7b5h/KA+AtWIzuXy0E6OyP8f1tCLYAtPvKRRDJjAPqhpCb0t6U2j7/xqAuLEebW2kiw==", "dependencies": { "undici-types": "~5.26.4" } @@ -2192,16 +2388,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.14.0.tgz", - "integrity": "sha512-1ZJBykBCXaSHG94vMMKmiHoL0MhNHKSVlcHVYZNw+BKxufhqQVTOawNpwwI1P5nIFZ/4jLVop0mcY6mJJDFNaw==", + "version": "6.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.17.0.tgz", + "integrity": "sha512-Vih/4xLXmY7V490dGwBQJTpIZxH4ZFH6eCVmQ4RFkB+wmaCTDAx4dtgoWwMNGKLkqRY1L6rPqzEbjorRnDo4rQ==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/type-utils": "6.14.0", - "@typescript-eslint/utils": "6.14.0", - "@typescript-eslint/visitor-keys": "6.14.0", + "@typescript-eslint/scope-manager": "6.17.0", + "@typescript-eslint/type-utils": "6.17.0", + "@typescript-eslint/utils": "6.17.0", + "@typescript-eslint/visitor-keys": "6.17.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -2227,15 +2423,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.14.0.tgz", - "integrity": "sha512-QjToC14CKacd4Pa7JK4GeB/vHmWFJckec49FR4hmIRf97+KXole0T97xxu9IFiPxVQ1DBWrQ5wreLwAGwWAVQA==", + "version": "6.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.17.0.tgz", + "integrity": "sha512-C4bBaX2orvhK+LlwrY8oWGmSl4WolCfYm513gEccdWZj0CwGadbIADb0FtVEcI+WzUyjyoBj2JRP8g25E6IB8A==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/typescript-estree": "6.14.0", - "@typescript-eslint/visitor-keys": "6.14.0", + "@typescript-eslint/scope-manager": "6.17.0", + "@typescript-eslint/types": "6.17.0", + "@typescript-eslint/typescript-estree": "6.17.0", + "@typescript-eslint/visitor-keys": "6.17.0", "debug": "^4.3.4" }, "engines": { @@ -2255,13 +2451,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.14.0.tgz", - "integrity": "sha512-VT7CFWHbZipPncAZtuALr9y3EuzY1b1t1AEkIq2bTXUPKw+pHoXflGNG5L+Gv6nKul1cz1VH8fz16IThIU0tdg==", + "version": "6.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.17.0.tgz", + "integrity": "sha512-RX7a8lwgOi7am0k17NUO0+ZmMOX4PpjLtLRgLmT1d3lBYdWH4ssBUbwdmc5pdRX8rXon8v9x8vaoOSpkHfcXGA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/visitor-keys": "6.14.0" + "@typescript-eslint/types": "6.17.0", + "@typescript-eslint/visitor-keys": "6.17.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2272,13 +2468,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.14.0.tgz", - "integrity": "sha512-x6OC9Q7HfYKqjnuNu5a7kffIYs3No30isapRBJl1iCHLitD8O0lFbRcVGiOcuyN837fqXzPZ1NS10maQzZMKqw==", + "version": "6.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.17.0.tgz", + "integrity": "sha512-hDXcWmnbtn4P2B37ka3nil3yi3VCQO2QEB9gBiHJmQp5wmyQWqnjA85+ZcE8c4FqnaB6lBwMrPkgd4aBYz3iNg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.14.0", - "@typescript-eslint/utils": "6.14.0", + "@typescript-eslint/typescript-estree": "6.17.0", + "@typescript-eslint/utils": "6.17.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -2299,9 +2495,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.14.0.tgz", - "integrity": "sha512-uty9H2K4Xs8E47z3SnXEPRNDfsis8JO27amp2GNCnzGETEW3yTqEIVg5+AI7U276oGF/tw6ZA+UesxeQ104ceA==", + "version": "6.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.17.0.tgz", + "integrity": "sha512-qRKs9tvc3a4RBcL/9PXtKSehI/q8wuU9xYJxe97WFxnzH8NWWtcW3ffNS+EWg8uPvIerhjsEZ+rHtDqOCiH57A==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2312,16 +2508,17 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.14.0.tgz", - "integrity": "sha512-yPkaLwK0yH2mZKFE/bXkPAkkFgOv15GJAUzgUVonAbv0Hr4PK/N2yaA/4XQbTZQdygiDkpt5DkxPELqHguNvyw==", + "version": "6.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.17.0.tgz", + "integrity": "sha512-gVQe+SLdNPfjlJn5VNGhlOhrXz4cajwFd5kAgWtZ9dCZf4XJf8xmgCTLIqec7aha3JwgLI2CK6GY1043FRxZwg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/visitor-keys": "6.14.0", + "@typescript-eslint/types": "6.17.0", + "@typescript-eslint/visitor-keys": "6.17.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", + "minimatch": "9.0.3", "semver": "^7.5.4", "ts-api-utils": "^1.0.1" }, @@ -2339,17 +2536,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.14.0.tgz", - "integrity": "sha512-XwRTnbvRr7Ey9a1NT6jqdKX8y/atWG+8fAIu3z73HSP8h06i3r/ClMhmaF/RGWGW1tHJEwij1uEg2GbEmPYvYg==", + "version": "6.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.17.0.tgz", + "integrity": "sha512-LofsSPjN/ITNkzV47hxas2JCsNCEnGhVvocfyOcLzT9c/tSZE7SfhS/iWtzP1lKNOEfLhRTZz6xqI8N2RzweSQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.14.0", - "@typescript-eslint/types": "6.14.0", - "@typescript-eslint/typescript-estree": "6.14.0", + "@typescript-eslint/scope-manager": "6.17.0", + "@typescript-eslint/types": "6.17.0", + "@typescript-eslint/typescript-estree": "6.17.0", "semver": "^7.5.4" }, "engines": { @@ -2364,12 +2561,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.14.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.14.0.tgz", - "integrity": "sha512-fB5cw6GRhJUz03MrROVuj5Zm/Q+XWlVdIsFj+Zb1Hvqouc8t+XP2H5y53QYU/MGtd2dPg6/vJJlhoX3xc2ehfw==", + "version": "6.17.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.17.0.tgz", + "integrity": "sha512-H6VwB/k3IuIeQOyYczyyKN8wH6ed8EwliaYHLxOIhyF0dYEIsN8+Bk3GE19qafeMKyZJJHP8+O1HiFhFLUNKSg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.14.0", + "@typescript-eslint/types": "6.17.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -2405,9 +2602,9 @@ } }, "node_modules/acorn": { - "version": "8.11.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", - "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -2579,9 +2776,9 @@ } }, "node_modules/blockstore-core": { - "version": "4.3.8", - "resolved": "https://registry.npmjs.org/blockstore-core/-/blockstore-core-4.3.8.tgz", - "integrity": "sha512-Agunhjw9w0I1OoJn012OpzJwBRm3Nf+v64N2FaZSsF3UGhoQAu4RePLuIBsZrPh4XRqT5Yg1rHoBYJGDhDmkWQ==", + "version": "4.3.10", + "resolved": "https://registry.npmjs.org/blockstore-core/-/blockstore-core-4.3.10.tgz", + "integrity": "sha512-YLpkZ9GRiakh40hFx3eC6YpPbIO+6pKwc+BDrnCTSnsjfUtmV6v/3D3zvWn3wK00iQsfX0/B3ThFhr6p97uThA==", "dependencies": { "@libp2p/logger": "^4.0.1", "err-code": "^3.0.1", @@ -2591,41 +2788,39 @@ "it-filter": "^3.0.0", "it-merge": "^3.0.1", "it-pushable": "^3.0.0", - "multiformats": "^12.0.1", + "multiformats": "^13.0.0", "uint8arrays": "^5.0.0" } }, "node_modules/blockstore-core/node_modules/@libp2p/interface": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-1.0.2.tgz", - "integrity": "sha512-z/3Yyg+7cVyzRXwzdrDkJd7YmNaLE9iZjQaixo5luI/n9uk5OFFjb9ulAsNqpq8V1xylCo2DXIC7f94KClwzVw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-1.1.0.tgz", + "integrity": "sha512-URIKSFtaliBGA8sIg/MGfyjIo5h4jAdfuZl6dXXXmtdfC3X0rry95YuLNYzXtGMuxG/X+pbVht3fykHvPiXUhg==", "dependencies": { "@multiformats/multiaddr": "^12.1.10", "it-pushable": "^3.2.1", "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", + "multiformats": "^13.0.0", + "progress-events": "^1.0.0", "uint8arraylist": "^2.4.3" } }, "node_modules/blockstore-core/node_modules/@libp2p/logger": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-4.0.2.tgz", - "integrity": "sha512-J9UMtMU9BKXNp+3c5kcI7HyWOPYg2B2E6sn1gEQckiSexTaz0wKJSlgTZ89f9F8bkC3AaC8ybXYuHbFQhwpTIg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-4.0.3.tgz", + "integrity": "sha512-AydOzxLfJtfu7K/kjCRkO15llrr8Pc6BXVSOWVGFBCZ9e5+YHDuj8z5Pyc0YsXElMb/6hClGDJhw7nM8/EVqDA==", "dependencies": { - "@libp2p/interface": "^1.0.2", + "@libp2p/interface": "^1.1.0", "@multiformats/multiaddr": "^12.1.10", "debug": "^4.3.4", "interface-datastore": "^8.2.0", - "multiformats": "^12.1.3" + "multiformats": "^13.0.0" } }, - "node_modules/blockstore-core/node_modules/uint8arrays": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.0.0.tgz", - "integrity": "sha512-RWO7gR4x6syxnKDfZO8mDCsaaYs1/BqZCxlHgrcRge50E9GTnLmtoA4kwFSGIL4s3dQkryeTkvtG6oEFEya3yg==", - "dependencies": { - "multiformats": "^12.0.1" - } + "node_modules/blockstore-core/node_modules/multiformats": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.0.0.tgz", + "integrity": "sha512-xiIB0p7EKmETm3wyKedOg/xuyQ18PoWwXCzzgpZAiDxL9ktl3XTh8AqoDT5kAqRg+DU48XAGPsUJL2Rn6Bx3Lw==" }, "node_modules/bn.js": { "version": "5.2.1", @@ -2633,13 +2828,11 @@ "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" }, "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/braces": { @@ -2843,9 +3036,9 @@ } }, "node_modules/datastore-core": { - "version": "9.2.6", - "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-9.2.6.tgz", - "integrity": "sha512-7Y79V6Iw5v8Ie2jCT6wiDBaWfZuTPzM3NcJxXOyEGRLJT0qgxa24Yxym83tTuu6rTOB+a+yZZWj0jB4F5lyg8w==", + "version": "9.2.7", + "resolved": "https://registry.npmjs.org/datastore-core/-/datastore-core-9.2.7.tgz", + "integrity": "sha512-S5ADNGRy1p6kHT6Khld+FThe1ITHuUiyYQ84VX2Kv8s6cXDiUuLlYPBIbZaWIgqR/JwxQCwa+5/08w6BZSIAow==", "dependencies": { "@libp2p/logger": "^4.0.1", "err-code": "^3.0.1", @@ -2863,36 +3056,34 @@ } }, "node_modules/datastore-core/node_modules/@libp2p/interface": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-1.0.2.tgz", - "integrity": "sha512-z/3Yyg+7cVyzRXwzdrDkJd7YmNaLE9iZjQaixo5luI/n9uk5OFFjb9ulAsNqpq8V1xylCo2DXIC7f94KClwzVw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@libp2p/interface/-/interface-1.1.0.tgz", + "integrity": "sha512-URIKSFtaliBGA8sIg/MGfyjIo5h4jAdfuZl6dXXXmtdfC3X0rry95YuLNYzXtGMuxG/X+pbVht3fykHvPiXUhg==", "dependencies": { "@multiformats/multiaddr": "^12.1.10", "it-pushable": "^3.2.1", "it-stream-types": "^2.0.1", - "multiformats": "^12.1.3", + "multiformats": "^13.0.0", + "progress-events": "^1.0.0", "uint8arraylist": "^2.4.3" } }, "node_modules/datastore-core/node_modules/@libp2p/logger": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-4.0.2.tgz", - "integrity": "sha512-J9UMtMU9BKXNp+3c5kcI7HyWOPYg2B2E6sn1gEQckiSexTaz0wKJSlgTZ89f9F8bkC3AaC8ybXYuHbFQhwpTIg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@libp2p/logger/-/logger-4.0.3.tgz", + "integrity": "sha512-AydOzxLfJtfu7K/kjCRkO15llrr8Pc6BXVSOWVGFBCZ9e5+YHDuj8z5Pyc0YsXElMb/6hClGDJhw7nM8/EVqDA==", "dependencies": { - "@libp2p/interface": "^1.0.2", + "@libp2p/interface": "^1.1.0", "@multiformats/multiaddr": "^12.1.10", "debug": "^4.3.4", "interface-datastore": "^8.2.0", - "multiformats": "^12.1.3" + "multiformats": "^13.0.0" } }, - "node_modules/datastore-core/node_modules/uint8arrays": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.0.0.tgz", - "integrity": "sha512-RWO7gR4x6syxnKDfZO8mDCsaaYs1/BqZCxlHgrcRge50E9GTnLmtoA4kwFSGIL4s3dQkryeTkvtG6oEFEya3yg==", - "dependencies": { - "multiformats": "^12.0.1" - } + "node_modules/datastore-core/node_modules/multiformats": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.0.0.tgz", + "integrity": "sha512-xiIB0p7EKmETm3wyKedOg/xuyQ18PoWwXCzzgpZAiDxL9ktl3XTh8AqoDT5kAqRg+DU48XAGPsUJL2Rn6Bx3Lw==" }, "node_modules/debug": { "version": "4.3.4", @@ -3087,15 +3278,15 @@ } }, "node_modules/eslint": { - "version": "8.55.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.55.0.tgz", - "integrity": "sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==", + "version": "8.56.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", + "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.55.0", + "@eslint/js": "8.56.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -3212,6 +3403,28 @@ "url": "https://opencollective.com/eslint" } }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", @@ -3366,9 +3579,9 @@ "dev": true }, "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.16.0.tgz", + "integrity": "sha512-ifCoaXsDrsdkWTtiNJX5uzHDsrck5TzfKKDcuFFTIrrc/BS076qgEIfoIy1VeZqViznfKiysPYTh/QeHtnIsYA==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -3590,6 +3803,28 @@ "node": ">=10.13.0" } }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/globals": { "version": "13.24.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", @@ -3644,6 +3879,14 @@ "npm": ">=7.0.0" } }, + "node_modules/hamt-sharding/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/handlebars": { "version": "4.7.8", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", @@ -3733,6 +3976,14 @@ "uint8arrays": "^4.0.3" } }, + "node_modules/helia/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/human-signals": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz", @@ -3815,35 +4066,32 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "node_modules/interface-blockstore": { - "version": "5.2.7", - "resolved": "https://registry.npmjs.org/interface-blockstore/-/interface-blockstore-5.2.7.tgz", - "integrity": "sha512-B9UplmgUdQg15f/6xDJEbQYcjMm568cnqJsxSZYbDD0s6eQX5gKh58sd9H3aJEMosIy8T4vz9MwWWZuAOc3hQQ==", + "version": "5.2.9", + "resolved": "https://registry.npmjs.org/interface-blockstore/-/interface-blockstore-5.2.9.tgz", + "integrity": "sha512-2nyiiOcmGSE5Z0K/Dck5Ayp2a51g1CEG1JyasqNYU/y+n0ykrT9sxuq+Dtc2w3qGpPuBBUirC4HwfGgBT4Z5lA==", "dependencies": { "interface-store": "^5.0.0", - "multiformats": "^12.0.1" + "multiformats": "^13.0.0" } }, + "node_modules/interface-blockstore/node_modules/multiformats": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.0.0.tgz", + "integrity": "sha512-xiIB0p7EKmETm3wyKedOg/xuyQ18PoWwXCzzgpZAiDxL9ktl3XTh8AqoDT5kAqRg+DU48XAGPsUJL2Rn6Bx3Lw==" + }, "node_modules/interface-datastore": { - "version": "8.2.9", - "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-8.2.9.tgz", - "integrity": "sha512-J/8PN8TnB5xxCRtgu9Vx3zExdOzcTU5/DBF2dlU41deX1GW6/SPpbJo5DRNSnvzfjmwJ7YhUOIFXyccUp8nuAA==", + "version": "8.2.10", + "resolved": "https://registry.npmjs.org/interface-datastore/-/interface-datastore-8.2.10.tgz", + "integrity": "sha512-D8RuxMdjOPB+j6WMDJ+I2aXTDzUT6DIVjgzo1E+ODL7w8WrSFl9FXD2SYmgj6vVzdb7Kb5qmAI9pEnDZJz7ifg==", "dependencies": { "interface-store": "^5.0.0", "uint8arrays": "^5.0.0" } }, - "node_modules/interface-datastore/node_modules/uint8arrays": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.0.0.tgz", - "integrity": "sha512-RWO7gR4x6syxnKDfZO8mDCsaaYs1/BqZCxlHgrcRge50E9GTnLmtoA4kwFSGIL4s3dQkryeTkvtG6oEFEya3yg==", - "dependencies": { - "multiformats": "^12.0.1" - } - }, "node_modules/interface-store": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/interface-store/-/interface-store-5.1.5.tgz", - "integrity": "sha512-X0KnJBk3o+YL13MxZBMwa88/b3Mdrpm0yPzkSTKDDVn9BSPH7UK6W+ZtIPO2bxKOQVmq7zqOwAnYnpfqWjb6/g==" + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/interface-store/-/interface-store-5.1.7.tgz", + "integrity": "sha512-DVMTgZ43NAdDtXL3QsEq8N0vuUYVBxiGbxN0uI0lrNasuX/CGSrU7bjOO2DaGTMNut4Pt3ae+VQYFvNtH4Oyeg==" }, "node_modules/ip-regex": { "version": "5.0.0", @@ -3894,10 +4142,18 @@ "varint-decoder": "^1.0.0" } }, + "node_modules/ipfs-bitswap/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/ipfs-unixfs": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/ipfs-unixfs/-/ipfs-unixfs-11.1.0.tgz", - "integrity": "sha512-Lq37nKLJOpRFjx3rcg3y+ZwUxBX7jluKfIt5UPp6wb1L3dP0sj1yaLR0Yg2CdGYvHWyUpZD1iTnT8upL0ToDOw==", + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/ipfs-unixfs/-/ipfs-unixfs-11.1.2.tgz", + "integrity": "sha512-HVjrACOhU8RgMskcrfydk+FDAE9pFKr8tneKLaVYQ2f81HUKXoiSdgsAJY/jt7Ieyj4tE12TZGduIeWtNpScOw==", "dependencies": { "err-code": "^3.0.1", "protons-runtime": "^5.0.0", @@ -3909,9 +4165,9 @@ } }, "node_modules/ipfs-unixfs-exporter": { - "version": "13.2.2", - "resolved": "https://registry.npmjs.org/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-13.2.2.tgz", - "integrity": "sha512-poCxSte+SdQzuPc/Sm+gx/86VJu+IEsW6/Cfkq29yEUZDG8QuCvTkvuqAysKAYuN40aR9SjYqwYFRW/hsvspSw==", + "version": "13.2.5", + "resolved": "https://registry.npmjs.org/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-13.2.5.tgz", + "integrity": "sha512-NkrLCE8qOrM7InhUWzgZ6ZtJGVFrb2oEqmd0PWNiT8QhD8Aw2dS2wBuiG2yoJ34qPm4MgMfQa3FOxmteg3JjsQ==", "dependencies": { "@ipld/dag-cbor": "^9.0.0", "@ipld/dag-pb": "^4.0.0", @@ -3926,20 +4182,40 @@ "it-parallel": "^3.0.0", "it-pipe": "^3.0.1", "it-pushable": "^3.1.0", - "multiformats": "^12.0.1", - "p-queue": "^7.3.0", + "multiformats": "^13.0.0", + "p-queue": "^8.0.1", "progress-events": "^1.0.0", - "uint8arrays": "^4.0.2" + "uint8arrays": "^5.0.0" }, "engines": { "node": ">=16.0.0", "npm": ">=7.0.0" } }, + "node_modules/ipfs-unixfs-exporter/node_modules/multiformats": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.0.0.tgz", + "integrity": "sha512-xiIB0p7EKmETm3wyKedOg/xuyQ18PoWwXCzzgpZAiDxL9ktl3XTh8AqoDT5kAqRg+DU48XAGPsUJL2Rn6Bx3Lw==" + }, + "node_modules/ipfs-unixfs-exporter/node_modules/p-queue": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.0.1.tgz", + "integrity": "sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA==", + "dependencies": { + "eventemitter3": "^5.0.1", + "p-timeout": "^6.1.2" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ipfs-unixfs-importer": { - "version": "15.2.1", - "resolved": "https://registry.npmjs.org/ipfs-unixfs-importer/-/ipfs-unixfs-importer-15.2.1.tgz", - "integrity": "sha512-9ArBh7Xfz8gUSe8pq9c9ilBOXd1bbT3L+4xnI6w/usWLwnNT14p8WbFZjDD0MO1/PrD0PTUZuHNDS2l4EO+wPg==", + "version": "15.2.3", + "resolved": "https://registry.npmjs.org/ipfs-unixfs-importer/-/ipfs-unixfs-importer-15.2.3.tgz", + "integrity": "sha512-Vk6q6ubqb/v9uCYgXtTw9ejutXZxPMyT7wlSov3xAf5GHbbYsfL44nOYWQs6eX17eD7M9siyAjQ69+XL+hFXew==", "dependencies": { "@ipld/dag-pb": "^4.0.0", "@multiformats/murmur3": "^2.0.0", @@ -3952,21 +4228,26 @@ "it-batch": "^3.0.2", "it-first": "^3.0.2", "it-parallel-batch": "^3.0.1", - "multiformats": "^12.0.1", + "multiformats": "^13.0.0", "progress-events": "^1.0.0", "rabin-wasm": "^0.1.4", "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.2" + "uint8arrays": "^5.0.0" }, "engines": { "node": ">=16.0.0", "npm": ">=7.0.0" } }, + "node_modules/ipfs-unixfs-importer/node_modules/multiformats": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.0.0.tgz", + "integrity": "sha512-xiIB0p7EKmETm3wyKedOg/xuyQ18PoWwXCzzgpZAiDxL9ktl3XTh8AqoDT5kAqRg+DU48XAGPsUJL2Rn6Bx3Lw==" + }, "node_modules/ipns": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/ipns/-/ipns-7.0.1.tgz", - "integrity": "sha512-S74hlKNeAW9eExGmRwEfOLAk5l/lEL3HajcenbIc7PTeyeL6PkKE31qQmTi7qynn1ll32hMAo1OagbtnceCtXQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/ipns/-/ipns-7.0.2.tgz", + "integrity": "sha512-jsrIgsCmFZL/kATuO+4N5Oy3b4xhnO42N39nCLyhhC8NM+SZIxTmZmUSDU0GoI8Vn0X/Zy2Sj3Lxbhg3UlVMUA==", "dependencies": { "@libp2p/crypto": "^2.0.3", "@libp2p/interface": "^0.1.2", @@ -3979,7 +4260,7 @@ "protons-runtime": "^5.0.0", "timestamp-nano": "^1.0.0", "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.2" + "uint8arrays": "^5.0.1" } }, "node_modules/is-binary-path": { @@ -4169,28 +4450,6 @@ "minimatch": "^9.0.0" } }, - "node_modules/it-glob/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/it-glob/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/it-handshake": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/it-handshake/-/it-handshake-4.1.3.tgz", @@ -4218,16 +4477,16 @@ "integrity": "sha512-RS3thYkvqtWksrV7SaAnTv+pgY7ozpS17HlRvWvcnoRjVyNJMuffdCkIKpKNPTq5uZw9zVnkVKLO077pJn5Yhg==" }, "node_modules/it-length-prefixed": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-9.0.3.tgz", - "integrity": "sha512-YAu424ceYpXctxtjcLOqn7vJq082CaoP8J646ZusYISfQc3bpzQErgTUqMFj81V262KG2W9/YMBHsy6A/4yvmg==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/it-length-prefixed/-/it-length-prefixed-9.0.4.tgz", + "integrity": "sha512-lz28fykbG0jq7s5XtvlzGxO5BeSOw6ikymkRllxjL21V5VKLcvB4pHr9wPvEnsAJ2et1xpOk3BRTMq9XrhgKsg==", "dependencies": { "err-code": "^3.0.1", "it-reader": "^6.0.1", "it-stream-types": "^2.0.1", "uint8-varint": "^2.0.1", "uint8arraylist": "^2.0.0", - "uint8arrays": "^4.0.2" + "uint8arrays": "^5.0.1" }, "engines": { "node": ">=16.0.0", @@ -4377,14 +4636,6 @@ "uint8arrays": "^5.0.0" } }, - "node_modules/it-to-buffer/node_modules/uint8arrays": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.0.0.tgz", - "integrity": "sha512-RWO7gR4x6syxnKDfZO8mDCsaaYs1/BqZCxlHgrcRge50E9GTnLmtoA4kwFSGIL4s3dQkryeTkvtG6oEFEya3yg==", - "dependencies": { - "multiformats": "^12.0.1" - } - }, "node_modules/it-ws": { "version": "6.1.1", "resolved": "https://registry.npmjs.org/it-ws/-/it-ws-6.1.1.tgz", @@ -4401,14 +4652,6 @@ "npm": ">=7.0.0" } }, - "node_modules/it-ws/node_modules/uint8arrays": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.0.0.tgz", - "integrity": "sha512-RWO7gR4x6syxnKDfZO8mDCsaaYs1/BqZCxlHgrcRge50E9GTnLmtoA4kwFSGIL4s3dQkryeTkvtG6oEFEya3yg==", - "dependencies": { - "multiformats": "^12.0.1" - } - }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -4529,6 +4772,14 @@ "xsalsa20": "^1.1.0" } }, + "node_modules/libp2p/node_modules/uint8arrays": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", + "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "dependencies": { + "multiformats": "^12.0.1" + } + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -4660,15 +4911,17 @@ } }, "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", "dependencies": { - "brace-expansion": "^1.1.7" + "brace-expansion": "^2.0.1" }, "engines": { - "node": "*" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/minimist": { @@ -4724,15 +4977,6 @@ "url": "https://opencollective.com/mochajs" } }, - "node_modules/mocha/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/mocha/node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -4810,15 +5054,30 @@ } }, "node_modules/mortice": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/mortice/-/mortice-3.0.3.tgz", - "integrity": "sha512-C1maDct5qTPH6dDXEzZg9XP+RteVHsdQ3IRdOF2Halll5qsCKYVwNL1x9FHGs3xOFvB6xerqxY9AG+Ac6aLr6A==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/mortice/-/mortice-3.0.4.tgz", + "integrity": "sha512-MUHRCAztSl4v/dAmK8vbYi5u1n9NZtQu4H3FsqS7qgMFQIAFw9lTpHiErd9kJpapqmvEdD1L3dUmiikifAvLsQ==", "dependencies": { "observable-webworkers": "^2.0.1", - "p-queue": "^7.2.0", + "p-queue": "^8.0.1", "p-timeout": "^6.0.0" } }, + "node_modules/mortice/node_modules/p-queue": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-8.0.1.tgz", + "integrity": "sha512-NXzu9aQJTAzbBqOt2hwsR63ea7yvxJc0PwN/zobNAudYfb1B7R08SzB4TsLeSbUCuG467NhnoT0oO6w1qRO+BA==", + "dependencies": { + "eventemitter3": "^5.0.1", + "p-timeout": "^6.1.2" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -4982,9 +5241,9 @@ } }, "node_modules/node-datachannel": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/node-datachannel/-/node-datachannel-0.5.2.tgz", - "integrity": "sha512-COuQtVSZc80jt7TV2/BlksOiqZyNFbitDENy8MensezoA7pEGB+lmd9Qk3dnmSZ1nr1vyhF44FL7IkKsQ52Mvw==", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/node-datachannel/-/node-datachannel-0.5.3.tgz", + "integrity": "sha512-aOp+6P2TC6+u36L06yeUAYpBp5FqpDGjIbIJQvC5AY9HX9ZVoqUO3ysLlswnpQRM7wJt8LhBuHxiPkLoM5xEUA==", "hasInstallScript": true, "dependencies": { "node-domexception": "^2.0.1", @@ -5047,9 +5306,9 @@ } }, "node_modules/npm-run-path": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.1.0.tgz", - "integrity": "sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.2.0.tgz", + "integrity": "sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==", "dependencies": { "path-key": "^4.0.0" }, @@ -5201,9 +5460,9 @@ } }, "node_modules/p-retry": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-6.1.0.tgz", - "integrity": "sha512-fJLEQ2KqYBJRuaA/8cKMnqhulqNM+bpcjYtXNex2t3mOXKRYPitAJt9NacSf8XAFzcYahSAbKpobiWDSqHSh2g==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/p-retry/-/p-retry-6.2.0.tgz", + "integrity": "sha512-JA6nkq6hKyWLLasXQXUrO4z8BUZGUt/LjlJxx8Gb2+2ntodU/SS63YZ8b0LUTbQ8ZB9iwOfhEPhg4ykKnn2KsA==", "dependencies": { "@types/retry": "0.12.2", "is-network-error": "^1.0.0", @@ -5410,12 +5669,12 @@ } }, "node_modules/protons-runtime": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-5.2.0.tgz", - "integrity": "sha512-jL3VSbXllgm17zurKQ/z+Ath0w+4BknJ+l/NLocfjAB8hbeASOZTNtb7zK3nDsKq2pHK9YFumNQvpkZ6gFfWhA==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/protons-runtime/-/protons-runtime-5.2.1.tgz", + "integrity": "sha512-Rt4ORm1WR62ysrXX5sCV32a5jPwVoIpU90XUzrdAfMIOSNTizvqlx/7wedNpogvZjUUY/gLJp3VftpA+ebx/og==", "dependencies": { "uint8arraylist": "^2.4.3", - "uint8arrays": "^4.0.6" + "uint8arrays": "^5.0.1" } }, "node_modules/pump": { @@ -6172,30 +6431,35 @@ } }, "node_modules/uint8-varint": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/uint8-varint/-/uint8-varint-2.0.2.tgz", - "integrity": "sha512-LZXmBT0jiHR7J4oKM1GUhtdLFW1yPauzI8NjJlotXn92TprO9u8VMvEVR4QMk8xhUVUd+2fqfU2/kGbVHYSSWw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/uint8-varint/-/uint8-varint-2.0.3.tgz", + "integrity": "sha512-seXTM8ba4uuAMDgi3UHXPdDxCBKjWWZigW+F+1ESPhOZv9ekT1qmbdzYHLSNA+u+wHj10P55dQ41y2Qh7NOqiA==", "dependencies": { "uint8arraylist": "^2.0.0", - "uint8arrays": "^4.0.2" + "uint8arrays": "^5.0.0" } }, "node_modules/uint8arraylist": { - "version": "2.4.7", - "resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-2.4.7.tgz", - "integrity": "sha512-ohRElqR6C5dd60vRFLq40MCiSnUe1AzkpHvbCEMCGGP6zMoFYECsjdhL6bR1kTK37ONNRDuHQ3RIpScRYcYYIg==", + "version": "2.4.8", + "resolved": "https://registry.npmjs.org/uint8arraylist/-/uint8arraylist-2.4.8.tgz", + "integrity": "sha512-vc1PlGOzglLF0eae1M8mLRTBivsvrGsdmJ5RbK3e+QRvRLOZfZhQROTwH/OfyF3+ZVUg9/8hE8bmKP2CvP9quQ==", "dependencies": { - "uint8arrays": "^4.0.2" + "uint8arrays": "^5.0.1" } }, "node_modules/uint8arrays": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-4.0.10.tgz", - "integrity": "sha512-AnJNUGGDJAgFw/eWu/Xb9zrVKEGlwJJCaeInlf3BkecE/zcTobk5YXYIPNQJO1q5Hh1QZrQQHf0JvcHqz2hqoA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-5.0.1.tgz", + "integrity": "sha512-ND5RpJAnPgHmZT7hWD/2T4BwRp04j8NLKvMKC/7bhiEwEjUMkQ4kvBKiH6hOqbljd6qJ2xS8reL3vl1e33grOQ==", "dependencies": { - "multiformats": "^12.0.1" + "multiformats": "^13.0.0" } }, + "node_modules/uint8arrays/node_modules/multiformats": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.0.0.tgz", + "integrity": "sha512-xiIB0p7EKmETm3wyKedOg/xuyQ18PoWwXCzzgpZAiDxL9ktl3XTh8AqoDT5kAqRg+DU48XAGPsUJL2Rn6Bx3Lw==" + }, "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", @@ -6330,9 +6594,9 @@ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" }, "node_modules/ws": { - "version": "8.15.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.15.1.tgz", - "integrity": "sha512-W5OZiCjXEmk0yZ66ZN82beM5Sz7l7coYxpRkzS+p9PP+ToQry8szKh+61eNktr7EA9DOwvFGhfC605jDHbP6QQ==", + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz", + "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==", "engines": { "node": ">=10.0.0" }, diff --git a/pallets/time-release/Cargo.toml b/pallets/time-release/Cargo.toml index 7e209709d8..f6a6013e31 100644 --- a/pallets/time-release/Cargo.toml +++ b/pallets/time-release/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-time-release" -description = "Provides scheduled balance locking mechanism, in a *graded release* way." +description = "Provides scheduled balance freezing mechanism, in a *graded release* way." authors = ["Frequency"] edition = "2021" homepage = "https://frequency.xyz" @@ -23,11 +23,12 @@ sp-io = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } frame-benchmarking = { workspace = true, optional = true } +sp-core = { workspace = true } +log = { workspace = true, default-features = false } [dev-dependencies] chrono = { workspace = true } pallet-balances = { workspace = true } -sp-core = { workspace = true } common-primitives = { default-features = false, path = "../../common/primitives" } [features] diff --git a/pallets/time-release/README.md b/pallets/time-release/README.md index 55e67b523f..308f13285d 100644 --- a/pallets/time-release/README.md +++ b/pallets/time-release/README.md @@ -4,8 +4,8 @@ This pallet is a fork of the [ORML-vesting]( [vesting](https://github.com/open-w ## Overview -Time-release module provides a means of scheduled balance lock on an account. It uses the *graded release* way, which unlocks a specific amount of balance every period of time, until all balance unlocked. +The `time-release` module offers a method for scheduling a balance freeze on an account. It employs a *graded release* approach, which thaws a specific amount of balance every period of time, until all balance is thawed. ### Release Schedule -The schedule of a release on hold is described by data structure `ReleaseSchedule`: from the block number of `start`, for every `period` amount of blocks, `per_period` amount of balance would unlocked, until number of periods `period_count` reached. Note in release schedules, *time* is measured by block number. All `ReleaseSchedule`s under an account could be queried in chain state. +The schedule of a release on hold is described by the data structure `ReleaseSchedule`. Starting from the specified block number denoted as `start`, the schedule operates on a periodic basis. For each `period` amount of blocks, a designated `per_period` amount of balance is unfrozen. This process continues until the specified number of periods, denoted as `period_count`, is reached. It's important to highlight that in release schedules, the concept of time is measured in terms of block numbers. Accessing all `ReleaseSchedule` instances associated with an account is possible through querying the chain state. diff --git a/pallets/time-release/src/benchmarking.rs b/pallets/time-release/src/benchmarking.rs index 685d0bcb37..7dafbc1a44 100644 --- a/pallets/time-release/src/benchmarking.rs +++ b/pallets/time-release/src/benchmarking.rs @@ -4,7 +4,6 @@ use super::*; use crate::Pallet as TimeReleasePallet; use frame_benchmarking::{account, benchmarks, whitelist_account, whitelisted_caller}; -use frame_support::traits::{Currency, Imbalance}; use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; use sp_runtime::{traits::TrailingZeroInput, SaturatedConversion}; use sp_std::prelude::*; @@ -17,9 +16,8 @@ pub type Schedule = ReleaseSchedule, BalanceOf>; const SEED: u32 = 0; fn set_balance(who: &T::AccountId, balance: BalanceOf) { - let deposit_result = T::Currency::deposit_creating(who, balance.saturated_into()); - let actual_deposit = deposit_result.peek(); - assert_eq!(balance, actual_deposit); + let actual_deposit = T::Currency::mint_into(&who, balance.saturated_into()); + assert_eq!(balance, actual_deposit.unwrap()); } fn lookup_of_account( @@ -76,7 +74,7 @@ benchmarks! { }: _(RawOrigin::Signed(to.clone())) verify { assert_eq!( - T::Currency::free_balance(&to), + T::Currency::balance(&to), schedule.total_amount().unwrap() * BalanceOf::::from(i) , ); } @@ -103,7 +101,7 @@ benchmarks! { }: _(RawOrigin::Root, to_lookup, schedules) verify { assert_eq!( - T::Currency::free_balance(&to), + T::Currency::balance(&to), schedule.total_amount().unwrap() * BalanceOf::::from(i) ); } diff --git a/pallets/time-release/src/lib.rs b/pallets/time-release/src/lib.rs index e3048bdcf3..ed4deb7627 100644 --- a/pallets/time-release/src/lib.rs +++ b/pallets/time-release/src/lib.rs @@ -4,15 +4,15 @@ //! //! ## Overview //! -//! Time-release module provides a means of scheduled balance lock on an account. It -//! uses the *graded release* way, which unlocks a specific amount of balance -//! every period of time, until all balance unlocked. +//! Time-release module provides a means of scheduled release (thaw) of a frozen balance in an account. +//! It uses the *graded release* approach, which thaws a specific amount of balance per period (measured +//! in blocks), until all frozen balances are thawed. //! //! ### Release Schedule //! //! The schedule of a release is described by data structure `ReleaseSchedule`: //! from the block number of `start`, for every `period` amount of blocks, -//! `per_period` amount of balance would unlocked, until number of periods +//! `per_period` amount of balance would thaw, until number of periods //! `period_count` reached. Note in release schedules, *time* is measured by //! block number. All `ReleaseSchedule`s under an account could be queried in //! chain state. @@ -22,7 +22,7 @@ //! ### Dispatchable Functions //! //! - `transfer` - Add a new release schedule for an account. -//! - `claim` - Claim unlocked balances. +//! - `claim` - Claim thawed balances. //! - `update_release_schedules` - Update all release schedules under an //! account, `root` origin required. // Substrate macros are tripping the clippy::expect_used lint. @@ -37,18 +37,22 @@ )] use frame_support::{ + dispatch::DispatchResult, ensure, pallet_prelude::*, traits::{ - BuildGenesisConfig, Currency, EnsureOrigin, ExistenceRequirement, Get, LockIdentifier, - LockableCurrency, WithdrawReasons, + tokens::{ + fungible::{Inspect as InspectFungible, Mutate, MutateFreeze}, + Balance, Preservation, + }, + BuildGenesisConfig, EnsureOrigin, Get, }, BoundedVec, }; use frame_system::{ensure_root, ensure_signed, pallet_prelude::*}; use sp_runtime::{ traits::{BlockNumberProvider, CheckedAdd, StaticLookup, Zero}, - ArithmeticError, DispatchResult, + ArithmeticError, }; use sp_std::vec::Vec; @@ -57,6 +61,9 @@ mod mock; #[cfg(test)] mod tests; +/// storage migrations +pub mod migration; + mod types; pub use types::*; @@ -68,15 +75,13 @@ mod benchmarking; pub use module::*; -/// The lock identifier for timed released transfers. -pub const RELEASE_LOCK_ID: LockIdentifier = *b"timeRels"; - #[frame_support::pallet] pub mod module { use super::*; - pub(crate) type BalanceOf = - <::Currency as Currency<::AccountId>>::Balance; + pub(crate) type BalanceOf = <::Currency as InspectFungible< + ::AccountId, + >>::Balance; pub(crate) type ReleaseScheduleOf = ReleaseSchedule, BalanceOf>; /// Scheduled item used for configuring genesis. @@ -88,13 +93,32 @@ pub mod module { BalanceOf, ); + /// A reason for freezing funds. + /// Creates a freeze reason for this pallet that is aggregated by `construct_runtime`. + #[pallet::composite_enum] + pub enum FreezeReason { + /// Funds are currently frozen and are not yet liquid. + TimeReleaseVesting, + } + + /// the storage version for this pallet + pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(2); + #[pallet::config] pub trait Config: frame_system::Config { /// The overarching event type. type RuntimeEvent: From> + IsType<::RuntimeEvent>; - /// The currency trait used to set a lock on a balance. - type Currency: LockableCurrency>; + /// The overarching freeze reason. + type RuntimeFreezeReason: From; + + /// We need MaybeSerializeDeserialize because of the genesis config. + type Balance: Balance + MaybeSerializeDeserialize; + + /// The currency trait used to set a freeze on a balance. + type Currency: MutateFreeze + + InspectFungible + + Mutate; #[pallet::constant] /// The minimum amount transferred to call `transfer`. @@ -119,8 +143,8 @@ pub mod module { ZeroReleasePeriod, /// Period-count is zero ZeroReleasePeriodCount, - /// Insufficient amount of balance to lock - InsufficientBalanceToLock, + /// Insufficient amount of balance to freeze + InsufficientBalanceToFreeze, /// This account have too many release schedules TooManyReleaseSchedules, /// The transfer amount is too low @@ -207,22 +231,23 @@ pub mod module { .expect("Invalid release schedule"); assert!( - T::Currency::free_balance(who) >= total_amount, - "Account do not have enough balance" + T::Currency::balance(who) >= total_amount, + "Account does not have enough balance." ); - T::Currency::set_lock( - RELEASE_LOCK_ID, + T::Currency::set_freeze( + &FreezeReason::TimeReleaseVesting.into(), who, total_amount, - WithdrawReasons::all(), - ); + ) + .expect("Failed to set freeze"); ReleaseSchedules::::insert(who, bounded_schedules); }); } } #[pallet::pallet] + #[pallet::storage_version(STORAGE_VERSION)] pub struct Pallet(_); #[pallet::hooks] @@ -230,7 +255,7 @@ pub mod module { #[pallet::call] impl Pallet { - /// Claim unlocked balances. + /// Claim thawed balances. /// /// # Events /// * [`Event::Claimed`] @@ -239,9 +264,9 @@ pub mod module { #[pallet::weight(T::WeightInfo::claim(::MaxReleaseSchedules::get() / 2))] pub fn claim(origin: OriginFor) -> DispatchResult { let who = ensure_signed(origin)?; - let locked_amount = Self::do_claim(&who); + let frozen_amount = Self::do_claim(&who)?; - Self::deposit_event(Event::Claimed { who, amount: locked_amount }); + Self::deposit_event(Event::Claimed { who, amount: frozen_amount }); Ok(()) } @@ -252,7 +277,7 @@ pub mod module { /// /// # Errors /// - /// * [`Error::InsufficientBalanceToLock] - Insuffience amount of balance to lock. + /// * [`Error::InsufficientBalanceToFreeze] - Insufficient amount of balance to freeze. /// * [`Error::MaxReleaseSchedulesExceeded] - Failed because the maximum release schedules was exceeded- /// * [`ArithmeticError::Overflow] - Failed because of an overflow. /// @@ -268,9 +293,9 @@ pub mod module { if to == from { ensure!( - T::Currency::free_balance(&from) >= + T::Currency::balance(&from) >= schedule.total_amount().ok_or(ArithmeticError::Overflow)?, - Error::::InsufficientBalanceToLock, + Error::::InsufficientBalanceToFreeze, ); } @@ -291,7 +316,7 @@ pub mod module { /// /// # Errors /// - /// * [`Error::InsufficientBalanceToLock] - Insuffience amount of balance to lock. + /// * [`Error::InsufficientBalanceToFreeze] - Insufficient amount of balance to freeze. /// * [`Error::MaxReleaseSchedulesExceeded] - Failed because the maximum release schedules was exceeded- /// * [`ArithmeticError::Overflow] - Failed because of an overflow. /// @@ -311,7 +336,7 @@ pub mod module { Ok(()) } - /// Claim unlocked balances on behalf for an account. + /// Claim thawed balances on behalf for an account. /// /// # Events /// * [`Event::Claimed`] @@ -324,24 +349,24 @@ pub mod module { ) -> DispatchResult { ensure_signed(origin)?; let who = T::Lookup::lookup(dest)?; - let locked_amount = Self::do_claim(&who); + let frozen_amount = Self::do_claim(&who)?; - Self::deposit_event(Event::Claimed { who, amount: locked_amount }); + Self::deposit_event(Event::Claimed { who, amount: frozen_amount }); Ok(()) } } } impl Pallet { - fn do_claim(who: &T::AccountId) -> BalanceOf { - let locked = Self::prune_and_get_locked_balance(who); - if locked.is_zero() { - Self::delete_lock(who); + fn do_claim(who: &T::AccountId) -> Result, DispatchError> { + let frozen = Self::prune_and_get_frozen_balance(who); + if frozen.is_zero() { + Self::delete_freeze(who)?; } else { - Self::update_lock(who, locked); + Self::update_freeze(who, frozen)?; } - locked + Ok(frozen) } /// Deletes schedules that have released all funds up to a block-number. @@ -350,7 +375,7 @@ impl Pallet { block_number: BlockNumberFor, ) -> BoundedVec, T::MaxReleaseSchedules> { let mut schedules = Self::release_schedules(who); - schedules.retain(|schedule| !schedule.locked_amount(block_number).is_zero()); + schedules.retain(|schedule| !schedule.frozen_amount(block_number).is_zero()); if schedules.is_empty() { ReleaseSchedules::::remove(who); @@ -361,15 +386,15 @@ impl Pallet { schedules } - /// Returns locked balance based on current block number. - fn prune_and_get_locked_balance(who: &T::AccountId) -> BalanceOf { + /// Returns frozen balance based on current block number. + fn prune_and_get_frozen_balance(who: &T::AccountId) -> BalanceOf { let now = T::BlockNumberProvider::current_block_number(); let schedules = Self::prune_schedules_for(&who, now); let total = schedules .iter() - .fold(BalanceOf::::zero(), |acc, schedule| acc + schedule.locked_amount(now)); + .fold(BalanceOf::::zero(), |acc, schedule| acc + schedule.frozen_amount(now)); total } @@ -381,13 +406,13 @@ impl Pallet { ) -> DispatchResult { let schedule_amount = ensure_valid_release_schedule::(&schedule)?; - let total_amount = Self::prune_and_get_locked_balance(to) + let total_amount = Self::prune_and_get_frozen_balance(to) .checked_add(&schedule_amount) .ok_or(ArithmeticError::Overflow)?; - T::Currency::transfer(from, to, schedule_amount, ExistenceRequirement::AllowDeath)?; + T::Currency::transfer(from, to, schedule_amount, Preservation::Expendable)?; - Self::update_lock(&to, total_amount); + Self::update_freeze(&to, total_amount)?; >::try_append(to, schedule) .map_err(|_| Error::::MaxReleaseSchedulesExceeded)?; @@ -403,9 +428,9 @@ impl Pallet { BoundedVec::, T::MaxReleaseSchedules>::try_from(schedules) .map_err(|_| Error::::MaxReleaseSchedulesExceeded)?; - // empty release schedules cleanup the storage and unlock the fund + // empty release schedules cleanup the storage and thaw the funds if bounded_schedules.is_empty() { - Self::delete_release_schedules(who); + Self::delete_release_schedules(who)?; return Ok(()) } @@ -418,23 +443,22 @@ impl Pallet { }, )?; - ensure!( - T::Currency::free_balance(who) >= total_amount, - Error::::InsufficientBalanceToLock, - ); + ensure!(T::Currency::balance(who) >= total_amount, Error::::InsufficientBalanceToFreeze,); - Self::update_lock(&who, total_amount); + Self::update_freeze(&who, total_amount)?; Self::set_schedules_for(who, bounded_schedules); Ok(()) } - fn update_lock(who: &T::AccountId, locked: BalanceOf) { - T::Currency::set_lock(RELEASE_LOCK_ID, who, locked, WithdrawReasons::all()); + fn update_freeze(who: &T::AccountId, frozen: BalanceOf) -> DispatchResult { + T::Currency::set_freeze(&FreezeReason::TimeReleaseVesting.into(), who, frozen)?; + Ok(()) } - fn delete_lock(who: &T::AccountId) { - T::Currency::remove_lock(RELEASE_LOCK_ID, who); + fn delete_freeze(who: &T::AccountId) -> DispatchResult { + T::Currency::thaw(&FreezeReason::TimeReleaseVesting.into(), who)?; + Ok(()) } fn set_schedules_for( @@ -444,9 +468,10 @@ impl Pallet { ReleaseSchedules::::insert(who, schedules); } - fn delete_release_schedules(who: &T::AccountId) { + fn delete_release_schedules(who: &T::AccountId) -> DispatchResult { >::remove(who); - Self::delete_lock(who); + Self::delete_freeze(who)?; + Ok(()) } } diff --git a/pallets/time-release/src/migration/mod.rs b/pallets/time-release/src/migration/mod.rs new file mode 100644 index 0000000000..c34354a101 --- /dev/null +++ b/pallets/time-release/src/migration/mod.rs @@ -0,0 +1,2 @@ +/// migrations to v2 +pub mod v2; diff --git a/pallets/time-release/src/migration/v2.rs b/pallets/time-release/src/migration/v2.rs new file mode 100644 index 0000000000..b97ccc48a8 --- /dev/null +++ b/pallets/time-release/src/migration/v2.rs @@ -0,0 +1,278 @@ +use crate::{types, BalanceOf, BlockNumberFor, Config, FreezeReason, Pallet, ReleaseSchedules}; +use frame_support::{ + pallet_prelude::{GetStorageVersion, IsType, Weight}, + traits::{ + fungible::MutateFreeze, Get, LockIdentifier, LockableCurrency, OnRuntimeUpgrade, + StorageVersion, + }, +}; +use parity_scale_codec::Encode; +use sp_core::hexdisplay::HexDisplay; +use sp_runtime::{traits::Zero, Saturating}; + +const LOG_TARGET: &str = "runtime::time-release"; + +#[cfg(feature = "try-runtime")] +use sp_std::vec::Vec; + +const RELEASE_LOCK_ID: LockIdentifier = *b"timeRels"; + +/// The OnRuntimeUpgrade implementation for this storage migration +pub struct MigrationToV2(sp_std::marker::PhantomData<(T, OldCurrency)>); +impl MigrationToV2 +where + T: Config, + OldCurrency: 'static + LockableCurrency>, + OldCurrency::Balance: IsType>, +{ + /// Translate time release locked deposit to frozen deposit + pub fn translate_lock_to_freeze( + account_id: &T::AccountId, + amount: OldCurrency::Balance, + ) -> Weight { + // 1 read get Freezes: set_freeze: get locks + // 1 read get Locks: update_freezes: Locks::get().iter() + // 1 write set Account: update_freezes->mutate_account->try_mutate_account->ensure_upgraded: if account is *not* already upgraded. + // 1 write set Account: update_freezes->mutate_account->try_mutate_account: set account data + // 1 write set Freezes: update_freezes: Freezes::insert + T::Currency::set_freeze( + &FreezeReason::TimeReleaseVesting.into(), + &account_id, + amount.into(), + ) + .unwrap_or_else(|err| { + log::error!( + target: LOG_TARGET, + "Failed to freeze {:?} from account 0x{:?}, reason: {:?}", + amount, + HexDisplay::from(&account_id.encode()), + err + ); + }); + + // 1 read get Locks: remove_lock: get locks + // 1 read get Freezes + // 1 read get Account + // 1 write set Account: update_locks->try_mutate_account->ensure_upgraded: if account is *not* already upgraded. + // 1 write set Account: update_locks->try_mutate_account: set account data + // [Cached] 1 read get Locks: update_locks: set existed with `contains_key` + // 1 write set Locks: update_locks->Locks::remove: remove existed + OldCurrency::remove_lock(RELEASE_LOCK_ID, &account_id); + + T::DbWeight::get().reads_writes(5, 6) + } +} + +impl OnRuntimeUpgrade for MigrationToV2 +where + T: Config, + OldCurrency: 'static + LockableCurrency>, + OldCurrency::Balance: IsType>, +{ + fn on_runtime_upgrade() -> Weight { + log::info!(target: LOG_TARGET, "Running storage migration..."); + + let on_chain_version = Pallet::::on_chain_storage_version(); + + // storage was already migrated. + if on_chain_version.ge(&2) { + log::warn!( + target: LOG_TARGET, + "Old Time Release Locks->Freezes migration attempted to run. Please remove" + ); + return T::DbWeight::get().reads(1) + } + + log::info!(target: LOG_TARGET, "🔄 Time Release Locks->Freezes migration started"); + // The migration started with 1r to get the on_chain_storage_version + let mut total_weight = T::DbWeight::get().reads_writes(1, 0); + let mut total_accounts_migrated = 0u32; + + // Get all the keys(accounts) from the ReleaseSchedules storage + ReleaseSchedules::::iter() + .map(|(account_id, _)| account_id) + .for_each(|account_id| { + let (total_amount, cal_fn_weight) = calculate_total_scheduled_frozen_for_account::(&account_id); + + let trans_fn_weight = MigrationToV2::::translate_lock_to_freeze( + &account_id, + total_amount.into(), + ); + + total_weight = total_weight.saturating_add(cal_fn_weight).saturating_add(trans_fn_weight); + + total_accounts_migrated += 1; + + log::info!(target: LOG_TARGET, "🔄 migrated account 0x{:?}, amount:{:?}", HexDisplay::from(&account_id.encode()), total_amount); + }); + + log::info!( + target: LOG_TARGET, + "total accounts migrated from locks to frozen {:?}", + total_accounts_migrated + ); + + StorageVersion::new(2).put::>(); + total_weight.saturating_add(T::DbWeight::get().reads_writes(0, 1)); + + log::info!(target: LOG_TARGET, "🔄 Time Release migration finished"); + log::info!( + target: LOG_TARGET, + "Time Release Migration calculated weight = {:?}", + total_weight + ); + + total_weight + } + + #[cfg(feature = "try-runtime")] + fn pre_upgrade() -> Result, sp_runtime::TryRuntimeError> { + use frame_support::storage::generator::StorageMap; + + let on_chain_version = Pallet::::on_chain_storage_version(); // 1r + if on_chain_version >= 2 { + return Ok(Vec::new()) + } + + let pallet_prefix = ReleaseSchedules::::module_prefix(); + let storage_prefix = ReleaseSchedules::::storage_prefix(); + assert_eq!(&b"TimeRelease"[..], pallet_prefix); + assert_eq!(&b"ReleaseSchedules"[..], storage_prefix); + log::info!(target: LOG_TARGET, "Running pre_upgrade..."); + + let count = ReleaseSchedules::::iter().count() as u32; + log::info!(target: LOG_TARGET, "Finish pre_upgrade for {:?} records", count); + Ok(count.encode()) + } + + #[cfg(feature = "try-runtime")] + fn post_upgrade(state: Vec) -> Result<(), sp_runtime::TryRuntimeError> { + use parity_scale_codec::Decode; + + let on_chain_version = Pallet::::on_chain_storage_version(); // 1r + if on_chain_version >= 2 { + return Ok(()) + } + let pre_upgrade_count: u32 = Decode::decode(&mut state.as_slice()).unwrap_or_default(); + let on_chain_version = Pallet::::on_chain_storage_version(); + + assert_eq!(on_chain_version, crate::module::STORAGE_VERSION); + assert_eq!(pre_upgrade_count as usize, ReleaseSchedules::::iter().count()); + + log::info!(target: LOG_TARGET, "✅ migration post_upgrade checks passed"); + Ok(()) + } +} + +fn calculate_total_scheduled_frozen_for_account( + account_id: &T::AccountId, +) -> (BalanceOf, Weight) { + let total = ReleaseSchedules::::get(&account_id) // 1r + .iter() + .map(|schedule: &types::ReleaseSchedule, BalanceOf>| { + schedule.total_amount() + }) + .fold(Zero::zero(), |acc: BalanceOf, amount| { + acc.saturating_add(amount.unwrap_or(Zero::zero())) + }); + + (total, T::DbWeight::get().reads(1)) +} + +#[cfg(test)] +mod test { + use frame_support::traits::{tokens::fungible::InspectFreeze, WithdrawReasons}; + + use super::*; + use crate::mock::{Test as T, *}; + use pallet_balances::{BalanceLock, Reasons}; + + type MigrationOf = MigrationToV2>; + + #[test] + fn migration_works() { + ExtBuilder::build().execute_with(|| { + assert_eq!(pallet_balances::Pallet::::free_balance(&DAVE), DAVE_BALANCE); + + let schedules = vec![ + // who, start, period, period_count, per_period + (DAVE, 2, 3, 1, 5), + ]; + + create_schedules_and_set_freeze(schedules); + + assert_eq!( + pallet_balances::Pallet::::locks(&DAVE) + .iter() + .find(|l| l.id == RELEASE_LOCK_ID), + Some(&BalanceLock { + id: RELEASE_LOCK_ID, + amount: 5u64.into(), + reasons: Reasons::All + }) + ); + + // Run migration. + let pre_upgrade_count = ReleaseSchedules::::iter().count() as u32; + MigrationOf::::on_runtime_upgrade(); + let on_chain_version = Pallet::::on_chain_storage_version(); + + assert_eq!(on_chain_version, crate::module::STORAGE_VERSION); + assert_eq!(pre_upgrade_count as usize, ReleaseSchedules::::iter().count()); + + assert_eq!( + pallet_balances::Pallet::::locks(&DAVE), + vec![], + "Locks should be empty" + ); + assert_eq!( + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &DAVE + ), + 5u64, + "Frozen balance should be 5 for account {:?}", + DAVE + ); + }) + } + + fn create_schedules_and_set_freeze(schedules: Vec<(AccountId, u32, u32, u32, u64)>) { + schedules.iter().for_each(|(who, start, period, period_count, per_period)| { + let mut bounded_schedules = ReleaseSchedules::::get(who); + let new_schedule = types::ReleaseSchedule { + start: *start, + period: *period, + period_count: *period_count, + per_period: *per_period, + }; + + bounded_schedules + .try_push(new_schedule.clone()) + .expect("Max release schedules exceeded"); + + let total_amount = bounded_schedules.iter().fold( + Zero::zero(), + |acc_amount: BalanceOf, schedule| { + acc_amount.saturating_add(schedule.total_amount().unwrap_or(Zero::zero())) + }, + ); + + assert_eq!(total_amount, new_schedule.total_amount().unwrap_or(Zero::zero())); + + assert!( + pallet_balances::Pallet::::free_balance(who) >= total_amount, + "Account does not have enough balance" + ); + + pallet_balances::Pallet::::set_lock( + RELEASE_LOCK_ID, + &who, + total_amount, + WithdrawReasons::all(), + ); + + ReleaseSchedules::::insert(who, bounded_schedules); + }); + } +} diff --git a/pallets/time-release/src/mock.rs b/pallets/time-release/src/mock.rs index 7234eea925..fe2ec44c78 100644 --- a/pallets/time-release/src/mock.rs +++ b/pallets/time-release/src/mock.rs @@ -50,9 +50,9 @@ impl pallet_balances::Config for Test { type MaxReserves = (); type ReserveIdentifier = [u8; 8]; type WeightInfo = (); - type FreezeIdentifier = (); + type FreezeIdentifier = RuntimeFreezeReason; + type MaxFreezes = ConstU32<1>; type MaxHolds = ConstU32<0>; - type MaxFreezes = ConstU32<0>; type RuntimeHoldReason = (); } @@ -99,6 +99,8 @@ impl Config for Test { type WeightInfo = (); type MaxReleaseSchedules = ConstU32<50>; type BlockNumberProvider = MockBlockNumberProvider; + type RuntimeFreezeReason = RuntimeFreezeReason; + type Balance = Balance; } type Block = frame_system::mocking::MockBlockU32; @@ -107,7 +109,7 @@ construct_runtime!( pub enum Test { System: frame_system::{Pallet, Call, Storage, Config, Event}, - TimeRelease: pallet_time_release::{Pallet, Storage, Call, Event, Config}, + TimeRelease: pallet_time_release::{Pallet, Storage, Call, Event, Config, FreezeReason}, PalletBalances: pallet_balances::{Pallet, Call, Storage, Config, Event}, } ); @@ -115,9 +117,11 @@ construct_runtime!( pub const ALICE: AccountId = 0; pub const BOB: AccountId = 2; pub const CHARLIE: AccountId = 3; +pub const DAVE: AccountId = 4; pub const ALICE_BALANCE: u64 = 100; -pub const CHARLIE_BALANCE: u64 = 50; +pub const CHARLIE_BALANCE: u64 = 30; +pub const DAVE_BALANCE: u64 = 200; #[derive(Default)] pub struct ExtBuilder; @@ -129,7 +133,11 @@ impl ExtBuilder { MockBlockNumberProvider::set(0); pallet_balances::GenesisConfig:: { - balances: vec![(ALICE, ALICE_BALANCE), (CHARLIE, CHARLIE_BALANCE)], + balances: vec![ + (ALICE, ALICE_BALANCE), + (CHARLIE, CHARLIE_BALANCE), + (DAVE, DAVE_BALANCE), + ], } .assimilate_storage(&mut t) .unwrap(); diff --git a/pallets/time-release/src/tests.rs b/pallets/time-release/src/tests.rs index 6b7df0fae3..b37b889cb0 100644 --- a/pallets/time-release/src/tests.rs +++ b/pallets/time-release/src/tests.rs @@ -1,24 +1,29 @@ //! Unit tests for the time-release module. use super::*; use chrono::{DateTime, Days, Duration, TimeZone, Utc}; -use frame_support::{assert_noop, assert_ok, error::BadOrigin, traits::Imbalance}; +use frame_support::{ + assert_noop, assert_ok, + error::BadOrigin, + traits::{ + fungible::{Inspect, InspectFreeze}, + tokens::{Fortitude, WithdrawConsequence}, + }, +}; use mock::*; -use pallet_balances::{BalanceLock, Reasons}; use sp_runtime::{traits::Dispatchable, SaturatedConversion, TokenError}; #[test] fn time_release_from_chain_spec_works() { ExtBuilder::build().execute_with(|| { - assert_ok!(PalletBalances::ensure_can_withdraw( - &CHARLIE, - 10, - WithdrawReasons::TRANSFER, - 20 - )); + // Charlie has 30 tokens in total + // 20 are frozen + // 10 are free + assert_eq!(PalletBalances::can_withdraw(&CHARLIE, 10), WithdrawConsequence::Success); - assert!(PalletBalances::ensure_can_withdraw(&CHARLIE, 11, WithdrawReasons::TRANSFER, 19) - .is_err()); + // Charlie cannot withdraw more than 10 tokens + assert_eq!(PalletBalances::can_withdraw(&CHARLIE, 11), WithdrawConsequence::Frozen); + // Check that the release schedules built at genesis are correct assert_eq!( TimeRelease::release_schedules(&CHARLIE), vec![ @@ -34,16 +39,24 @@ fn time_release_from_chain_spec_works() { MockBlockNumberProvider::set(13); + // 15 tokens will be released after 13 blocks + // 25 = 10(free) + 15(released) assert_ok!(TimeRelease::claim(RuntimeOrigin::signed(CHARLIE))); - assert_ok!(PalletBalances::ensure_can_withdraw(&CHARLIE, 25, WithdrawReasons::TRANSFER, 5)); - assert!(PalletBalances::ensure_can_withdraw(&CHARLIE, 26, WithdrawReasons::TRANSFER, 4) - .is_err()); + assert_eq!(PalletBalances::can_withdraw(&CHARLIE, 25), WithdrawConsequence::Success); + assert_eq!(PalletBalances::can_withdraw(&CHARLIE, 26), WithdrawConsequence::Frozen); MockBlockNumberProvider::set(14); + // The final 5 tokens are released after 14 = (5[start] + 3[period] x 3[period count]) blocks assert_ok!(TimeRelease::claim(RuntimeOrigin::signed(CHARLIE))); - assert_ok!(PalletBalances::ensure_can_withdraw(&CHARLIE, 30, WithdrawReasons::TRANSFER, 0)); + // Charlie can now withdraw all 30 tokens + // However, if Charlie doesn't leave an ED, the account will be reaped + assert_eq!( + PalletBalances::can_withdraw(&CHARLIE, 30), + WithdrawConsequence::ReducedToZero(0) + ); + assert_eq!(PalletBalances::can_withdraw(&CHARLIE, 29), WithdrawConsequence::Success); }); } @@ -85,7 +98,7 @@ fn self_releasing() { assert_noop!( TimeRelease::transfer(RuntimeOrigin::signed(ALICE), ALICE, bad_schedule), - crate::Error::::InsufficientBalanceToLock + crate::Error::::InsufficientBalanceToFreeze ); assert_ok!(TimeRelease::transfer(RuntimeOrigin::signed(ALICE), ALICE, schedule.clone())); @@ -100,7 +113,7 @@ fn self_releasing() { } #[test] -fn add_new_release_schedule_merges_with_current_locked_balance_and_until() { +fn add_new_release_schedule_merges_with_current_frozen_balance_and_until() { ExtBuilder::build().execute_with(|| { let schedule = ReleaseSchedule { start: 0u32, period: 10u32, period_count: 2u32, per_period: 10u64 }; @@ -113,8 +126,11 @@ fn add_new_release_schedule_merges_with_current_locked_balance_and_until() { assert_ok!(TimeRelease::transfer(RuntimeOrigin::signed(ALICE), BOB, another_schedule)); assert_eq!( - PalletBalances::locks(&BOB).get(0), - Some(&BalanceLock { id: RELEASE_LOCK_ID, amount: 17u64, reasons: Reasons::All }) + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + 17u64 ); }); } @@ -125,9 +141,7 @@ fn cannot_use_fund_if_not_claimed() { let schedule = ReleaseSchedule { start: 10u32, period: 10u32, period_count: 1u32, per_period: 50u64 }; assert_ok!(TimeRelease::transfer(RuntimeOrigin::signed(ALICE), BOB, schedule)); - assert!( - PalletBalances::ensure_can_withdraw(&BOB, 1, WithdrawReasons::TRANSFER, 49).is_err() - ); + assert_eq!(PalletBalances::can_withdraw(&BOB, 1), WithdrawConsequence::Frozen); }); } @@ -201,15 +215,15 @@ fn claim_works() { assert_ok!(TimeRelease::transfer(RuntimeOrigin::signed(ALICE), BOB, schedule)); MockBlockNumberProvider::set(11); - // remain locked if not claimed + // remain frozen if not claimed assert!( PalletBalances::transfer_allow_death(RuntimeOrigin::signed(BOB), ALICE, 10).is_err() ); - // unlocked after claiming + // thawed after claiming assert_ok!(TimeRelease::claim(RuntimeOrigin::signed(BOB))); assert!(ReleaseSchedules::::contains_key(BOB)); assert_ok!(PalletBalances::transfer_allow_death(RuntimeOrigin::signed(BOB), ALICE, 10)); - // more are still locked + // more are still frozen assert!(PalletBalances::transfer_allow_death(RuntimeOrigin::signed(BOB), ALICE, 1).is_err()); MockBlockNumberProvider::set(21); @@ -218,10 +232,16 @@ fn claim_works() { assert!(!ReleaseSchedules::::contains_key(BOB)); assert_ok!(PalletBalances::transfer_allow_death(RuntimeOrigin::signed(BOB), ALICE, 10)); // all used up - assert_eq!(PalletBalances::free_balance(BOB), 0); + assert_eq!(::Currency::balance(&BOB), 0); - // no locks anymore - assert_eq!(PalletBalances::locks(&BOB), vec![]); + // none frozen anymore + assert_eq!( + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + 0 + ); }); } @@ -235,8 +255,11 @@ fn claim_for_works() { assert_ok!(TimeRelease::claim_for(RuntimeOrigin::signed(ALICE), BOB)); assert_eq!( - PalletBalances::locks(&BOB).get(0), - Some(&BalanceLock { id: RELEASE_LOCK_ID, amount: 20u64, reasons: Reasons::All }) + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + 20u64 ); assert!(ReleaseSchedules::::contains_key(&BOB)); @@ -244,8 +267,14 @@ fn claim_for_works() { assert_ok!(TimeRelease::claim_for(RuntimeOrigin::signed(ALICE), BOB)); - // no locks anymore - assert_eq!(PalletBalances::locks(&BOB), vec![]); + // none frozen anymore + assert_eq!( + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + 0 + ); assert!(!ReleaseSchedules::::contains_key(&BOB)); }); } @@ -273,23 +302,36 @@ fn update_release_schedules_works() { assert_ok!(TimeRelease::claim(RuntimeOrigin::signed(BOB))); assert_ok!(PalletBalances::transfer_allow_death(RuntimeOrigin::signed(BOB), ALICE, 10)); - // empty release schedules cleanup the storage and unlock the fund + // empty release schedules cleanup the storage and thaw the funds assert!(ReleaseSchedules::::contains_key(BOB)); assert_eq!( - PalletBalances::locks(&BOB).get(0), - Some(&BalanceLock { id: RELEASE_LOCK_ID, amount: 10u64, reasons: Reasons::All }) + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + 10u64 ); assert_ok!(TimeRelease::update_release_schedules(RuntimeOrigin::root(), BOB, vec![])); assert!(!ReleaseSchedules::::contains_key(BOB)); - assert_eq!(PalletBalances::locks(&BOB), vec![]); + assert_eq!( + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + 0 + ); }); } #[test] -fn update_release_schedules_fails_if_unexpected_existing_locks() { +fn update_release_schedules_fails_if_unexpected_existing_freezes() { ExtBuilder::build().execute_with(|| { assert_ok!(PalletBalances::transfer_allow_death(RuntimeOrigin::signed(ALICE), BOB, 1)); - PalletBalances::set_lock(*b"prelocks", &BOB, 0u64, WithdrawReasons::all()); + let _ = ::Currency::set_freeze( + &FreezeReason::TimeReleaseVesting.into(), + &BOB, + 0u64, + ); }); } @@ -330,7 +372,13 @@ fn multiple_release_schedule_claim_works() { assert!(!ReleaseSchedules::::contains_key(&BOB)); - assert_eq!(PalletBalances::locks(&BOB), vec![]); + assert_eq!( + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + 0 + ); }); } @@ -380,19 +428,28 @@ fn cliff_release_works() { per_period: VESTING_AMOUNT, }; - let balance_lock = - BalanceLock { id: RELEASE_LOCK_ID, amount: VESTING_AMOUNT, reasons: Reasons::All }; - - assert_eq!(PalletBalances::free_balance(BOB), 0); + assert_eq!(::Currency::balance(&BOB), 0); assert_ok!(TimeRelease::transfer(RuntimeOrigin::signed(ALICE), BOB, cliff_schedule)); - assert_eq!(PalletBalances::free_balance(BOB), VESTING_AMOUNT); - assert_eq!(PalletBalances::locks(&BOB), vec![balance_lock.clone()]); + assert_eq!(::Currency::balance(&BOB), VESTING_AMOUNT); + assert_eq!( + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + VESTING_AMOUNT + ); for i in 1..VESTING_PERIOD { MockBlockNumberProvider::set(i); assert_ok!(TimeRelease::claim(RuntimeOrigin::signed(BOB))); - assert_eq!(PalletBalances::free_balance(BOB), VESTING_AMOUNT); - assert_eq!(PalletBalances::locks(&BOB), vec![balance_lock.clone()]); + assert_eq!(::Currency::balance(&BOB), VESTING_AMOUNT); + assert_eq!( + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + VESTING_AMOUNT + ); assert_noop!( PalletBalances::transfer_allow_death( RuntimeOrigin::signed(BOB), @@ -405,7 +462,13 @@ fn cliff_release_works() { MockBlockNumberProvider::set(VESTING_PERIOD); assert_ok!(TimeRelease::claim(RuntimeOrigin::signed(BOB))); - assert!(PalletBalances::locks(&BOB).is_empty()); + assert_eq!( + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + 0 + ); assert_ok!(PalletBalances::transfer_allow_death( RuntimeOrigin::signed(BOB), CHARLIE, @@ -418,7 +481,7 @@ fn cliff_release_works() { /// Alice has 100k tokens /// Alice gets 25k tokens on April 1 /// Note: 25k = 1/4th = 6/24ths of total -/// Alice's 25k tokens will unlock: +/// Alice's 25k tokens will thaw: /// - 1/24th of total (1/6th of the 25k) on July 1st 2024 /// - 2/24th of total (2/6th of the 25k) on Aug 1st 2024 (+432_000 blocks) /// - 3/24th of total (3/6th of the 25k) on Sep 1st 2024 @@ -432,9 +495,9 @@ fn cliff_release_works() { #[test] fn alice_time_releases_schedule() { ExtBuilder::build().execute_with(|| { - // First Unlock = ~ July 1, 2024 - // Unlock monthly - // "Start" lock June 1, 2024 + // First Thaw = ~ July 1, 2024 + // Thaw monthly + // "Start" freeze June 1, 2024 let total_award: u64 = 100_000; let amount_released_per_period = total_award / 24; let number_of_periods = 6u32; @@ -452,21 +515,47 @@ fn alice_time_releases_schedule() { set_balance::(&ALICE, total_award); - // Bob starts with zero balance and zero locks. + // Bob starts with zero balance and zero frozen. assert_eq!(get_balance::(&BOB), 0); - assert!(PalletBalances::locks(&BOB).is_empty()); + assert_eq!( + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + 0 + ); // Time release transfer is initiated by Alice to Bob. As a result, Bobs free-balance // increases by the total amount scheduled to be time-released. - // However, it cannot spent because a lock is put on the balance. + // However, it cannot spent because a freeze is put on the balance. assert_ok!(TimeRelease::transfer(RuntimeOrigin::signed(ALICE), BOB, schedule)); assert_eq!(get_balance::(&BOB), 24_996); - assert_eq!(PalletBalances::locks(&BOB).len(), 1usize); + assert_eq!( + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + 24996 + ); + assert_eq!( + ::Currency::reducible_balance( + &BOB, + Preservation::Expendable, + Fortitude::Polite + ), + 0 + ); // Bob naively attempts to claim the transfer before the scheduled release date // and nothing happens because the schedule release has yet to start. assert_ok!(TimeRelease::claim(RuntimeOrigin::signed(BOB))); - assert_eq!(PalletBalances::locks(&BOB).first().unwrap().amount, 24_996); + assert_eq!( + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + 24_996 + ); let time_release_transfer_data: Vec<(DateTime, _)> = time_release_transfers_data::(); @@ -474,12 +563,12 @@ fn alice_time_releases_schedule() { // quarters 1 - 5 let july_1_2023_to_july_1_2024_data = &time_release_transfer_data[0..4]; - // time travel and create transfer for each date. These transfers increases the total amount locked in Bobs account. - let mut total_locked = amount_released_per_period * 6; + // time travel and create transfer for each date. These transfers increase the total amount frozen in Bobs account. + let mut total_frozen = amount_released_per_period * 6; for transfer in july_1_2023_to_july_1_2024_data.iter() { let transfer_1 = transfer.1.get(0).unwrap().clone(); let transfer_2 = transfer.1.get(1).unwrap().clone(); - total_locked += transfer_1.per_period + transfer_2.per_period; + total_frozen += transfer_1.per_period + transfer_2.per_period; assert_ok!(TimeRelease::transfer(RuntimeOrigin::signed(ALICE), BOB, transfer_1,)); assert_ok!(TimeRelease::transfer(RuntimeOrigin::signed(ALICE), BOB, transfer_2)); @@ -493,8 +582,14 @@ fn alice_time_releases_schedule() { ); // Doing a claim does not do anything assert_ok!(TimeRelease::claim(RuntimeOrigin::signed(BOB))); - // Since the first issuance the total amount locked increases by the new transfers: 24_996; - assert_eq!(PalletBalances::locks(&BOB).first().unwrap().amount, total_locked); + // Since the first issuance the total amount frozen increases by the new transfers: 24_996; + assert_eq!( + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + total_frozen + ); let july_2024_sept_2024: Vec> = vec![ Utc.with_ymd_and_hms(2024, 7, 1, 0, 0, 0).unwrap(), @@ -504,12 +599,18 @@ fn alice_time_releases_schedule() { for month in july_2024_sept_2024.iter() { // Bob trys again at the end of the first period. Bob is now - // happy because he has unlocked 4_166 tokens every month and can spend them. + // happy because he has thawed 4_166 tokens every month and can spend them. // The total amount is reduced by the amount released per period. MockBlockNumberProvider::set(date_to_approximate_block_number(month.clone()).into()); assert_ok!(TimeRelease::claim(RuntimeOrigin::signed(BOB))); - total_locked -= 4_166 as u64; - assert_eq!(PalletBalances::locks(&BOB).first().unwrap().amount, total_locked); + total_frozen -= 4_166 as u64; + assert_eq!( + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + total_frozen + ); } // quarter-6: time-release transfer AND monthly claim @@ -528,9 +629,15 @@ fn alice_time_releases_schedule() { transfer_1.total_amount().unwrap() + transfer_2.total_amount().unwrap(); // new transfer_total - one_month_of_time_release - total_locked += total_transfered; - total_locked -= 4_166; - assert_eq!(PalletBalances::locks(&BOB).first().unwrap().amount, total_locked); + total_frozen += total_transfered; + total_frozen -= 4_166; + assert_eq!( + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + total_frozen + ); // quarter-7-12: time-release transfer AND monthly claim let jan_2025_to_april_2026_quarterly_data = &time_release_transfer_data[6..]; @@ -557,18 +664,23 @@ fn alice_time_releases_schedule() { .into(), ); assert_ok!(TimeRelease::claim(RuntimeOrigin::signed(BOB))); - assert_eq!(PalletBalances::locks(&BOB).first(), None); + assert_eq!( + ::Currency::balance_frozen( + &FreezeReason::TimeReleaseVesting.into(), + &BOB + ), + 0 + ); }); } fn get_balance(who: &T::AccountId) -> BalanceOf { - T::Currency::free_balance(who) + T::Currency::balance(who) } fn set_balance(who: &T::AccountId, balance: BalanceOf) { - let deposit_result = T::Currency::deposit_creating(who, balance.saturated_into()); - let actual_deposit = deposit_result.peek(); - assert_eq!(balance, actual_deposit); + let actual_deposit = T::Currency::mint_into(&who, balance.saturated_into()); + assert_eq!(balance, actual_deposit.unwrap()); } fn build_time_release_schedule( @@ -619,7 +731,7 @@ fn date_to_approximate_block_number(input_date: DateTime) -> u32 { // Quarter 11: Jan 2026 // Quarter 12: April 2026 // Time-Relese schedules: -// Monthly unlocks 1 / 24 of 100K starting July 1, 2024 +// Monthly thaws 1 / 24 of 100K starting July 1, 2024 fn time_release_transfers_data() -> Vec<(DateTime, Vec>)> { let total_award: u64 = 100_000; diff --git a/pallets/time-release/src/types.rs b/pallets/time-release/src/types.rs index 94b5640551..9e355fd276 100644 --- a/pallets/time-release/src/types.rs +++ b/pallets/time-release/src/types.rs @@ -33,17 +33,17 @@ impl Option { self.per_period.checked_mul(&self.period_count.into()) } - /// Returns locked amount for a given `time`. + /// Returns frozen amount for a given `time`. /// /// Note this func assumes schedule is a valid one(non-zero period and /// non-overflow total amount), and it should be guaranteed by callers. #[allow(clippy::expect_used)] - pub fn locked_amount(&self, time: BlockNumber) -> Balance { + pub fn frozen_amount(&self, time: BlockNumber) -> Balance { // full = (time - start) / period // unrealized = period_count - full // per_period * unrealized diff --git a/runtime/frequency/src/lib.rs b/runtime/frequency/src/lib.rs index b869c42a77..81980e7150 100644 --- a/runtime/frequency/src/lib.rs +++ b/runtime/frequency/src/lib.rs @@ -222,6 +222,10 @@ pub type Executive = frame_executive::Executive< pallet_capacity::migration::v2::MigrateToV2, pallet_capacity::migration::v3::MigrationToV3>, pallet_schemas::migration::v3::MigrateToV3, + pallet_time_release::migration::v2::MigrationToV2< + Runtime, + pallet_balances::Pallet, + >, MigratePalletsCurrentStorage, ), >; @@ -326,7 +330,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("frequency"), impl_name: create_runtime_str!("frequency"), authoring_version: 1, - spec_version: 67, + spec_version: 68, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -340,7 +344,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("frequency-rococo"), impl_name: create_runtime_str!("frequency"), authoring_version: 1, - spec_version: 67, + spec_version: 68, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -532,6 +536,7 @@ pub type MaxReleaseSchedules = ConstU32<{ MAX_RELEASE_SCHEDULES }>; // the descriptions of these configs. impl pallet_time_release::Config for Runtime { type RuntimeEvent = RuntimeEvent; + type Balance = Balance; type Currency = Balances; type MinReleaseTransfer = MinReleaseTransfer; type TransferOrigin = EnsureSigned; @@ -541,6 +546,7 @@ impl pallet_time_release::Config for Runtime { type BlockNumberProvider = RelaychainDataProvider; #[cfg(feature = "frequency-no-relay")] type BlockNumberProvider = System; + type RuntimeFreezeReason = RuntimeFreezeReason; } // See https://paritytech.github.io/substrate/master/pallet_timestamp/index.html for @@ -1115,7 +1121,7 @@ construct_runtime!( Multisig: pallet_multisig::{Pallet, Call, Storage, Event} = 30, // FRQC Update - TimeRelease: pallet_time_release::{Pallet, Call, Storage, Event, Config} = 40, + TimeRelease: pallet_time_release::{Pallet, Call, Storage, Event, Config, FreezeReason} = 40, // Frequency related pallets Msa: pallet_msa::{Pallet, Call, Storage, Event} = 60,