From 03e679bc0f3165ec2cfd95599a331c31bc5b82c1 Mon Sep 17 00:00:00 2001 From: Daanvdplas Date: Tue, 17 Sep 2024 16:50:58 +0200 Subject: [PATCH 01/43] feat: assets api --- Cargo.lock | 19 ++++ drink/src/session.rs | 8 +- ink-sandbox/Cargo.lock | 20 ++++ ink-sandbox/Cargo.toml | 2 + ink-sandbox/src/api.rs | 5 +- ink-sandbox/src/api/assets_api.rs | 100 ++++++++++++++++++ .../api/{balance_api.rs => balances_api.rs} | 2 +- ink-sandbox/src/api/system_api.rs | 2 +- ink-sandbox/src/lib.rs | 2 +- ink-sandbox/src/macros.rs | 27 ++++- rust-toolchain.toml | 3 - 11 files changed, 176 insertions(+), 14 deletions(-) create mode 100644 ink-sandbox/src/api/assets_api.rs rename ink-sandbox/src/api/{balance_api.rs => balances_api.rs} (98%) delete mode 100644 rust-toolchain.toml diff --git a/Cargo.lock b/Cargo.lock index eb9600b..e6079a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2219,6 +2219,7 @@ dependencies = [ "frame-support", "frame-system", "log", + "pallet-assets", "pallet-balances", "pallet-contracts", "pallet-timestamp", @@ -2775,6 +2776,24 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "pallet-assets" +version = "37.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f79ef6a7763fc08177f014052469ee12aefcdad0d99a747372360c2f648d2cc4" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-balances" version = "37.0.0" diff --git a/drink/src/session.rs b/drink/src/session.rs index 50c3b94..39da36f 100644 --- a/drink/src/session.rs +++ b/drink/src/session.rs @@ -62,7 +62,7 @@ pub const NO_SALT: Vec = vec![]; /// # use ink_sandbox::AccountId32; /// # use drink::{ /// # session::Session, -/// # session::{NO_ARGS, NO_SALT, None}, +/// # session::{NO_ARGS, NO_SALT}, /// # minimal::MinimalSandbox /// # }; /// # @@ -90,7 +90,7 @@ pub const NO_SALT: Vec = vec![]; /// # use drink::{ /// # session::Session, /// # minimal::MinimalSandbox, -/// # session::{NO_ARGS, None, NO_SALT} +/// # session::{NO_ARGS, NO_SALT} /// # }; /// # fn get_transcoder() -> Arc { /// # Arc::new(ContractMessageTranscoder::load("").unwrap()) @@ -113,7 +113,7 @@ pub const NO_SALT: Vec = vec![]; /// # use drink::{ /// # local_contract_file, /// # session::Session, -/// # session::{ContractBundle, NO_ARGS, NO_SALT, None}, +/// # session::{ContractBundle, NO_ARGS, NO_SALT}, /// # minimal::MinimalSandbox /// # }; /// @@ -132,7 +132,7 @@ pub struct Session where T::Runtime: Config, { - sandbox: T, + pub sandbox: T, actor: AccountIdFor, gas_limit: Weight, diff --git a/ink-sandbox/Cargo.lock b/ink-sandbox/Cargo.lock index 2a28eb3..127feff 100644 --- a/ink-sandbox/Cargo.lock +++ b/ink-sandbox/Cargo.lock @@ -1351,6 +1351,8 @@ dependencies = [ "frame-metadata", "frame-support", "frame-system", + "log", + "pallet-assets", "pallet-balances", "pallet-contracts", "pallet-timestamp", @@ -1767,6 +1769,24 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +[[package]] +name = "pallet-assets" +version = "37.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f79ef6a7763fc08177f014052469ee12aefcdad0d99a747372360c2f648d2cc4" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-balances" version = "37.0.0" diff --git a/ink-sandbox/Cargo.toml b/ink-sandbox/Cargo.toml index f2fbfaa..2c04481 100644 --- a/ink-sandbox/Cargo.toml +++ b/ink-sandbox/Cargo.toml @@ -10,6 +10,7 @@ frame-metadata = { version = "16.0.0", default-features = false } frame-support = { version = "36.0.0", default-features = false } frame-system = { version = "36.1.0", default-features = false } pallet-contracts = { version = "35.0.0", default-features = false } +pallet-assets = { version = "37.0.0", default-features = false } pallet-balances = { version = "37.0.0", default-features = false } pallet-timestamp = { version = "35.0.0", default-features = false } scale = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = [ @@ -35,6 +36,7 @@ std = [ "frame-metadata/std", "frame-support/std", "frame-system/std", + "pallet-assets/std", "pallet-balances/std", "pallet-contracts/std", "pallet-timestamp/std", diff --git a/ink-sandbox/src/api.rs b/ink-sandbox/src/api.rs index 78de0e5..62edd5d 100644 --- a/ink-sandbox/src/api.rs +++ b/ink-sandbox/src/api.rs @@ -1,11 +1,12 @@ -pub mod balance_api; +pub mod balances_api; pub mod contracts_api; pub mod system_api; pub mod timestamp_api; +pub mod assets_api; pub mod prelude { pub use super::{ - balance_api::BalanceAPI, contracts_api::ContractAPI, system_api::SystemAPI, + assets_api::AssetsAPI, balances_api::BalanceAPI, contracts_api::ContractAPI, system_api::SystemAPI, timestamp_api::TimestampAPI, }; } diff --git a/ink-sandbox/src/api/assets_api.rs b/ink-sandbox/src/api/assets_api.rs new file mode 100644 index 0000000..10d024e --- /dev/null +++ b/ink-sandbox/src/api/assets_api.rs @@ -0,0 +1,100 @@ +use frame_support::{sp_runtime::DispatchError, traits::{fungibles::{Inspect, Create, Mutate}}}; +use pallet_assets::Instance1; + +use crate::{AccountIdFor, Sandbox}; + +type AssetIdOf = as Inspect<::AccountId>>::AssetId; +type AssetsOf = pallet_assets::Pallet; +type BalanceOf = as Inspect<::AccountId>>::Balance; + +// TODO: api is the same with balances api. Perhaps should be changed to e.g. `create_asset`. +// Not important for now though. +/// Assets API for the sandbox. +pub trait AssetsAPI + where + T: Sandbox, + T::Runtime: pallet_assets::Config, +{ + /// Create a token. + fn create( + &mut self, + id: &AssetIdOf, + owner: &AccountIdFor, + min_balance: BalanceOf, + ) -> Result<(), DispatchError>; + + /// Mint tokens to an account. + /// + /// # Arguments + /// + /// * `address` - The address of the account to add tokens to. + /// * `amount` - The number of tokens to add. + fn mint_into( + &mut self, + asset: &AssetIdOf, + account: &AccountIdFor, + value: BalanceOf, + ) -> Result, DispatchError>; + + /// Return the balance of an account. + /// + /// # Arguments + /// + /// * `address` - The address of the account to query. + fn balance_of(&mut self, asset: &AssetIdOf, owner: &AccountIdFor) -> BalanceOf; + + fn asset_exists(&mut self, asset: &AssetIdOf) -> bool; +} + +impl AssetsAPI for T + where + T: Sandbox, + T::Runtime: pallet_assets::Config, +{ + fn create(&mut self, id: &AssetIdOf, owner: &AccountIdFor, min_balance: BalanceOf) -> Result<(), DispatchError> { + self.execute_with(|| as Create>>::create(id.clone(), owner.clone(), true, min_balance)) + } + + fn mint_into( + &mut self, + asset: &AssetIdOf, + account: &AccountIdFor, + value: BalanceOf, + ) -> Result, DispatchError> { + self.execute_with(|| pallet_assets::Pallet::::mint_into(asset.clone(), account, value)) + } + + fn balance_of(&mut self, asset: &AssetIdOf, owner: &AccountIdFor) -> BalanceOf { + self.execute_with(|| pallet_assets::Pallet::::balance(asset.clone(), owner)) + } + + fn asset_exists(&mut self, asset: &AssetIdOf) -> bool { + self.execute_with(|| pallet_assets::Pallet::::asset_exists(asset.clone())) + } +} + +#[cfg(test)] +mod test { + use super::*; + use crate::DefaultSandbox; + #[test] + fn api_works() { + let mut sandbox = DefaultSandbox::default(); + let token = 1; + let balance = sandbox.balance_of(&token, &DefaultSandbox::default_actor()); + + sandbox + .create(&token, &DefaultSandbox::default_actor(), 1) + .unwrap(); + sandbox + .mint_into(&token, &DefaultSandbox::default_actor(), 100) + .unwrap(); + + assert_eq!( + sandbox.balance_of(&token, &DefaultSandbox::default_actor()), + balance + 100 + ); + + assert!(sandbox.asset_exists(&token)); + } +} \ No newline at end of file diff --git a/ink-sandbox/src/api/balance_api.rs b/ink-sandbox/src/api/balances_api.rs similarity index 98% rename from ink-sandbox/src/api/balance_api.rs rename to ink-sandbox/src/api/balances_api.rs index 9635f0c..984b785 100644 --- a/ink-sandbox/src/api/balance_api.rs +++ b/ink-sandbox/src/api/balances_api.rs @@ -4,7 +4,7 @@ use crate::{AccountIdFor, Sandbox}; type BalanceOf = ::Balance; -/// Balance API for the sandbox. +/// Balances API for the sandbox. pub trait BalanceAPI where T: Sandbox, diff --git a/ink-sandbox/src/api/system_api.rs b/ink-sandbox/src/api/system_api.rs index b8d50d9..f6d27dd 100644 --- a/ink-sandbox/src/api/system_api.rs +++ b/ink-sandbox/src/api/system_api.rs @@ -93,7 +93,7 @@ where mod tests { use frame_support::sp_runtime::{traits::Dispatchable, AccountId32, DispatchResultWithInfo}; - use crate::{api::prelude::*, DefaultSandbox, RuntimeCall, RuntimeEventOf, RuntimeOf, Sandbox}; + use crate::{api::prelude::{BalanceAPI, SystemAPI}, DefaultSandbox, RuntimeCall, RuntimeEventOf, RuntimeOf, Sandbox}; fn make_transfer( sandbox: &mut DefaultSandbox, diff --git a/ink-sandbox/src/lib.rs b/ink-sandbox/src/lib.rs index d94b11f..8e6549a 100644 --- a/ink-sandbox/src/lib.rs +++ b/ink-sandbox/src/lib.rs @@ -15,7 +15,7 @@ pub use { self, sp_runtime::{AccountId32, DispatchError}, }, - frame_system, pallet_balances, pallet_contracts, pallet_timestamp, paste, + frame_system, pallet_balances, pallet_assets, pallet_contracts, pallet_timestamp, paste, sp_core::crypto::Ss58Codec, sp_externalities::{self, Extension}, sp_io::TestExternalities, diff --git a/ink-sandbox/src/macros.rs b/ink-sandbox/src/macros.rs index aeb00bb..fa10532 100644 --- a/ink-sandbox/src/macros.rs +++ b/ink-sandbox/src/macros.rs @@ -194,15 +194,17 @@ mod construct_runtime { traits::Convert, Perbill, }, - traits::{ConstBool, ConstU128, ConstU32, ConstU64, Currency, Randomness}, + traits::{AsEnsureOriginWithArg, ConstBool, ConstU128, ConstU32, ConstU64, Currency, Randomness}, weights::Weight, }; use $module_path::frame_system::EnsureSigned; + use $module_path::pallet_assets::Instance1; // Define the runtime type as a collection of pallets construct_runtime!( pub enum $runtime { System: $module_path::frame_system, + Assets: $module_path::pallet_assets::, Balances: $module_path::pallet_balances, Timestamp: $module_path::pallet_timestamp, Contracts: $module_path::pallet_contracts, @@ -221,6 +223,27 @@ mod construct_runtime { type AccountData = $module_path::pallet_balances::AccountData<<$runtime as $module_path::pallet_balances::Config>::Balance>; } + impl $module_path::pallet_assets::Config for $runtime { + type ApprovalDeposit = ConstU128<1>; + type AssetAccountDeposit = ConstU128<10>; + type AssetDeposit = ConstU128<1>; + type AssetId = u32; + type AssetIdParameter = u32; + type Balance = u128; + type CallbackHandle = (); + type CreateOrigin = AsEnsureOriginWithArg>; + type Currency = Balances; + type Extra = (); + type ForceOrigin = EnsureSigned; + type Freezer = (); + type MetadataDepositBase = ConstU128<1>; + type MetadataDepositPerByte = ConstU128<1>; + type RemoveItemsLimit = ConstU32<5>; + type RuntimeEvent = RuntimeEvent; + type StringLimit = ConstU32<50>; + type WeightInfo = (); + } + // Configure pallet balances impl $module_path::pallet_balances::Config for $runtime { type RuntimeEvent = RuntimeEvent; @@ -313,7 +336,7 @@ mod construct_runtime { // Export runtime type itself, pallets and useful types from the auxiliary module pub use construct_runtime::{ - $sandbox, $runtime, Balances, Contracts, PalletInfo, RuntimeCall, RuntimeEvent, RuntimeHoldReason, + $sandbox, $runtime, Assets, Balances, Contracts, PalletInfo, RuntimeCall, RuntimeEvent, RuntimeHoldReason, RuntimeOrigin, System, Timestamp, }; }; diff --git a/rust-toolchain.toml b/rust-toolchain.toml deleted file mode 100644 index ba3f7e4..0000000 --- a/rust-toolchain.toml +++ /dev/null @@ -1,3 +0,0 @@ -[toolchain] -channel = "1.74" -components = ["rustfmt", "clippy"] From 732ecf414d143cf009ce762e0e0cef91a635e9a6 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Fri, 20 Sep 2024 18:10:54 +0700 Subject: [PATCH 02/43] fix: format with pop-node config --- .github/actions/init/action.yml | 32 + .github/workflows/ci.yml | 75 ++ .github/workflows/lint-pr.yml | 20 + .rustfmt.toml | 24 + .taplo.toml | 17 + drink-cli/src/app_state/contracts.rs | 82 +- drink-cli/src/app_state/mod.rs | 94 +- drink-cli/src/app_state/output.rs | 96 +- drink-cli/src/app_state/print.rs | 90 +- drink-cli/src/app_state/user_input.rs | 110 +- drink-cli/src/cli.rs | 92 +- drink-cli/src/executor/contract.rs | 226 ++-- drink-cli/src/executor/error.rs | 19 +- drink-cli/src/executor/mod.rs | 105 +- drink-cli/src/main.rs | 10 +- drink-cli/src/ui/contracts.rs | 47 +- drink-cli/src/ui/current_env.rs | 34 +- drink-cli/src/ui/footer.rs | 72 +- drink-cli/src/ui/help.rs | 62 +- drink-cli/src/ui/layout.rs | 88 +- drink-cli/src/ui/mod.rs | 145 ++- drink-cli/src/ui/output.rs | 6 +- drink-cli/src/ui/user_input.rs | 20 +- drink/src/errors.rs | 36 +- drink/src/lib.rs | 16 +- .../intercepting.rs | 42 +- .../src/pallet_contracts_debugging/runtime.rs | 90 +- .../src/pallet_contracts_debugging/tracing.rs | 62 +- drink/src/session.rs | 941 +++++++------- drink/src/session/bundle.rs | 94 +- drink/src/session/error.rs | 77 +- drink/src/session/mock.rs | 47 +- drink/src/session/mock/contract.rs | 60 +- drink/src/session/mock/error.rs | 8 +- drink/src/session/mock/extension.rs | 98 +- drink/src/session/mocking_api.rs | 80 +- drink/src/session/record.rs | 325 +++-- drink/src/session/transcoding.rs | 22 +- drink/test-macro/src/bundle_provision.rs | 127 +- drink/test-macro/src/contract_building.rs | 204 ++- drink/test-macro/src/lib.rs | 130 +- examples/chain-extension/Cargo.lock | 1111 ++++++++++++++--- examples/flipper/Cargo.lock | 19 + ink-sandbox/src/api/assets_api.rs | 155 +-- rustfmt.toml | 7 - 45 files changed, 3075 insertions(+), 2242 deletions(-) create mode 100644 .github/actions/init/action.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/lint-pr.yml create mode 100644 .rustfmt.toml create mode 100644 .taplo.toml delete mode 100644 rustfmt.toml diff --git a/.github/actions/init/action.yml b/.github/actions/init/action.yml new file mode 100644 index 0000000..f82d4fc --- /dev/null +++ b/.github/actions/init/action.yml @@ -0,0 +1,32 @@ +name: Initialize +description: This action initializes a runner for use in other actions. +inputs: + cache-key: + description: "The key to be used for the cache" + +runs: + using: "composite" + steps: + - name: Setup Ubuntu dependencies + shell: bash + run: sudo apt update && sudo apt install -y protobuf-compiler + + - name: Free up space on runner + shell: bash + run: | + sudo rm -rf /opt/ghc + sudo rm -rf /opt/hostedtoolcache/CodeQL + sudo rm -rf /usr/local/.ghcup + sudo rm -rf /usr/local/lib/android + sudo rm -rf /usr/local/share/boost + sudo rm -rf /usr/local/share/powershell + sudo rm -rf /usr/share/dotnet + sudo rm -rf /usr/share/swift + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + + - name: Rust Cache + uses: Swatinem/rust-cache@v2.7.3 + with: + cache-on-failure: true + cache-all-crates: true + key: ${{ inputs.cache-key }} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..1b33fe6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,75 @@ +name: ci + +on: + push: + branches: [main] + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: "./.github/actions/init" + + - name: Check formatting + run: | + rustup toolchain install nightly --profile minimal --component rustfmt + cargo +nightly fmt --all -- --check + + - name: Check manifests + run: | + cargo install taplo-cli --locked + taplo format --check + + - name: Check features + run: | + cargo install zepter --locked + zepter lint propagate-feature --feature try-runtime --left-side-feature-missing=ignore --workspace --feature-enables-dep="try-runtime:frame-try-runtime" --locked + zepter lint propagate-feature --feature runtime-benchmarks --left-side-feature-missing=ignore --workspace --feature-enables-dep="runtime-benchmarks:frame-benchmarking" --locked + zepter lint propagate-feature --feature std --left-side-feature-missing=ignore --workspace --locked + zepter format features + + check: + needs: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: "./.github/actions/init" + + - name: Check Build + run: | + cargo check --release --locked --features=runtime-benchmarks,try-runtime + + clippy: + needs: lint + runs-on: ubuntu-latest + permissions: + checks: write + env: + RUSTFLAGS: "-Wmissing_docs" + SKIP_WASM_BUILD: 1 + steps: + - uses: actions/checkout@v4 + + - uses: "./.github/actions/init" + + - name: Annotate with Clippy warnings + uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --release --locked --features=runtime-benchmarks + + test: + needs: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: "./.github/actions/init" + + - name: Run tests + run: cargo test --release --locked --workspace --features=runtime-benchmarks --exclude integration-tests diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml new file mode 100644 index 0000000..047030c --- /dev/null +++ b/.github/workflows/lint-pr.yml @@ -0,0 +1,20 @@ +name: "Lint PR" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + lint: + name: Validate PR title for conventional commit compliance + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.rustfmt.toml b/.rustfmt.toml new file mode 100644 index 0000000..8743bd4 --- /dev/null +++ b/.rustfmt.toml @@ -0,0 +1,24 @@ +# Non-default formatting configuration options: use with `cargo +nightly fmt --all` +binop_separator = "Back" +chain_width = 80 +combine_control_expr = false +comment_width = 100 +condense_wildcard_suffixes = true +edition = "2021" +format_code_in_doc_comments = true +format_strings = true +group_imports = "StdExternalCrate" +hard_tabs = true +imports_granularity = "Crate" +match_arm_blocks = false +match_block_trailing_comma = true +newline_style = "Unix" +normalize_comments = true +reorder_impl_items = true +trailing_semicolon = false +unstable_features = true +use_field_init_shorthand = true +# Uses max_width or its default value (100) if not specified. +use_small_heuristics = "Max" +use_try_shorthand = true +wrap_comments = true diff --git a/.taplo.toml b/.taplo.toml new file mode 100644 index 0000000..ea64cf5 --- /dev/null +++ b/.taplo.toml @@ -0,0 +1,17 @@ +# all options https://taplo.tamasfe.dev/configuration/formatter-options.html + +exclude = [ "networks/**", "target/**" ] + +# global rules +[formatting] +array_auto_collapse = false +array_auto_expand = true +compact_arrays = false # zepter compatibility +indent_string = " " # tab +inline_table_expand = false +reorder_arrays = true +reorder_keys = true + +[[rule]] +include = [ "Cargo.toml" ] +keys = [ "workspace.dependencies" ] diff --git a/drink-cli/src/app_state/contracts.rs b/drink-cli/src/app_state/contracts.rs index 401ea22..2d1111c 100644 --- a/drink-cli/src/app_state/contracts.rs +++ b/drink-cli/src/app_state/contracts.rs @@ -7,56 +7,56 @@ use ContractIndex::NoContracts; use crate::app_state::ContractIndex::CurrentContract; pub struct Contract { - pub name: String, - pub address: AccountId32, - pub base_path: PathBuf, - pub transcoder: Arc, + pub name: String, + pub address: AccountId32, + pub base_path: PathBuf, + pub transcoder: Arc, } #[derive(Copy, Clone, Eq, PartialEq, Debug, Default)] pub enum ContractIndex { - #[default] - NoContracts, - CurrentContract(usize), + #[default] + NoContracts, + CurrentContract(usize), } #[derive(Default)] pub struct ContractRegistry { - contracts: Vec, - index: ContractIndex, + contracts: Vec, + index: ContractIndex, } impl ContractRegistry { - pub fn add(&mut self, contract: Contract) { - self.contracts.push(contract); - self.index = CurrentContract(self.contracts.len() - 1); - } - - pub fn current_index(&self) -> ContractIndex { - self.index - } - - pub fn current_contract(&self) -> Option<&Contract> { - match self.index { - NoContracts => None, - CurrentContract(idx) => Some(&self.contracts[idx]), - } - } - - pub fn get_all(&self) -> &[Contract] { - &self.contracts - } - - pub fn next(&mut self) -> Option<&Contract> { - let CurrentContract(old_index) = self.index else { - return None; - }; - - self.index = CurrentContract((old_index + 1) % self.contracts.len()); - self.current_contract() - } - - pub fn count(&self) -> usize { - self.contracts.len() - } + pub fn add(&mut self, contract: Contract) { + self.contracts.push(contract); + self.index = CurrentContract(self.contracts.len() - 1); + } + + pub fn current_index(&self) -> ContractIndex { + self.index + } + + pub fn current_contract(&self) -> Option<&Contract> { + match self.index { + NoContracts => None, + CurrentContract(idx) => Some(&self.contracts[idx]), + } + } + + pub fn get_all(&self) -> &[Contract] { + &self.contracts + } + + pub fn next(&mut self) -> Option<&Contract> { + let CurrentContract(old_index) = self.index else { + return None; + }; + + self.index = CurrentContract((old_index + 1) % self.contracts.len()); + self.current_contract() + } + + pub fn count(&self) -> usize { + self.contracts.len() + } } diff --git a/drink-cli/src/app_state/mod.rs b/drink-cli/src/app_state/mod.rs index f35aed7..4683f85 100644 --- a/drink-cli/src/app_state/mod.rs +++ b/drink-cli/src/app_state/mod.rs @@ -13,80 +13,80 @@ mod user_input; #[derive(Clone, Eq, PartialEq, Debug)] pub struct ChainInfo { - pub block_height: u32, - pub actor: AccountId32, - pub gas_limit: Weight, + pub block_height: u32, + pub actor: AccountId32, + pub gas_limit: Weight, } impl Default for ChainInfo { - fn default() -> Self { - Self { - block_height: 0, - actor: MinimalSandbox::default_actor(), - gas_limit: MinimalSandbox::default_gas_limit(), - } - } + fn default() -> Self { + Self { + block_height: 0, + actor: MinimalSandbox::default_actor(), + gas_limit: MinimalSandbox::default_gas_limit(), + } + } } #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Default)] pub enum Mode { - #[default] - Managing, - Drinking, + #[default] + Managing, + Drinking, } #[derive(Clone, Eq, PartialEq, Debug)] pub struct UiState { - pub cwd: PathBuf, - pub mode: Mode, + pub cwd: PathBuf, + pub mode: Mode, - pub user_input: UserInput, - pub output: Output, + pub user_input: UserInput, + pub output: Output, - pub show_help: bool, + pub show_help: bool, } impl UiState { - pub fn new(cwd_override: Option) -> Self { - let cwd = cwd_override - .unwrap_or_else(|| env::current_dir().expect("Failed to get current directory")); + pub fn new(cwd_override: Option) -> Self { + let cwd = cwd_override + .unwrap_or_else(|| env::current_dir().expect("Failed to get current directory")); - UiState { - cwd, - mode: Default::default(), - user_input: Default::default(), - output: Default::default(), - show_help: false, - } - } + UiState { + cwd, + mode: Default::default(), + user_input: Default::default(), + output: Default::default(), + show_help: false, + } + } } impl Default for UiState { - fn default() -> Self { - UiState::new(None) - } + fn default() -> Self { + UiState::new(None) + } } pub struct AppState { - pub session: Session, - pub chain_info: ChainInfo, - pub ui_state: UiState, - pub contracts: ContractRegistry, + pub session: Session, + pub chain_info: ChainInfo, + pub ui_state: UiState, + pub contracts: ContractRegistry, } impl AppState { - pub fn new(cwd_override: Option) -> Self { - AppState { - session: Session::default(), - chain_info: Default::default(), - ui_state: UiState::new(cwd_override), - contracts: Default::default(), - } - } + pub fn new(cwd_override: Option) -> Self { + AppState { + session: Session::default(), + chain_info: Default::default(), + ui_state: UiState::new(cwd_override), + contracts: Default::default(), + } + } } impl Default for AppState { - fn default() -> Self { - Self::new(None) - } + fn default() -> Self { + Self::new(None) + } } diff --git a/drink-cli/src/app_state/output.rs b/drink-cli/src/app_state/output.rs index ab1632a..258d36a 100644 --- a/drink-cli/src/app_state/output.rs +++ b/drink-cli/src/app_state/output.rs @@ -2,55 +2,55 @@ use ratatui::text::Line; #[derive(Clone, Eq, PartialEq, Debug, Default)] pub struct Output { - content: Vec>, - offset: u16, - scrolling: bool, - window_height: u16, + content: Vec>, + offset: u16, + scrolling: bool, + window_height: u16, } impl Output { - pub fn content(&self) -> &[Line<'static>] { - &self.content - } - - pub fn push(&mut self, line: Line<'static>) { - self.content.push(line) - } - - pub fn clear(&mut self) { - *self = Default::default(); - } - - pub fn offset(&self) -> u16 { - self.offset - } - - fn max_offset(&self) -> u16 { - (self.content.len() as u16).saturating_sub(self.window_height) - } - - pub fn note_display_height(&mut self, height: u16) { - self.window_height = height; - if !self.scrolling { - self.offset = self.max_offset(); - } - } - - pub fn reset_scrolling(&mut self) { - self.scrolling = false; - } - - pub fn scroll_down(&mut self) { - if self.offset < self.max_offset() { - self.scrolling = true; - self.offset += 1 - } - } - - pub fn scroll_up(&mut self) { - if self.offset > 0 { - self.scrolling = true; - self.offset -= 1; - } - } + pub fn content(&self) -> &[Line<'static>] { + &self.content + } + + pub fn push(&mut self, line: Line<'static>) { + self.content.push(line) + } + + pub fn clear(&mut self) { + *self = Default::default(); + } + + pub fn offset(&self) -> u16 { + self.offset + } + + fn max_offset(&self) -> u16 { + (self.content.len() as u16).saturating_sub(self.window_height) + } + + pub fn note_display_height(&mut self, height: u16) { + self.window_height = height; + if !self.scrolling { + self.offset = self.max_offset(); + } + } + + pub fn reset_scrolling(&mut self) { + self.scrolling = false; + } + + pub fn scroll_down(&mut self) { + if self.offset < self.max_offset() { + self.scrolling = true; + self.offset += 1 + } + } + + pub fn scroll_up(&mut self) { + if self.offset > 0 { + self.scrolling = true; + self.offset -= 1; + } + } } diff --git a/drink-cli/src/app_state/print.rs b/drink-cli/src/app_state/print.rs index d9880a2..7d3962c 100644 --- a/drink-cli/src/app_state/print.rs +++ b/drink-cli/src/app_state/print.rs @@ -1,60 +1,56 @@ use drink::{pallet_contracts::ContractResult, sandbox_api::contracts_api::decode_debug_buffer}; use ratatui::{ - style::{Color, Modifier, Style}, - text::Span, + style::{Color, Modifier, Style}, + text::Span, }; use crate::app_state::AppState; impl AppState { - pub fn print_command(&mut self, command: &str) { - self.ui_state.output.push("".into()); - self.ui_state.output.push( - Span::styled( - format!("Executing `{command}`"), - Style::default() - .fg(Color::Blue) - .add_modifier(Modifier::BOLD) - .add_modifier(Modifier::ITALIC), - ) - .into(), - ); - } - - pub fn print(&mut self, msg: &str) { - self.print_sequence( - msg.split('\n'), - Style::default() - .fg(Color::White) - .add_modifier(Modifier::BOLD), - ); - } - - pub fn print_error(&mut self, err: &str) { - self.print_sequence( - err.split('\n'), - Style::default().fg(Color::Red).add_modifier(Modifier::BOLD), - ); - } - - fn print_sequence<'a, I: Iterator>(&mut self, seq: I, style: Style) { - for line in seq { - self.ui_state - .output - .push(Span::styled(line.to_string(), style).into()); - } - } + pub fn print_command(&mut self, command: &str) { + self.ui_state.output.push("".into()); + self.ui_state.output.push( + Span::styled( + format!("Executing `{command}`"), + Style::default() + .fg(Color::Blue) + .add_modifier(Modifier::BOLD) + .add_modifier(Modifier::ITALIC), + ) + .into(), + ); + } + + pub fn print(&mut self, msg: &str) { + self.print_sequence( + msg.split('\n'), + Style::default().fg(Color::White).add_modifier(Modifier::BOLD), + ); + } + + pub fn print_error(&mut self, err: &str) { + self.print_sequence( + err.split('\n'), + Style::default().fg(Color::Red).add_modifier(Modifier::BOLD), + ); + } + + fn print_sequence<'a, I: Iterator>(&mut self, seq: I, style: Style) { + for line in seq { + self.ui_state.output.push(Span::styled(line.to_string(), style).into()); + } + } } pub fn format_contract_action(result: &ContractResult) -> String { - let mut output = format!( - "Gas consumed: {:?}\nGas required: {:?}\nDebug buffer:\n", - result.gas_consumed, result.gas_required - ); + let mut output = format!( + "Gas consumed: {:?}\nGas required: {:?}\nDebug buffer:\n", + result.gas_consumed, result.gas_required + ); - for line in &decode_debug_buffer(&result.debug_message) { - output.push_str(&format!(" {line}\n")); - } + for line in &decode_debug_buffer(&result.debug_message) { + output.push_str(&format!(" {line}\n")); + } - output + output } diff --git a/drink-cli/src/app_state/user_input.rs b/drink-cli/src/app_state/user_input.rs index 33bf26f..160cbbc 100644 --- a/drink-cli/src/app_state/user_input.rs +++ b/drink-cli/src/app_state/user_input.rs @@ -1,71 +1,71 @@ #[derive(Copy, Clone, Eq, PartialEq, Debug, Default)] enum Position { - #[default] - Fresh, - History(usize), + #[default] + Fresh, + History(usize), } #[derive(Clone, Eq, PartialEq, Debug, Default)] pub struct UserInput { - history: Vec, - position: Position, - current_input: String, + history: Vec, + position: Position, + current_input: String, } impl UserInput { - pub fn push(&mut self, c: char) { - self.current_input.push(c); - } + pub fn push(&mut self, c: char) { + self.current_input.push(c); + } - pub fn pop(&mut self) { - self.current_input.pop(); - } + pub fn pop(&mut self) { + self.current_input.pop(); + } - pub fn set(&mut self, s: String) { - self.current_input = s; - self.position = Position::Fresh; - } + pub fn set(&mut self, s: String) { + self.current_input = s; + self.position = Position::Fresh; + } - pub fn prev_input(&mut self) { - match self.position { - Position::Fresh if self.history.is_empty() => {} - Position::Fresh => { - self.position = Position::History(self.history.len() - 1); - self.current_input = self.history[self.history.len() - 1].clone(); - } - Position::History(0) => {} - Position::History(n) => { - self.position = Position::History(n - 1); - self.current_input = self.history[n - 1].clone(); - } - } - } + pub fn prev_input(&mut self) { + match self.position { + Position::Fresh if self.history.is_empty() => {}, + Position::Fresh => { + self.position = Position::History(self.history.len() - 1); + self.current_input = self.history[self.history.len() - 1].clone(); + }, + Position::History(0) => {}, + Position::History(n) => { + self.position = Position::History(n - 1); + self.current_input = self.history[n - 1].clone(); + }, + } + } - pub fn next_input(&mut self) { - match self.position { - Position::Fresh => {} - Position::History(n) if n == self.history.len() - 1 => { - self.position = Position::Fresh; - self.current_input.clear(); - } - Position::History(n) => { - self.position = Position::History(n + 1); - self.current_input = self.history[n + 1].clone(); - } - } - } + pub fn next_input(&mut self) { + match self.position { + Position::Fresh => {}, + Position::History(n) if n == self.history.len() - 1 => { + self.position = Position::Fresh; + self.current_input.clear(); + }, + Position::History(n) => { + self.position = Position::History(n + 1); + self.current_input = self.history[n + 1].clone(); + }, + } + } - pub fn apply(&mut self) { - if !self.current_input.is_empty() - && self.history.last().cloned().unwrap_or_default() != self.current_input - { - self.history.push(self.current_input.clone()); - } - self.current_input.clear(); - self.position = Position::Fresh; - } + pub fn apply(&mut self) { + if !self.current_input.is_empty() && + self.history.last().cloned().unwrap_or_default() != self.current_input + { + self.history.push(self.current_input.clone()); + } + self.current_input.clear(); + self.position = Position::Fresh; + } - pub fn current_input(&self) -> &str { - &self.current_input - } + pub fn current_input(&self) -> &str { + &self.current_input + } } diff --git a/drink-cli/src/cli.rs b/drink-cli/src/cli.rs index 388100b..afdc721 100644 --- a/drink-cli/src/cli.rs +++ b/drink-cli/src/cli.rs @@ -5,57 +5,57 @@ use drink::AccountId32; #[derive(Parser)] pub enum CliCommand { - #[clap(alias = "c")] - Clear, - #[clap(alias = "cd")] - ChangeDir { - path: String, - }, + #[clap(alias = "c")] + Clear, + #[clap(alias = "cd")] + ChangeDir { + path: String, + }, - #[clap(alias = "nb")] - NextBlock { - #[clap(default_value = "1")] - count: u32, - }, - AddTokens { - // TODO: from_ss58_checked - #[clap(value_parser = AccountId32::from_str)] - recipient: AccountId32, - value: u128, - }, - SetActor { - // TODO: from_ss58_checked - #[clap(value_parser = AccountId32::from_str)] - actor: AccountId32, - }, - SetGasLimit { - ref_time: u64, - proof_size: u64, - }, + #[clap(alias = "nb")] + NextBlock { + #[clap(default_value = "1")] + count: u32, + }, + AddTokens { + // TODO: from_ss58_checked + #[clap(value_parser = AccountId32::from_str)] + recipient: AccountId32, + value: u128, + }, + SetActor { + // TODO: from_ss58_checked + #[clap(value_parser = AccountId32::from_str)] + actor: AccountId32, + }, + SetGasLimit { + ref_time: u64, + proof_size: u64, + }, - #[clap(alias = "b")] - Build, - #[clap(alias = "d")] - Deploy { - #[clap(long, default_value = "new")] - constructor: String, - args: Vec, - #[clap(long, default_values_t = Vec::::new(), value_delimiter = ',')] - salt: Vec, - }, - Call { - message: String, - args: Vec, - }, + #[clap(alias = "b")] + Build, + #[clap(alias = "d")] + Deploy { + #[clap(long, default_value = "new")] + constructor: String, + args: Vec, + #[clap(long, default_values_t = Vec::::new(), value_delimiter = ',')] + salt: Vec, + }, + Call { + message: String, + args: Vec, + }, } #[cfg(test)] mod tests { - use super::*; + use super::*; - #[test] - fn verify_cli() { - use clap::CommandFactory; - CliCommand::command().debug_assert() - } + #[test] + fn verify_cli() { + use clap::CommandFactory; + CliCommand::command().debug_assert() + } } diff --git a/drink-cli/src/executor/contract.rs b/drink-cli/src/executor/contract.rs index 2812886..c870243 100644 --- a/drink-cli/src/executor/contract.rs +++ b/drink-cli/src/executor/contract.rs @@ -1,142 +1,132 @@ use std::{ - fs, - path::{Path, PathBuf}, - sync::Arc, + fs, + path::{Path, PathBuf}, + sync::Arc, }; use contract_build::{BuildMode, ExecuteArgs, ManifestPath, OptimizationPasses, Verbosity}; use contract_transcode::ContractMessageTranscoder; use crate::{ - app_state::{print::format_contract_action, AppState, Contract}, - executor::error::BuildError, + app_state::{print::format_contract_action, AppState, Contract}, + executor::error::BuildError, }; fn build_result(app_state: &mut AppState) -> Result { - let path_to_cargo_toml = app_state.ui_state.cwd.join(Path::new("Cargo.toml")); - let manifest_path = ManifestPath::new(path_to_cargo_toml.clone()).map_err(|err| { - BuildError::InvalidManifest { - manifest_path: path_to_cargo_toml, - err, - } - })?; - - let args = ExecuteArgs { - manifest_path, - build_mode: BuildMode::Release, - optimization_passes: Some(OptimizationPasses::default()), - verbosity: Verbosity::Quiet, - ..Default::default() - }; - - contract_build::execute(args) - .map_err(|err| BuildError::BuildFailed { err })? - .dest_wasm - .ok_or(BuildError::WasmNotGenerated)? - .canonicalize() - .map_err(|err| BuildError::InvalidDestPath { err }) - .map(|pb| pb.to_string_lossy().to_string()) + let path_to_cargo_toml = app_state.ui_state.cwd.join(Path::new("Cargo.toml")); + let manifest_path = ManifestPath::new(path_to_cargo_toml.clone()) + .map_err(|err| BuildError::InvalidManifest { manifest_path: path_to_cargo_toml, err })?; + + let args = ExecuteArgs { + manifest_path, + build_mode: BuildMode::Release, + optimization_passes: Some(OptimizationPasses::default()), + verbosity: Verbosity::Quiet, + ..Default::default() + }; + + contract_build::execute(args) + .map_err(|err| BuildError::BuildFailed { err })? + .dest_wasm + .ok_or(BuildError::WasmNotGenerated)? + .canonicalize() + .map_err(|err| BuildError::InvalidDestPath { err }) + .map(|pb| pb.to_string_lossy().to_string()) } /// Build the contract in the current directory. pub fn build(app_state: &mut AppState) { - match build_result(app_state) { - Ok(res) => app_state.print(&format!("Contract built successfully {res}")), - Err(msg) => app_state.print_error(&format!("{msg}")), - } + match build_result(app_state) { + Ok(res) => app_state.print(&format!("Contract built successfully {res}")), + Err(msg) => app_state.print_error(&format!("{msg}")), + } } pub fn deploy(app_state: &mut AppState, constructor: String, args: Vec, salt: Vec) { - // Get raw contract bytes - let Some((contract_name, contract_file)) = find_wasm_blob(&app_state.ui_state.cwd) else { - app_state.print_error("Failed to find contract file"); - return; - }; - - let contract_bytes = match fs::read(contract_file) { - Ok(bytes) => bytes, - Err(err) => { - app_state.print_error(&format!("Failed to read contract bytes\n{err}")); - return; - } - }; - - // Read contract metadata and prepare transcoder - let metadata_path = app_state - .ui_state - .cwd - .join(format!("target/ink/{contract_name}.json")); - - let Ok(transcoder) = ContractMessageTranscoder::load(metadata_path) else { - app_state.print_error("Failed to create transcoder from metadata file."); - return; - }; - let transcoder = Arc::new(transcoder); - - match app_state.session.deploy( - contract_bytes, - &constructor, - args.as_slice(), - salt, - None, - &transcoder, - ) { - Ok(address) => { - app_state.contracts.add(Contract { - name: contract_name, - address, - base_path: app_state.ui_state.cwd.clone(), - transcoder, - }); - app_state.print("Contract deployed successfully"); - } - Err(err) => app_state.print_error(&format!("Failed to deploy contract\n{err}")), - } - - if let Some(info) = app_state.session.record().deploy_results().last() { - app_state.print(&format_contract_action(info)); - } + // Get raw contract bytes + let Some((contract_name, contract_file)) = find_wasm_blob(&app_state.ui_state.cwd) else { + app_state.print_error("Failed to find contract file"); + return; + }; + + let contract_bytes = match fs::read(contract_file) { + Ok(bytes) => bytes, + Err(err) => { + app_state.print_error(&format!("Failed to read contract bytes\n{err}")); + return; + }, + }; + + // Read contract metadata and prepare transcoder + let metadata_path = app_state.ui_state.cwd.join(format!("target/ink/{contract_name}.json")); + + let Ok(transcoder) = ContractMessageTranscoder::load(metadata_path) else { + app_state.print_error("Failed to create transcoder from metadata file."); + return; + }; + let transcoder = Arc::new(transcoder); + + match app_state.session.deploy( + contract_bytes, + &constructor, + args.as_slice(), + salt, + None, + &transcoder, + ) { + Ok(address) => { + app_state.contracts.add(Contract { + name: contract_name, + address, + base_path: app_state.ui_state.cwd.clone(), + transcoder, + }); + app_state.print("Contract deployed successfully"); + }, + Err(err) => app_state.print_error(&format!("Failed to deploy contract\n{err}")), + } + + if let Some(info) = app_state.session.record().deploy_results().last() { + app_state.print(&format_contract_action(info)); + } } pub fn call(app_state: &mut AppState, message: String, args: Vec) { - let Some(contract) = app_state.contracts.current_contract() else { - app_state.print_error("No deployed contract"); - return; - }; - - let address = contract.address.clone(); - match app_state - .session - .call_with_address::<_, ()>(address, &message, &args, None) - { - Ok(result) => app_state.print(&format!("Result: {:?}", result)), - Err(err) => app_state.print_error(&format!("Failed to call contract\n{err}")), - }; - - if let Some(info) = app_state.session.record().call_results().last() { - app_state.print(&format_contract_action(info)) - } + let Some(contract) = app_state.contracts.current_contract() else { + app_state.print_error("No deployed contract"); + return; + }; + + let address = contract.address.clone(); + match app_state.session.call_with_address::<_, ()>(address, &message, &args, None) { + Ok(result) => app_state.print(&format!("Result: {:?}", result)), + Err(err) => app_state.print_error(&format!("Failed to call contract\n{err}")), + }; + + if let Some(info) = app_state.session.record().call_results().last() { + app_state.print(&format_contract_action(info)) + } } fn find_wasm_blob(cwd: &Path) -> Option<(String, PathBuf)> { - let Ok(entries) = fs::read_dir(cwd.join("target/ink")) else { - return None; - }; - let Some(file) = entries - .into_iter() - .filter_map(|e| e.ok()) - .find(|e| e.path().extension().unwrap_or_default() == "wasm") - else { - return None; - }; - - let raw_name = file - .file_name() - .into_string() - .expect("Invalid file name") - .strip_suffix(".wasm") - .expect("We have just checked file extension") - .to_string(); - - Some((raw_name, file.path())) + let Ok(entries) = fs::read_dir(cwd.join("target/ink")) else { + return None; + }; + let Some(file) = entries + .into_iter() + .filter_map(|e| e.ok()) + .find(|e| e.path().extension().unwrap_or_default() == "wasm") + else { + return None; + }; + + let raw_name = file + .file_name() + .into_string() + .expect("Invalid file name") + .strip_suffix(".wasm") + .expect("We have just checked file extension") + .to_string(); + + Some((raw_name, file.path())) } diff --git a/drink-cli/src/executor/error.rs b/drink-cli/src/executor/error.rs index f56b532..7f196a6 100644 --- a/drink-cli/src/executor/error.rs +++ b/drink-cli/src/executor/error.rs @@ -2,15 +2,12 @@ use thiserror::Error; #[derive(Error, Debug)] pub(crate) enum BuildError { - #[error("Invalid manifest path {manifest_path}: {err}")] - InvalidManifest { - manifest_path: std::path::PathBuf, - err: anyhow::Error, - }, - #[error("Contract build failed: {err}")] - BuildFailed { err: anyhow::Error }, - #[error("Wasm code artifact not generated")] - WasmNotGenerated, - #[error("Invalid destination bundle path: {err}")] - InvalidDestPath { err: std::io::Error }, + #[error("Invalid manifest path {manifest_path}: {err}")] + InvalidManifest { manifest_path: std::path::PathBuf, err: anyhow::Error }, + #[error("Contract build failed: {err}")] + BuildFailed { err: anyhow::Error }, + #[error("Wasm code artifact not generated")] + WasmNotGenerated, + #[error("Invalid destination bundle path: {err}")] + InvalidDestPath { err: std::io::Error }, } diff --git a/drink-cli/src/executor/mod.rs b/drink-cli/src/executor/mod.rs index b7c09ce..9d38784 100644 --- a/drink-cli/src/executor/mod.rs +++ b/drink-cli/src/executor/mod.rs @@ -10,72 +10,63 @@ use drink::{sandbox_api::prelude::*, AccountId32, Weight}; use crate::{app_state::AppState, cli::CliCommand}; pub fn execute(app_state: &mut AppState) -> Result<()> { - let command = app_state.ui_state.user_input.current_input().to_string(); - app_state.print_command(&command); + let command = app_state.ui_state.user_input.current_input().to_string(); + app_state.print_command(&command); - let command = command - .split_ascii_whitespace() - .map(|a| a.trim()) - .collect::>(); - let cli_command = match CliCommand::try_parse_from([vec![""], command].concat()) { - Ok(cli_command) => cli_command, - Err(_) => { - app_state.print_error("Invalid command"); - return Ok(()); - } - }; + let command = command.split_ascii_whitespace().map(|a| a.trim()).collect::>(); + let cli_command = match CliCommand::try_parse_from([vec![""], command].concat()) { + Ok(cli_command) => cli_command, + Err(_) => { + app_state.print_error("Invalid command"); + return Ok(()); + }, + }; - match cli_command { - CliCommand::Clear => app_state.ui_state.output.clear(), - CliCommand::ChangeDir { path } => { - let target_dir = app_state.ui_state.cwd.join(path); - match env::set_current_dir(target_dir) { - Ok(_) => { - app_state.ui_state.cwd = - env::current_dir().expect("Failed to get current directory"); - app_state.print("Directory changed"); - } - Err(err) => app_state.print_error(&err.to_string()), - } - } + match cli_command { + CliCommand::Clear => app_state.ui_state.output.clear(), + CliCommand::ChangeDir { path } => { + let target_dir = app_state.ui_state.cwd.join(path); + match env::set_current_dir(target_dir) { + Ok(_) => { + app_state.ui_state.cwd = + env::current_dir().expect("Failed to get current directory"); + app_state.print("Directory changed"); + }, + Err(err) => app_state.print_error(&err.to_string()), + } + }, - CliCommand::NextBlock { count } => build_blocks(app_state, count), - CliCommand::AddTokens { recipient, value } => add_tokens(app_state, recipient, value)?, - CliCommand::SetActor { actor } => { - app_state.chain_info.actor = actor; - app_state.print("Actor was set"); - } - CliCommand::SetGasLimit { - ref_time, - proof_size, - } => { - app_state.chain_info.gas_limit = Weight::from_parts(ref_time, proof_size); - app_state.print("Gas limit was set"); - } + CliCommand::NextBlock { count } => build_blocks(app_state, count), + CliCommand::AddTokens { recipient, value } => add_tokens(app_state, recipient, value)?, + CliCommand::SetActor { actor } => { + app_state.chain_info.actor = actor; + app_state.print("Actor was set"); + }, + CliCommand::SetGasLimit { ref_time, proof_size } => { + app_state.chain_info.gas_limit = Weight::from_parts(ref_time, proof_size); + app_state.print("Gas limit was set"); + }, - CliCommand::Build => contract::build(app_state), - CliCommand::Deploy { - constructor, - args, - salt, - } => contract::deploy(app_state, constructor, args, salt), - CliCommand::Call { message, args } => contract::call(app_state, message, args), - } + CliCommand::Build => contract::build(app_state), + CliCommand::Deploy { constructor, args, salt } => + contract::deploy(app_state, constructor, args, salt), + CliCommand::Call { message, args } => contract::call(app_state, message, args), + } - Ok(()) + Ok(()) } fn build_blocks(app_state: &mut AppState, count: u32) { - app_state.chain_info.block_height = app_state.session.sandbox().build_blocks(count); - app_state.print(&format!("{count} blocks built")); + app_state.chain_info.block_height = app_state.session.sandbox().build_blocks(count); + app_state.print(&format!("{count} blocks built")); } fn add_tokens(app_state: &mut AppState, recipient: AccountId32, value: u128) -> Result<()> { - app_state - .session - .sandbox() - .mint_into(&recipient, value) - .map_err(|err| anyhow::format_err!("Failed to add token: {err:?}"))?; - app_state.print(&format!("{value} tokens added to {recipient}",)); - Ok(()) + app_state + .session + .sandbox() + .mint_into(&recipient, value) + .map_err(|err| anyhow::format_err!("Failed to add token: {err:?}"))?; + app_state.print(&format!("{value} tokens added to {recipient}",)); + Ok(()) } diff --git a/drink-cli/src/main.rs b/drink-cli/src/main.rs index e3c4d96..5319bbc 100644 --- a/drink-cli/src/main.rs +++ b/drink-cli/src/main.rs @@ -13,12 +13,12 @@ mod ui; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] struct Args { - /// Starts the CLI in the provided directory - #[arg(short, long, value_name = "DIRECTORY")] - path: Option, + /// Starts the CLI in the provided directory + #[arg(short, long, value_name = "DIRECTORY")] + path: Option, } fn main() -> Result<()> { - let args = Args::parse(); - run_ui(args.path) + let args = Args::parse(); + run_ui(args.path) } diff --git a/drink-cli/src/ui/contracts.rs b/drink-cli/src/ui/contracts.rs index 6151375..67aa27e 100644 --- a/drink-cli/src/ui/contracts.rs +++ b/drink-cli/src/ui/contracts.rs @@ -1,34 +1,33 @@ use ratatui::{ - style::{Color, Style}, - text::{Line, Span}, - widgets::{List, ListItem, Widget}, + style::{Color, Style}, + text::{Line, Span}, + widgets::{List, ListItem, Widget}, }; use crate::{ - app_state::{AppState, ContractIndex}, - ui::layout::section, + app_state::{AppState, ContractIndex}, + ui::layout::section, }; pub(super) fn build(app_state: &mut AppState) -> impl Widget { - let items = app_state - .contracts - .get_all() - .iter() - .enumerate() - .map(|(idx, contract)| { - let style = match app_state.contracts.current_index() { - ContractIndex::CurrentContract(cc) if cc == idx => { - Style::default().bg(Color::White).fg(Color::Black) - } - _ => Style::default(), - }; + let items = app_state + .contracts + .get_all() + .iter() + .enumerate() + .map(|(idx, contract)| { + let style = match app_state.contracts.current_index() { + ContractIndex::CurrentContract(cc) if cc == idx => + Style::default().bg(Color::White).fg(Color::Black), + _ => Style::default(), + }; - ListItem::new(Line::from(Span::styled( - format!("{} / {}", contract.name, &contract.address.to_string()[..8],), - style, - ))) - }) - .collect::>(); + ListItem::new(Line::from(Span::styled( + format!("{} / {}", contract.name, &contract.address.to_string()[..8],), + style, + ))) + }) + .collect::>(); - List::new(items).block(section("Deployed contracts")) + List::new(items).block(section("Deployed contracts")) } diff --git a/drink-cli/src/ui/current_env.rs b/drink-cli/src/ui/current_env.rs index 1891510..43b1773 100644 --- a/drink-cli/src/ui/current_env.rs +++ b/drink-cli/src/ui/current_env.rs @@ -1,29 +1,29 @@ use ratatui::{ - layout::Alignment, - widgets::{Paragraph, Widget, Wrap}, + layout::Alignment, + widgets::{Paragraph, Widget, Wrap}, }; use crate::{app_state::AppState, ui::layout::section}; pub(super) fn build(app_state: &mut AppState) -> impl Widget { - let current_contract_info = match app_state.contracts.current_contract() { - Some(contract) => format!("name: {} | address: {}", contract.name, contract.address), - None => "No deployed contract".to_string(), - }; + let current_contract_info = match app_state.contracts.current_contract() { + Some(contract) => format!("name: {} | address: {}", contract.name, contract.address), + None => "No deployed contract".to_string(), + }; - Paragraph::new(format!( - r#"Current working directory: {} + Paragraph::new(format!( + r#"Current working directory: {} Block height: {} Deployed contracts: {} Current actor: {} Current contract: {{ {} }}"#, - app_state.ui_state.cwd.to_str().unwrap(), - app_state.chain_info.block_height, - app_state.contracts.count(), - app_state.chain_info.actor, - current_contract_info - )) - .alignment(Alignment::Left) - .wrap(Wrap { trim: false }) - .block(section("Current environment")) + app_state.ui_state.cwd.to_str().unwrap(), + app_state.chain_info.block_height, + app_state.contracts.count(), + app_state.chain_info.actor, + current_contract_info + )) + .alignment(Alignment::Left) + .wrap(Wrap { trim: false }) + .block(section("Current environment")) } diff --git a/drink-cli/src/ui/footer.rs b/drink-cli/src/ui/footer.rs index 6fde4cc..6299b94 100644 --- a/drink-cli/src/ui/footer.rs +++ b/drink-cli/src/ui/footer.rs @@ -1,48 +1,48 @@ use ratatui::{ - layout::Alignment, - style::{Color, Style}, - text::{Line, Span}, - widgets::{Paragraph, Widget}, + layout::Alignment, + style::{Color, Style}, + text::{Line, Span}, + widgets::{Paragraph, Widget}, }; use crate::{ - app_state::{AppState, Mode}, - ui::layout::section, + app_state::{AppState, Mode}, + ui::layout::section, }; pub(super) fn build(app_state: &AppState) -> impl Widget { - let instruction: Line = match app_state.ui_state.mode { - Mode::Managing => alternate_help([ - "Use arrows to scroll through output. Press ", - "'q'", - " to quit. Press ", - "'h'", - " to see help. Press ", - "'i'", - " to enter editing mode.", - ]), - Mode::Drinking => alternate_help([ - "Press ", - "'Esc'", - " to quit editing mode. Use ", - "'Tab'", - " to switch between deployed contracts.", - ]), - }; + let instruction: Line = match app_state.ui_state.mode { + Mode::Managing => alternate_help([ + "Use arrows to scroll through output. Press ", + "'q'", + " to quit. Press ", + "'h'", + " to see help. Press ", + "'i'", + " to enter editing mode.", + ]), + Mode::Drinking => alternate_help([ + "Press ", + "'Esc'", + " to quit editing mode. Use ", + "'Tab'", + " to switch between deployed contracts.", + ]), + }; - Paragraph::new(vec![instruction]) - .alignment(Alignment::Center) - .block(section("Help")) + Paragraph::new(vec![instruction]) + .alignment(Alignment::Center) + .block(section("Help")) } fn alternate_help>(items: I) -> Line<'static> { - items - .into_iter() - .enumerate() - .map(|(idx, item)| match idx % 2 { - 0 => Span::raw(item), - _ => Span::styled(item, Style::default().fg(Color::Yellow)), - }) - .collect::>() - .into() + items + .into_iter() + .enumerate() + .map(|(idx, item)| match idx % 2 { + 0 => Span::raw(item), + _ => Span::styled(item, Style::default().fg(Color::Yellow)), + }) + .collect::>() + .into() } diff --git a/drink-cli/src/ui/help.rs b/drink-cli/src/ui/help.rs index 7d7356d..583ca92 100644 --- a/drink-cli/src/ui/help.rs +++ b/drink-cli/src/ui/help.rs @@ -1,47 +1,35 @@ use ratatui::{ - style::{Color, Style}, - text::{Line, Span}, - widgets::{Paragraph, Widget}, + style::{Color, Style}, + text::{Line, Span}, + widgets::{Paragraph, Widget}, }; use crate::{app_state::AppState, ui::layout::section}; pub(super) fn build(_app_state: &AppState) -> impl Widget { - Paragraph::new(vec![ - command("cd ", "change directory do "), - command("clear / c", "clear output tab"), - command( - "build / b", - "build contract from the sources in the current directory", - ), - command( - "deploy / d [--constructor ] [--salt ]", - "deploy contract using (`new` by default) and (empty by default)", - ), - command("call ", "call contract's message"), - command( - "next-block / nb [count]", - "build next blocks (by default a single block)", - ), - command( - "add-tokens ", - "add tokens to ", - ), - command( - "set-actor ", - "set as the current actor (transaction sender)", - ), - command( - "set-gas-limit ", - "set gas limits to and ", - ), - ]) - .block(section("Help")) + Paragraph::new(vec![ + command("cd ", "change directory do "), + command("clear / c", "clear output tab"), + command("build / b", "build contract from the sources in the current directory"), + command( + "deploy / d [--constructor ] [--salt ]", + "deploy contract using (`new` by default) and (empty by default)", + ), + command("call ", "call contract's message"), + command("next-block / nb [count]", "build next blocks (by default a single block)"), + command("add-tokens ", "add tokens to "), + command("set-actor ", "set as the current actor (transaction sender)"), + command( + "set-gas-limit ", + "set gas limits to and ", + ), + ]) + .block(section("Help")) } fn command(command: &'static str, description: &'static str) -> Line<'static> { - Line::from(vec![ - Span::styled(command, Style::default().fg(Color::Green)), - format!(": {description}").into(), - ]) + Line::from(vec![ + Span::styled(command, Style::default().fg(Color::Green)), + format!(": {description}").into(), + ]) } diff --git a/drink-cli/src/ui/layout.rs b/drink-cli/src/ui/layout.rs index 8df5928..e28da32 100644 --- a/drink-cli/src/ui/layout.rs +++ b/drink-cli/src/ui/layout.rs @@ -1,61 +1,55 @@ use ratatui::{ - backend::Backend, - layout::{Constraint, Direction, Layout, Margin}, - widgets::{Block, BorderType, Borders, Padding}, - Frame, + backend::Backend, + layout::{Constraint, Direction, Layout, Margin}, + widgets::{Block, BorderType, Borders, Padding}, + Frame, }; use crate::{ - app_state::AppState, - ui::{contracts, current_env, footer, help, output, user_input}, + app_state::AppState, + ui::{contracts, current_env, footer, help, output, user_input}, }; pub(super) fn section(title: &str) -> Block { - Block::default() - .title(title) - .borders(Borders::ALL) - .border_type(BorderType::Rounded) - .padding(Padding::horizontal(1)) + Block::default() + .title(title) + .borders(Borders::ALL) + .border_type(BorderType::Rounded) + .padding(Padding::horizontal(1)) } pub(super) fn layout(f: &mut Frame, app_state: &mut AppState) { - let chunks = Layout::default() - .direction(Direction::Vertical) - .constraints( - [ - // current env - Constraint::Ratio(4, 20), - // output / help - Constraint::Ratio(12, 20), - // user input - Constraint::Length(3), - // footer - Constraint::Ratio(2, 20), - ] - .as_ref(), - ) - .split(f.size()); + let chunks = Layout::default() + .direction(Direction::Vertical) + .constraints( + [ + // current env + Constraint::Ratio(4, 20), + // output / help + Constraint::Ratio(12, 20), + // user input + Constraint::Length(3), + // footer + Constraint::Ratio(2, 20), + ] + .as_ref(), + ) + .split(f.size()); - let subchunks = Layout::default() - .direction(Direction::Horizontal) - .constraints([Constraint::Percentage(70), Constraint::Percentage(30)].as_ref()) - .split(chunks[0].inner(&Margin { - horizontal: 0, - vertical: 0, - })); - f.render_widget(current_env::build(app_state), subchunks[0]); - f.render_widget(contracts::build(app_state), subchunks[1]); + let subchunks = Layout::default() + .direction(Direction::Horizontal) + .constraints([Constraint::Percentage(70), Constraint::Percentage(30)].as_ref()) + .split(chunks[0].inner(&Margin { horizontal: 0, vertical: 0 })); + f.render_widget(current_env::build(app_state), subchunks[0]); + f.render_widget(contracts::build(app_state), subchunks[1]); - if app_state.ui_state.show_help { - f.render_widget(help::build(app_state), chunks[1]); - } else { - app_state - .ui_state - .output - .note_display_height(chunks[1].height - 2); - f.render_widget(output::build(app_state), chunks[1]); - } + if app_state.ui_state.show_help { + f.render_widget(help::build(app_state), chunks[1]); + } else { + app_state.ui_state.output.note_display_height(chunks[1].height - 2); + f.render_widget(output::build(app_state), chunks[1]); + } - f.render_widget(user_input::build(app_state), chunks[2]); - f.render_widget(footer::build(app_state), chunks[3]); + f.render_widget(user_input::build(app_state), chunks[2]); + f.render_widget(footer::build(app_state), chunks[3]); } diff --git a/drink-cli/src/ui/mod.rs b/drink-cli/src/ui/mod.rs index 3748722..a0ccb44 100644 --- a/drink-cli/src/ui/mod.rs +++ b/drink-cli/src/ui/mod.rs @@ -10,105 +10,100 @@ use std::{io, io::Stdout, path::PathBuf}; use anyhow::{anyhow, Result}; use crossterm::{ - event, - event::{DisableMouseCapture, EnableMouseCapture, Event, KeyCode}, - execute, - terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, + event, + event::{DisableMouseCapture, EnableMouseCapture, Event, KeyCode}, + execute, + terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, }; use layout::layout; use ratatui::backend::CrosstermBackend; use crate::{ - app_state::{ - AppState, - Mode::{Drinking, Managing}, - }, - executor::execute, + app_state::{ + AppState, + Mode::{Drinking, Managing}, + }, + executor::execute, }; type Terminal = ratatui::Terminal>; pub fn run_ui(cwd: Option) -> Result<()> { - let mut terminal = setup_dedicated_terminal()?; - let app_result = run_ui_app(&mut terminal, cwd); - restore_original_terminal(terminal)?; - app_result + let mut terminal = setup_dedicated_terminal()?; + let app_result = run_ui_app(&mut terminal, cwd); + restore_original_terminal(terminal)?; + app_result } fn setup_dedicated_terminal() -> Result { - enable_raw_mode()?; - let mut stdout = io::stdout(); - execute!(stdout, EnterAlternateScreen, EnableMouseCapture)?; - let backend = CrosstermBackend::new(stdout); - Terminal::new(backend).map_err(|e| anyhow!(e)) + enable_raw_mode()?; + let mut stdout = io::stdout(); + execute!(stdout, EnterAlternateScreen, EnableMouseCapture)?; + let backend = CrosstermBackend::new(stdout); + Terminal::new(backend).map_err(|e| anyhow!(e)) } fn restore_original_terminal(mut terminal: Terminal) -> Result<()> { - disable_raw_mode()?; - execute!( - terminal.backend_mut(), - LeaveAlternateScreen, - DisableMouseCapture - )?; - terminal.show_cursor().map_err(|e| anyhow!(e)) + disable_raw_mode()?; + execute!(terminal.backend_mut(), LeaveAlternateScreen, DisableMouseCapture)?; + terminal.show_cursor().map_err(|e| anyhow!(e)) } fn run_ui_app(terminal: &mut Terminal, cwd_override: Option) -> Result<()> { - let mut app_state = AppState::new(cwd_override); + let mut app_state = AppState::new(cwd_override); - loop { - terminal.draw(|f| layout(f, &mut app_state))?; + loop { + terminal.draw(|f| layout(f, &mut app_state))?; - let mode = &mut app_state.ui_state.mode; - if let Event::Key(key) = event::read()? { - match (*mode, key.code) { - (_, KeyCode::Esc) => *mode = Managing, + let mode = &mut app_state.ui_state.mode; + if let Event::Key(key) = event::read()? { + match (*mode, key.code) { + (_, KeyCode::Esc) => *mode = Managing, - (Managing, KeyCode::Char('q')) => break, - (Managing, KeyCode::Char('i')) => { - *mode = Drinking; - app_state.ui_state.show_help = false; - } - (Managing, KeyCode::Char('h')) => { - app_state.ui_state.show_help = !app_state.ui_state.show_help - } - (Managing, KeyCode::Down) => app_state.ui_state.output.scroll_down(), - (Managing, KeyCode::Up) => app_state.ui_state.output.scroll_up(), + (Managing, KeyCode::Char('q')) => break, + (Managing, KeyCode::Char('i')) => { + *mode = Drinking; + app_state.ui_state.show_help = false; + }, + (Managing, KeyCode::Char('h')) => + app_state.ui_state.show_help = !app_state.ui_state.show_help, + (Managing, KeyCode::Down) => app_state.ui_state.output.scroll_down(), + (Managing, KeyCode::Up) => app_state.ui_state.output.scroll_up(), - (Drinking, KeyCode::Char(c)) => app_state.ui_state.user_input.push(c), - (Drinking, KeyCode::Backspace) => { - app_state.ui_state.user_input.pop(); - } - (Drinking, KeyCode::Tab) => { - let prev_path = match app_state.contracts.current_contract() { - Some(c) => c.base_path.clone(), - None => continue, - }; + (Drinking, KeyCode::Char(c)) => app_state.ui_state.user_input.push(c), + (Drinking, KeyCode::Backspace) => { + app_state.ui_state.user_input.pop(); + }, + (Drinking, KeyCode::Tab) => { + let prev_path = match app_state.contracts.current_contract() { + Some(c) => c.base_path.clone(), + None => continue, + }; - let new_path = &app_state - .contracts - .next() - .expect("There is at least one contract - just checked") - .base_path; + let new_path = &app_state + .contracts + .next() + .expect("There is at least one contract - just checked") + .base_path; - if *new_path != prev_path { - let base_path = new_path.to_str().unwrap(); - app_state.ui_state.user_input.set(format!("cd {base_path}")); - execute(&mut app_state)?; - app_state.ui_state.user_input.set(String::new()); - } - } - (Drinking, KeyCode::Up) => app_state.ui_state.user_input.prev_input(), - (Drinking, KeyCode::Down) => app_state.ui_state.user_input.next_input(), - (Drinking, KeyCode::Enter) => { - execute(&mut app_state)?; - app_state.ui_state.user_input.apply(); - app_state.ui_state.output.reset_scrolling(); - } + if *new_path != prev_path { + let base_path = new_path.to_str().unwrap(); + app_state.ui_state.user_input.set(format!("cd {base_path}")); + execute(&mut app_state)?; + app_state.ui_state.user_input.set(String::new()); + } + }, + (Drinking, KeyCode::Up) => app_state.ui_state.user_input.prev_input(), + (Drinking, KeyCode::Down) => app_state.ui_state.user_input.next_input(), + (Drinking, KeyCode::Enter) => { + execute(&mut app_state)?; + app_state.ui_state.user_input.apply(); + app_state.ui_state.output.reset_scrolling(); + }, - _ => {} - } - } - } - Ok(()) + _ => {}, + } + } + } + Ok(()) } diff --git a/drink-cli/src/ui/output.rs b/drink-cli/src/ui/output.rs index 7f4ec37..eb27b74 100644 --- a/drink-cli/src/ui/output.rs +++ b/drink-cli/src/ui/output.rs @@ -3,7 +3,7 @@ use ratatui::widgets::{Paragraph, Widget}; use crate::{app_state::AppState, ui::layout::section}; pub(super) fn build(app_state: &AppState) -> impl Widget { - Paragraph::new(app_state.ui_state.output.content().to_vec()) - .block(section("Output")) - .scroll((app_state.ui_state.output.offset(), 0)) + Paragraph::new(app_state.ui_state.output.content().to_vec()) + .block(section("Output")) + .scroll((app_state.ui_state.output.offset(), 0)) } diff --git a/drink-cli/src/ui/user_input.rs b/drink-cli/src/ui/user_input.rs index 65ed45d..1633d89 100644 --- a/drink-cli/src/ui/user_input.rs +++ b/drink-cli/src/ui/user_input.rs @@ -1,19 +1,19 @@ use ratatui::{ - style::{Color, Style}, - widgets::{Paragraph, Widget}, + style::{Color, Style}, + widgets::{Paragraph, Widget}, }; use crate::{ - app_state::{AppState, Mode}, - ui::layout::section, + app_state::{AppState, Mode}, + ui::layout::section, }; pub(super) fn build(app_state: &mut AppState) -> impl Widget { - let mut style = Style::default(); - if app_state.ui_state.mode != Mode::Drinking { - style = style.fg(Color::DarkGray); - } + let mut style = Style::default(); + if app_state.ui_state.mode != Mode::Drinking { + style = style.fg(Color::DarkGray); + } - let block = section("User input").style(style); - Paragraph::new(app_state.ui_state.user_input.current_input().to_string()).block(block) + let block = section("User input").style(style); + Paragraph::new(app_state.ui_state.user_input.current_input().to_string()).block(block) } diff --git a/drink/src/errors.rs b/drink/src/errors.rs index 960e74e..c8d64dc 100644 --- a/drink/src/errors.rs +++ b/drink/src/errors.rs @@ -5,12 +5,12 @@ use thiserror::Error; /// Main error type for the drink crate. #[derive(Clone, Error, Debug)] pub enum Error { - /// Externalities could not be initialized. - #[error("Failed to build storage: {0}")] - StorageBuilding(String), - /// Bundle loading and parsing has failed - #[error("Loading the contract bundle has failed: {0}")] - BundleLoadFailed(String), + /// Externalities could not be initialized. + #[error("Failed to build storage: {0}")] + StorageBuilding(String), + /// Bundle loading and parsing has failed + #[error("Loading the contract bundle has failed: {0}")] + BundleLoadFailed(String), } /// Every contract message wraps its return value in `Result`. This is the error @@ -20,20 +20,20 @@ pub enum Error { #[non_exhaustive] #[repr(u32)] #[derive( - Debug, - Copy, - Clone, - PartialEq, - Eq, - parity_scale_codec::Encode, - parity_scale_codec::Decode, - scale_info::TypeInfo, - Error, + Debug, + Copy, + Clone, + PartialEq, + Eq, + parity_scale_codec::Encode, + parity_scale_codec::Decode, + scale_info::TypeInfo, + Error, )] pub enum LangError { - /// Failed to read execution input for the dispatchable. - #[error("Failed to read execution input for the dispatchable.")] - CouldNotReadInput = 1u32, + /// Failed to read execution input for the dispatchable. + #[error("Failed to read execution input for the dispatchable.")] + CouldNotReadInput = 1u32, } /// The `Result` type for ink! messages. diff --git a/drink/src/lib.rs b/drink/src/lib.rs index 0d66ecf..6702cf3 100644 --- a/drink/src/lib.rs +++ b/drink/src/lib.rs @@ -14,9 +14,9 @@ pub use drink_test_macro::{contract_bundle_provider, test}; pub use errors::Error; pub use frame_support; pub use ink_sandbox::{ - self, api as sandbox_api, create_sandbox, create_sandbox_with_runtime, impl_sandbox, - pallet_balances, pallet_contracts, pallet_timestamp, sp_externalities, AccountId32, - DispatchError, Sandbox, Ss58Codec, Weight, + self, api as sandbox_api, create_sandbox, create_sandbox_with_runtime, impl_sandbox, + pallet_balances, pallet_contracts, pallet_timestamp, sp_externalities, AccountId32, + DispatchError, Sandbox, Ss58Codec, Weight, }; #[cfg(feature = "session")] pub use session::mock::{mock_message, ContractMock, MessageMock, MockedCallResult, Selector}; @@ -27,12 +27,8 @@ pub type DrinkResult = std::result::Result; /// Minimal Sandbox runtime used for testing contracts with drink!. #[allow(missing_docs)] pub mod minimal { - use ink_sandbox::create_sandbox_with_runtime; + use ink_sandbox::create_sandbox_with_runtime; - // create_sandbox_with_runtime!(MinimalSandbox); - create_sandbox_with_runtime!( - MinimalSandbox, - (), - crate::pallet_contracts_debugging::DrinkDebug - ); + // create_sandbox_with_runtime!(MinimalSandbox); + create_sandbox_with_runtime!(MinimalSandbox, (), crate::pallet_contracts_debugging::DrinkDebug); } diff --git a/drink/src/pallet_contracts_debugging/intercepting.rs b/drink/src/pallet_contracts_debugging/intercepting.rs index 7ae00a4..28168e2 100644 --- a/drink/src/pallet_contracts_debugging/intercepting.rs +++ b/drink/src/pallet_contracts_debugging/intercepting.rs @@ -2,28 +2,28 @@ use ink_sandbox::AccountIdFor; use parity_scale_codec::{Decode, Encode}; use crate::{ - pallet_contracts::{ - debug::{CallInterceptor, ExecResult, ExportedFunction}, - Config, - }, - pallet_contracts_debugging::{runtime::contract_call_debugger, DrinkDebug}, + pallet_contracts::{ + debug::{CallInterceptor, ExecResult, ExportedFunction}, + Config, + }, + pallet_contracts_debugging::{runtime::contract_call_debugger, DrinkDebug}, }; impl CallInterceptor for DrinkDebug { - fn intercept_call( - contract_address: &AccountIdFor, - entry_point: &ExportedFunction, - input_data: &[u8], - ) -> Option { - // Pass the data to the runtime interface. The data must be encoded (only simple types are - // supported). - contract_call_debugger::intercept_call( - contract_address.encode(), - matches!(*entry_point, ExportedFunction::Call), - input_data.to_vec(), - ) - .and_then(|intercepting_result| { - Decode::decode(&mut intercepting_result.as_slice()).expect("Decoding should succeed") - }) - } + fn intercept_call( + contract_address: &AccountIdFor, + entry_point: &ExportedFunction, + input_data: &[u8], + ) -> Option { + // Pass the data to the runtime interface. The data must be encoded (only simple types are + // supported). + contract_call_debugger::intercept_call( + contract_address.encode(), + matches!(*entry_point, ExportedFunction::Call), + input_data.to_vec(), + ) + .and_then(|intercepting_result| { + Decode::decode(&mut intercepting_result.as_slice()).expect("Decoding should succeed") + }) + } } diff --git a/drink/src/pallet_contracts_debugging/runtime.rs b/drink/src/pallet_contracts_debugging/runtime.rs index 4675783..d62123a 100644 --- a/drink/src/pallet_contracts_debugging/runtime.rs +++ b/drink/src/pallet_contracts_debugging/runtime.rs @@ -10,66 +10,66 @@ use sp_runtime_interface::runtime_interface; /// traits. For simplicity, we just go with primitives and codec encoded data. #[runtime_interface] pub trait ContractCallDebugger { - fn after_call( - &mut self, - contract_address: Vec, - is_call: bool, - input_data: Vec, - result: Vec, - ) { - if let Some(ext) = self.extension::() { - ext.after_call(contract_address, is_call, input_data, result); - } - } + fn after_call( + &mut self, + contract_address: Vec, + is_call: bool, + input_data: Vec, + result: Vec, + ) { + if let Some(ext) = self.extension::() { + ext.after_call(contract_address, is_call, input_data, result); + } + } - fn intercept_call( - &mut self, - contract_address: Vec, - is_call: bool, - input_data: Vec, - ) -> Option> { - self.extension::() - .map(|ext| ext.intercept_call(contract_address, is_call, input_data)) - } + fn intercept_call( + &mut self, + contract_address: Vec, + is_call: bool, + input_data: Vec, + ) -> Option> { + self.extension::() + .map(|ext| ext.intercept_call(contract_address, is_call, input_data)) + } } /// This trait describes a runtime extension that can be used to debug contract calls. pub trait TracingExtT { - /// Called after a contract call is made. - fn after_call( - &self, - _contract_address: Vec, - _is_call: bool, - _input_data: Vec, - _result: Vec, - ) { - } + /// Called after a contract call is made. + fn after_call( + &self, + _contract_address: Vec, + _is_call: bool, + _input_data: Vec, + _result: Vec, + ) { + } } decl_extension! { - /// A wrapper type for the `TracingExtT` debug extension. - pub struct TracingExt(Box); + /// A wrapper type for the `TracingExtT` debug extension. + pub struct TracingExt(Box); } /// This trait describes a runtime extension that can be used to intercept contract calls. pub trait InterceptingExtT { - /// Called when a contract call is made. - /// - /// The returned value must be a valid codec encoding for `Option`. - fn intercept_call( - &self, - _contract_address: Vec, - _is_call: bool, - _input_data: Vec, - ) -> Vec { - // By default, do not intercept, continue with the standard procedure. - None::<()>.encode() - } + /// Called when a contract call is made. + /// + /// The returned value must be a valid codec encoding for `Option`. + fn intercept_call( + &self, + _contract_address: Vec, + _is_call: bool, + _input_data: Vec, + ) -> Vec { + // By default, do not intercept, continue with the standard procedure. + None::<()>.encode() + } } decl_extension! { - /// A wrapper type for the `InterceptingExtT` debug extension. - pub struct InterceptingExt(Box); + /// A wrapper type for the `InterceptingExtT` debug extension. + pub struct InterceptingExt(Box); } /// The simplest extension - uses default implementation. diff --git a/drink/src/pallet_contracts_debugging/tracing.rs b/drink/src/pallet_contracts_debugging/tracing.rs index 80c2ff2..2f9cfb2 100644 --- a/drink/src/pallet_contracts_debugging/tracing.rs +++ b/drink/src/pallet_contracts_debugging/tracing.rs @@ -1,27 +1,27 @@ use ink_sandbox::AccountIdFor; use crate::{ - pallet_contracts::{ - debug::{CallSpan, ExportedFunction}, - Config, ExecReturnValue, Tracing, - }, - pallet_contracts_debugging::DrinkDebug, + pallet_contracts::{ + debug::{CallSpan, ExportedFunction}, + Config, ExecReturnValue, Tracing, + }, + pallet_contracts_debugging::DrinkDebug, }; impl Tracing for DrinkDebug { - type CallSpan = DrinkCallSpan>; + type CallSpan = DrinkCallSpan>; - fn new_call_span( - contract_address: &AccountIdFor, - entry_point: ExportedFunction, - input_data: &[u8], - ) -> Self::CallSpan { - DrinkCallSpan { - contract_address: contract_address.clone(), - entry_point, - input_data: input_data.to_vec(), - } - } + fn new_call_span( + contract_address: &AccountIdFor, + entry_point: ExportedFunction, + input_data: &[u8], + ) -> Self::CallSpan { + DrinkCallSpan { + contract_address: contract_address.clone(), + entry_point, + input_data: input_data.to_vec(), + } + } } /// A contract's call span. @@ -29,21 +29,21 @@ impl Tracing for DrinkDebug { /// It is created just before the call is made and `Self::after_call` is called after the call is /// done. pub struct DrinkCallSpan { - /// The address of the contract that has been called. - pub contract_address: AccountId, - /// The entry point that has been called (either constructor or call). - pub entry_point: ExportedFunction, - /// The input data of the call. - pub input_data: Vec, + /// The address of the contract that has been called. + pub contract_address: AccountId, + /// The entry point that has been called (either constructor or call). + pub entry_point: ExportedFunction, + /// The input data of the call. + pub input_data: Vec, } impl CallSpan for DrinkCallSpan { - fn after_call(self, output: &ExecReturnValue) { - crate::pallet_contracts_debugging::runtime::contract_call_debugger::after_call( - self.contract_address.encode(), - matches!(self.entry_point, ExportedFunction::Call), - self.input_data.to_vec(), - output.data.clone(), - ); - } + fn after_call(self, output: &ExecReturnValue) { + crate::pallet_contracts_debugging::runtime::contract_call_debugger::after_call( + self.contract_address.encode(), + matches!(self.entry_point, ExportedFunction::Call), + self.input_data.to_vec(), + output.data.clone(), + ); + } } diff --git a/drink/src/session.rs b/drink/src/session.rs index 39da36f..e0dcdb8 100644 --- a/drink/src/session.rs +++ b/drink/src/session.rs @@ -1,9 +1,9 @@ //! This module provides a context-aware interface for interacting with contracts. use std::{ - fmt::Debug, - mem, - sync::{Arc, Mutex}, + fmt::Debug, + mem, + sync::{Arc, Mutex}, }; pub use contract_transcode; @@ -11,15 +11,15 @@ use contract_transcode::ContractMessageTranscoder; use error::SessionError; use frame_support::{traits::fungible::Inspect, weights::Weight}; use ink_sandbox::{ - api::prelude::*, AccountIdFor, ContractExecResultFor, ContractInstantiateResultFor, Sandbox, + api::prelude::*, AccountIdFor, ContractExecResultFor, ContractInstantiateResultFor, Sandbox, }; use parity_scale_codec::Decode; pub use record::{EventBatch, Record}; use crate::{ - pallet_contracts::{Config, Determinism}, - pallet_contracts_debugging::{InterceptingExt, TracingExt}, - session::mock::MockRegistry, + pallet_contracts::{Config, Determinism}, + pallet_contracts_debugging::{InterceptingExt, TracingExt}, + session::mock::MockRegistry, }; pub mod mock; @@ -34,9 +34,9 @@ pub use bundle::ContractBundle; use self::mocking_api::MockingApi; use crate::{ - errors::MessageResult, - // minimal::MinimalSandboxRuntime, - session::transcoding::TranscoderRegistry, + errors::MessageResult, + // minimal::MinimalSandboxRuntime, + session::transcoding::TranscoderRegistry, }; type BalanceOf = <::Currency as Inspect>>::Balance; @@ -75,10 +75,10 @@ pub const NO_SALT: Vec = vec![]; /// # fn main() -> Result<(), drink::session::error::SessionError> { /// /// Session::::default() -/// .deploy_and(contract_bytes(), "new", NO_ARGS, NO_SALT, None, &get_transcoder())? -/// .call_and("foo", NO_ARGS, None)? -/// .with_actor(bob()) -/// .call_and("bar", NO_ARGS, None)?; +/// .deploy_and(contract_bytes(), "new", NO_ARGS, NO_SALT, None, &get_transcoder())? +/// .call_and("foo", NO_ARGS, None)? +/// .with_actor(bob()) +/// .call_and("bar", NO_ARGS, None)?; /// # Ok(()) } /// ``` /// @@ -101,7 +101,8 @@ pub const NO_SALT: Vec = vec![]; /// # fn main() -> Result<(), Box> { /// /// let mut session = Session::::default(); -/// let _address = session.deploy(contract_bytes(), "new", NO_ARGS, NO_SALT, None, &get_transcoder())?; +/// let _address = +/// session.deploy(contract_bytes(), "new", NO_ARGS, NO_SALT, None, &get_transcoder())?; /// let _result: u32 = session.call("foo", NO_ARGS, None)??; /// session.set_actor(bob()); /// session.call::<_, ()>("bar", NO_ARGS, None)??; @@ -119,483 +120,477 @@ pub const NO_SALT: Vec = vec![]; /// /// # fn main() -> Result<(), drink::session::error::SessionError> { /// // Simplest way, loading a bundle from the project's directory: -/// Session::::default() -/// .deploy_bundle_and(local_contract_file!(), "new", NO_ARGS, NO_SALT, None)?; /* ... */ +/// Session::::default().deploy_bundle_and( +/// local_contract_file!(), +/// "new", +/// NO_ARGS, +/// NO_SALT, +/// None, +/// )?; // ... /// /// // Or choosing the file explicitly: /// let contract = ContractBundle::load("path/to/your.contract")?; /// Session::::default() -/// .deploy_bundle_and(contract, "new", NO_ARGS, NO_SALT, None)?; /* ... */ +/// .deploy_bundle_and(contract, "new", NO_ARGS, NO_SALT, None)?; // ... /// # Ok(()) } /// ``` pub struct Session where - T::Runtime: Config, + T::Runtime: Config, { - pub sandbox: T, + pub sandbox: T, - actor: AccountIdFor, - gas_limit: Weight, - determinism: Determinism, + actor: AccountIdFor, + gas_limit: Weight, + determinism: Determinism, - transcoders: TranscoderRegistry>, - record: Record, - mocks: Arc>>>, + transcoders: TranscoderRegistry>, + record: Record, + mocks: Arc>>>, } impl Default for Session where - T::Runtime: Config, - T: Default, + T::Runtime: Config, + T: Default, { - fn default() -> Self { - let mocks = Arc::new(Mutex::new(MockRegistry::new())); - let mut sandbox = T::default(); - sandbox.register_extension(InterceptingExt(Box::new(MockingExtension { - mock_registry: Arc::clone(&mocks), - }))); - - Self { - sandbox, - mocks, - actor: T::default_actor(), - gas_limit: T::default_gas_limit(), - determinism: Determinism::Enforced, - transcoders: TranscoderRegistry::new(), - record: Default::default(), - } - } + fn default() -> Self { + let mocks = Arc::new(Mutex::new(MockRegistry::new())); + let mut sandbox = T::default(); + sandbox.register_extension(InterceptingExt(Box::new(MockingExtension { + mock_registry: Arc::clone(&mocks), + }))); + + Self { + sandbox, + mocks, + actor: T::default_actor(), + gas_limit: T::default_gas_limit(), + determinism: Determinism::Enforced, + transcoders: TranscoderRegistry::new(), + record: Default::default(), + } + } } impl Session where - T::Runtime: Config, + T::Runtime: Config, { - const LOG_TARGET: &'static str = "pop-drink::session"; - - /// Sets a new actor and returns updated `self`. - pub fn with_actor(self, actor: AccountIdFor) -> Self { - Self { actor, ..self } - } - - /// Returns currently set actor. - pub fn get_actor(&self) -> AccountIdFor { - self.actor.clone() - } - - /// Sets a new actor and returns the old one. - pub fn set_actor(&mut self, actor: AccountIdFor) -> AccountIdFor { - mem::replace(&mut self.actor, actor) - } - - /// Sets a new gas limit and returns updated `self`. - pub fn with_gas_limit(self, gas_limit: Weight) -> Self { - Self { gas_limit, ..self } - } - - /// Sets a new gas limit and returns the old one. - pub fn set_gas_limit(&mut self, gas_limit: Weight) -> Weight { - mem::replace(&mut self.gas_limit, gas_limit) - } - - /// Returns currently set gas limit. - pub fn get_gas_limit(&self) -> Weight { - self.gas_limit - } - - /// Sets a new determinism policy and returns updated `self`. - pub fn with_determinism(self, determinism: Determinism) -> Self { - Self { - determinism, - ..self - } - } - - /// Sets a new determinism policy and returns the old one. - pub fn set_determinism(&mut self, determinism: Determinism) -> Determinism { - mem::replace(&mut self.determinism, determinism) - } - - /// Register a transcoder for a particular contract and returns updated `self`. - pub fn with_transcoder( - mut self, - contract_address: AccountIdFor, - transcoder: &Arc, - ) -> Self { - self.set_transcoder(contract_address, transcoder); - self - } - - /// Registers a transcoder for a particular contract. - pub fn set_transcoder( - &mut self, - contract_address: AccountIdFor, - transcoder: &Arc, - ) { - self.transcoders.register(contract_address, transcoder); - } - - /// The underlying `Sandbox` instance. - pub fn sandbox(&mut self) -> &mut T { - &mut self.sandbox - } - - /// Returns a reference to the record of the session. - pub fn record(&self) -> &Record { - &self.record - } - - /// Returns a reference for mocking API. - pub fn mocking_api(&mut self) -> &mut impl MockingApi { - self - } - - /// Deploys a contract with a given constructor, arguments, salt and endowment. In case of - /// success, returns `self`. - pub fn deploy_and + Debug>( - mut self, - contract_bytes: Vec, - constructor: &str, - args: &[S], - salt: Vec, - endowment: Option>, - transcoder: &Arc, - ) -> Result { - self.deploy( - contract_bytes, - constructor, - args, - salt, - endowment, - transcoder, - ) - .map(|_| self) - } - fn record_events(&mut self, recording: impl FnOnce(&mut Self) -> V) -> V { - let start = self.sandbox.events().len(); - let result = recording(self); - let events = self.sandbox.events()[start..].to_vec(); - self.record.push_event_batches(events); - result - } - - /// Deploys a contract with a given constructor, arguments, salt and endowment. In case of - /// success, returns the address of the deployed contract. - pub fn deploy + Debug>( - &mut self, - contract_bytes: Vec, - constructor: &str, - args: &[S], - salt: Vec, - endowment: Option>, - transcoder: &Arc, - ) -> Result, SessionError> { - let data = transcoder - .encode(constructor, args) - .map_err(|err| SessionError::Encoding(err.to_string()))?; - - let result = self.record_events(|session| { - session.sandbox.deploy_contract( - contract_bytes, - endowment.unwrap_or_default(), - data, - salt, - session.actor.clone(), - session.gas_limit, - None, - ) - }); - - let ret = match &result.result { - Ok(exec_result) if exec_result.result.did_revert() => { - Err(SessionError::DeploymentReverted) - } - Ok(exec_result) => { - let address = exec_result.account_id.clone(); - self.record.push_deploy_return(address.clone()); - self.transcoders.register(address.clone(), transcoder); - - Ok(address) - } - Err(err) => Err(SessionError::DeploymentFailed(*err)), - }; - - self.record.push_deploy_result(result); - ret - } - - /// Similar to `deploy` but takes the parsed contract file (`ContractBundle`) as a first argument. - /// - /// You can get it with `ContractBundle::load("some/path/your.contract")` or `local_contract_file!()` - pub fn deploy_bundle + Debug>( - &mut self, - contract_file: ContractBundle, - constructor: &str, - args: &[S], - salt: Vec, - endowment: Option>, - ) -> Result, SessionError> { - self.deploy( - contract_file.wasm, - constructor, - args, - salt, - endowment, - &contract_file.transcoder, - ) - } - - /// Performs a dry run of the deployment of a contract. - pub fn dry_run_deployment + Debug>( - &mut self, - contract_file: ContractBundle, - constructor: &str, - args: &[S], - salt: Vec, - endowment: Option>, - ) -> Result, SessionError> { - let data = contract_file - .transcoder - .encode(constructor, args) - .map_err(|err| SessionError::Encoding(err.to_string()))?; - - Ok(self.sandbox.dry_run(|sandbox| { - sandbox.deploy_contract( - contract_file.wasm, - endowment.unwrap_or_default(), - data, - salt, - self.actor.clone(), - self.gas_limit, - None, - ) - })) - } - - /// Similar to `deploy_and` but takes the parsed contract file (`ContractBundle`) as a first argument. - /// - /// You can get it with `ContractBundle::load("some/path/your.contract")` or `local_contract_file!()` - pub fn deploy_bundle_and + Debug>( - mut self, - contract_file: ContractBundle, - constructor: &str, - args: &[S], - salt: Vec, - endowment: Option>, - ) -> Result { - self.deploy_bundle(contract_file, constructor, args, salt, endowment) - .map(|_| self) - } - - /// Uploads a raw contract code. In case of success, returns `self`. - pub fn upload_and(mut self, contract_bytes: Vec) -> Result { - self.upload(contract_bytes).map(|_| self) - } - - /// Uploads a raw contract code. In case of success returns the code hash. - pub fn upload(&mut self, contract_bytes: Vec) -> Result, SessionError> { - log::debug!( - target: Self::LOG_TARGET, - "upload: bytes={:?}", - contract_bytes - ); - let result = self.sandbox.upload_contract( - contract_bytes, - self.actor.clone(), - None, - self.determinism, - ); - - result - .map(|upload_result| upload_result.code_hash) - .map_err(SessionError::UploadFailed) - } - - /// Similar to `upload_and` but takes the contract bundle as the first argument. - /// - /// You can obtain it using `ContractBundle::load("some/path/your.contract")` or `local_contract_file!()` - pub fn upload_bundle_and(self, contract_file: ContractBundle) -> Result { - self.upload_and(contract_file.wasm) - } - - /// Similar to `upload` but takes the contract bundle as the first argument. - /// - /// You can obtain it using `ContractBundle::load("some/path/your.contract")` or `local_contract_file!()` - pub fn upload_bundle( - &mut self, - contract_file: ContractBundle, - ) -> Result, SessionError> { - self.upload(contract_file.wasm) - } - - /// Calls a contract with a given address. In case of a successful call, returns `self`. - pub fn call_and + Debug>( - mut self, - message: &str, - args: &[S], - endowment: Option>, - ) -> Result { - log::debug!( - target: Self::LOG_TARGET, - "call_and: message={message}, args={args:?}, endowment={endowment:?}", - ); - // We ignore result, so we can pass `()` as the message result type, which will never fail - // at decoding. - self.call_internal::<_, ()>(None, message, args, endowment) - .map(|_| self) - } - - /// Calls the last deployed contract. In case of a successful call, returns `self`. - pub fn call_with_address_and + Debug>( - mut self, - address: AccountIdFor, - message: &str, - args: &[S], - endowment: Option>, - ) -> Result { - log::debug!( - target: Self::LOG_TARGET, - "call_with_address_and: address={address}, message={message}, args={args:?}, endowment={endowment:?}", - ); - // We ignore result, so we can pass `()` as the message result type, which will never fail - // at decoding. - self.call_internal::<_, ()>(Some(address), message, args, endowment) - .map(|_| self) - } - - /// Calls the last deployed contract. In case of a successful call, returns the encoded result. - pub fn call + Debug, V: Decode>( - &mut self, - message: &str, - args: &[S], - endowment: Option>, - ) -> Result, SessionError> { - log::debug!( - target: Self::LOG_TARGET, - "call: message={message}, args={args:?}, endowment={endowment:?}", - ); - self.call_internal::<_, V>(None, message, args, endowment) - } - - /// Calls the last deployed contract. Expect it to be reverted and the message result to be of - /// type `Result<_, E>`. - pub fn call_and_expect_error + Debug, E: Debug + Decode>( - &mut self, - message: &str, - args: &[S], - endowment: Option>, - ) -> Result { - log::debug!( - target: Self::LOG_TARGET, - "call_and_expect_error: message={message}, args={args:?}, endowment={endowment:?}", - ); - Ok(self - .call_internal::<_, Result<(), E>>(None, message, args, endowment) - .expect_err("Call should fail") - .decode_revert::>()? - .expect("Call should return an error") - .expect_err("Call should return an error")) - } - - /// Calls a contract with a given address. In case of a successful call, returns the encoded - /// result. - pub fn call_with_address + Debug, V: Decode>( - &mut self, - address: AccountIdFor, - message: &str, - args: &[S], - endowment: Option>, - ) -> Result, SessionError> { - log::debug!( - target: Self::LOG_TARGET, - "call_with_address: address={address}, message={message}, args={args:?}, endowment={endowment:?}", - ); - self.call_internal(Some(address), message, args, endowment) - } - - /// Performs a dry run of a contract call. - pub fn dry_run_call + Debug>( - &mut self, - address: AccountIdFor, - message: &str, - args: &[S], - endowment: Option>, - ) -> Result, SessionError> { - let data = self - .transcoders - .get(&address) - .as_ref() - .ok_or(SessionError::NoTranscoder)? - .encode(message, args) - .map_err(|err| SessionError::Encoding(err.to_string()))?; - - Ok(self.sandbox.dry_run(|sandbox| { - sandbox.call_contract( - address, - endowment.unwrap_or_default(), - data, - self.actor.clone(), - self.gas_limit, - None, - self.determinism, - ) - })) - } - - fn call_internal + Debug, V: Decode>( - &mut self, - address: Option>, - message: &str, - args: &[S], - endowment: Option>, - ) -> Result, SessionError> { - let address = match address { - Some(address) => address, - None => self - .record - .deploy_returns() - .last() - .ok_or(SessionError::NoContract)? - .clone(), - }; - - let data = self - .transcoders - .get(&address) - .as_ref() - .ok_or(SessionError::NoTranscoder)? - .encode(message, args) - .map_err(|err| SessionError::Encoding(err.to_string()))?; - - let result = self.record_events(|session| { - session.sandbox.call_contract( - address, - endowment.unwrap_or_default(), - data, - session.actor.clone(), - session.gas_limit, - None, - session.determinism, - ) - }); - - let ret = match &result.result { - Ok(exec_result) if exec_result.did_revert() => { - Err(SessionError::CallReverted(exec_result.data.clone())) - } - Ok(exec_result) => { - self.record.push_call_return(exec_result.data.clone()); - self.record.last_call_return_decoded::() - } - Err(err) => Err(SessionError::CallFailed(*err)), - }; - - self.record.push_call_result(result); - ret - } - - /// Set the tracing extension - pub fn set_tracing_extension(&mut self, d: TracingExt) { - self.sandbox.register_extension(d); - } + const LOG_TARGET: &'static str = "pop-drink::session"; + + /// Sets a new actor and returns updated `self`. + pub fn with_actor(self, actor: AccountIdFor) -> Self { + Self { actor, ..self } + } + + /// Returns currently set actor. + pub fn get_actor(&self) -> AccountIdFor { + self.actor.clone() + } + + /// Sets a new actor and returns the old one. + pub fn set_actor(&mut self, actor: AccountIdFor) -> AccountIdFor { + mem::replace(&mut self.actor, actor) + } + + /// Sets a new gas limit and returns updated `self`. + pub fn with_gas_limit(self, gas_limit: Weight) -> Self { + Self { gas_limit, ..self } + } + + /// Sets a new gas limit and returns the old one. + pub fn set_gas_limit(&mut self, gas_limit: Weight) -> Weight { + mem::replace(&mut self.gas_limit, gas_limit) + } + + /// Returns currently set gas limit. + pub fn get_gas_limit(&self) -> Weight { + self.gas_limit + } + + /// Sets a new determinism policy and returns updated `self`. + pub fn with_determinism(self, determinism: Determinism) -> Self { + Self { determinism, ..self } + } + + /// Sets a new determinism policy and returns the old one. + pub fn set_determinism(&mut self, determinism: Determinism) -> Determinism { + mem::replace(&mut self.determinism, determinism) + } + + /// Register a transcoder for a particular contract and returns updated `self`. + pub fn with_transcoder( + mut self, + contract_address: AccountIdFor, + transcoder: &Arc, + ) -> Self { + self.set_transcoder(contract_address, transcoder); + self + } + + /// Registers a transcoder for a particular contract. + pub fn set_transcoder( + &mut self, + contract_address: AccountIdFor, + transcoder: &Arc, + ) { + self.transcoders.register(contract_address, transcoder); + } + + /// The underlying `Sandbox` instance. + pub fn sandbox(&mut self) -> &mut T { + &mut self.sandbox + } + + /// Returns a reference to the record of the session. + pub fn record(&self) -> &Record { + &self.record + } + + /// Returns a reference for mocking API. + pub fn mocking_api(&mut self) -> &mut impl MockingApi { + self + } + + /// Deploys a contract with a given constructor, arguments, salt and endowment. In case of + /// success, returns `self`. + pub fn deploy_and + Debug>( + mut self, + contract_bytes: Vec, + constructor: &str, + args: &[S], + salt: Vec, + endowment: Option>, + transcoder: &Arc, + ) -> Result { + self.deploy(contract_bytes, constructor, args, salt, endowment, transcoder) + .map(|_| self) + } + + fn record_events(&mut self, recording: impl FnOnce(&mut Self) -> V) -> V { + let start = self.sandbox.events().len(); + let result = recording(self); + let events = self.sandbox.events()[start..].to_vec(); + self.record.push_event_batches(events); + result + } + + /// Deploys a contract with a given constructor, arguments, salt and endowment. In case of + /// success, returns the address of the deployed contract. + pub fn deploy + Debug>( + &mut self, + contract_bytes: Vec, + constructor: &str, + args: &[S], + salt: Vec, + endowment: Option>, + transcoder: &Arc, + ) -> Result, SessionError> { + let data = transcoder + .encode(constructor, args) + .map_err(|err| SessionError::Encoding(err.to_string()))?; + + let result = self.record_events(|session| { + session.sandbox.deploy_contract( + contract_bytes, + endowment.unwrap_or_default(), + data, + salt, + session.actor.clone(), + session.gas_limit, + None, + ) + }); + + let ret = match &result.result { + Ok(exec_result) if exec_result.result.did_revert() => + Err(SessionError::DeploymentReverted), + Ok(exec_result) => { + let address = exec_result.account_id.clone(); + self.record.push_deploy_return(address.clone()); + self.transcoders.register(address.clone(), transcoder); + + Ok(address) + }, + Err(err) => Err(SessionError::DeploymentFailed(*err)), + }; + + self.record.push_deploy_result(result); + ret + } + + /// Similar to `deploy` but takes the parsed contract file (`ContractBundle`) as a first + /// argument. + /// + /// You can get it with `ContractBundle::load("some/path/your.contract")` or + /// `local_contract_file!()` + pub fn deploy_bundle + Debug>( + &mut self, + contract_file: ContractBundle, + constructor: &str, + args: &[S], + salt: Vec, + endowment: Option>, + ) -> Result, SessionError> { + self.deploy( + contract_file.wasm, + constructor, + args, + salt, + endowment, + &contract_file.transcoder, + ) + } + + /// Performs a dry run of the deployment of a contract. + pub fn dry_run_deployment + Debug>( + &mut self, + contract_file: ContractBundle, + constructor: &str, + args: &[S], + salt: Vec, + endowment: Option>, + ) -> Result, SessionError> { + let data = contract_file + .transcoder + .encode(constructor, args) + .map_err(|err| SessionError::Encoding(err.to_string()))?; + + Ok(self.sandbox.dry_run(|sandbox| { + sandbox.deploy_contract( + contract_file.wasm, + endowment.unwrap_or_default(), + data, + salt, + self.actor.clone(), + self.gas_limit, + None, + ) + })) + } + + /// Similar to `deploy_and` but takes the parsed contract file (`ContractBundle`) as a first + /// argument. + /// + /// You can get it with `ContractBundle::load("some/path/your.contract")` or + /// `local_contract_file!()` + pub fn deploy_bundle_and + Debug>( + mut self, + contract_file: ContractBundle, + constructor: &str, + args: &[S], + salt: Vec, + endowment: Option>, + ) -> Result { + self.deploy_bundle(contract_file, constructor, args, salt, endowment) + .map(|_| self) + } + + /// Uploads a raw contract code. In case of success, returns `self`. + pub fn upload_and(mut self, contract_bytes: Vec) -> Result { + self.upload(contract_bytes).map(|_| self) + } + + /// Uploads a raw contract code. In case of success returns the code hash. + pub fn upload(&mut self, contract_bytes: Vec) -> Result, SessionError> { + log::debug!( + target: Self::LOG_TARGET, + "upload: bytes={:?}", + contract_bytes + ); + let result = self.sandbox.upload_contract( + contract_bytes, + self.actor.clone(), + None, + self.determinism, + ); + + result + .map(|upload_result| upload_result.code_hash) + .map_err(SessionError::UploadFailed) + } + + /// Similar to `upload_and` but takes the contract bundle as the first argument. + /// + /// You can obtain it using `ContractBundle::load("some/path/your.contract")` or + /// `local_contract_file!()` + pub fn upload_bundle_and(self, contract_file: ContractBundle) -> Result { + self.upload_and(contract_file.wasm) + } + + /// Similar to `upload` but takes the contract bundle as the first argument. + /// + /// You can obtain it using `ContractBundle::load("some/path/your.contract")` or + /// `local_contract_file!()` + pub fn upload_bundle( + &mut self, + contract_file: ContractBundle, + ) -> Result, SessionError> { + self.upload(contract_file.wasm) + } + + /// Calls a contract with a given address. In case of a successful call, returns `self`. + pub fn call_and + Debug>( + mut self, + message: &str, + args: &[S], + endowment: Option>, + ) -> Result { + log::debug!( + target: Self::LOG_TARGET, + "call_and: message={message}, args={args:?}, endowment={endowment:?}", + ); + // We ignore result, so we can pass `()` as the message result type, which will never fail + // at decoding. + self.call_internal::<_, ()>(None, message, args, endowment).map(|_| self) + } + + /// Calls the last deployed contract. In case of a successful call, returns `self`. + pub fn call_with_address_and + Debug>( + mut self, + address: AccountIdFor, + message: &str, + args: &[S], + endowment: Option>, + ) -> Result { + log::debug!( + target: Self::LOG_TARGET, + "call_with_address_and: address={address}, message={message}, args={args:?}, endowment={endowment:?}", + ); + // We ignore result, so we can pass `()` as the message result type, which will never fail + // at decoding. + self.call_internal::<_, ()>(Some(address), message, args, endowment) + .map(|_| self) + } + + /// Calls the last deployed contract. In case of a successful call, returns the encoded result. + pub fn call + Debug, V: Decode>( + &mut self, + message: &str, + args: &[S], + endowment: Option>, + ) -> Result, SessionError> { + log::debug!( + target: Self::LOG_TARGET, + "call: message={message}, args={args:?}, endowment={endowment:?}", + ); + self.call_internal::<_, V>(None, message, args, endowment) + } + + /// Calls the last deployed contract. Expect it to be reverted and the message result to be of + /// type `Result<_, E>`. + pub fn call_and_expect_error + Debug, E: Debug + Decode>( + &mut self, + message: &str, + args: &[S], + endowment: Option>, + ) -> Result { + log::debug!( + target: Self::LOG_TARGET, + "call_and_expect_error: message={message}, args={args:?}, endowment={endowment:?}", + ); + Ok(self + .call_internal::<_, Result<(), E>>(None, message, args, endowment) + .expect_err("Call should fail") + .decode_revert::>()? + .expect("Call should return an error") + .expect_err("Call should return an error")) + } + + /// Calls a contract with a given address. In case of a successful call, returns the encoded + /// result. + pub fn call_with_address + Debug, V: Decode>( + &mut self, + address: AccountIdFor, + message: &str, + args: &[S], + endowment: Option>, + ) -> Result, SessionError> { + log::debug!( + target: Self::LOG_TARGET, + "call_with_address: address={address}, message={message}, args={args:?}, endowment={endowment:?}", + ); + self.call_internal(Some(address), message, args, endowment) + } + + /// Performs a dry run of a contract call. + pub fn dry_run_call + Debug>( + &mut self, + address: AccountIdFor, + message: &str, + args: &[S], + endowment: Option>, + ) -> Result, SessionError> { + let data = self + .transcoders + .get(&address) + .as_ref() + .ok_or(SessionError::NoTranscoder)? + .encode(message, args) + .map_err(|err| SessionError::Encoding(err.to_string()))?; + + Ok(self.sandbox.dry_run(|sandbox| { + sandbox.call_contract( + address, + endowment.unwrap_or_default(), + data, + self.actor.clone(), + self.gas_limit, + None, + self.determinism, + ) + })) + } + + fn call_internal + Debug, V: Decode>( + &mut self, + address: Option>, + message: &str, + args: &[S], + endowment: Option>, + ) -> Result, SessionError> { + let address = match address { + Some(address) => address, + None => self.record.deploy_returns().last().ok_or(SessionError::NoContract)?.clone(), + }; + + let data = self + .transcoders + .get(&address) + .as_ref() + .ok_or(SessionError::NoTranscoder)? + .encode(message, args) + .map_err(|err| SessionError::Encoding(err.to_string()))?; + + let result = self.record_events(|session| { + session.sandbox.call_contract( + address, + endowment.unwrap_or_default(), + data, + session.actor.clone(), + session.gas_limit, + None, + session.determinism, + ) + }); + + let ret = match &result.result { + Ok(exec_result) if exec_result.did_revert() => + Err(SessionError::CallReverted(exec_result.data.clone())), + Ok(exec_result) => { + self.record.push_call_return(exec_result.data.clone()); + self.record.last_call_return_decoded::() + }, + Err(err) => Err(SessionError::CallFailed(*err)), + }; + + self.record.push_call_result(result); + ret + } + + /// Set the tracing extension + pub fn set_tracing_extension(&mut self, d: TracingExt) { + self.sandbox.register_extension(d); + } } diff --git a/drink/src/session/bundle.rs b/drink/src/session/bundle.rs index ad389b2..1ce0713 100644 --- a/drink/src/session/bundle.rs +++ b/drink/src/session/bundle.rs @@ -1,4 +1,5 @@ -//! This module provides simple utilities for loading and parsing `.contract` files in context of `drink` tests. +//! This module provides simple utilities for loading and parsing `.contract` files in context of +//! `drink` tests. use std::{path::PathBuf, sync::Arc}; @@ -16,63 +17,64 @@ use crate::{DrinkResult, Error}; /// - `upload_bundle_and` #[derive(Clone)] pub struct ContractBundle { - /// WASM blob of the contract - pub wasm: Vec, - /// Transcoder derived from the ABI/metadata - pub transcoder: Arc, + /// WASM blob of the contract + pub wasm: Vec, + /// Transcoder derived from the ABI/metadata + pub transcoder: Arc, } impl ContractBundle { - /// Load and parse the information in a `.contract` bundle under `path`, producing a - /// `ContractBundle` struct. - pub fn load

(path: P) -> DrinkResult - where - P: AsRef, - { - let metadata: ContractMetadata = ContractMetadata::load(&path).map_err(|e| { - Error::BundleLoadFailed(format!("Failed to load the contract file:\n{e:?}")) - })?; + /// Load and parse the information in a `.contract` bundle under `path`, producing a + /// `ContractBundle` struct. + pub fn load

(path: P) -> DrinkResult + where + P: AsRef, + { + let metadata: ContractMetadata = ContractMetadata::load(&path).map_err(|e| { + Error::BundleLoadFailed(format!("Failed to load the contract file:\n{e:?}")) + })?; - let ink_metadata = serde_json::from_value(serde_json::Value::Object(metadata.abi)) - .map_err(|e| { - Error::BundleLoadFailed(format!( - "Failed to parse metadata from the contract file:\n{e:?}" - )) - })?; + let ink_metadata = serde_json::from_value(serde_json::Value::Object(metadata.abi)) + .map_err(|e| { + Error::BundleLoadFailed(format!( + "Failed to parse metadata from the contract file:\n{e:?}" + )) + })?; - let transcoder = Arc::new(ContractMessageTranscoder::new(ink_metadata)); + let transcoder = Arc::new(ContractMessageTranscoder::new(ink_metadata)); - let wasm = metadata - .source - .wasm - .ok_or(Error::BundleLoadFailed( - "Failed to get the WASM blob from the contract file".to_string(), - ))? - .0; + let wasm = metadata + .source + .wasm + .ok_or(Error::BundleLoadFailed( + "Failed to get the WASM blob from the contract file".to_string(), + ))? + .0; - Ok(Self { wasm, transcoder }) - } + Ok(Self { wasm, transcoder }) + } - /// Load the `.contract` bundle (`contract_file_name`) located in the `project_dir`` working directory. - /// - /// This is meant to be used predominantly by the `local_contract_file!` macro. - pub fn local(project_dir: &str, contract_file_name: String) -> Self { - let mut path = PathBuf::from(project_dir); - path.push("target"); - path.push("ink"); - path.push(contract_file_name); - Self::load(path).expect("Loading the local bundle failed") - } + /// Load the `.contract` bundle (`contract_file_name`) located in the `project_dir`` working + /// directory. + /// + /// This is meant to be used predominantly by the `local_contract_file!` macro. + pub fn local(project_dir: &str, contract_file_name: String) -> Self { + let mut path = PathBuf::from(project_dir); + path.push("target"); + path.push("ink"); + path.push(contract_file_name); + Self::load(path).expect("Loading the local bundle failed") + } } /// A convenience macro that allows you to load a bundle found in the target directory /// of the current project. #[macro_export] macro_rules! local_contract_file { - () => { - drink::session::ContractBundle::local( - env!("CARGO_MANIFEST_DIR"), - env!("CARGO_CRATE_NAME").to_owned() + ".contract", - ) - }; + () => { + drink::session::ContractBundle::local( + env!("CARGO_MANIFEST_DIR"), + env!("CARGO_CRATE_NAME").to_owned() + ".contract", + ) + }; } diff --git a/drink/src/session/error.rs b/drink/src/session/error.rs index bf1cae7..33e72a3 100644 --- a/drink/src/session/error.rs +++ b/drink/src/session/error.rs @@ -9,46 +9,45 @@ use crate::errors::MessageResult; /// Session specific errors. #[derive(Clone, Error, Debug)] pub enum SessionError { - /// Encoding data failed. - #[error("Encoding call data failed: {0}")] - Encoding(String), - /// Decoding data failed. - #[error("Decoding call data failed: {0}")] - Decoding(String), - /// Crate-specific error. - #[error("{0:?}")] - Drink(#[from] crate::Error), - /// Deployment has been reverted by the contract. - #[error("Contract deployment has been reverted")] - DeploymentReverted, - /// Deployment failed (aborted by the pallet). - #[error("Contract deployment failed before execution: {0:?}")] - DeploymentFailed(DispatchError), - /// Code upload failed (aborted by the pallet). - #[error("Code upload failed: {0:?}")] - UploadFailed(DispatchError), - /// Call has been reverted by the contract. - #[error("Contract call has been reverted. Encoded error: {0:?}")] - CallReverted(Vec), - /// Contract call failed (aborted by the pallet). - #[error("Contract call failed before execution: {0:?}")] - CallFailed(DispatchError), - /// There is no deployed contract to call. - #[error("No deployed contract")] - NoContract, - /// There is no registered transcoder to encode/decode messages for the called contract. - #[error("Missing transcoder")] - NoTranscoder, + /// Encoding data failed. + #[error("Encoding call data failed: {0}")] + Encoding(String), + /// Decoding data failed. + #[error("Decoding call data failed: {0}")] + Decoding(String), + /// Crate-specific error. + #[error("{0:?}")] + Drink(#[from] crate::Error), + /// Deployment has been reverted by the contract. + #[error("Contract deployment has been reverted")] + DeploymentReverted, + /// Deployment failed (aborted by the pallet). + #[error("Contract deployment failed before execution: {0:?}")] + DeploymentFailed(DispatchError), + /// Code upload failed (aborted by the pallet). + #[error("Code upload failed: {0:?}")] + UploadFailed(DispatchError), + /// Call has been reverted by the contract. + #[error("Contract call has been reverted. Encoded error: {0:?}")] + CallReverted(Vec), + /// Contract call failed (aborted by the pallet). + #[error("Contract call failed before execution: {0:?}")] + CallFailed(DispatchError), + /// There is no deployed contract to call. + #[error("No deployed contract")] + NoContract, + /// There is no registered transcoder to encode/decode messages for the called contract. + #[error("Missing transcoder")] + NoTranscoder, } impl SessionError { - /// Check if the error is a revert error and if so, decode the error message. - pub fn decode_revert(&self) -> Result, Self> { - match self { - SessionError::CallReverted(error) => { - Ok(MessageResult::decode(&mut &error[..]).expect("Failed to decode error")) - } - _ => Err(self.clone()), - } - } + /// Check if the error is a revert error and if so, decode the error message. + pub fn decode_revert(&self) -> Result, Self> { + match self { + SessionError::CallReverted(error) => + Ok(MessageResult::decode(&mut &error[..]).expect("Failed to decode error")), + _ => Err(self.clone()), + } + } } diff --git a/drink/src/session/mock.rs b/drink/src/session/mock.rs index f74eac5..63ba438 100644 --- a/drink/src/session/mock.rs +++ b/drink/src/session/mock.rs @@ -14,32 +14,29 @@ pub type MockedCallResult = Result, MockingError>; /// A registry of mocked contracts. pub(crate) struct MockRegistry { - mocked_contracts: BTreeMap, - nonce: u8, + mocked_contracts: BTreeMap, + nonce: u8, } impl MockRegistry { - /// Creates a new registry. - pub fn new() -> Self { - Self { - mocked_contracts: BTreeMap::new(), - nonce: 0u8, - } - } - - /// Returns the salt for the next contract. - pub fn salt(&mut self) -> Vec { - self.nonce += 1; - vec![self.nonce] - } - - /// Registers `mock` for `address`. Returns the previous mock, if any. - pub fn register(&mut self, address: AccountId, mock: ContractMock) -> Option { - self.mocked_contracts.insert(address, mock) - } - - /// Returns the mock for `address`, if any. - pub fn get(&self, address: &AccountId) -> Option<&ContractMock> { - self.mocked_contracts.get(address) - } + /// Creates a new registry. + pub fn new() -> Self { + Self { mocked_contracts: BTreeMap::new(), nonce: 0u8 } + } + + /// Returns the salt for the next contract. + pub fn salt(&mut self) -> Vec { + self.nonce += 1; + vec![self.nonce] + } + + /// Registers `mock` for `address`. Returns the previous mock, if any. + pub fn register(&mut self, address: AccountId, mock: ContractMock) -> Option { + self.mocked_contracts.insert(address, mock) + } + + /// Returns the mock for `address`, if any. + pub fn get(&self, address: &AccountId) -> Option<&ContractMock> { + self.mocked_contracts.get(address) + } } diff --git a/drink/src/session/mock/contract.rs b/drink/src/session/mock/contract.rs index e3e1707..26a5cdd 100644 --- a/drink/src/session/mock/contract.rs +++ b/drink/src/session/mock/contract.rs @@ -3,8 +3,8 @@ use std::collections::BTreeMap; use parity_scale_codec::{Decode, Encode}; use crate::{ - errors::LangError, - session::mock::{error::MockingError, MockedCallResult}, + errors::LangError, + session::mock::{error::MockingError, MockedCallResult}, }; /// Alias for a 4-byte selector. @@ -18,36 +18,34 @@ pub type MessageMock = Box) -> MockedCallResult + Send + Sync>; /// A contract mock. pub struct ContractMock { - messages: BTreeMap, + messages: BTreeMap, } impl ContractMock { - /// Creates a new mock without any message. - pub fn new() -> Self { - Self { - messages: BTreeMap::new(), - } - } - - /// Adds a message mock. - pub fn with_message(mut self, selector: Selector, message: MessageMock) -> Self { - self.messages.insert(selector, message); - self - } - - /// Try to call a message mock. Returns an error if there is no message mock for `selector`. - pub fn call(&self, selector: Selector, input: Vec) -> MockedCallResult { - match self.messages.get(&selector) { - None => Err(MockingError::MessageNotFound(selector)), - Some(message) => message(input), - } - } + /// Creates a new mock without any message. + pub fn new() -> Self { + Self { messages: BTreeMap::new() } + } + + /// Adds a message mock. + pub fn with_message(mut self, selector: Selector, message: MessageMock) -> Self { + self.messages.insert(selector, message); + self + } + + /// Try to call a message mock. Returns an error if there is no message mock for `selector`. + pub fn call(&self, selector: Selector, input: Vec) -> MockedCallResult { + match self.messages.get(&selector) { + None => Err(MockingError::MessageNotFound(selector)), + Some(message) => message(input), + } + } } impl Default for ContractMock { - fn default() -> Self { - Self::new() - } + fn default() -> Self { + Self::new() + } } /// A helper function to create a message mock out of a typed closure. @@ -55,10 +53,10 @@ impl Default for ContractMock { /// In particular, it takes care of decoding the input and encoding the output. Also, wraps the /// return value in a `Result`, which is normally done implicitly by ink!. pub fn mock_message Ret + Send + Sync + 'static>( - body: Body, + body: Body, ) -> MessageMock { - Box::new(move |encoded_input| { - let input = Decode::decode(&mut &*encoded_input).map_err(MockingError::ArgumentDecoding)?; - Ok(Ok::(body(input)).encode()) - }) + Box::new(move |encoded_input| { + let input = Decode::decode(&mut &*encoded_input).map_err(MockingError::ArgumentDecoding)?; + Ok(Ok::(body(input)).encode()) + }) } diff --git a/drink/src/session/mock/error.rs b/drink/src/session/mock/error.rs index 9f577cb..7cd013e 100644 --- a/drink/src/session/mock/error.rs +++ b/drink/src/session/mock/error.rs @@ -5,8 +5,8 @@ use crate::session::mock::Selector; /// Error type for mocking operations. #[derive(Error, Debug)] pub enum MockingError { - #[error("Message not found (unknown selector: {0:?})")] - MessageNotFound(Selector), - #[error("Decoding message arguments failed: {0:?}")] - ArgumentDecoding(parity_scale_codec::Error), + #[error("Message not found (unknown selector: {0:?})")] + MessageNotFound(Selector), + #[error("Decoding message arguments failed: {0:?}")] + ArgumentDecoding(parity_scale_codec::Error), } diff --git a/drink/src/session/mock/extension.rs b/drink/src/session/mock/extension.rs index fa8f3c3..4fa8dda 100644 --- a/drink/src/session/mock/extension.rs +++ b/drink/src/session/mock/extension.rs @@ -3,68 +3,64 @@ use std::sync::{Arc, Mutex}; use parity_scale_codec::{Decode, Encode}; use crate::{ - errors::MessageResult, - pallet_contracts::{chain_extension::ReturnFlags, debug::ExecResult, ExecReturnValue}, - pallet_contracts_debugging::InterceptingExtT, - session::mock::{MockRegistry, Selector}, + errors::MessageResult, + pallet_contracts::{chain_extension::ReturnFlags, debug::ExecResult, ExecReturnValue}, + pallet_contracts_debugging::InterceptingExtT, + session::mock::{MockRegistry, Selector}, }; /// Runtime extension enabling contract call interception. pub(crate) struct MockingExtension { - /// Mock registry, shared with the sandbox. - /// - /// Potentially the runtime is executed in parallel and thus we need to wrap the registry in - /// `Arc` instead of `Rc`. - pub mock_registry: Arc>>, + /// Mock registry, shared with the sandbox. + /// + /// Potentially the runtime is executed in parallel and thus we need to wrap the registry in + /// `Arc` instead of `Rc`. + pub mock_registry: Arc>>, } impl InterceptingExtT for MockingExtension { - fn intercept_call( - &self, - contract_address: Vec, - _is_call: bool, - input_data: Vec, - ) -> Vec { - let contract_address = Decode::decode(&mut &contract_address[..]) - .expect("Contract address should be decodable"); + fn intercept_call( + &self, + contract_address: Vec, + _is_call: bool, + input_data: Vec, + ) -> Vec { + let contract_address = Decode::decode(&mut &contract_address[..]) + .expect("Contract address should be decodable"); - match self - .mock_registry - .lock() - .expect("Should be able to acquire registry") - .get(&contract_address) - { - // There is no mock registered for this address, so we return `None` to indicate that - // the call should be executed normally. - None => None::<()>.encode(), - // We intercept the call and return the result of the mock. - Some(mock) => { - let (selector, call_data) = input_data.split_at(4); - let selector: Selector = selector - .try_into() - .expect("Input data should contain at least selector bytes"); + match self + .mock_registry + .lock() + .expect("Should be able to acquire registry") + .get(&contract_address) + { + // There is no mock registered for this address, so we return `None` to indicate that + // the call should be executed normally. + None => None::<()>.encode(), + // We intercept the call and return the result of the mock. + Some(mock) => { + let (selector, call_data) = input_data.split_at(4); + let selector: Selector = + selector.try_into().expect("Input data should contain at least selector bytes"); - let result = mock - .call(selector, call_data.to_vec()) - .expect("TODO: let the user define the fallback mechanism"); + let result = mock + .call(selector, call_data.to_vec()) + .expect("TODO: let the user define the fallback mechanism"); - // Although we don't know the exact type, thanks to the SCALE encoding we know - // that `()` will always succeed (we only care about the `Ok`/`Err` distinction). - let decoded_result: MessageResult<()> = - Decode::decode(&mut &result[..]).expect("Mock result should be decodable"); + // Although we don't know the exact type, thanks to the SCALE encoding we know + // that `()` will always succeed (we only care about the `Ok`/`Err` distinction). + let decoded_result: MessageResult<()> = + Decode::decode(&mut &result[..]).expect("Mock result should be decodable"); - let flags = match decoded_result { - Ok(_) => ReturnFlags::empty(), - Err(_) => ReturnFlags::REVERT, - }; + let flags = match decoded_result { + Ok(_) => ReturnFlags::empty(), + Err(_) => ReturnFlags::REVERT, + }; - let result: ExecResult = Ok(ExecReturnValue { - flags, - data: result, - }); + let result: ExecResult = Ok(ExecReturnValue { flags, data: result }); - Some(result).encode() - } - } - } + Some(result).encode() + }, + } + } } diff --git a/drink/src/session/mocking_api.rs b/drink/src/session/mocking_api.rs index 41d4529..81e4392 100644 --- a/drink/src/session/mocking_api.rs +++ b/drink/src/session/mocking_api.rs @@ -3,62 +3,58 @@ use ink_sandbox::{api::prelude::*, AccountIdFor, Sandbox}; use super::Session; use crate::{ - pallet_contracts::Config, - session::mock::ContractMock, - // DEFAULT_GAS_LIMIT, + pallet_contracts::Config, + session::mock::ContractMock, + // DEFAULT_GAS_LIMIT, }; /// Interface for basic mocking operations. pub trait MockingApi { - /// Deploy `mock` as a standard contract. Returns the address of the deployed contract. - fn deploy(&mut self, mock: ContractMock) -> AccountIdFor; + /// Deploy `mock` as a standard contract. Returns the address of the deployed contract. + fn deploy(&mut self, mock: ContractMock) -> AccountIdFor; - /// Mock part of an existing contract. In particular, allows to override real behavior of - /// deployed contract's messages. - fn mock_existing_contract(&mut self, _mock: ContractMock, _address: AccountIdFor); + /// Mock part of an existing contract. In particular, allows to override real behavior of + /// deployed contract's messages. + fn mock_existing_contract(&mut self, _mock: ContractMock, _address: AccountIdFor); } impl MockingApi for Session where - T::Runtime: Config, + T::Runtime: Config, { - fn deploy(&mut self, mock: ContractMock) -> AccountIdFor { - // We have to deploy some contract. We use a dummy contract for that. Thanks to that, we - // ensure that the pallet will treat our mock just as a regular contract, until we actually - // call it. - let mock_bytes = wat::parse_str(DUMMY_CONTRACT).expect("Dummy contract should be valid"); - let salt = self - .mocks - .lock() - .expect("Should be able to acquire lock on registry") - .salt(); + fn deploy(&mut self, mock: ContractMock) -> AccountIdFor { + // We have to deploy some contract. We use a dummy contract for that. Thanks to that, we + // ensure that the pallet will treat our mock just as a regular contract, until we actually + // call it. + let mock_bytes = wat::parse_str(DUMMY_CONTRACT).expect("Dummy contract should be valid"); + let salt = self.mocks.lock().expect("Should be able to acquire lock on registry").salt(); - let mock_address = self - .sandbox() - .deploy_contract( - mock_bytes, - 0u32.into(), - vec![], - salt, - T::default_actor(), - T::default_gas_limit(), - None, - ) - .result - .expect("Deployment of a dummy contract should succeed") - .account_id; + let mock_address = self + .sandbox() + .deploy_contract( + mock_bytes, + 0u32.into(), + vec![], + salt, + T::default_actor(), + T::default_gas_limit(), + None, + ) + .result + .expect("Deployment of a dummy contract should succeed") + .account_id; - self.mocks - .lock() - .expect("Should be able to acquire lock on registry") - .register(mock_address.clone(), mock); + self.mocks + .lock() + .expect("Should be able to acquire lock on registry") + .register(mock_address.clone(), mock); - mock_address - } + mock_address + } - fn mock_existing_contract(&mut self, _mock: ContractMock, _address: AccountIdFor) { - todo!("soon") - } + fn mock_existing_contract(&mut self, _mock: ContractMock, _address: AccountIdFor) { + todo!("soon") + } } /// A dummy contract that is used to deploy a mock. diff --git a/drink/src/session/record.rs b/drink/src/session/record.rs index 05f1d44..b776478 100644 --- a/drink/src/session/record.rs +++ b/drink/src/session/record.rs @@ -6,12 +6,12 @@ use ink_sandbox::{pallet_contracts, AccountIdFor, EventRecordOf}; use parity_scale_codec::{Decode, Encode}; use crate::{ - errors::MessageResult, - session::{error::SessionError, BalanceOf}, + errors::MessageResult, + session::{error::SessionError, BalanceOf}, }; type ContractInstantiateResult = - pallet_contracts::ContractInstantiateResult, BalanceOf, EventRecordOf>; + pallet_contracts::ContractInstantiateResult, BalanceOf, EventRecordOf>; type ContractExecResult = pallet_contracts::ContractExecResult, EventRecordOf>; /// Data structure storing the results of contract interaction during a session. @@ -23,192 +23,191 @@ type ContractExecResult = pallet_contracts::ContractExecResult, /// execution, like a value returned from a message or the address of a newly instantiated contract. #[derive(frame_support::DefaultNoBound)] pub struct Record { - /// The results of contract instantiation. - deploy_results: Vec>, - /// The return values of contract instantiation (i.e. the addresses of the newly instantiated - /// contracts). - deploy_returns: Vec>, - - /// The results of contract calls. - call_results: Vec>, - /// The return values of contract calls (in the SCALE-encoded form). - call_returns: Vec>, - - /// The events emitted by the contracts. - event_batches: Vec>, + /// The results of contract instantiation. + deploy_results: Vec>, + /// The return values of contract instantiation (i.e. the addresses of the newly instantiated + /// contracts). + deploy_returns: Vec>, + + /// The results of contract calls. + call_results: Vec>, + /// The return values of contract calls (in the SCALE-encoded form). + call_returns: Vec>, + + /// The events emitted by the contracts. + event_batches: Vec>, } // API for `Session` to record results and events related to contract interaction. impl Record { - pub(super) fn push_deploy_result(&mut self, result: ContractInstantiateResult) { - self.deploy_results.push(result); - } + pub(super) fn push_deploy_result(&mut self, result: ContractInstantiateResult) { + self.deploy_results.push(result); + } - pub(super) fn push_deploy_return(&mut self, return_value: AccountIdFor) { - self.deploy_returns.push(return_value); - } + pub(super) fn push_deploy_return(&mut self, return_value: AccountIdFor) { + self.deploy_returns.push(return_value); + } - pub(super) fn push_call_result(&mut self, result: ContractExecResult) { - self.call_results.push(result); - } + pub(super) fn push_call_result(&mut self, result: ContractExecResult) { + self.call_results.push(result); + } - pub(super) fn push_call_return(&mut self, return_value: Vec) { - self.call_returns.push(return_value); - } + pub(super) fn push_call_return(&mut self, return_value: Vec) { + self.call_returns.push(return_value); + } - pub(super) fn push_event_batches(&mut self, events: Vec>) { - self.event_batches.push(EventBatch { events }); - } + pub(super) fn push_event_batches(&mut self, events: Vec>) { + self.event_batches.push(EventBatch { events }); + } } // API for the end user. impl Record { - /// Returns all the results of contract instantiations that happened during the session. - pub fn deploy_results(&self) -> &[ContractInstantiateResult] { - &self.deploy_results - } - - /// Returns the last result of contract instantiation that happened during the session. Panics - /// if there were no contract instantiations. - pub fn last_deploy_result(&self) -> &ContractInstantiateResult { - self.deploy_results.last().expect("No deploy results") - } - - /// Returns all the return values of contract instantiations that happened during the session. - pub fn deploy_returns(&self) -> &[AccountIdFor] { - &self.deploy_returns - } - - /// Returns the last return value of contract instantiation that happened during the session. - /// Panics if there were no contract instantiations. - pub fn last_deploy_return(&self) -> &AccountIdFor { - self.deploy_returns.last().expect("No deploy returns") - } - - /// Returns all the results of contract calls that happened during the session. - pub fn call_results(&self) -> &[ContractExecResult] { - &self.call_results - } - - /// Returns the last result of contract call that happened during the session. Panics if there - /// were no contract calls. - pub fn last_call_result(&self) -> &ContractExecResult { - self.call_results.last().expect("No call results") - } - - /// Returns all the (encoded) return values of contract calls that happened during the session. - pub fn call_returns(&self) -> &[Vec] { - &self.call_returns - } - - /// Returns the last (encoded) return value of contract call that happened during the session. - /// Panics if there were no contract calls. - pub fn last_call_return(&self) -> &[u8] { - self.call_returns.last().expect("No call returns") - } - - /// Returns the last (decoded) return value of contract call that happened during the session. - /// Panics if there were no contract calls. - pub fn last_call_return_decoded(&self) -> Result, SessionError> { - let mut raw = self.last_call_return(); - MessageResult::decode(&mut raw).map_err(|err| { - SessionError::Decoding(format!( - "Failed to decode the result of calling a contract: {err:?}" - )) - }) - } - - /// Returns all the event batches that were recorded for contract interactions during the - /// session. - pub fn event_batches(&self) -> &[EventBatch] { - &self.event_batches - } - - /// Returns the last event batch that was recorded for contract interactions during the session. - /// Panics if there were no event batches. - pub fn last_event_batch(&self) -> &EventBatch { - self.event_batches.last().expect("No event batches") - } + /// Returns all the results of contract instantiations that happened during the session. + pub fn deploy_results(&self) -> &[ContractInstantiateResult] { + &self.deploy_results + } + + /// Returns the last result of contract instantiation that happened during the session. Panics + /// if there were no contract instantiations. + pub fn last_deploy_result(&self) -> &ContractInstantiateResult { + self.deploy_results.last().expect("No deploy results") + } + + /// Returns all the return values of contract instantiations that happened during the session. + pub fn deploy_returns(&self) -> &[AccountIdFor] { + &self.deploy_returns + } + + /// Returns the last return value of contract instantiation that happened during the session. + /// Panics if there were no contract instantiations. + pub fn last_deploy_return(&self) -> &AccountIdFor { + self.deploy_returns.last().expect("No deploy returns") + } + + /// Returns all the results of contract calls that happened during the session. + pub fn call_results(&self) -> &[ContractExecResult] { + &self.call_results + } + + /// Returns the last result of contract call that happened during the session. Panics if there + /// were no contract calls. + pub fn last_call_result(&self) -> &ContractExecResult { + self.call_results.last().expect("No call results") + } + + /// Returns all the (encoded) return values of contract calls that happened during the session. + pub fn call_returns(&self) -> &[Vec] { + &self.call_returns + } + + /// Returns the last (encoded) return value of contract call that happened during the session. + /// Panics if there were no contract calls. + pub fn last_call_return(&self) -> &[u8] { + self.call_returns.last().expect("No call returns") + } + + /// Returns the last (decoded) return value of contract call that happened during the session. + /// Panics if there were no contract calls. + pub fn last_call_return_decoded(&self) -> Result, SessionError> { + let mut raw = self.last_call_return(); + MessageResult::decode(&mut raw).map_err(|err| { + SessionError::Decoding(format!( + "Failed to decode the result of calling a contract: {err:?}" + )) + }) + } + + /// Returns all the event batches that were recorded for contract interactions during the + /// session. + pub fn event_batches(&self) -> &[EventBatch] { + &self.event_batches + } + + /// Returns the last event batch that was recorded for contract interactions during the session. + /// Panics if there were no event batches. + pub fn last_event_batch(&self) -> &EventBatch { + self.event_batches.last().expect("No event batches") + } } /// A batch of runtime events that were emitted during a single contract interaction. pub struct EventBatch { - events: Vec>, + events: Vec>, } impl EventBatch { - /// Returns all the events that were emitted during the contract interaction. - pub fn all_events(&self) -> &[EventRecordOf] { - &self.events - } + /// Returns all the events that were emitted during the contract interaction. + pub fn all_events(&self) -> &[EventRecordOf] { + &self.events + } } impl EventBatch where - R: pallet_contracts::Config, - ::RuntimeEvent: TryInto>, + R: pallet_contracts::Config, + ::RuntimeEvent: TryInto>, { - /// Returns all the contract events that were emitted during the contract interaction. - /// - /// **WARNING**: This method will return all the events that were emitted by ANY contract. If your - /// call triggered multiple contracts, you will have to filter the events yourself. - /// - /// We have to match against static enum variant, and thus (at least for now) we support only - /// `MinimalSandbox`. - pub fn contract_events(&self) -> Vec> { - self.events - .iter() - .filter_map(|event_record| { - if let Ok(pallet_event) = &event_record.event.clone().try_into() { - match pallet_event { - pallet_contracts::Event::::ContractEmitted { data, .. } => { - Some(data.clone()) - } - _ => None, - } - } else { - None - } - }) - .collect::>>() - } - - /// The same as `contract_events`, but decodes the events using the given transcoder. - /// - /// **WARNING**: This method will try to decode all the events that were emitted by ANY - /// contract. This means that some contract events might either fail to decode or be decoded - /// incorrectly (to some rubbish). In the former case, they will be skipped, but with the latter - /// case, you will have to filter the events yourself. - /// - /// **WARNING 2**: This method will ignore anonymous events. - pub fn contract_events_decoded( - &self, - transcoder: &Arc, - ) -> Vec { - let signature_topics = transcoder - .metadata() - .spec() - .events() - .iter() - .filter_map(|event| event.signature_topic()) - .map(|sig| sig.as_bytes().try_into().unwrap()) - .collect::>(); - - self.contract_events() - .into_iter() - .filter_map(|data| { - for signature_topic in &signature_topics { - if let Ok(decoded) = transcoder + /// Returns all the contract events that were emitted during the contract interaction. + /// + /// **WARNING**: This method will return all the events that were emitted by ANY contract. If + /// your call triggered multiple contracts, you will have to filter the events yourself. + /// + /// We have to match against static enum variant, and thus (at least for now) we support only + /// `MinimalSandbox`. + pub fn contract_events(&self) -> Vec> { + self.events + .iter() + .filter_map(|event_record| { + if let Ok(pallet_event) = &event_record.event.clone().try_into() { + match pallet_event { + pallet_contracts::Event::::ContractEmitted { data, .. } => + Some(data.clone()), + _ => None, + } + } else { + None + } + }) + .collect::>>() + } + + /// The same as `contract_events`, but decodes the events using the given transcoder. + /// + /// **WARNING**: This method will try to decode all the events that were emitted by ANY + /// contract. This means that some contract events might either fail to decode or be decoded + /// incorrectly (to some rubbish). In the former case, they will be skipped, but with the latter + /// case, you will have to filter the events yourself. + /// + /// **WARNING 2**: This method will ignore anonymous events. + pub fn contract_events_decoded( + &self, + transcoder: &Arc, + ) -> Vec { + let signature_topics = transcoder + .metadata() + .spec() + .events() + .iter() + .filter_map(|event| event.signature_topic()) + .map(|sig| sig.as_bytes().try_into().unwrap()) + .collect::>(); + + self.contract_events() + .into_iter() + .filter_map(|data| { + for signature_topic in &signature_topics { + if let Ok(decoded) = transcoder // We have to `encode` the data because `decode_contract_event` is targeted // at decoding the data from the runtime, and not directly from the contract // events. .decode_contract_event(&signature_topic, &mut &*data.encode()) - { - return Some(decoded); - } - } - None - }) - .collect() - } + { + return Some(decoded); + } + } + None + }) + .collect() + } } diff --git a/drink/src/session/transcoding.rs b/drink/src/session/transcoding.rs index 304ec82..66e0f42 100644 --- a/drink/src/session/transcoding.rs +++ b/drink/src/session/transcoding.rs @@ -3,21 +3,19 @@ use std::{collections::BTreeMap, sync::Arc}; use contract_transcode::ContractMessageTranscoder; pub struct TranscoderRegistry { - transcoders: BTreeMap>, + transcoders: BTreeMap>, } impl TranscoderRegistry { - pub fn new() -> Self { - Self { - transcoders: BTreeMap::new(), - } - } + pub fn new() -> Self { + Self { transcoders: BTreeMap::new() } + } - pub fn register(&mut self, contract: Contract, transcoder: &Arc) { - self.transcoders.insert(contract, Arc::clone(transcoder)); - } + pub fn register(&mut self, contract: Contract, transcoder: &Arc) { + self.transcoders.insert(contract, Arc::clone(transcoder)); + } - pub fn get(&self, contract: &Contract) -> Option> { - self.transcoders.get(contract).map(Arc::clone) - } + pub fn get(&self, contract: &Contract) -> Option> { + self.transcoders.get(contract).map(Arc::clone) + } } diff --git a/drink/test-macro/src/bundle_provision.rs b/drink/test-macro/src/bundle_provision.rs index cac143d..c5fd231 100644 --- a/drink/test-macro/src/bundle_provision.rs +++ b/drink/test-macro/src/bundle_provision.rs @@ -6,80 +6,77 @@ use quote::quote; use syn::ItemEnum; pub struct BundleProviderGenerator { - root_contract_name: Option, - bundles: HashMap, + root_contract_name: Option, + bundles: HashMap, } impl BundleProviderGenerator { - pub fn new>( - bundles: I, - root_contract_name: Option, - ) -> Self { - let root_contract_name = root_contract_name.map(|name| name.to_case(Case::Pascal)); - let bundles = HashMap::from_iter(bundles.map(|(name, path)| { - let name = name.to_case(Case::Pascal); - (name, path) - })); + pub fn new>( + bundles: I, + root_contract_name: Option, + ) -> Self { + let root_contract_name = root_contract_name.map(|name| name.to_case(Case::Pascal)); + let bundles = HashMap::from_iter(bundles.map(|(name, path)| { + let name = name.to_case(Case::Pascal); + (name, path) + })); - if let Some(root_contract_name) = &root_contract_name { - assert!( - bundles.contains_key(root_contract_name), - "Root contract must be part of the bundles" - ); - } + if let Some(root_contract_name) = &root_contract_name { + assert!( + bundles.contains_key(root_contract_name), + "Root contract must be part of the bundles" + ); + } - Self { - root_contract_name, - bundles, - } - } + Self { root_contract_name, bundles } + } - pub fn generate_bundle_provision(&self, enum_item: ItemEnum) -> TokenStream2 { - let enum_name = &enum_item.ident; - let enum_vis = &enum_item.vis; - let enum_attrs = &enum_item.attrs; + pub fn generate_bundle_provision(&self, enum_item: ItemEnum) -> TokenStream2 { + let enum_name = &enum_item.ident; + let enum_vis = &enum_item.vis; + let enum_attrs = &enum_item.attrs; - let local = match &self.root_contract_name { - None => quote! {}, - Some(root_name) => { - let local_bundle = self.bundles[root_name].to_str().expect("Invalid path"); - quote! { - pub fn local() -> ::drink::DrinkResult<::drink::session::ContractBundle> { - ::drink::session::ContractBundle::load(#local_bundle) - } - } - } - }; + let local = match &self.root_contract_name { + None => quote! {}, + Some(root_name) => { + let local_bundle = self.bundles[root_name].to_str().expect("Invalid path"); + quote! { + pub fn local() -> ::drink::DrinkResult<::drink::session::ContractBundle> { + ::drink::session::ContractBundle::load(#local_bundle) + } + } + }, + }; - let (contract_names, matches): (Vec<_>, Vec<_>) = self - .bundles - .keys() - .map(|name| { - let name_ident = Ident::new(name, Span::call_site()); - let path = self.bundles[name].to_str().expect("Invalid path"); - let matcher = quote! { - #enum_name::#name_ident => ::drink::session::ContractBundle::load(#path), - }; - (name_ident, matcher) - }) - .unzip(); + let (contract_names, matches): (Vec<_>, Vec<_>) = self + .bundles + .keys() + .map(|name| { + let name_ident = Ident::new(name, Span::call_site()); + let path = self.bundles[name].to_str().expect("Invalid path"); + let matcher = quote! { + #enum_name::#name_ident => ::drink::session::ContractBundle::load(#path), + }; + (name_ident, matcher) + }) + .unzip(); - quote! { - #(#enum_attrs)* - #[derive(Copy, Clone, PartialEq, Eq, Debug)] - #enum_vis enum #enum_name { - #(#contract_names,)* - } + quote! { + #(#enum_attrs)* + #[derive(Copy, Clone, PartialEq, Eq, Debug)] + #enum_vis enum #enum_name { + #(#contract_names,)* + } - impl #enum_name { - #local + impl #enum_name { + #local - pub fn bundle(self) -> ::drink::DrinkResult<::drink::session::ContractBundle> { - match self { - #(#matches)* - } - } - } - } - } + pub fn bundle(self) -> ::drink::DrinkResult<::drink::session::ContractBundle> { + match self { + #(#matches)* + } + } + } + } + } } diff --git a/drink/test-macro/src/contract_building.rs b/drink/test-macro/src/contract_building.rs index f2ef8a2..7cb207c 100644 --- a/drink/test-macro/src/contract_building.rs +++ b/drink/test-macro/src/contract_building.rs @@ -1,13 +1,13 @@ use std::{ - collections::{hash_map::Entry, HashMap}, - path::PathBuf, - sync::{Mutex, OnceLock}, + collections::{hash_map::Entry, HashMap}, + path::PathBuf, + sync::{Mutex, OnceLock}, }; use cargo_metadata::{Metadata, MetadataCommand, Package}; use contract_build::{ - BuildArtifacts, BuildMode, ExecuteArgs, Features, ImageVariant, ManifestPath, Network, - OptimizationPasses, OutputType, Target, UnstableFlags, Verbosity, DEFAULT_MAX_MEMORY_PAGES, + BuildArtifacts, BuildMode, ExecuteArgs, Features, ImageVariant, ManifestPath, Network, + OptimizationPasses, OutputType, Target, UnstableFlags, Verbosity, DEFAULT_MAX_MEMORY_PAGES, }; use crate::bundle_provision::BundleProviderGenerator; @@ -29,125 +29,103 @@ static CONTRACTS_BUILT: OnceLock>> = O /// A contract dependency, is a package defined in the `Cargo.toml` file with the /// `ink-as-dependency` feature enabled. pub fn build_contracts() -> BundleProviderGenerator { - let metadata = MetadataCommand::new() - .exec() - .expect("Error invoking `cargo metadata`"); - - let (maybe_root, contract_deps) = get_contract_crates(&metadata); - let maybe_root = maybe_root.map(build_contract_crate); - let contract_deps = contract_deps.map(build_contract_crate); - - BundleProviderGenerator::new( - maybe_root.clone().into_iter().chain(contract_deps), - maybe_root.map(|(name, _)| name), - ) + let metadata = MetadataCommand::new().exec().expect("Error invoking `cargo metadata`"); + + let (maybe_root, contract_deps) = get_contract_crates(&metadata); + let maybe_root = maybe_root.map(build_contract_crate); + let contract_deps = contract_deps.map(build_contract_crate); + + BundleProviderGenerator::new( + maybe_root.clone().into_iter().chain(contract_deps), + maybe_root.map(|(name, _)| name), + ) } /// Contract package together with the features it should be built with. struct FeaturedPackage<'metadata> { - package: &'metadata Package, - features_on: Vec, + package: &'metadata Package, + features_on: Vec, } fn get_contract_crates( - metadata: &Metadata, -) -> ( - Option, - impl Iterator, -) { - let pkg_lookup = |id| { - metadata - .packages - .iter() - .find(|package| package.id == id) - .unwrap_or_else(|| panic!("Error resolving package {id}")) - }; - - let dep_graph = metadata - .resolve - .as_ref() - .expect("Error resolving dependencies"); - - let contract_deps = dep_graph - .nodes - .iter() - .filter(|node| { - node.features - .contains(&INK_AS_DEPENDENCY_FEATURE.to_string()) - }) - .map(move |node| { - let mut features_on = node.features.clone(); - features_on.retain(|feature| feature != INK_AS_DEPENDENCY_FEATURE && feature != "std"); - FeaturedPackage { - package: pkg_lookup(node.id.clone()), - features_on, - } - }); - - let root = dep_graph - .root - .as_ref() - .expect("Error resolving root package"); - let root = pkg_lookup(root.clone()); - - ( - root.features - .contains_key(INK_AS_DEPENDENCY_FEATURE) - .then_some(FeaturedPackage { - package: root, - features_on: vec![], - }), - contract_deps, - ) + metadata: &Metadata, +) -> (Option, impl Iterator) { + let pkg_lookup = |id| { + metadata + .packages + .iter() + .find(|package| package.id == id) + .unwrap_or_else(|| panic!("Error resolving package {id}")) + }; + + let dep_graph = metadata.resolve.as_ref().expect("Error resolving dependencies"); + + let contract_deps = dep_graph + .nodes + .iter() + .filter(|node| node.features.contains(&INK_AS_DEPENDENCY_FEATURE.to_string())) + .map(move |node| { + let mut features_on = node.features.clone(); + features_on.retain(|feature| feature != INK_AS_DEPENDENCY_FEATURE && feature != "std"); + FeaturedPackage { package: pkg_lookup(node.id.clone()), features_on } + }); + + let root = dep_graph.root.as_ref().expect("Error resolving root package"); + let root = pkg_lookup(root.clone()); + + ( + root.features + .contains_key(INK_AS_DEPENDENCY_FEATURE) + .then_some(FeaturedPackage { package: root, features_on: vec![] }), + contract_deps, + ) } fn build_contract_crate(pkg: FeaturedPackage) -> (String, PathBuf) { - let manifest_path = get_manifest_path(pkg.package); - let mut features = Features::default(); - for feature in pkg.features_on { - features.push(&feature); - } - - match CONTRACTS_BUILT - .get_or_init(|| Mutex::new(HashMap::new())) - .lock() - .expect("Error locking mutex") - .entry(manifest_path.clone().into()) - { - Entry::Occupied(ready) => ready.get().clone(), - Entry::Vacant(todo) => { - let args = ExecuteArgs { - manifest_path, - verbosity: Verbosity::Default, - build_mode: BuildMode::Release, - features, - network: Network::Online, - build_artifact: BuildArtifacts::All, - unstable_flags: UnstableFlags::default(), - optimization_passes: Some(OptimizationPasses::default()), - keep_debug_symbols: false, - extra_lints: false, - output_type: OutputType::HumanReadable, - skip_wasm_validation: false, - target: Target::Wasm, - max_memory_pages: DEFAULT_MAX_MEMORY_PAGES, - image: ImageVariant::Default, - }; - - let result = contract_build::execute(args).expect("Error building contract"); - let bundle_path = result - .metadata_result - .expect("Metadata should have been generated") - .dest_bundle; - - let new_entry = (pkg.package.name.clone(), bundle_path); - todo.insert(new_entry.clone()); - new_entry - } - } + let manifest_path = get_manifest_path(pkg.package); + let mut features = Features::default(); + for feature in pkg.features_on { + features.push(&feature); + } + + match CONTRACTS_BUILT + .get_or_init(|| Mutex::new(HashMap::new())) + .lock() + .expect("Error locking mutex") + .entry(manifest_path.clone().into()) + { + Entry::Occupied(ready) => ready.get().clone(), + Entry::Vacant(todo) => { + let args = ExecuteArgs { + manifest_path, + verbosity: Verbosity::Default, + build_mode: BuildMode::Release, + features, + network: Network::Online, + build_artifact: BuildArtifacts::All, + unstable_flags: UnstableFlags::default(), + optimization_passes: Some(OptimizationPasses::default()), + keep_debug_symbols: false, + extra_lints: false, + output_type: OutputType::HumanReadable, + skip_wasm_validation: false, + target: Target::Wasm, + max_memory_pages: DEFAULT_MAX_MEMORY_PAGES, + image: ImageVariant::Default, + }; + + let result = contract_build::execute(args).expect("Error building contract"); + let bundle_path = + result.metadata_result.expect("Metadata should have been generated").dest_bundle; + + let new_entry = (pkg.package.name.clone(), bundle_path); + todo.insert(new_entry.clone()); + new_entry + }, + } } fn get_manifest_path(package: &Package) -> ManifestPath { - ManifestPath::new(package.manifest_path.clone().into_std_path_buf()) - .unwrap_or_else(|_| panic!("Error resolving manifest path for package {}", package.name)) + ManifestPath::new(package.manifest_path.clone().into_std_path_buf()) + .unwrap_or_else(|_| panic!("Error resolving manifest path for package {}", package.name)) } diff --git a/drink/test-macro/src/lib.rs b/drink/test-macro/src/lib.rs index 679f670..49b1dd8 100644 --- a/drink/test-macro/src/lib.rs +++ b/drink/test-macro/src/lib.rs @@ -38,15 +38,17 @@ type SynResult = Result; /// /// 1. The root contract package (if any) is assumed to be built without any features. /// -/// 2. All contract dependencies will be built with a union of all features enabled on that package (through potentially -/// different configurations or dependency paths), **excluding** `ink-as-dependency` and `std` features. +/// 2. All contract dependencies will be built with a union of all features enabled on that package +/// (through potentially +/// different configurations or dependency paths), **excluding** `ink-as-dependency` and `std` +/// features. /// /// # Creating a session object /// -/// The macro will also create a new mutable session object and pass it to the decorated function by value. You can -/// configure which sandbox should be used (by specifying a path to a type implementing -/// `ink_sandbox::Sandbox` trait. Thus, your testcase function should accept a single argument: -/// `mut session: Session<_>`. +/// The macro will also create a new mutable session object and pass it to the decorated function by +/// value. You can configure which sandbox should be used (by specifying a path to a type +/// implementing `ink_sandbox::Sandbox` trait. Thus, your testcase function should accept a single +/// argument: `mut session: Session<_>`. /// /// By default, the macro will use `drink::minimal::MinimalSandbox`. /// @@ -62,47 +64,47 @@ type SynResult = Result; /// ``` #[proc_macro_attribute] pub fn test(attr: TokenStream, item: TokenStream) -> TokenStream { - match test_internal(attr.into(), item.into()) { - Ok(ts) => ts.into(), - Err(e) => e.to_compile_error().into(), - } + match test_internal(attr.into(), item.into()) { + Ok(ts) => ts.into(), + Err(e) => e.to_compile_error().into(), + } } #[derive(FromMeta)] struct TestAttributes { - sandbox: Option, + sandbox: Option, } /// Auxiliary function to enter ?-based error propagation. fn test_internal(attr: TokenStream2, item: TokenStream2) -> SynResult { - let item_fn = syn::parse2::(item)?; - let macro_args = TestAttributes::from_list(&NestedMeta::parse_meta_list(attr)?)?; - - // TODO: why do we build the contracts again? - build_contracts(); - - let fn_vis = item_fn.vis; - let fn_attrs = item_fn.attrs; - let fn_block = item_fn.block; - let fn_name = item_fn.sig.ident; - let fn_async = item_fn.sig.asyncness; - let fn_generics = item_fn.sig.generics; - let fn_output = item_fn.sig.output; - let fn_const = item_fn.sig.constness; - let fn_unsafety = item_fn.sig.unsafety; - - let sandbox = macro_args - .sandbox - .unwrap_or(syn::parse2(quote! { ::drink::minimal::MinimalSandbox })?); - - Ok(quote! { - #[test] - #(#fn_attrs)* - #fn_vis #fn_async #fn_const #fn_unsafety fn #fn_name #fn_generics () #fn_output { - let mut session = Session::<#sandbox>::default(); - #fn_block - } - }) + let item_fn = syn::parse2::(item)?; + let macro_args = TestAttributes::from_list(&NestedMeta::parse_meta_list(attr)?)?; + + // TODO: why do we build the contracts again? + build_contracts(); + + let fn_vis = item_fn.vis; + let fn_attrs = item_fn.attrs; + let fn_block = item_fn.block; + let fn_name = item_fn.sig.ident; + let fn_async = item_fn.sig.asyncness; + let fn_generics = item_fn.sig.generics; + let fn_output = item_fn.sig.output; + let fn_const = item_fn.sig.constness; + let fn_unsafety = item_fn.sig.unsafety; + + let sandbox = macro_args + .sandbox + .unwrap_or(syn::parse2(quote! { ::drink::minimal::MinimalSandbox })?); + + Ok(quote! { + #[test] + #(#fn_attrs)* + #fn_vis #fn_async #fn_const #fn_unsafety fn #fn_name #fn_generics () #fn_output { + let mut session = Session::<#sandbox>::default(); + #fn_block + } + }) } /// Defines a contract bundle provider. @@ -145,37 +147,37 @@ fn test_internal(attr: TokenStream2, item: TokenStream2) -> SynResult TokenStream { - match contract_bundle_provider_internal(attr.into(), item.into()) { - Ok(ts) => ts.into(), - Err(e) => e.to_compile_error().into(), - } + match contract_bundle_provider_internal(attr.into(), item.into()) { + Ok(ts) => ts.into(), + Err(e) => e.to_compile_error().into(), + } } /// Auxiliary function to enter ?-based error propagation. fn contract_bundle_provider_internal( - _attr: TokenStream2, - item: TokenStream2, + _attr: TokenStream2, + item: TokenStream2, ) -> SynResult { - let enum_item = parse_bundle_enum(item)?; - let bundle_registry = build_contracts(); - Ok(bundle_registry.generate_bundle_provision(enum_item)) + let enum_item = parse_bundle_enum(item)?; + let bundle_registry = build_contracts(); + Ok(bundle_registry.generate_bundle_provision(enum_item)) } fn parse_bundle_enum(item: TokenStream2) -> SynResult { - let enum_item = syn::parse2::(item)?; - - if !enum_item.generics.params.is_empty() { - return Err(syn::Error::new_spanned( - enum_item.generics.params, - "ContractBundleProvider must not be generic", - )); - } - if !enum_item.variants.is_empty() { - return Err(syn::Error::new_spanned( - enum_item.variants, - "ContractBundleProvider must not have variants", - )); - } - - Ok(enum_item) + let enum_item = syn::parse2::(item)?; + + if !enum_item.generics.params.is_empty() { + return Err(syn::Error::new_spanned( + enum_item.generics.params, + "ContractBundleProvider must not be generic", + )); + } + if !enum_item.variants.is_empty() { + return Err(syn::Error::new_spanned( + enum_item.variants, + "ContractBundleProvider must not have variants", + )); + } + + Ok(enum_item) } diff --git a/examples/chain-extension/Cargo.lock b/examples/chain-extension/Cargo.lock index 106597c..41d2d91 100644 --- a/examples/chain-extension/Cargo.lock +++ b/examples/chain-extension/Cargo.lock @@ -79,6 +79,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -416,19 +422,35 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ - "bitcoin_hashes", + "bitcoin_hashes 0.11.0", "rand", "rand_core 0.6.4", "serde", "unicode-normalization", ] +[[package]] +name = "bitcoin-internals" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" + [[package]] name = "bitcoin_hashes" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" +[[package]] +name = "bitcoin_hashes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals", + "hex-conservative", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -657,8 +679,8 @@ name = "chain-extension" version = "0.1.0" dependencies = [ "drink", - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "ink", "parity-scale-codec", "scale-info", @@ -1308,14 +1330,15 @@ dependencies = [ "contract-metadata", "contract-transcode", "drink-test-macro", - "frame-support", - "frame-system", + "frame-support 36.0.1", + "frame-system 36.1.0", "ink_sandbox", + "log", "parity-scale-codec", "parity-scale-codec-derive", "scale-info", "serde_json", - "sp-runtime-interface", + "sp-runtime-interface 28.0.0", "thiserror", "wat", ] @@ -1383,6 +1406,7 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", + "serdect", "signature", "spki", ] @@ -1425,6 +1449,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek 4.1.2", + "ed25519", + "hashbrown 0.14.3", + "hex", + "rand_core 0.6.4", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "either" version = "1.10.0" @@ -1446,6 +1485,7 @@ dependencies = [ "pkcs8", "rand_core 0.6.4", "sec1", + "serdect", "subtle", "zeroize", ] @@ -1552,27 +1592,27 @@ dependencies = [ [[package]] name = "frame-benchmarking" -version = "29.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4090659c6aaa3c4d5b6c6ec909b4b0a25dec10ad92aad5f729efa8d5bd4d806a" +checksum = "709b26657ebbba53dc7bb616577375ca462b20fef1b00e8d9b20d2435e87f7bc" dependencies = [ - "frame-support", - "frame-support-procedural", - "frame-system", + "frame-support 36.0.1", + "frame-support-procedural 30.0.2", + "frame-system 36.1.0", "linregress", "log", "parity-scale-codec", "paste", "scale-info", "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-io", - "sp-runtime", - "sp-runtime-interface", + "sp-api 33.0.0", + "sp-application-crypto 37.0.0", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.1", + "sp-runtime-interface 28.0.0", "sp-std", - "sp-storage", + "sp-storage 21.0.0", "static_assertions", ] @@ -1600,7 +1640,49 @@ dependencies = [ "docify", "environmental", "frame-metadata", - "frame-support-procedural", + "frame-support-procedural 24.0.0", + "impl-trait-for-tuples", + "k256", + "log", + "macro_magic", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "serde_json", + "smallvec", + "sp-api 27.0.1", + "sp-arithmetic 24.0.0", + "sp-core 29.0.0", + "sp-crypto-hashing-proc-macro", + "sp-debug-derive", + "sp-genesis-builder 0.8.0", + "sp-inherents 27.0.0", + "sp-io 31.0.0", + "sp-metadata-ir 0.6.0", + "sp-runtime 32.0.0", + "sp-staking 27.0.0", + "sp-state-machine 0.36.0", + "sp-std", + "sp-tracing 16.0.0", + "sp-weights 28.0.0", + "static_assertions", + "tt-call", +] + +[[package]] +name = "frame-support" +version = "36.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4d08149c28010bfa568dcfa832aea628fb794d4243794a13b1bdef1aa66fb1" +dependencies = [ + "aquamarine", + "array-bytes", + "bitflags 1.3.2", + "docify", + "environmental", + "frame-metadata", + "frame-support-procedural 30.0.2", "impl-trait-for-tuples", "k256", "log", @@ -1611,21 +1693,21 @@ dependencies = [ "serde", "serde_json", "smallvec", - "sp-api", - "sp-arithmetic", - "sp-core", + "sp-api 33.0.0", + "sp-arithmetic 26.0.0", + "sp-core 34.0.0", "sp-crypto-hashing-proc-macro", "sp-debug-derive", - "sp-genesis-builder", - "sp-inherents", - "sp-io", - "sp-metadata-ir", - "sp-runtime", - "sp-staking", - "sp-state-machine", + "sp-genesis-builder 0.14.0", + "sp-inherents 33.0.0", + "sp-io 37.0.0", + "sp-metadata-ir 0.7.0", + "sp-runtime 38.0.1", + "sp-staking 33.0.0", + "sp-state-machine 0.42.0", "sp-std", - "sp-tracing", - "sp-weights", + "sp-tracing 17.0.0", + "sp-weights 31.0.0", "static_assertions", "tt-call", ] @@ -1640,7 +1722,7 @@ dependencies = [ "cfg-expr", "derive-syn-parse 0.1.5", "expander", - "frame-support-procedural-tools", + "frame-support-procedural-tools 10.0.0", "itertools 0.10.5", "macro_magic", "proc-macro-warning", @@ -1650,13 +1732,46 @@ dependencies = [ "syn 2.0.57", ] +[[package]] +name = "frame-support-procedural" +version = "30.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e4662a809f559aea6234bd90940fa29df583a3c8124a3cf923f66a0d21126b7" +dependencies = [ + "Inflector", + "cfg-expr", + "derive-syn-parse 0.2.0", + "expander", + "frame-support-procedural-tools 13.0.0", + "itertools 0.11.0", + "macro_magic", + "proc-macro-warning", + "proc-macro2", + "quote", + "sp-crypto-hashing", + "syn 2.0.57", +] + [[package]] name = "frame-support-procedural-tools" version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3363df38464c47a73eb521a4f648bfcc7537a82d70347ef8af3f73b6d019e910" dependencies = [ - "frame-support-procedural-tools-derive", + "frame-support-procedural-tools-derive 11.0.0", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.57", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bead15a320be1764cdd50458c4cfacb23e0cee65f64f500f8e34136a94c7eeca" +dependencies = [ + "frame-support-procedural-tools-derive 12.0.0", "proc-macro-crate 3.1.0", "proc-macro2", "quote", @@ -1674,6 +1789,17 @@ dependencies = [ "syn 2.0.57", ] +[[package]] +name = "frame-support-procedural-tools-derive" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.57", +] + [[package]] name = "frame-system" version = "29.0.0" @@ -1682,17 +1808,38 @@ checksum = "5bc20a793c3cec0b11165c1075fe11a255b2491f3eef8230bb3073cb296e7383" dependencies = [ "cfg-if", "docify", - "frame-support", + "frame-support 29.0.2", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", + "sp-std", + "sp-version 30.0.0", + "sp-weights 28.0.0", +] + +[[package]] +name = "frame-system" +version = "36.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d6a0e7bb6503facdcc6f8e19c83cd0bfc8bbbd268522b1a50e107dfc6b972d" +dependencies = [ + "cfg-if", + "docify", + "frame-support 36.0.1", "log", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.1", "sp-std", - "sp-version", - "sp-weights", + "sp-version 36.0.0", + "sp-weights 31.0.0", ] [[package]] @@ -1898,6 +2045,10 @@ name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash 0.8.11", + "allocator-api2", +] [[package]] name = "heck" @@ -1923,6 +2074,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex-conservative" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" + [[package]] name = "hmac" version = "0.8.1" @@ -2375,18 +2532,20 @@ name = "ink_sandbox" version = "5.0.0" dependencies = [ "frame-metadata", - "frame-support", - "frame-system", + "frame-support 36.0.1", + "frame-system 36.1.0", + "log", + "pallet-assets", "pallet-balances", "pallet-contracts", "pallet-timestamp", "parity-scale-codec", "paste", "scale-info", - "sp-core", - "sp-externalities", - "sp-io", - "sp-runtime-interface", + "sp-core 34.0.0", + "sp-externalities 0.29.0", + "sp-io 37.0.0", + "sp-runtime-interface 28.0.0", "wat", ] @@ -2451,6 +2610,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.12.1" @@ -2500,6 +2668,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", + "serdect", "sha2 0.10.8", ] @@ -2661,9 +2830,9 @@ dependencies = [ [[package]] name = "macro_magic" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e03844fc635e92f3a0067e25fa4bf3e3dbf3f2927bf3aa01bb7bc8f1c428949d" +checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d" dependencies = [ "macro_magic_core", "macro_magic_macros", @@ -2673,12 +2842,12 @@ dependencies = [ [[package]] name = "macro_magic_core" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d" +checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" dependencies = [ "const-random", - "derive-syn-parse 0.1.5", + "derive-syn-parse 0.2.0", "macro_magic_core_macros", "proc-macro2", "quote", @@ -2687,9 +2856,9 @@ dependencies = [ [[package]] name = "macro_magic_core_macros" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" +checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", @@ -2698,9 +2867,9 @@ dependencies = [ [[package]] name = "macro_magic_macros" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" +checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", @@ -2798,6 +2967,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "multi-stash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685a9ac4b61f4e728e1d2c6a7844609c16527aeb5e6c865915c08e619c16410f" + [[package]] name = "nalgebra" version = "0.32.5" @@ -2880,6 +3055,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.57", +] + [[package]] name = "num-format" version = "0.4.4" @@ -2972,48 +3158,67 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "pallet-assets" +version = "37.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f79ef6a7763fc08177f014052469ee12aefcdad0d99a747372360c2f648d2cc4" +dependencies = [ + "frame-benchmarking", + "frame-support 36.0.1", + "frame-system 36.1.0", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "sp-core 34.0.0", + "sp-runtime 38.0.1", + "sp-std", +] + [[package]] name = "pallet-balances" -version = "29.0.2" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a54b5d0c7c4c3731883d6b1ac18aff44db20c3d0a3470c8861001a17afdc85" +checksum = "6878e240962d3887f0e0654ac343a18845adb95ad493c9d4d5e803c015d4a4c3" dependencies = [ "docify", "frame-benchmarking", - "frame-support", - "frame-system", + "frame-support 36.0.1", + "frame-system 36.1.0", "log", "parity-scale-codec", "scale-info", - "sp-runtime", + "sp-runtime 38.0.1", "sp-std", ] [[package]] name = "pallet-contracts" -version = "28.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b56fe53df97911ed3ecd90d631f8093cedd795c756d4e42d386110e9fe6614f" +checksum = "3e6989ac82690f981959b0d38ac6d6d52fc06bf00a035548d62b9a2e9c220376" dependencies = [ "bitflags 1.3.2", "environmental", "frame-benchmarking", - "frame-support", - "frame-system", + "frame-support 36.0.1", + "frame-system 36.1.0", "impl-trait-for-tuples", "log", "pallet-balances", "pallet-contracts-proc-macro", "pallet-contracts-uapi", "parity-scale-codec", + "paste", "rand", "scale-info", "serde", "smallvec", - "sp-api", - "sp-core", - "sp-io", - "sp-runtime", + "sp-api 33.0.0", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.1", "sp-std", "staging-xcm", "staging-xcm-builder", @@ -3023,9 +3228,9 @@ dependencies = [ [[package]] name = "pallet-contracts-proc-macro" -version = "19.0.0" +version = "23.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3163c6bc21b55a0ccb74c546ba784d9c9e69beb9240c059d28a3052f4cbce509" +checksum = "94226cbd48516b7c310eb5dae8d50798c1ce73a7421dc0977c55b7fc2237a283" dependencies = [ "proc-macro2", "quote", @@ -3034,14 +3239,14 @@ dependencies = [ [[package]] name = "pallet-contracts-uapi" -version = "6.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61eeda58538dc888c59ae6de2146f0e2f43e9ad0eb1d56c228e5cc7af90d4e52" +checksum = "e1330375dcced95509e3cca7ef6b1c3fac648df995b86d39467d082ba981dc46" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", "paste", - "polkavm-derive", + "polkavm-derive 0.9.1", "scale-info", ] @@ -3053,47 +3258,60 @@ checksum = "fd549c16296ea5b2eb7c65c56aba548b286c1be4d7675b424ff6ccb8319c97a9" dependencies = [ "bitflags 1.3.2", "paste", - "polkavm-derive", + "polkavm-derive 0.5.0", ] [[package]] name = "pallet-timestamp" -version = "28.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b8810ddfb254c7fb8cd7698229cce513d309a43ff117b38798dae6120f477b" +checksum = "ae789d344be857679b0b98b28a67c747119724847f81d704d3fd03ee13fb6841" dependencies = [ "docify", "frame-benchmarking", - "frame-support", - "frame-system", + "frame-support 36.0.1", + "frame-system 36.1.0", "log", "parity-scale-codec", "scale-info", - "sp-inherents", - "sp-io", - "sp-runtime", + "sp-inherents 33.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.1", "sp-std", - "sp-storage", + "sp-storage 21.0.0", "sp-timestamp", ] [[package]] name = "pallet-transaction-payment" -version = "29.0.2" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5ba71f06f09e955b80dc313c333be3f8d9e8505b051558e0b7af4806b13310" +checksum = "74fb6114223c8d967c3c2f21cbc845e8ea604ff7e21a8e59d119d5a9257ba886" dependencies = [ - "frame-support", - "frame-system", + "frame-support 36.0.1", + "frame-system 36.1.0", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.1", "sp-std", ] +[[package]] +name = "parity-bip39" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" +dependencies = [ + "bitcoin_hashes 0.13.0", + "rand", + "rand_core 0.6.4", + "serde", + "unicode-normalization", +] + [[package]] name = "parity-scale-codec" version = "3.6.12" @@ -3150,6 +3368,17 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "paste" version = "1.0.14" @@ -3165,6 +3394,16 @@ dependencies = [ "crypto-mac 0.11.0", ] +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest 0.10.7", + "password-hash", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -3221,22 +3460,22 @@ checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" [[package]] name = "polkadot-core-primitives" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a08e4e014c853b252ecbbe3ccd67b2d33d78e46988d309b8cccf4ac06e25ef" +checksum = "17c72ee63bcf920f963cd7ac066759b0b649350c8ab3781a85a6aac87b1488f2" dependencies = [ "parity-scale-codec", "scale-info", - "sp-core", - "sp-runtime", + "sp-core 34.0.0", + "sp-runtime 38.0.1", "sp-std", ] [[package]] name = "polkadot-parachain-primitives" -version = "7.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248ab090959a92e61493277e33b7e85104280a4beb4cb0815137d3c8c50a07f4" +checksum = "f61070d0ff28f596890def0e0d03c231860796130b2a43e293106fa86a50c9a9" dependencies = [ "bounded-collections", "derive_more", @@ -3244,10 +3483,10 @@ dependencies = [ "polkadot-core-primitives", "scale-info", "serde", - "sp-core", - "sp-runtime", + "sp-core 34.0.0", + "sp-runtime 38.0.1", "sp-std", - "sp-weights", + "sp-weights 31.0.0", ] [[package]] @@ -3256,28 +3495,65 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88b4e215c80fe876147f3d58158d5dfeae7dabdd6047e175af77095b78d0035c" +[[package]] +name = "polkavm-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d9428a5cfcc85c5d7b9fc4b6a18c4b802d0173d768182a51cc7751640f08b92" + [[package]] name = "polkavm-derive" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6380dbe1fb03ecc74ad55d841cfc75480222d153ba69ddcb00977866cbdabdb8" dependencies = [ - "polkavm-derive-impl", + "polkavm-derive-impl 0.5.0", "syn 2.0.57", ] +[[package]] +name = "polkavm-derive" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" +dependencies = [ + "polkavm-derive-impl-macro", +] + [[package]] name = "polkavm-derive-impl" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc8211b3365bbafb2fb32057d68b0e1ca55d079f5cf6f9da9b98079b94b3987d" dependencies = [ - "polkavm-common", + "polkavm-common 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.57", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c" +dependencies = [ + "polkavm-common 0.9.0", "proc-macro2", "quote", "syn 2.0.57", ] +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" +dependencies = [ + "polkavm-derive-impl 0.9.0", + "syn 2.0.57", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -3775,6 +4051,7 @@ dependencies = [ "der", "generic-array", "pkcs8", + "serdect", "subtle", "zeroize", ] @@ -3915,6 +4192,16 @@ dependencies = [ "time", ] +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "sha2" version = "0.9.9" @@ -4062,15 +4349,38 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-api-proc-macro", - "sp-core", - "sp-externalities", - "sp-metadata-ir", - "sp-runtime", - "sp-state-machine", + "sp-api-proc-macro 15.0.1", + "sp-core 29.0.0", + "sp-externalities 0.26.0", + "sp-metadata-ir 0.6.0", + "sp-runtime 32.0.0", + "sp-state-machine 0.36.0", + "sp-std", + "sp-trie 30.0.0", + "sp-version 30.0.0", + "thiserror", +] + +[[package]] +name = "sp-api" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e43fbf034e9dbaa8ffc6a238a22808777eb38c580f66fc6736d8511631789e" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "scale-info", + "sp-api-proc-macro 20.0.0", + "sp-core 34.0.0", + "sp-externalities 0.29.0", + "sp-metadata-ir 0.7.0", + "sp-runtime 38.0.1", + "sp-runtime-interface 28.0.0", + "sp-state-machine 0.42.0", "sp-std", - "sp-trie", - "sp-version", + "sp-trie 36.0.0", + "sp-version 36.0.0", "thiserror", ] @@ -4089,6 +4399,21 @@ dependencies = [ "syn 2.0.57", ] +[[package]] +name = "sp-api-proc-macro" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9aadf9e97e694f0e343978aa632938c5de309cbcc8afed4136cb71596737278" +dependencies = [ + "Inflector", + "blake2", + "expander", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.57", +] + [[package]] name = "sp-application-crypto" version = "31.0.0" @@ -4098,14 +4423,28 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", + "sp-core 29.0.0", + "sp-io 31.0.0", "sp-std", ] [[package]] -name = "sp-arithmetic" -version = "24.0.0" +name = "sp-application-crypto" +version = "37.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d96d1fc0f1c741bbcbd0dd5470eff7b66f011708cc1942b088ebf0d4efb3d93" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-std", +] + +[[package]] +name = "sp-arithmetic" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afa823ca5adc490d47dccb41d69ad482bc57a317bd341de275868378f48f131c" dependencies = [ @@ -4118,6 +4457,22 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "sp-arithmetic" +version = "26.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46d0d0a4c591c421d3231ddd5e27d828618c24456d51445d21a1f79fcee97c23" +dependencies = [ + "docify", + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-std", + "static_assertions", +] + [[package]] name = "sp-core" version = "29.0.0" @@ -4131,7 +4486,7 @@ dependencies = [ "bounded-collections", "bs58", "dyn-clonable", - "ed25519-zebra", + "ed25519-zebra 3.1.0", "futures", "hash-db", "hash256-std-hasher", @@ -4152,12 +4507,59 @@ dependencies = [ "serde", "sp-crypto-hashing", "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", + "sp-externalities 0.26.0", + "sp-runtime-interface 25.0.0", + "sp-std", + "sp-storage 20.0.0", + "ss58-registry", + "substrate-bip39 0.4.6", + "thiserror", + "tracing", + "w3f-bls", + "zeroize", +] + +[[package]] +name = "sp-core" +version = "34.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c961a5e33fb2962fa775c044ceba43df9c6f917e2c35d63bfe23738468fa76a7" +dependencies = [ + "array-bytes", + "bitflags 1.3.2", + "blake2", + "bounded-collections", + "bs58", + "dyn-clonable", + "ed25519-zebra 4.0.3", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde", + "itertools 0.11.0", + "k256", + "libsecp256k1", + "log", + "merlin", + "parity-bip39", + "parity-scale-codec", + "parking_lot", + "paste", + "primitive-types", + "rand", + "scale-info", + "schnorrkel", + "secp256k1", + "secrecy", + "serde", + "sp-crypto-hashing", + "sp-debug-derive", + "sp-externalities 0.29.0", + "sp-runtime-interface 28.0.0", "sp-std", - "sp-storage", + "sp-storage 21.0.0", "ss58-registry", - "substrate-bip39", + "substrate-bip39 0.6.0", "thiserror", "tracing", "w3f-bls", @@ -4209,7 +4611,18 @@ dependencies = [ "environmental", "parity-scale-codec", "sp-std", - "sp-storage", + "sp-storage 20.0.0", +] + +[[package]] +name = "sp-externalities" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a904407d61cb94228c71b55a9d3708e9d6558991f9e83bd42bd91df37a159d30" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-storage 21.0.0", ] [[package]] @@ -4219,11 +4632,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd865540ec19479c7349b584ccd78cc34c3f3a628a2a69dbb6365ceec36295ee" dependencies = [ "serde_json", - "sp-api", - "sp-runtime", + "sp-api 27.0.1", + "sp-runtime 32.0.0", "sp-std", ] +[[package]] +name = "sp-genesis-builder" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcd065854d96fd81521c103d0aaa287d4f08b9b15c9fae2a3bfb208b0812bf44" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde_json", + "sp-api 33.0.0", + "sp-runtime 38.0.1", +] + [[package]] name = "sp-inherents" version = "27.0.0" @@ -4234,11 +4660,25 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", "thiserror", ] +[[package]] +name = "sp-inherents" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53407ba38ec22ca4a16381722c4bd0b559a0428bc1713079b0d5163ada63186a" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-runtime 38.0.1", + "thiserror", +] + [[package]] name = "sp-io" version = "31.0.0" @@ -4252,15 +4692,42 @@ dependencies = [ "parity-scale-codec", "rustversion", "secp256k1", - "sp-core", + "sp-core 29.0.0", "sp-crypto-hashing", - "sp-externalities", - "sp-keystore", - "sp-runtime-interface", - "sp-state-machine", + "sp-externalities 0.26.0", + "sp-keystore 0.35.0", + "sp-runtime-interface 25.0.0", + "sp-state-machine 0.36.0", "sp-std", - "sp-tracing", - "sp-trie", + "sp-tracing 16.0.0", + "sp-trie 30.0.0", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-io" +version = "37.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5036cad2e48d41f5caf6785226c8be1a7db15bec14a9fd7aa6cca84f34cf689f" +dependencies = [ + "bytes", + "ed25519-dalek", + "libsecp256k1", + "log", + "parity-scale-codec", + "polkavm-derive 0.9.1", + "rustversion", + "secp256k1", + "sp-core 34.0.0", + "sp-crypto-hashing", + "sp-externalities 0.29.0", + "sp-keystore 0.40.0", + "sp-runtime-interface 28.0.0", + "sp-state-machine 0.42.0", + "sp-std", + "sp-tracing 17.0.0", + "sp-trie 36.0.0", "tracing", "tracing-core", ] @@ -4273,11 +4740,23 @@ checksum = "444f2d53968b1ce5e908882710ff1f3873fcf3e95f59d57432daf685bbacb959" dependencies = [ "parity-scale-codec", "parking_lot", - "sp-core", - "sp-externalities", + "sp-core 29.0.0", + "sp-externalities 0.26.0", "thiserror", ] +[[package]] +name = "sp-keystore" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0248b4d784cb4a01472276928977121fa39d977a5bb24793b6b15e64b046df42" +dependencies = [ + "parity-scale-codec", + "parking_lot", + "sp-core 34.0.0", + "sp-externalities 0.29.0", +] + [[package]] name = "sp-metadata-ir" version = "0.6.0" @@ -4290,6 +4769,17 @@ dependencies = [ "sp-std", ] +[[package]] +name = "sp-metadata-ir" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a616fa51350b35326682a472ee8e6ba742fdacb18babac38ecd46b3e05ead869" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", +] + [[package]] name = "sp-panic-handler" version = "13.0.0" @@ -4318,12 +4808,39 @@ dependencies = [ "scale-info", "serde", "simple-mermaid", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-io", + "sp-application-crypto 31.0.0", + "sp-arithmetic 24.0.0", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-std", + "sp-weights 28.0.0", +] + +[[package]] +name = "sp-runtime" +version = "38.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5273900f0b0bef48b2e1ff9c4fb5e188b8168ee5891418a427f4be2af92ee40f" +dependencies = [ + "docify", + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "num-traits", + "parity-scale-codec", + "paste", + "rand", + "scale-info", + "serde", + "simple-mermaid", + "sp-application-crypto 37.0.0", + "sp-arithmetic 26.0.0", + "sp-core 34.0.0", + "sp-io 37.0.0", "sp-std", - "sp-weights", + "sp-weights 31.0.0", + "tracing", ] [[package]] @@ -4336,12 +4853,32 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", + "sp-externalities 0.26.0", + "sp-runtime-interface-proc-macro 17.0.0", + "sp-std", + "sp-storage 20.0.0", + "sp-tracing 16.0.0", + "sp-wasm-interface 20.0.0", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985eb981f40c689c6a0012c937b68ed58dabb4341d06f2dfe4dfd5ed72fa4017" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "polkavm-derive 0.9.1", + "primitive-types", + "sp-externalities 0.29.0", + "sp-runtime-interface-proc-macro 18.0.0", "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", + "sp-storage 21.0.0", + "sp-tracing 17.0.0", + "sp-wasm-interface 21.0.0", "static_assertions", ] @@ -4359,6 +4896,20 @@ dependencies = [ "syn 2.0.57", ] +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" +dependencies = [ + "Inflector", + "expander", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.57", +] + [[package]] name = "sp-staking" version = "27.0.0" @@ -4369,11 +4920,25 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-runtime", + "sp-core 29.0.0", + "sp-runtime 32.0.0", "sp-std", ] +[[package]] +name = "sp-staking" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a0b7abfe66c07a3b6eb99e1286dfa9b6f3b057b0e986e7da2ccbf707f6c781a" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 34.0.0", + "sp-runtime 38.0.1", +] + [[package]] name = "sp-state-machine" version = "0.36.0" @@ -4386,14 +4951,35 @@ dependencies = [ "parking_lot", "rand", "smallvec", - "sp-core", - "sp-externalities", + "sp-core 29.0.0", + "sp-externalities 0.26.0", "sp-panic-handler", "sp-std", - "sp-trie", + "sp-trie 30.0.0", "thiserror", "tracing", - "trie-db", + "trie-db 0.28.0", +] + +[[package]] +name = "sp-state-machine" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "211e528aa6e902261a343f7b40840aa3d66fe4ad3aadbd04a035f10baf96dbc5" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "parking_lot", + "rand", + "smallvec", + "sp-core 34.0.0", + "sp-externalities 0.29.0", + "sp-panic-handler", + "sp-trie 36.0.0", + "thiserror", + "tracing", + "trie-db 0.29.1", ] [[package]] @@ -4416,17 +5002,29 @@ dependencies = [ "sp-std", ] +[[package]] +name = "sp-storage" +version = "21.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99c82989b3a4979a7e1ad848aad9f5d0b4388f1f454cc131766526601ab9e8f8" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive", +] + [[package]] name = "sp-timestamp" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "249cd06624f2edb53b25af528ab216a508dc9d0870e158b43caac3a97e86699f" +checksum = "78becf144a76f6fd108dfe94a90e20a185b38c0b310dc5482328196143c8266b" dependencies = [ "async-trait", "parity-scale-codec", - "sp-inherents", - "sp-runtime", - "sp-std", + "sp-inherents 33.0.0", + "sp-runtime 38.0.1", "thiserror", ] @@ -4443,6 +5041,18 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "sp-tracing" +version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90b3decf116db9f1dfaf1f1597096b043d0e12c952d3bcdc018c6d6b77deec7e" +dependencies = [ + "parity-scale-codec", + "tracing", + "tracing-core", + "tracing-subscriber", +] + [[package]] name = "sp-trie" version = "30.0.0" @@ -4459,12 +5069,36 @@ dependencies = [ "rand", "scale-info", "schnellru", - "sp-core", - "sp-externalities", + "sp-core 29.0.0", + "sp-externalities 0.26.0", "sp-std", "thiserror", "tracing", - "trie-db", + "trie-db 0.28.0", + "trie-root", +] + +[[package]] +name = "sp-trie" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d717c0f465f5371569e6fdc25b6f32d47c15d6e4c92b3b779e1c9b18b951d" +dependencies = [ + "ahash 0.8.11", + "hash-db", + "lazy_static", + "memory-db", + "nohash-hasher", + "parity-scale-codec", + "parking_lot", + "rand", + "scale-info", + "schnellru", + "sp-core 34.0.0", + "sp-externalities 0.29.0", + "thiserror", + "tracing", + "trie-db 0.29.1", "trie-root", ] @@ -4480,9 +5114,27 @@ dependencies = [ "scale-info", "serde", "sp-crypto-hashing-proc-macro", - "sp-runtime", + "sp-runtime 32.0.0", + "sp-std", + "sp-version-proc-macro 13.0.0", + "thiserror", +] + +[[package]] +name = "sp-version" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bccf96fefae339dee7c4453f91be64eb28cce4c2fe82130445cf096b18b2c081" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "parity-wasm", + "scale-info", + "serde", + "sp-crypto-hashing-proc-macro", + "sp-runtime 38.0.1", "sp-std", - "sp-version-proc-macro", + "sp-version-proc-macro 14.0.0", "thiserror", ] @@ -4498,6 +5150,18 @@ dependencies = [ "syn 2.0.57", ] +[[package]] +name = "sp-version-proc-macro" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aee8f6730641a65fcf0c8f9b1e448af4b3bb083d08058b47528188bccc7b7a7" +dependencies = [ + "parity-scale-codec", + "proc-macro2", + "quote", + "syn 2.0.57", +] + [[package]] name = "sp-wasm-interface" version = "20.0.0" @@ -4512,6 +5176,17 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "sp-wasm-interface" +version = "21.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b04b919e150b4736d85089d49327eab65507deb1485eec929af69daa2278eb3" +dependencies = [ + "impl-trait-for-tuples", + "log", + "parity-scale-codec", +] + [[package]] name = "sp-weights" version = "28.0.0" @@ -4523,11 +5198,26 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-arithmetic", + "sp-arithmetic 24.0.0", "sp-debug-derive", "sp-std", ] +[[package]] +name = "sp-weights" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93cdaf72a1dad537bbb130ba4d47307ebe5170405280ed1aa31fa712718a400e" +dependencies = [ + "bounded-collections", + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic 26.0.0", + "sp-debug-derive", +] + [[package]] name = "spin" version = "0.9.8" @@ -4567,9 +5257,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-xcm" -version = "8.0.1" +version = "14.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fa328b87de3466bc38cc9a07244c42c647b7755b81115e1dfeb47cc13fc6e6" +checksum = "f2b7b5f531c6bf9629514ef8e5fda0e9e80dd84516957f710940d0e01d3fb36c" dependencies = [ "array-bytes", "bounded-collections", @@ -4580,52 +5270,52 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-weights", + "sp-weights 31.0.0", "xcm-procedural", ] [[package]] name = "staging-xcm-builder" -version = "8.0.3" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b7447c38be3ca9fb21c7434de2243aa6ac74acde8944cda7bb6e2a4f765801" +checksum = "847fa2afe1bed2751eaabf7b91fa4043037947f17653d7cc59ea202cc44c6bb8" dependencies = [ - "frame-support", - "frame-system", + "frame-support 36.0.1", + "frame-system 36.1.0", "impl-trait-for-tuples", "log", "pallet-transaction-payment", "parity-scale-codec", "polkadot-parachain-primitives", "scale-info", - "sp-arithmetic", - "sp-io", - "sp-runtime", + "sp-arithmetic 26.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.1", "sp-std", - "sp-weights", + "sp-weights 31.0.0", "staging-xcm", "staging-xcm-executor", ] [[package]] name = "staging-xcm-executor" -version = "8.0.2" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b5c5f2a1d610c5e20e5fae2680c9a28380f305afafeed62f341bfbce57b79a" +checksum = "26b98d8219449eaf02e71a7edf1a14b14d4c713dd01d9df66fde1ce30dba4d6d" dependencies = [ "environmental", "frame-benchmarking", - "frame-support", + "frame-support 36.0.1", "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", + "sp-arithmetic 26.0.0", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.1", "sp-std", - "sp-weights", + "sp-weights 31.0.0", "staging-xcm", ] @@ -4635,6 +5325,17 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "string-interner" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c6a0d765f5807e98a091107bae0a56ea3799f66a5de47b2c84c94a39c09974e" +dependencies = [ + "cfg-if", + "hashbrown 0.14.3", + "serde", +] + [[package]] name = "strsim" version = "0.10.0" @@ -4695,12 +5396,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" dependencies = [ "hmac 0.11.0", - "pbkdf2", + "pbkdf2 0.8.0", "schnorrkel", "sha2 0.9.9", "zeroize", ] +[[package]] +name = "substrate-bip39" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" +dependencies = [ + "hmac 0.12.1", + "pbkdf2 0.12.2", + "schnorrkel", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "subtle" version = "2.5.0" @@ -5094,6 +5808,18 @@ dependencies = [ "smallvec", ] +[[package]] +name = "trie-db" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c992b4f40c234a074d48a757efeabb1a6be88af84c0c23f7ca158950cb0ae7f" +dependencies = [ + "hash-db", + "log", + "rustc-hex", + "smallvec", +] + [[package]] name = "trie-root" version = "0.18.0" @@ -5387,28 +6113,37 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.31.2" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8281d1d660cdf54c76a3efa9ddd0c270cada1383a995db3ccb43d166456c7" +checksum = "50386c99b9c32bd2ed71a55b6dd4040af2580530fae8bdb9a6576571a80d0cca" dependencies = [ + "arrayvec", + "multi-stash", + "num-derive", + "num-traits", "smallvec", "spin", - "wasmi_arena", + "wasmi_collections", "wasmi_core", "wasmparser-nostd", ] [[package]] -name = "wasmi_arena" -version = "0.4.1" +name = "wasmi_collections" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" +checksum = "9c128c039340ffd50d4195c3f8ce31aac357f06804cfc494c8b9508d4b30dca4" +dependencies = [ + "ahash 0.8.11", + "hashbrown 0.14.3", + "string-interner", +] [[package]] name = "wasmi_core" -version = "0.13.0" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" +checksum = "a23b3a7f6c8c3ceeec6b83531ee61f0013c56e51cbf2b14b0f213548b23a4b41" dependencies = [ "downcast-rs", "libm", @@ -5428,9 +6163,9 @@ dependencies = [ [[package]] name = "wasmparser-nostd" -version = "0.100.1" +version = "0.100.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9157cab83003221bfd385833ab587a039f5d6fa7304854042ba358a3b09e0724" +checksum = "d5a015fe95f3504a94bb1462c717aae75253e39b9dd6c3fb1062c934535c64aa" dependencies = [ "indexmap-nostd", ] @@ -5884,9 +6619,9 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "8.0.0" +version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4717a97970a9cda70d7db53cf50d2615c2f6f6b7c857445325b4a39ea7aa2cd" +checksum = "87fb4f14094d65c500a59bcf540cf42b99ee82c706edd6226a92e769ad60563e" dependencies = [ "Inflector", "proc-macro2", diff --git a/examples/flipper/Cargo.lock b/examples/flipper/Cargo.lock index 9082ece..a1b8f32 100644 --- a/examples/flipper/Cargo.lock +++ b/examples/flipper/Cargo.lock @@ -2282,6 +2282,7 @@ dependencies = [ "frame-support", "frame-system", "log", + "pallet-assets", "pallet-balances", "pallet-contracts", "pallet-timestamp", @@ -2848,6 +2849,24 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "pallet-assets" +version = "37.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f79ef6a7763fc08177f014052469ee12aefcdad0d99a747372360c2f648d2cc4" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-balances" version = "37.0.0" diff --git a/ink-sandbox/src/api/assets_api.rs b/ink-sandbox/src/api/assets_api.rs index 10d024e..448c782 100644 --- a/ink-sandbox/src/api/assets_api.rs +++ b/ink-sandbox/src/api/assets_api.rs @@ -1,4 +1,7 @@ -use frame_support::{sp_runtime::DispatchError, traits::{fungibles::{Inspect, Create, Mutate}}}; +use frame_support::{ + sp_runtime::DispatchError, + traits::fungibles::{Create, Inspect, Mutate}, +}; use pallet_assets::Instance1; use crate::{AccountIdFor, Sandbox}; @@ -11,90 +14,102 @@ type BalanceOf = as Inspect<::Account // Not important for now though. /// Assets API for the sandbox. pub trait AssetsAPI - where - T: Sandbox, - T::Runtime: pallet_assets::Config, +where + T: Sandbox, + T::Runtime: pallet_assets::Config, { - /// Create a token. - fn create( - &mut self, - id: &AssetIdOf, - owner: &AccountIdFor, - min_balance: BalanceOf, - ) -> Result<(), DispatchError>; + /// Create a token. + fn create( + &mut self, + id: &AssetIdOf, + owner: &AccountIdFor, + min_balance: BalanceOf, + ) -> Result<(), DispatchError>; - /// Mint tokens to an account. - /// - /// # Arguments - /// - /// * `address` - The address of the account to add tokens to. - /// * `amount` - The number of tokens to add. - fn mint_into( - &mut self, - asset: &AssetIdOf, - account: &AccountIdFor, - value: BalanceOf, - ) -> Result, DispatchError>; + /// Mint tokens to an account. + /// + /// # Arguments + /// + /// * `address` - The address of the account to add tokens to. + /// * `amount` - The number of tokens to add. + fn mint_into( + &mut self, + asset: &AssetIdOf, + account: &AccountIdFor, + value: BalanceOf, + ) -> Result, DispatchError>; - /// Return the balance of an account. - /// - /// # Arguments - /// - /// * `address` - The address of the account to query. - fn balance_of(&mut self, asset: &AssetIdOf, owner: &AccountIdFor) -> BalanceOf; + /// Return the balance of an account. + /// + /// # Arguments + /// + /// * `address` - The address of the account to query. + fn balance_of( + &mut self, + asset: &AssetIdOf, + owner: &AccountIdFor, + ) -> BalanceOf; - fn asset_exists(&mut self, asset: &AssetIdOf) -> bool; + fn asset_exists(&mut self, asset: &AssetIdOf) -> bool; } impl AssetsAPI for T - where - T: Sandbox, - T::Runtime: pallet_assets::Config, +where + T: Sandbox, + T::Runtime: pallet_assets::Config, { - fn create(&mut self, id: &AssetIdOf, owner: &AccountIdFor, min_balance: BalanceOf) -> Result<(), DispatchError> { - self.execute_with(|| as Create>>::create(id.clone(), owner.clone(), true, min_balance)) - } + fn create( + &mut self, + id: &AssetIdOf, + owner: &AccountIdFor, + min_balance: BalanceOf, + ) -> Result<(), DispatchError> { + self.execute_with(|| as Create>>::create(id.clone(), owner.clone(), true, min_balance)) + } - fn mint_into( - &mut self, - asset: &AssetIdOf, - account: &AccountIdFor, - value: BalanceOf, - ) -> Result, DispatchError> { - self.execute_with(|| pallet_assets::Pallet::::mint_into(asset.clone(), account, value)) - } + fn mint_into( + &mut self, + asset: &AssetIdOf, + account: &AccountIdFor, + value: BalanceOf, + ) -> Result, DispatchError> { + self.execute_with(|| { + pallet_assets::Pallet::::mint_into(asset.clone(), account, value) + }) + } - fn balance_of(&mut self, asset: &AssetIdOf, owner: &AccountIdFor) -> BalanceOf { - self.execute_with(|| pallet_assets::Pallet::::balance(asset.clone(), owner)) - } + fn balance_of( + &mut self, + asset: &AssetIdOf, + owner: &AccountIdFor, + ) -> BalanceOf { + self.execute_with(|| { + pallet_assets::Pallet::::balance(asset.clone(), owner) + }) + } - fn asset_exists(&mut self, asset: &AssetIdOf) -> bool { - self.execute_with(|| pallet_assets::Pallet::::asset_exists(asset.clone())) - } + fn asset_exists(&mut self, asset: &AssetIdOf) -> bool { + self.execute_with(|| { + pallet_assets::Pallet::::asset_exists(asset.clone()) + }) + } } #[cfg(test)] mod test { - use super::*; - use crate::DefaultSandbox; - #[test] - fn api_works() { - let mut sandbox = DefaultSandbox::default(); - let token = 1; - let balance = sandbox.balance_of(&token, &DefaultSandbox::default_actor()); + use super::*; + use crate::DefaultSandbox; + #[test] + fn api_works() { + let mut sandbox = DefaultSandbox::default(); + let token = 1; + let balance = sandbox.balance_of(&token, &DefaultSandbox::default_actor()); - sandbox - .create(&token, &DefaultSandbox::default_actor(), 1) - .unwrap(); - sandbox - .mint_into(&token, &DefaultSandbox::default_actor(), 100) - .unwrap(); + sandbox.create(&token, &DefaultSandbox::default_actor(), 1).unwrap(); + sandbox.mint_into(&token, &DefaultSandbox::default_actor(), 100).unwrap(); - assert_eq!( - sandbox.balance_of(&token, &DefaultSandbox::default_actor()), - balance + 100 - ); + assert_eq!(sandbox.balance_of(&token, &DefaultSandbox::default_actor()), balance + 100); - assert!(sandbox.asset_exists(&token)); - } -} \ No newline at end of file + assert!(sandbox.asset_exists(&token)); + } +} diff --git a/rustfmt.toml b/rustfmt.toml deleted file mode 100644 index af85000..0000000 --- a/rustfmt.toml +++ /dev/null @@ -1,7 +0,0 @@ -edition = "2021" -use_field_init_shorthand = true -reorder_modules = true - -imports_granularity = "Crate" -group_imports = "StdExternalCrate" -reorder_imports = true From d16f01f6b2e50121e9c8d9b81e436a96534173a1 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 23 Sep 2024 20:24:25 +0700 Subject: [PATCH 03/43] feat: add approve, total_supply --- examples/chain-extension/Cargo.lock | 1111 ++++++++++++++++++++++----- ink-sandbox/src/api/assets_api.rs | 165 +++- 2 files changed, 1054 insertions(+), 222 deletions(-) diff --git a/examples/chain-extension/Cargo.lock b/examples/chain-extension/Cargo.lock index 106597c..41d2d91 100644 --- a/examples/chain-extension/Cargo.lock +++ b/examples/chain-extension/Cargo.lock @@ -79,6 +79,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -416,19 +422,35 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ - "bitcoin_hashes", + "bitcoin_hashes 0.11.0", "rand", "rand_core 0.6.4", "serde", "unicode-normalization", ] +[[package]] +name = "bitcoin-internals" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" + [[package]] name = "bitcoin_hashes" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" +[[package]] +name = "bitcoin_hashes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals", + "hex-conservative", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -657,8 +679,8 @@ name = "chain-extension" version = "0.1.0" dependencies = [ "drink", - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "ink", "parity-scale-codec", "scale-info", @@ -1308,14 +1330,15 @@ dependencies = [ "contract-metadata", "contract-transcode", "drink-test-macro", - "frame-support", - "frame-system", + "frame-support 36.0.1", + "frame-system 36.1.0", "ink_sandbox", + "log", "parity-scale-codec", "parity-scale-codec-derive", "scale-info", "serde_json", - "sp-runtime-interface", + "sp-runtime-interface 28.0.0", "thiserror", "wat", ] @@ -1383,6 +1406,7 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", + "serdect", "signature", "spki", ] @@ -1425,6 +1449,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek 4.1.2", + "ed25519", + "hashbrown 0.14.3", + "hex", + "rand_core 0.6.4", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "either" version = "1.10.0" @@ -1446,6 +1485,7 @@ dependencies = [ "pkcs8", "rand_core 0.6.4", "sec1", + "serdect", "subtle", "zeroize", ] @@ -1552,27 +1592,27 @@ dependencies = [ [[package]] name = "frame-benchmarking" -version = "29.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4090659c6aaa3c4d5b6c6ec909b4b0a25dec10ad92aad5f729efa8d5bd4d806a" +checksum = "709b26657ebbba53dc7bb616577375ca462b20fef1b00e8d9b20d2435e87f7bc" dependencies = [ - "frame-support", - "frame-support-procedural", - "frame-system", + "frame-support 36.0.1", + "frame-support-procedural 30.0.2", + "frame-system 36.1.0", "linregress", "log", "parity-scale-codec", "paste", "scale-info", "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-io", - "sp-runtime", - "sp-runtime-interface", + "sp-api 33.0.0", + "sp-application-crypto 37.0.0", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.1", + "sp-runtime-interface 28.0.0", "sp-std", - "sp-storage", + "sp-storage 21.0.0", "static_assertions", ] @@ -1600,7 +1640,49 @@ dependencies = [ "docify", "environmental", "frame-metadata", - "frame-support-procedural", + "frame-support-procedural 24.0.0", + "impl-trait-for-tuples", + "k256", + "log", + "macro_magic", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "serde_json", + "smallvec", + "sp-api 27.0.1", + "sp-arithmetic 24.0.0", + "sp-core 29.0.0", + "sp-crypto-hashing-proc-macro", + "sp-debug-derive", + "sp-genesis-builder 0.8.0", + "sp-inherents 27.0.0", + "sp-io 31.0.0", + "sp-metadata-ir 0.6.0", + "sp-runtime 32.0.0", + "sp-staking 27.0.0", + "sp-state-machine 0.36.0", + "sp-std", + "sp-tracing 16.0.0", + "sp-weights 28.0.0", + "static_assertions", + "tt-call", +] + +[[package]] +name = "frame-support" +version = "36.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4d08149c28010bfa568dcfa832aea628fb794d4243794a13b1bdef1aa66fb1" +dependencies = [ + "aquamarine", + "array-bytes", + "bitflags 1.3.2", + "docify", + "environmental", + "frame-metadata", + "frame-support-procedural 30.0.2", "impl-trait-for-tuples", "k256", "log", @@ -1611,21 +1693,21 @@ dependencies = [ "serde", "serde_json", "smallvec", - "sp-api", - "sp-arithmetic", - "sp-core", + "sp-api 33.0.0", + "sp-arithmetic 26.0.0", + "sp-core 34.0.0", "sp-crypto-hashing-proc-macro", "sp-debug-derive", - "sp-genesis-builder", - "sp-inherents", - "sp-io", - "sp-metadata-ir", - "sp-runtime", - "sp-staking", - "sp-state-machine", + "sp-genesis-builder 0.14.0", + "sp-inherents 33.0.0", + "sp-io 37.0.0", + "sp-metadata-ir 0.7.0", + "sp-runtime 38.0.1", + "sp-staking 33.0.0", + "sp-state-machine 0.42.0", "sp-std", - "sp-tracing", - "sp-weights", + "sp-tracing 17.0.0", + "sp-weights 31.0.0", "static_assertions", "tt-call", ] @@ -1640,7 +1722,7 @@ dependencies = [ "cfg-expr", "derive-syn-parse 0.1.5", "expander", - "frame-support-procedural-tools", + "frame-support-procedural-tools 10.0.0", "itertools 0.10.5", "macro_magic", "proc-macro-warning", @@ -1650,13 +1732,46 @@ dependencies = [ "syn 2.0.57", ] +[[package]] +name = "frame-support-procedural" +version = "30.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e4662a809f559aea6234bd90940fa29df583a3c8124a3cf923f66a0d21126b7" +dependencies = [ + "Inflector", + "cfg-expr", + "derive-syn-parse 0.2.0", + "expander", + "frame-support-procedural-tools 13.0.0", + "itertools 0.11.0", + "macro_magic", + "proc-macro-warning", + "proc-macro2", + "quote", + "sp-crypto-hashing", + "syn 2.0.57", +] + [[package]] name = "frame-support-procedural-tools" version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3363df38464c47a73eb521a4f648bfcc7537a82d70347ef8af3f73b6d019e910" dependencies = [ - "frame-support-procedural-tools-derive", + "frame-support-procedural-tools-derive 11.0.0", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.57", +] + +[[package]] +name = "frame-support-procedural-tools" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bead15a320be1764cdd50458c4cfacb23e0cee65f64f500f8e34136a94c7eeca" +dependencies = [ + "frame-support-procedural-tools-derive 12.0.0", "proc-macro-crate 3.1.0", "proc-macro2", "quote", @@ -1674,6 +1789,17 @@ dependencies = [ "syn 2.0.57", ] +[[package]] +name = "frame-support-procedural-tools-derive" +version = "12.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.57", +] + [[package]] name = "frame-system" version = "29.0.0" @@ -1682,17 +1808,38 @@ checksum = "5bc20a793c3cec0b11165c1075fe11a255b2491f3eef8230bb3073cb296e7383" dependencies = [ "cfg-if", "docify", - "frame-support", + "frame-support 29.0.2", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", + "sp-std", + "sp-version 30.0.0", + "sp-weights 28.0.0", +] + +[[package]] +name = "frame-system" +version = "36.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d6a0e7bb6503facdcc6f8e19c83cd0bfc8bbbd268522b1a50e107dfc6b972d" +dependencies = [ + "cfg-if", + "docify", + "frame-support 36.0.1", "log", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.1", "sp-std", - "sp-version", - "sp-weights", + "sp-version 36.0.0", + "sp-weights 31.0.0", ] [[package]] @@ -1898,6 +2045,10 @@ name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash 0.8.11", + "allocator-api2", +] [[package]] name = "heck" @@ -1923,6 +2074,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex-conservative" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" + [[package]] name = "hmac" version = "0.8.1" @@ -2375,18 +2532,20 @@ name = "ink_sandbox" version = "5.0.0" dependencies = [ "frame-metadata", - "frame-support", - "frame-system", + "frame-support 36.0.1", + "frame-system 36.1.0", + "log", + "pallet-assets", "pallet-balances", "pallet-contracts", "pallet-timestamp", "parity-scale-codec", "paste", "scale-info", - "sp-core", - "sp-externalities", - "sp-io", - "sp-runtime-interface", + "sp-core 34.0.0", + "sp-externalities 0.29.0", + "sp-io 37.0.0", + "sp-runtime-interface 28.0.0", "wat", ] @@ -2451,6 +2610,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.12.1" @@ -2500,6 +2668,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", + "serdect", "sha2 0.10.8", ] @@ -2661,9 +2830,9 @@ dependencies = [ [[package]] name = "macro_magic" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e03844fc635e92f3a0067e25fa4bf3e3dbf3f2927bf3aa01bb7bc8f1c428949d" +checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d" dependencies = [ "macro_magic_core", "macro_magic_macros", @@ -2673,12 +2842,12 @@ dependencies = [ [[package]] name = "macro_magic_core" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d" +checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" dependencies = [ "const-random", - "derive-syn-parse 0.1.5", + "derive-syn-parse 0.2.0", "macro_magic_core_macros", "proc-macro2", "quote", @@ -2687,9 +2856,9 @@ dependencies = [ [[package]] name = "macro_magic_core_macros" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" +checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", @@ -2698,9 +2867,9 @@ dependencies = [ [[package]] name = "macro_magic_macros" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" +checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", @@ -2798,6 +2967,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "multi-stash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685a9ac4b61f4e728e1d2c6a7844609c16527aeb5e6c865915c08e619c16410f" + [[package]] name = "nalgebra" version = "0.32.5" @@ -2880,6 +3055,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.57", +] + [[package]] name = "num-format" version = "0.4.4" @@ -2972,48 +3158,67 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "pallet-assets" +version = "37.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f79ef6a7763fc08177f014052469ee12aefcdad0d99a747372360c2f648d2cc4" +dependencies = [ + "frame-benchmarking", + "frame-support 36.0.1", + "frame-system 36.1.0", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "sp-core 34.0.0", + "sp-runtime 38.0.1", + "sp-std", +] + [[package]] name = "pallet-balances" -version = "29.0.2" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a54b5d0c7c4c3731883d6b1ac18aff44db20c3d0a3470c8861001a17afdc85" +checksum = "6878e240962d3887f0e0654ac343a18845adb95ad493c9d4d5e803c015d4a4c3" dependencies = [ "docify", "frame-benchmarking", - "frame-support", - "frame-system", + "frame-support 36.0.1", + "frame-system 36.1.0", "log", "parity-scale-codec", "scale-info", - "sp-runtime", + "sp-runtime 38.0.1", "sp-std", ] [[package]] name = "pallet-contracts" -version = "28.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b56fe53df97911ed3ecd90d631f8093cedd795c756d4e42d386110e9fe6614f" +checksum = "3e6989ac82690f981959b0d38ac6d6d52fc06bf00a035548d62b9a2e9c220376" dependencies = [ "bitflags 1.3.2", "environmental", "frame-benchmarking", - "frame-support", - "frame-system", + "frame-support 36.0.1", + "frame-system 36.1.0", "impl-trait-for-tuples", "log", "pallet-balances", "pallet-contracts-proc-macro", "pallet-contracts-uapi", "parity-scale-codec", + "paste", "rand", "scale-info", "serde", "smallvec", - "sp-api", - "sp-core", - "sp-io", - "sp-runtime", + "sp-api 33.0.0", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.1", "sp-std", "staging-xcm", "staging-xcm-builder", @@ -3023,9 +3228,9 @@ dependencies = [ [[package]] name = "pallet-contracts-proc-macro" -version = "19.0.0" +version = "23.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3163c6bc21b55a0ccb74c546ba784d9c9e69beb9240c059d28a3052f4cbce509" +checksum = "94226cbd48516b7c310eb5dae8d50798c1ce73a7421dc0977c55b7fc2237a283" dependencies = [ "proc-macro2", "quote", @@ -3034,14 +3239,14 @@ dependencies = [ [[package]] name = "pallet-contracts-uapi" -version = "6.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61eeda58538dc888c59ae6de2146f0e2f43e9ad0eb1d56c228e5cc7af90d4e52" +checksum = "e1330375dcced95509e3cca7ef6b1c3fac648df995b86d39467d082ba981dc46" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", "paste", - "polkavm-derive", + "polkavm-derive 0.9.1", "scale-info", ] @@ -3053,47 +3258,60 @@ checksum = "fd549c16296ea5b2eb7c65c56aba548b286c1be4d7675b424ff6ccb8319c97a9" dependencies = [ "bitflags 1.3.2", "paste", - "polkavm-derive", + "polkavm-derive 0.5.0", ] [[package]] name = "pallet-timestamp" -version = "28.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b8810ddfb254c7fb8cd7698229cce513d309a43ff117b38798dae6120f477b" +checksum = "ae789d344be857679b0b98b28a67c747119724847f81d704d3fd03ee13fb6841" dependencies = [ "docify", "frame-benchmarking", - "frame-support", - "frame-system", + "frame-support 36.0.1", + "frame-system 36.1.0", "log", "parity-scale-codec", "scale-info", - "sp-inherents", - "sp-io", - "sp-runtime", + "sp-inherents 33.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.1", "sp-std", - "sp-storage", + "sp-storage 21.0.0", "sp-timestamp", ] [[package]] name = "pallet-transaction-payment" -version = "29.0.2" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5ba71f06f09e955b80dc313c333be3f8d9e8505b051558e0b7af4806b13310" +checksum = "74fb6114223c8d967c3c2f21cbc845e8ea604ff7e21a8e59d119d5a9257ba886" dependencies = [ - "frame-support", - "frame-system", + "frame-support 36.0.1", + "frame-system 36.1.0", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.1", "sp-std", ] +[[package]] +name = "parity-bip39" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" +dependencies = [ + "bitcoin_hashes 0.13.0", + "rand", + "rand_core 0.6.4", + "serde", + "unicode-normalization", +] + [[package]] name = "parity-scale-codec" version = "3.6.12" @@ -3150,6 +3368,17 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "paste" version = "1.0.14" @@ -3165,6 +3394,16 @@ dependencies = [ "crypto-mac 0.11.0", ] +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest 0.10.7", + "password-hash", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -3221,22 +3460,22 @@ checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" [[package]] name = "polkadot-core-primitives" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a08e4e014c853b252ecbbe3ccd67b2d33d78e46988d309b8cccf4ac06e25ef" +checksum = "17c72ee63bcf920f963cd7ac066759b0b649350c8ab3781a85a6aac87b1488f2" dependencies = [ "parity-scale-codec", "scale-info", - "sp-core", - "sp-runtime", + "sp-core 34.0.0", + "sp-runtime 38.0.1", "sp-std", ] [[package]] name = "polkadot-parachain-primitives" -version = "7.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248ab090959a92e61493277e33b7e85104280a4beb4cb0815137d3c8c50a07f4" +checksum = "f61070d0ff28f596890def0e0d03c231860796130b2a43e293106fa86a50c9a9" dependencies = [ "bounded-collections", "derive_more", @@ -3244,10 +3483,10 @@ dependencies = [ "polkadot-core-primitives", "scale-info", "serde", - "sp-core", - "sp-runtime", + "sp-core 34.0.0", + "sp-runtime 38.0.1", "sp-std", - "sp-weights", + "sp-weights 31.0.0", ] [[package]] @@ -3256,28 +3495,65 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88b4e215c80fe876147f3d58158d5dfeae7dabdd6047e175af77095b78d0035c" +[[package]] +name = "polkavm-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d9428a5cfcc85c5d7b9fc4b6a18c4b802d0173d768182a51cc7751640f08b92" + [[package]] name = "polkavm-derive" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6380dbe1fb03ecc74ad55d841cfc75480222d153ba69ddcb00977866cbdabdb8" dependencies = [ - "polkavm-derive-impl", + "polkavm-derive-impl 0.5.0", "syn 2.0.57", ] +[[package]] +name = "polkavm-derive" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" +dependencies = [ + "polkavm-derive-impl-macro", +] + [[package]] name = "polkavm-derive-impl" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc8211b3365bbafb2fb32057d68b0e1ca55d079f5cf6f9da9b98079b94b3987d" dependencies = [ - "polkavm-common", + "polkavm-common 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.57", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c" +dependencies = [ + "polkavm-common 0.9.0", "proc-macro2", "quote", "syn 2.0.57", ] +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" +dependencies = [ + "polkavm-derive-impl 0.9.0", + "syn 2.0.57", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -3775,6 +4051,7 @@ dependencies = [ "der", "generic-array", "pkcs8", + "serdect", "subtle", "zeroize", ] @@ -3915,6 +4192,16 @@ dependencies = [ "time", ] +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "sha2" version = "0.9.9" @@ -4062,15 +4349,38 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-api-proc-macro", - "sp-core", - "sp-externalities", - "sp-metadata-ir", - "sp-runtime", - "sp-state-machine", + "sp-api-proc-macro 15.0.1", + "sp-core 29.0.0", + "sp-externalities 0.26.0", + "sp-metadata-ir 0.6.0", + "sp-runtime 32.0.0", + "sp-state-machine 0.36.0", + "sp-std", + "sp-trie 30.0.0", + "sp-version 30.0.0", + "thiserror", +] + +[[package]] +name = "sp-api" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e43fbf034e9dbaa8ffc6a238a22808777eb38c580f66fc6736d8511631789e" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "scale-info", + "sp-api-proc-macro 20.0.0", + "sp-core 34.0.0", + "sp-externalities 0.29.0", + "sp-metadata-ir 0.7.0", + "sp-runtime 38.0.1", + "sp-runtime-interface 28.0.0", + "sp-state-machine 0.42.0", "sp-std", - "sp-trie", - "sp-version", + "sp-trie 36.0.0", + "sp-version 36.0.0", "thiserror", ] @@ -4089,6 +4399,21 @@ dependencies = [ "syn 2.0.57", ] +[[package]] +name = "sp-api-proc-macro" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9aadf9e97e694f0e343978aa632938c5de309cbcc8afed4136cb71596737278" +dependencies = [ + "Inflector", + "blake2", + "expander", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.57", +] + [[package]] name = "sp-application-crypto" version = "31.0.0" @@ -4098,14 +4423,28 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", + "sp-core 29.0.0", + "sp-io 31.0.0", "sp-std", ] [[package]] -name = "sp-arithmetic" -version = "24.0.0" +name = "sp-application-crypto" +version = "37.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d96d1fc0f1c741bbcbd0dd5470eff7b66f011708cc1942b088ebf0d4efb3d93" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-std", +] + +[[package]] +name = "sp-arithmetic" +version = "24.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afa823ca5adc490d47dccb41d69ad482bc57a317bd341de275868378f48f131c" dependencies = [ @@ -4118,6 +4457,22 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "sp-arithmetic" +version = "26.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46d0d0a4c591c421d3231ddd5e27d828618c24456d51445d21a1f79fcee97c23" +dependencies = [ + "docify", + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-std", + "static_assertions", +] + [[package]] name = "sp-core" version = "29.0.0" @@ -4131,7 +4486,7 @@ dependencies = [ "bounded-collections", "bs58", "dyn-clonable", - "ed25519-zebra", + "ed25519-zebra 3.1.0", "futures", "hash-db", "hash256-std-hasher", @@ -4152,12 +4507,59 @@ dependencies = [ "serde", "sp-crypto-hashing", "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", + "sp-externalities 0.26.0", + "sp-runtime-interface 25.0.0", + "sp-std", + "sp-storage 20.0.0", + "ss58-registry", + "substrate-bip39 0.4.6", + "thiserror", + "tracing", + "w3f-bls", + "zeroize", +] + +[[package]] +name = "sp-core" +version = "34.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c961a5e33fb2962fa775c044ceba43df9c6f917e2c35d63bfe23738468fa76a7" +dependencies = [ + "array-bytes", + "bitflags 1.3.2", + "blake2", + "bounded-collections", + "bs58", + "dyn-clonable", + "ed25519-zebra 4.0.3", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde", + "itertools 0.11.0", + "k256", + "libsecp256k1", + "log", + "merlin", + "parity-bip39", + "parity-scale-codec", + "parking_lot", + "paste", + "primitive-types", + "rand", + "scale-info", + "schnorrkel", + "secp256k1", + "secrecy", + "serde", + "sp-crypto-hashing", + "sp-debug-derive", + "sp-externalities 0.29.0", + "sp-runtime-interface 28.0.0", "sp-std", - "sp-storage", + "sp-storage 21.0.0", "ss58-registry", - "substrate-bip39", + "substrate-bip39 0.6.0", "thiserror", "tracing", "w3f-bls", @@ -4209,7 +4611,18 @@ dependencies = [ "environmental", "parity-scale-codec", "sp-std", - "sp-storage", + "sp-storage 20.0.0", +] + +[[package]] +name = "sp-externalities" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a904407d61cb94228c71b55a9d3708e9d6558991f9e83bd42bd91df37a159d30" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-storage 21.0.0", ] [[package]] @@ -4219,11 +4632,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd865540ec19479c7349b584ccd78cc34c3f3a628a2a69dbb6365ceec36295ee" dependencies = [ "serde_json", - "sp-api", - "sp-runtime", + "sp-api 27.0.1", + "sp-runtime 32.0.0", "sp-std", ] +[[package]] +name = "sp-genesis-builder" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcd065854d96fd81521c103d0aaa287d4f08b9b15c9fae2a3bfb208b0812bf44" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde_json", + "sp-api 33.0.0", + "sp-runtime 38.0.1", +] + [[package]] name = "sp-inherents" version = "27.0.0" @@ -4234,11 +4660,25 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", "thiserror", ] +[[package]] +name = "sp-inherents" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53407ba38ec22ca4a16381722c4bd0b559a0428bc1713079b0d5163ada63186a" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-runtime 38.0.1", + "thiserror", +] + [[package]] name = "sp-io" version = "31.0.0" @@ -4252,15 +4692,42 @@ dependencies = [ "parity-scale-codec", "rustversion", "secp256k1", - "sp-core", + "sp-core 29.0.0", "sp-crypto-hashing", - "sp-externalities", - "sp-keystore", - "sp-runtime-interface", - "sp-state-machine", + "sp-externalities 0.26.0", + "sp-keystore 0.35.0", + "sp-runtime-interface 25.0.0", + "sp-state-machine 0.36.0", "sp-std", - "sp-tracing", - "sp-trie", + "sp-tracing 16.0.0", + "sp-trie 30.0.0", + "tracing", + "tracing-core", +] + +[[package]] +name = "sp-io" +version = "37.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5036cad2e48d41f5caf6785226c8be1a7db15bec14a9fd7aa6cca84f34cf689f" +dependencies = [ + "bytes", + "ed25519-dalek", + "libsecp256k1", + "log", + "parity-scale-codec", + "polkavm-derive 0.9.1", + "rustversion", + "secp256k1", + "sp-core 34.0.0", + "sp-crypto-hashing", + "sp-externalities 0.29.0", + "sp-keystore 0.40.0", + "sp-runtime-interface 28.0.0", + "sp-state-machine 0.42.0", + "sp-std", + "sp-tracing 17.0.0", + "sp-trie 36.0.0", "tracing", "tracing-core", ] @@ -4273,11 +4740,23 @@ checksum = "444f2d53968b1ce5e908882710ff1f3873fcf3e95f59d57432daf685bbacb959" dependencies = [ "parity-scale-codec", "parking_lot", - "sp-core", - "sp-externalities", + "sp-core 29.0.0", + "sp-externalities 0.26.0", "thiserror", ] +[[package]] +name = "sp-keystore" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0248b4d784cb4a01472276928977121fa39d977a5bb24793b6b15e64b046df42" +dependencies = [ + "parity-scale-codec", + "parking_lot", + "sp-core 34.0.0", + "sp-externalities 0.29.0", +] + [[package]] name = "sp-metadata-ir" version = "0.6.0" @@ -4290,6 +4769,17 @@ dependencies = [ "sp-std", ] +[[package]] +name = "sp-metadata-ir" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a616fa51350b35326682a472ee8e6ba742fdacb18babac38ecd46b3e05ead869" +dependencies = [ + "frame-metadata", + "parity-scale-codec", + "scale-info", +] + [[package]] name = "sp-panic-handler" version = "13.0.0" @@ -4318,12 +4808,39 @@ dependencies = [ "scale-info", "serde", "simple-mermaid", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-io", + "sp-application-crypto 31.0.0", + "sp-arithmetic 24.0.0", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-std", + "sp-weights 28.0.0", +] + +[[package]] +name = "sp-runtime" +version = "38.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5273900f0b0bef48b2e1ff9c4fb5e188b8168ee5891418a427f4be2af92ee40f" +dependencies = [ + "docify", + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "num-traits", + "parity-scale-codec", + "paste", + "rand", + "scale-info", + "serde", + "simple-mermaid", + "sp-application-crypto 37.0.0", + "sp-arithmetic 26.0.0", + "sp-core 34.0.0", + "sp-io 37.0.0", "sp-std", - "sp-weights", + "sp-weights 31.0.0", + "tracing", ] [[package]] @@ -4336,12 +4853,32 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", + "sp-externalities 0.26.0", + "sp-runtime-interface-proc-macro 17.0.0", + "sp-std", + "sp-storage 20.0.0", + "sp-tracing 16.0.0", + "sp-wasm-interface 20.0.0", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985eb981f40c689c6a0012c937b68ed58dabb4341d06f2dfe4dfd5ed72fa4017" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "polkavm-derive 0.9.1", + "primitive-types", + "sp-externalities 0.29.0", + "sp-runtime-interface-proc-macro 18.0.0", "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", + "sp-storage 21.0.0", + "sp-tracing 17.0.0", + "sp-wasm-interface 21.0.0", "static_assertions", ] @@ -4359,6 +4896,20 @@ dependencies = [ "syn 2.0.57", ] +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" +dependencies = [ + "Inflector", + "expander", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.57", +] + [[package]] name = "sp-staking" version = "27.0.0" @@ -4369,11 +4920,25 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-runtime", + "sp-core 29.0.0", + "sp-runtime 32.0.0", "sp-std", ] +[[package]] +name = "sp-staking" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a0b7abfe66c07a3b6eb99e1286dfa9b6f3b057b0e986e7da2ccbf707f6c781a" +dependencies = [ + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 34.0.0", + "sp-runtime 38.0.1", +] + [[package]] name = "sp-state-machine" version = "0.36.0" @@ -4386,14 +4951,35 @@ dependencies = [ "parking_lot", "rand", "smallvec", - "sp-core", - "sp-externalities", + "sp-core 29.0.0", + "sp-externalities 0.26.0", "sp-panic-handler", "sp-std", - "sp-trie", + "sp-trie 30.0.0", "thiserror", "tracing", - "trie-db", + "trie-db 0.28.0", +] + +[[package]] +name = "sp-state-machine" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "211e528aa6e902261a343f7b40840aa3d66fe4ad3aadbd04a035f10baf96dbc5" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "parking_lot", + "rand", + "smallvec", + "sp-core 34.0.0", + "sp-externalities 0.29.0", + "sp-panic-handler", + "sp-trie 36.0.0", + "thiserror", + "tracing", + "trie-db 0.29.1", ] [[package]] @@ -4416,17 +5002,29 @@ dependencies = [ "sp-std", ] +[[package]] +name = "sp-storage" +version = "21.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99c82989b3a4979a7e1ad848aad9f5d0b4388f1f454cc131766526601ab9e8f8" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive", +] + [[package]] name = "sp-timestamp" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "249cd06624f2edb53b25af528ab216a508dc9d0870e158b43caac3a97e86699f" +checksum = "78becf144a76f6fd108dfe94a90e20a185b38c0b310dc5482328196143c8266b" dependencies = [ "async-trait", "parity-scale-codec", - "sp-inherents", - "sp-runtime", - "sp-std", + "sp-inherents 33.0.0", + "sp-runtime 38.0.1", "thiserror", ] @@ -4443,6 +5041,18 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "sp-tracing" +version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90b3decf116db9f1dfaf1f1597096b043d0e12c952d3bcdc018c6d6b77deec7e" +dependencies = [ + "parity-scale-codec", + "tracing", + "tracing-core", + "tracing-subscriber", +] + [[package]] name = "sp-trie" version = "30.0.0" @@ -4459,12 +5069,36 @@ dependencies = [ "rand", "scale-info", "schnellru", - "sp-core", - "sp-externalities", + "sp-core 29.0.0", + "sp-externalities 0.26.0", "sp-std", "thiserror", "tracing", - "trie-db", + "trie-db 0.28.0", + "trie-root", +] + +[[package]] +name = "sp-trie" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d717c0f465f5371569e6fdc25b6f32d47c15d6e4c92b3b779e1c9b18b951d" +dependencies = [ + "ahash 0.8.11", + "hash-db", + "lazy_static", + "memory-db", + "nohash-hasher", + "parity-scale-codec", + "parking_lot", + "rand", + "scale-info", + "schnellru", + "sp-core 34.0.0", + "sp-externalities 0.29.0", + "thiserror", + "tracing", + "trie-db 0.29.1", "trie-root", ] @@ -4480,9 +5114,27 @@ dependencies = [ "scale-info", "serde", "sp-crypto-hashing-proc-macro", - "sp-runtime", + "sp-runtime 32.0.0", + "sp-std", + "sp-version-proc-macro 13.0.0", + "thiserror", +] + +[[package]] +name = "sp-version" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bccf96fefae339dee7c4453f91be64eb28cce4c2fe82130445cf096b18b2c081" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "parity-wasm", + "scale-info", + "serde", + "sp-crypto-hashing-proc-macro", + "sp-runtime 38.0.1", "sp-std", - "sp-version-proc-macro", + "sp-version-proc-macro 14.0.0", "thiserror", ] @@ -4498,6 +5150,18 @@ dependencies = [ "syn 2.0.57", ] +[[package]] +name = "sp-version-proc-macro" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aee8f6730641a65fcf0c8f9b1e448af4b3bb083d08058b47528188bccc7b7a7" +dependencies = [ + "parity-scale-codec", + "proc-macro2", + "quote", + "syn 2.0.57", +] + [[package]] name = "sp-wasm-interface" version = "20.0.0" @@ -4512,6 +5176,17 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "sp-wasm-interface" +version = "21.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b04b919e150b4736d85089d49327eab65507deb1485eec929af69daa2278eb3" +dependencies = [ + "impl-trait-for-tuples", + "log", + "parity-scale-codec", +] + [[package]] name = "sp-weights" version = "28.0.0" @@ -4523,11 +5198,26 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-arithmetic", + "sp-arithmetic 24.0.0", "sp-debug-derive", "sp-std", ] +[[package]] +name = "sp-weights" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93cdaf72a1dad537bbb130ba4d47307ebe5170405280ed1aa31fa712718a400e" +dependencies = [ + "bounded-collections", + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic 26.0.0", + "sp-debug-derive", +] + [[package]] name = "spin" version = "0.9.8" @@ -4567,9 +5257,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-xcm" -version = "8.0.1" +version = "14.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fa328b87de3466bc38cc9a07244c42c647b7755b81115e1dfeb47cc13fc6e6" +checksum = "f2b7b5f531c6bf9629514ef8e5fda0e9e80dd84516957f710940d0e01d3fb36c" dependencies = [ "array-bytes", "bounded-collections", @@ -4580,52 +5270,52 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-weights", + "sp-weights 31.0.0", "xcm-procedural", ] [[package]] name = "staging-xcm-builder" -version = "8.0.3" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b7447c38be3ca9fb21c7434de2243aa6ac74acde8944cda7bb6e2a4f765801" +checksum = "847fa2afe1bed2751eaabf7b91fa4043037947f17653d7cc59ea202cc44c6bb8" dependencies = [ - "frame-support", - "frame-system", + "frame-support 36.0.1", + "frame-system 36.1.0", "impl-trait-for-tuples", "log", "pallet-transaction-payment", "parity-scale-codec", "polkadot-parachain-primitives", "scale-info", - "sp-arithmetic", - "sp-io", - "sp-runtime", + "sp-arithmetic 26.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.1", "sp-std", - "sp-weights", + "sp-weights 31.0.0", "staging-xcm", "staging-xcm-executor", ] [[package]] name = "staging-xcm-executor" -version = "8.0.2" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b5c5f2a1d610c5e20e5fae2680c9a28380f305afafeed62f341bfbce57b79a" +checksum = "26b98d8219449eaf02e71a7edf1a14b14d4c713dd01d9df66fde1ce30dba4d6d" dependencies = [ "environmental", "frame-benchmarking", - "frame-support", + "frame-support 36.0.1", "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", + "sp-arithmetic 26.0.0", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.1", "sp-std", - "sp-weights", + "sp-weights 31.0.0", "staging-xcm", ] @@ -4635,6 +5325,17 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "string-interner" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c6a0d765f5807e98a091107bae0a56ea3799f66a5de47b2c84c94a39c09974e" +dependencies = [ + "cfg-if", + "hashbrown 0.14.3", + "serde", +] + [[package]] name = "strsim" version = "0.10.0" @@ -4695,12 +5396,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" dependencies = [ "hmac 0.11.0", - "pbkdf2", + "pbkdf2 0.8.0", "schnorrkel", "sha2 0.9.9", "zeroize", ] +[[package]] +name = "substrate-bip39" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" +dependencies = [ + "hmac 0.12.1", + "pbkdf2 0.12.2", + "schnorrkel", + "sha2 0.10.8", + "zeroize", +] + [[package]] name = "subtle" version = "2.5.0" @@ -5094,6 +5808,18 @@ dependencies = [ "smallvec", ] +[[package]] +name = "trie-db" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c992b4f40c234a074d48a757efeabb1a6be88af84c0c23f7ca158950cb0ae7f" +dependencies = [ + "hash-db", + "log", + "rustc-hex", + "smallvec", +] + [[package]] name = "trie-root" version = "0.18.0" @@ -5387,28 +6113,37 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.31.2" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8281d1d660cdf54c76a3efa9ddd0c270cada1383a995db3ccb43d166456c7" +checksum = "50386c99b9c32bd2ed71a55b6dd4040af2580530fae8bdb9a6576571a80d0cca" dependencies = [ + "arrayvec", + "multi-stash", + "num-derive", + "num-traits", "smallvec", "spin", - "wasmi_arena", + "wasmi_collections", "wasmi_core", "wasmparser-nostd", ] [[package]] -name = "wasmi_arena" -version = "0.4.1" +name = "wasmi_collections" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" +checksum = "9c128c039340ffd50d4195c3f8ce31aac357f06804cfc494c8b9508d4b30dca4" +dependencies = [ + "ahash 0.8.11", + "hashbrown 0.14.3", + "string-interner", +] [[package]] name = "wasmi_core" -version = "0.13.0" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" +checksum = "a23b3a7f6c8c3ceeec6b83531ee61f0013c56e51cbf2b14b0f213548b23a4b41" dependencies = [ "downcast-rs", "libm", @@ -5428,9 +6163,9 @@ dependencies = [ [[package]] name = "wasmparser-nostd" -version = "0.100.1" +version = "0.100.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9157cab83003221bfd385833ab587a039f5d6fa7304854042ba358a3b09e0724" +checksum = "d5a015fe95f3504a94bb1462c717aae75253e39b9dd6c3fb1062c934535c64aa" dependencies = [ "indexmap-nostd", ] @@ -5884,9 +6619,9 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "8.0.0" +version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4717a97970a9cda70d7db53cf50d2615c2f6f6b7c857445325b4a39ea7aa2cd" +checksum = "87fb4f14094d65c500a59bcf540cf42b99ee82c706edd6226a92e769ad60563e" dependencies = [ "Inflector", "proc-macro2", diff --git a/ink-sandbox/src/api/assets_api.rs b/ink-sandbox/src/api/assets_api.rs index 10d024e..c8d3ddf 100644 --- a/ink-sandbox/src/api/assets_api.rs +++ b/ink-sandbox/src/api/assets_api.rs @@ -1,4 +1,10 @@ -use frame_support::{sp_runtime::DispatchError, traits::{fungibles::{Inspect, Create, Mutate}}}; +use frame_support::{ + sp_runtime::DispatchError, + traits::fungibles::{ + approvals::{Inspect as ApprovalsInspect, Mutate as ApprovalsMutate}, + Create, Inspect, Mutate, + }, +}; use pallet_assets::Instance1; use crate::{AccountIdFor, Sandbox}; @@ -7,15 +13,18 @@ type AssetIdOf = as Inspect<::Account type AssetsOf = pallet_assets::Pallet; type BalanceOf = as Inspect<::AccountId>>::Balance; -// TODO: api is the same with balances api. Perhaps should be changed to e.g. `create_asset`. -// Not important for now though. /// Assets API for the sandbox. pub trait AssetsAPI - where - T: Sandbox, - T::Runtime: pallet_assets::Config, +where + T: Sandbox, + T::Runtime: pallet_assets::Config, { - /// Create a token. + /// Creates `value` amount of tokens and assigns them to `account`, increasing the total supply. + /// + /// # Arguments + /// * `id` - ID of the new asset to be created. + /// * `owner` - The owner of the created asset. + /// * `min_balance` - The asset amount one account need at least. fn create( &mut self, id: &AssetIdOf, @@ -23,12 +32,28 @@ pub trait AssetsAPI min_balance: BalanceOf, ) -> Result<(), DispatchError>; - /// Mint tokens to an account. + /// Approves `spender` to spend `value` amount of tokens on behalf of the caller. + /// + /// Successive calls of this method overwrite previous values. /// /// # Arguments + /// * `asset` - ID of the asset. + /// * `spender` - The account that is allowed to spend the tokens. + /// * `value` - The number of tokens to approve. + fn approve( + &mut self, + asset: &AssetIdOf, + owner: &AccountIdFor, + delegate: &AccountIdFor, + amount: BalanceOf, + ) -> Result<(), DispatchError>; + + /// Creates `value` amount of tokens and assigns them to `account`, increasing the total supply. /// - /// * `address` - The address of the account to add tokens to. - /// * `amount` - The number of tokens to add. + /// # Arguments + /// * `asset` - ID of the asset. + /// * `account` - The account to be credited with the created tokens. + /// * `value` - The number of tokens to mint. fn mint_into( &mut self, asset: &AssetIdOf, @@ -36,22 +61,53 @@ pub trait AssetsAPI value: BalanceOf, ) -> Result, DispatchError>; - /// Return the balance of an account. + /// Returns the account balance for the specified `owner`. + /// + /// # Arguments + /// * `owner` - The account whose balance is being queried. + fn balance_of( + &mut self, + asset: &AssetIdOf, + owner: &AccountIdFor, + ) -> BalanceOf; + + /// Returns the total supply of the `asset`. /// /// # Arguments + /// * `asset` - ID of the asset. + fn total_supply(&mut self, asset: &AssetIdOf) -> BalanceOf; + + /// Returns the allowance for a `spender` approved by an `owner`. /// - /// * `address` - The address of the account to query. - fn balance_of(&mut self, asset: &AssetIdOf, owner: &AccountIdFor) -> BalanceOf; + /// # Arguments + /// * `asset` - ID of the asset. + /// * `owner` - The account that owns the tokens. + /// * `spender` - The account that is allowed to spend the tokens. + fn allowance( + &mut self, + asset: &AssetIdOf, + owner: &AccountIdFor, + delegate: &AccountIdFor, + ) -> BalanceOf; + /// Check if the asset is created. + /// + /// # Arguments + /// * `asset` - ID of the asset. fn asset_exists(&mut self, asset: &AssetIdOf) -> bool; } impl AssetsAPI for T - where - T: Sandbox, - T::Runtime: pallet_assets::Config, +where + T: Sandbox, + T::Runtime: pallet_assets::Config, { - fn create(&mut self, id: &AssetIdOf, owner: &AccountIdFor, min_balance: BalanceOf) -> Result<(), DispatchError> { + fn create( + &mut self, + id: &AssetIdOf, + owner: &AccountIdFor, + min_balance: BalanceOf, + ) -> Result<(), DispatchError> { self.execute_with(|| as Create>>::create(id.clone(), owner.clone(), true, min_balance)) } @@ -61,15 +117,63 @@ impl AssetsAPI for T account: &AccountIdFor, value: BalanceOf, ) -> Result, DispatchError> { - self.execute_with(|| pallet_assets::Pallet::::mint_into(asset.clone(), account, value)) + self.execute_with(|| { + pallet_assets::Pallet::::mint_into(asset.clone(), account, value) + }) + } + + fn approve( + &mut self, + asset: &AssetIdOf, + owner: &AccountIdFor, + delegate: &AccountIdFor, + amount: BalanceOf, + ) -> Result<(), DispatchError> { + self.execute_with(|| { + pallet_assets::Pallet::::approve( + asset.clone(), + owner, + delegate, + amount, + ) + }) + } + + fn balance_of( + &mut self, + asset: &AssetIdOf, + owner: &AccountIdFor, + ) -> BalanceOf { + self.execute_with(|| { + pallet_assets::Pallet::::balance(asset.clone(), owner) + }) } - fn balance_of(&mut self, asset: &AssetIdOf, owner: &AccountIdFor) -> BalanceOf { - self.execute_with(|| pallet_assets::Pallet::::balance(asset.clone(), owner)) + fn total_supply(&mut self, asset: &AssetIdOf) -> BalanceOf { + self.execute_with(|| { + pallet_assets::Pallet::::total_supply(asset.clone()) + }) + } + + fn allowance( + &mut self, + asset: &AssetIdOf, + owner: &AccountIdFor, + delegate: &AccountIdFor, + ) -> BalanceOf { + self.execute_with(|| { + pallet_assets::Pallet::::allowance( + asset.clone(), + owner, + delegate, + ) + }) } fn asset_exists(&mut self, asset: &AssetIdOf) -> bool { - self.execute_with(|| pallet_assets::Pallet::::asset_exists(asset.clone())) + self.execute_with(|| { + pallet_assets::Pallet::::asset_exists(asset.clone()) + }) } } @@ -81,20 +185,13 @@ mod test { fn api_works() { let mut sandbox = DefaultSandbox::default(); let token = 1; - let balance = sandbox.balance_of(&token, &DefaultSandbox::default_actor()); + let actor = DefaultSandbox::default_actor(); + let balance = sandbox.balance_of(&token, &actor); - sandbox - .create(&token, &DefaultSandbox::default_actor(), 1) - .unwrap(); - sandbox - .mint_into(&token, &DefaultSandbox::default_actor(), 100) - .unwrap(); - - assert_eq!( - sandbox.balance_of(&token, &DefaultSandbox::default_actor()), - balance + 100 - ); + sandbox.create(&token, &actor, 1).unwrap(); + sandbox.mint_into(&token, &actor, 100).unwrap(); + assert_eq!(sandbox.balance_of(&token, &actor), balance + 100); assert!(sandbox.asset_exists(&token)); } -} \ No newline at end of file +} From 061b4226e954370d47b4511a1c09227c866c5304 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Wed, 25 Sep 2024 23:01:48 +0700 Subject: [PATCH 04/43] feat: add set_metadata and destroy --- ink-sandbox/src/api/assets_api.rs | 58 ++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 4 deletions(-) diff --git a/ink-sandbox/src/api/assets_api.rs b/ink-sandbox/src/api/assets_api.rs index c8d3ddf..ea338b8 100644 --- a/ink-sandbox/src/api/assets_api.rs +++ b/ink-sandbox/src/api/assets_api.rs @@ -1,13 +1,13 @@ use frame_support::{ - sp_runtime::DispatchError, + sp_runtime::{traits::Dispatchable, DispatchError}, traits::fungibles::{ - approvals::{Inspect as ApprovalsInspect, Mutate as ApprovalsMutate}, - Create, Inspect, Mutate, + approvals::{Inspect as _, Mutate as _}, + Create, Destroy, Inspect, Mutate, }, }; use pallet_assets::Instance1; -use crate::{AccountIdFor, Sandbox}; +use crate::{AccountIdFor, RuntimeCall, Sandbox}; type AssetIdOf = as Inspect<::AccountId>>::AssetId; type AssetsOf = pallet_assets::Pallet; @@ -19,6 +19,9 @@ where T: Sandbox, T::Runtime: pallet_assets::Config, { + /// The runtime pallet-assets config. + type T: pallet_assets::Config; + /// Creates `value` amount of tokens and assigns them to `account`, increasing the total supply. /// /// # Arguments @@ -32,6 +35,28 @@ where min_balance: BalanceOf, ) -> Result<(), DispatchError>; + /// Start the destruction an existing fungible asset. + /// + /// # Arguments + /// * `asset` - ID of the asset. + fn destroy(&mut self, asset: &AssetIdOf) -> Result<(), DispatchError>; + + /// Start the destruction an existing fungible asset. + /// + /// # Arguments + /// * `asset` - ID of the asset. + /// * `name` - Token name. + /// * `symbol` - Token symbol. + /// * `decimals` - Token decimals. + fn set_metadata as Dispatchable>::RuntimeOrigin>>( + &mut self, + origin: Origin, + asset: &AssetIdOf, + name: Vec, + symbol: Vec, + decimals: u8, + ) -> Result<(), DispatchError>; + /// Approves `spender` to spend `value` amount of tokens on behalf of the caller. /// /// Successive calls of this method overwrite previous values. @@ -102,6 +127,8 @@ where T: Sandbox, T::Runtime: pallet_assets::Config, { + type T = T::Runtime; + fn create( &mut self, id: &AssetIdOf, @@ -111,6 +138,29 @@ where self.execute_with(|| as Create>>::create(id.clone(), owner.clone(), true, min_balance)) } + fn destroy(&mut self, asset: &AssetIdOf) -> Result<(), DispatchError> { + self.execute_with(|| as Destroy>>::start_destroy(asset.clone(), None)) + } + + fn set_metadata as Dispatchable>::RuntimeOrigin>>( + &mut self, + origin: Origin, + asset: &AssetIdOf, + name: Vec, + symbol: Vec, + decimals: u8, + ) -> Result<(), DispatchError> { + self.execute_with(|| { + pallet_assets::Pallet::::set_metadata( + origin.into(), + asset.clone().into(), + name, + symbol, + decimals, + ) + }) + } + fn mint_into( &mut self, asset: &AssetIdOf, From 04aa7b84b71bfd6bc0017f68bbd6cd55f488113c Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Wed, 25 Sep 2024 23:04:13 +0700 Subject: [PATCH 05/43] fix: formatting --- drink/src/session.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drink/src/session.rs b/drink/src/session.rs index e0dcdb8..f43ba0d 100644 --- a/drink/src/session.rs +++ b/drink/src/session.rs @@ -304,8 +304,9 @@ where }); let ret = match &result.result { - Ok(exec_result) if exec_result.result.did_revert() => - Err(SessionError::DeploymentReverted), + Ok(exec_result) if exec_result.result.did_revert() => { + Err(SessionError::DeploymentReverted) + }, Ok(exec_result) => { let address = exec_result.account_id.clone(); self.record.push_deploy_return(address.clone()); @@ -576,8 +577,9 @@ where }); let ret = match &result.result { - Ok(exec_result) if exec_result.did_revert() => - Err(SessionError::CallReverted(exec_result.data.clone())), + Ok(exec_result) if exec_result.did_revert() => { + Err(SessionError::CallReverted(exec_result.data.clone())) + }, Ok(exec_result) => { self.record.push_call_return(exec_result.data.clone()); self.record.last_call_return_decoded::() From ca063cca2a2620fa0c6c73ac755b5b9ed7ab45cc Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Wed, 25 Sep 2024 23:08:17 +0700 Subject: [PATCH 06/43] fix: rename destroy method --- ink-sandbox/src/api/assets_api.rs | 446 +++++++++++++++--------------- 1 file changed, 223 insertions(+), 223 deletions(-) diff --git a/ink-sandbox/src/api/assets_api.rs b/ink-sandbox/src/api/assets_api.rs index ea338b8..586fe54 100644 --- a/ink-sandbox/src/api/assets_api.rs +++ b/ink-sandbox/src/api/assets_api.rs @@ -1,9 +1,9 @@ use frame_support::{ - sp_runtime::{traits::Dispatchable, DispatchError}, - traits::fungibles::{ - approvals::{Inspect as _, Mutate as _}, - Create, Destroy, Inspect, Mutate, - }, + sp_runtime::{traits::Dispatchable, DispatchError}, + traits::fungibles::{ + approvals::{Inspect as _, Mutate as _}, + Create, Destroy, Inspect, Mutate, + }, }; use pallet_assets::Instance1; @@ -16,232 +16,232 @@ type BalanceOf = as Inspect<::Account /// Assets API for the sandbox. pub trait AssetsAPI where - T: Sandbox, - T::Runtime: pallet_assets::Config, + T: Sandbox, + T::Runtime: pallet_assets::Config, { - /// The runtime pallet-assets config. - type T: pallet_assets::Config; - - /// Creates `value` amount of tokens and assigns them to `account`, increasing the total supply. - /// - /// # Arguments - /// * `id` - ID of the new asset to be created. - /// * `owner` - The owner of the created asset. - /// * `min_balance` - The asset amount one account need at least. - fn create( - &mut self, - id: &AssetIdOf, - owner: &AccountIdFor, - min_balance: BalanceOf, - ) -> Result<(), DispatchError>; - - /// Start the destruction an existing fungible asset. - /// - /// # Arguments - /// * `asset` - ID of the asset. - fn destroy(&mut self, asset: &AssetIdOf) -> Result<(), DispatchError>; - - /// Start the destruction an existing fungible asset. - /// - /// # Arguments - /// * `asset` - ID of the asset. - /// * `name` - Token name. - /// * `symbol` - Token symbol. - /// * `decimals` - Token decimals. - fn set_metadata as Dispatchable>::RuntimeOrigin>>( - &mut self, - origin: Origin, - asset: &AssetIdOf, - name: Vec, - symbol: Vec, - decimals: u8, - ) -> Result<(), DispatchError>; - - /// Approves `spender` to spend `value` amount of tokens on behalf of the caller. - /// - /// Successive calls of this method overwrite previous values. - /// - /// # Arguments - /// * `asset` - ID of the asset. - /// * `spender` - The account that is allowed to spend the tokens. - /// * `value` - The number of tokens to approve. - fn approve( - &mut self, - asset: &AssetIdOf, - owner: &AccountIdFor, - delegate: &AccountIdFor, - amount: BalanceOf, - ) -> Result<(), DispatchError>; - - /// Creates `value` amount of tokens and assigns them to `account`, increasing the total supply. - /// - /// # Arguments - /// * `asset` - ID of the asset. - /// * `account` - The account to be credited with the created tokens. - /// * `value` - The number of tokens to mint. - fn mint_into( - &mut self, - asset: &AssetIdOf, - account: &AccountIdFor, - value: BalanceOf, - ) -> Result, DispatchError>; - - /// Returns the account balance for the specified `owner`. - /// - /// # Arguments - /// * `owner` - The account whose balance is being queried. - fn balance_of( - &mut self, - asset: &AssetIdOf, - owner: &AccountIdFor, - ) -> BalanceOf; - - /// Returns the total supply of the `asset`. - /// - /// # Arguments - /// * `asset` - ID of the asset. - fn total_supply(&mut self, asset: &AssetIdOf) -> BalanceOf; - - /// Returns the allowance for a `spender` approved by an `owner`. - /// - /// # Arguments - /// * `asset` - ID of the asset. - /// * `owner` - The account that owns the tokens. - /// * `spender` - The account that is allowed to spend the tokens. - fn allowance( - &mut self, - asset: &AssetIdOf, - owner: &AccountIdFor, - delegate: &AccountIdFor, - ) -> BalanceOf; - - /// Check if the asset is created. - /// - /// # Arguments - /// * `asset` - ID of the asset. - fn asset_exists(&mut self, asset: &AssetIdOf) -> bool; + /// The runtime pallet-assets config. + type T: pallet_assets::Config; + + /// Creates `value` amount of tokens and assigns them to `account`, increasing the total supply. + /// + /// # Arguments + /// * `id` - ID of the new asset to be created. + /// * `owner` - The owner of the created asset. + /// * `min_balance` - The asset amount one account need at least. + fn create( + &mut self, + id: &AssetIdOf, + owner: &AccountIdFor, + min_balance: BalanceOf, + ) -> Result<(), DispatchError>; + + /// Start the destruction an existing fungible asset. + /// + /// # Arguments + /// * `asset` - ID of the asset. + fn start_destroy(&mut self, asset: &AssetIdOf) -> Result<(), DispatchError>; + + /// Start the destruction an existing fungible asset. + /// + /// # Arguments + /// * `asset` - ID of the asset. + /// * `name` - Token name. + /// * `symbol` - Token symbol. + /// * `decimals` - Token decimals. + fn set_metadata as Dispatchable>::RuntimeOrigin>>( + &mut self, + origin: Origin, + asset: &AssetIdOf, + name: Vec, + symbol: Vec, + decimals: u8, + ) -> Result<(), DispatchError>; + + /// Approves `spender` to spend `value` amount of tokens on behalf of the caller. + /// + /// Successive calls of this method overwrite previous values. + /// + /// # Arguments + /// * `asset` - ID of the asset. + /// * `spender` - The account that is allowed to spend the tokens. + /// * `value` - The number of tokens to approve. + fn approve( + &mut self, + asset: &AssetIdOf, + owner: &AccountIdFor, + delegate: &AccountIdFor, + amount: BalanceOf, + ) -> Result<(), DispatchError>; + + /// Creates `value` amount of tokens and assigns them to `account`, increasing the total supply. + /// + /// # Arguments + /// * `asset` - ID of the asset. + /// * `account` - The account to be credited with the created tokens. + /// * `value` - The number of tokens to mint. + fn mint_into( + &mut self, + asset: &AssetIdOf, + account: &AccountIdFor, + value: BalanceOf, + ) -> Result, DispatchError>; + + /// Returns the account balance for the specified `owner`. + /// + /// # Arguments + /// * `owner` - The account whose balance is being queried. + fn balance_of( + &mut self, + asset: &AssetIdOf, + owner: &AccountIdFor, + ) -> BalanceOf; + + /// Returns the total supply of the `asset`. + /// + /// # Arguments + /// * `asset` - ID of the asset. + fn total_supply(&mut self, asset: &AssetIdOf) -> BalanceOf; + + /// Returns the allowance for a `spender` approved by an `owner`. + /// + /// # Arguments + /// * `asset` - ID of the asset. + /// * `owner` - The account that owns the tokens. + /// * `spender` - The account that is allowed to spend the tokens. + fn allowance( + &mut self, + asset: &AssetIdOf, + owner: &AccountIdFor, + delegate: &AccountIdFor, + ) -> BalanceOf; + + /// Check if the asset is created. + /// + /// # Arguments + /// * `asset` - ID of the asset. + fn asset_exists(&mut self, asset: &AssetIdOf) -> bool; } impl AssetsAPI for T where - T: Sandbox, - T::Runtime: pallet_assets::Config, + T: Sandbox, + T::Runtime: pallet_assets::Config, { - type T = T::Runtime; - - fn create( - &mut self, - id: &AssetIdOf, - owner: &AccountIdFor, - min_balance: BalanceOf, - ) -> Result<(), DispatchError> { - self.execute_with(|| as Create>>::create(id.clone(), owner.clone(), true, min_balance)) - } - - fn destroy(&mut self, asset: &AssetIdOf) -> Result<(), DispatchError> { - self.execute_with(|| as Destroy>>::start_destroy(asset.clone(), None)) - } - - fn set_metadata as Dispatchable>::RuntimeOrigin>>( - &mut self, - origin: Origin, - asset: &AssetIdOf, - name: Vec, - symbol: Vec, - decimals: u8, - ) -> Result<(), DispatchError> { - self.execute_with(|| { - pallet_assets::Pallet::::set_metadata( - origin.into(), - asset.clone().into(), - name, - symbol, - decimals, - ) - }) - } - - fn mint_into( - &mut self, - asset: &AssetIdOf, - account: &AccountIdFor, - value: BalanceOf, - ) -> Result, DispatchError> { - self.execute_with(|| { - pallet_assets::Pallet::::mint_into(asset.clone(), account, value) - }) - } - - fn approve( - &mut self, - asset: &AssetIdOf, - owner: &AccountIdFor, - delegate: &AccountIdFor, - amount: BalanceOf, - ) -> Result<(), DispatchError> { - self.execute_with(|| { - pallet_assets::Pallet::::approve( - asset.clone(), - owner, - delegate, - amount, - ) - }) - } - - fn balance_of( - &mut self, - asset: &AssetIdOf, - owner: &AccountIdFor, - ) -> BalanceOf { - self.execute_with(|| { - pallet_assets::Pallet::::balance(asset.clone(), owner) - }) - } - - fn total_supply(&mut self, asset: &AssetIdOf) -> BalanceOf { - self.execute_with(|| { - pallet_assets::Pallet::::total_supply(asset.clone()) - }) - } - - fn allowance( - &mut self, - asset: &AssetIdOf, - owner: &AccountIdFor, - delegate: &AccountIdFor, - ) -> BalanceOf { - self.execute_with(|| { - pallet_assets::Pallet::::allowance( - asset.clone(), - owner, - delegate, - ) - }) - } - - fn asset_exists(&mut self, asset: &AssetIdOf) -> bool { - self.execute_with(|| { - pallet_assets::Pallet::::asset_exists(asset.clone()) - }) - } + type T = T::Runtime; + + fn create( + &mut self, + id: &AssetIdOf, + owner: &AccountIdFor, + min_balance: BalanceOf, + ) -> Result<(), DispatchError> { + self.execute_with(|| as Create>>::create(id.clone(), owner.clone(), true, min_balance)) + } + + fn start_destroy(&mut self, asset: &AssetIdOf) -> Result<(), DispatchError> { + self.execute_with(|| as Destroy>>::start_destroy(asset.clone(), None)) + } + + fn set_metadata as Dispatchable>::RuntimeOrigin>>( + &mut self, + origin: Origin, + asset: &AssetIdOf, + name: Vec, + symbol: Vec, + decimals: u8, + ) -> Result<(), DispatchError> { + self.execute_with(|| { + pallet_assets::Pallet::::set_metadata( + origin.into(), + asset.clone().into(), + name, + symbol, + decimals, + ) + }) + } + + fn mint_into( + &mut self, + asset: &AssetIdOf, + account: &AccountIdFor, + value: BalanceOf, + ) -> Result, DispatchError> { + self.execute_with(|| { + pallet_assets::Pallet::::mint_into(asset.clone(), account, value) + }) + } + + fn approve( + &mut self, + asset: &AssetIdOf, + owner: &AccountIdFor, + delegate: &AccountIdFor, + amount: BalanceOf, + ) -> Result<(), DispatchError> { + self.execute_with(|| { + pallet_assets::Pallet::::approve( + asset.clone(), + owner, + delegate, + amount, + ) + }) + } + + fn balance_of( + &mut self, + asset: &AssetIdOf, + owner: &AccountIdFor, + ) -> BalanceOf { + self.execute_with(|| { + pallet_assets::Pallet::::balance(asset.clone(), owner) + }) + } + + fn total_supply(&mut self, asset: &AssetIdOf) -> BalanceOf { + self.execute_with(|| { + pallet_assets::Pallet::::total_supply(asset.clone()) + }) + } + + fn allowance( + &mut self, + asset: &AssetIdOf, + owner: &AccountIdFor, + delegate: &AccountIdFor, + ) -> BalanceOf { + self.execute_with(|| { + pallet_assets::Pallet::::allowance( + asset.clone(), + owner, + delegate, + ) + }) + } + + fn asset_exists(&mut self, asset: &AssetIdOf) -> bool { + self.execute_with(|| { + pallet_assets::Pallet::::asset_exists(asset.clone()) + }) + } } #[cfg(test)] mod test { - use super::*; - use crate::DefaultSandbox; - #[test] - fn api_works() { - let mut sandbox = DefaultSandbox::default(); - let token = 1; - let actor = DefaultSandbox::default_actor(); - let balance = sandbox.balance_of(&token, &actor); - - sandbox.create(&token, &actor, 1).unwrap(); - sandbox.mint_into(&token, &actor, 100).unwrap(); - assert_eq!(sandbox.balance_of(&token, &actor), balance + 100); - - assert!(sandbox.asset_exists(&token)); - } + use super::*; + use crate::DefaultSandbox; + #[test] + fn api_works() { + let mut sandbox = DefaultSandbox::default(); + let token = 1; + let actor = DefaultSandbox::default_actor(); + let balance = sandbox.balance_of(&token, &actor); + + sandbox.create(&token, &actor, 1).unwrap(); + sandbox.mint_into(&token, &actor, 100).unwrap(); + assert_eq!(sandbox.balance_of(&token, &actor), balance + 100); + + assert!(sandbox.asset_exists(&token)); + } } From 513c0f72fc4542b7f66785f8b3d2816616a5e887 Mon Sep 17 00:00:00 2001 From: Daanvdplas Date: Thu, 26 Sep 2024 20:24:55 +0200 Subject: [PATCH 07/43] refactor: repo structure --- Cargo.lock | 3095 +++++++++++++---- Cargo.toml | 53 +- README.md | 115 +- CHANGELOG.md => crates/drink/CHANGELOG.md | 2 +- LICENSE => crates/drink/LICENSE | 0 Makefile => crates/drink/Makefile | 0 crates/drink/README.md | 113 + crates/drink/drink-cli/Cargo.toml | 24 + .../drink/drink-cli}/README.md | 0 .../drink-cli}/src/app_state/contracts.rs | 0 .../drink/drink-cli}/src/app_state/mod.rs | 0 .../drink/drink-cli}/src/app_state/output.rs | 0 .../drink/drink-cli}/src/app_state/print.rs | 0 .../drink-cli}/src/app_state/user_input.rs | 0 .../drink/drink-cli}/src/cli.rs | 0 .../drink/drink-cli}/src/executor/contract.rs | 0 .../drink/drink-cli}/src/executor/error.rs | 0 .../drink/drink-cli}/src/executor/mod.rs | 2 +- .../drink/drink-cli}/src/main.rs | 0 .../drink/drink-cli}/src/ui/contracts.rs | 0 .../drink/drink-cli}/src/ui/current_env.rs | 0 .../drink/drink-cli}/src/ui/footer.rs | 0 .../drink/drink-cli}/src/ui/help.rs | 0 .../drink/drink-cli}/src/ui/layout.rs | 0 .../drink/drink-cli}/src/ui/mod.rs | 0 .../drink/drink-cli}/src/ui/output.rs | 0 .../drink/drink-cli}/src/ui/user_input.rs | 0 crates/drink/drink/Cargo.toml | 50 + {drink => crates/drink/drink}/src/errors.rs | 4 +- {drink => crates/drink/drink}/src/lib.rs | 17 +- .../drink}/src/pallet_contracts_debugging.rs | 0 .../intercepting.rs | 2 +- .../src/pallet_contracts_debugging/runtime.rs | 2 +- .../src/pallet_contracts_debugging/tracing.rs | 2 +- {drink => crates/drink/drink}/src/session.rs | 31 +- .../drink/drink}/src/session/bundle.rs | 0 .../drink/drink}/src/session/error.rs | 2 +- .../drink/drink}/src/session/mock.rs | 0 .../drink/drink}/src/session/mock/contract.rs | 2 +- .../drink/drink}/src/session/mock/error.rs | 2 +- .../drink}/src/session/mock/extension.rs | 2 +- .../drink/drink}/src/session/mocking_api.rs | 0 .../drink/drink}/src/session/record.rs | 2 +- .../drink/drink}/src/session/transcoding.rs | 0 .../drink/drink}/test-macro/Cargo.toml | 14 +- .../drink}/test-macro/src/bundle_provision.rs | 0 .../test-macro/src/contract_building.rs | 0 .../drink/drink}/test-macro/src/lib.rs | 9 +- .../drink/drink}/test-resources/dummy.wat | 0 .../examples}/chain-extension/Cargo.lock | 0 .../examples}/chain-extension/Cargo.toml | 2 +- .../drink/examples}/chain-extension/README.md | 2 +- .../src/chain_extension_ink_side.rs | 0 .../src/chain_extension_runtime_side.rs | 0 .../examples}/chain-extension/src/lib.rs | 4 +- .../examples}/contract-events/Cargo.lock | 0 .../examples}/contract-events/Cargo.toml | 0 .../drink/examples}/contract-events/README.md | 0 .../drink/examples}/contract-events/lib.rs | 6 +- .../cross-contract-call-tracing/Cargo.lock | 0 .../cross-contract-call-tracing/Cargo.toml | 0 .../cross-contract-call-tracing/README.md | 0 .../cross-contract-call-tracing/lib.rs | 10 +- .../drink/examples}/dry-running/Cargo.lock | 0 .../drink/examples}/dry-running/Cargo.toml | 0 .../drink/examples}/dry-running/README.md | 0 .../drink/examples}/dry-running/lib.rs | 10 +- .../drink/examples}/flipper/Cargo.lock | 0 .../drink/examples}/flipper/Cargo.toml | 1 - .../drink/examples}/flipper/lib.rs | 16 +- .../drink/examples}/mocking/Cargo.lock | 1243 ++----- .../drink/examples}/mocking/Cargo.toml | 1 + .../drink/examples}/mocking/README.md | 0 .../drink/examples}/mocking/lib.rs | 6 +- .../examples}/multiple-contracts/Cargo.lock | 1251 ++----- .../examples}/multiple-contracts/Cargo.toml | 0 .../examples}/multiple-contracts/README.md | 0 .../drink/examples}/multiple-contracts/lib.rs | 8 +- .../quick-start-with-drink/Cargo.lock | 0 .../quick-start-with-drink/Cargo.toml | 0 .../quick-start-with-drink/README.md | 0 .../examples}/quick-start-with-drink/lib.rs | 20 +- .../examples}/runtime-interaction/Cargo.lock | 0 .../examples}/runtime-interaction/Cargo.toml | 0 .../examples}/runtime-interaction/README.md | 0 .../examples}/runtime-interaction/lib.rs | 0 .../drink/resources}/blockchain-onion.svg | 0 .../drink/resources}/testing-strategies.svg | 0 .../ink-sandbox}/.gitignore | 0 .../ink-sandbox}/Cargo.lock | 0 crates/ink-sandbox/Cargo.toml | 47 + .../ink-sandbox}/src/api.rs | 0 .../ink-sandbox}/src/api/assets_api.rs | 11 +- .../ink-sandbox}/src/api/balances_api.rs | 0 .../ink-sandbox}/src/api/contracts_api.rs | 0 .../ink-sandbox}/src/api/system_api.rs | 0 .../ink-sandbox}/src/api/timestamp_api.rs | 0 .../ink-sandbox}/src/lib.rs | 8 +- .../ink-sandbox}/src/macros.rs | 165 +- .../ink-sandbox}/test-resources/dummy.wat | 0 crates/pop-drink/Cargo.lock | 7 + crates/pop-drink/Cargo.toml | 21 + crates/pop-drink/README.md | 60 + crates/pop-drink/src/lib.rs | 13 + drink-cli/Cargo.toml | 22 - drink/Cargo.toml | 39 - ink-sandbox/Cargo.toml | 49 - 107 files changed, 3745 insertions(+), 2822 deletions(-) rename CHANGELOG.md => crates/drink/CHANGELOG.md (97%) rename LICENSE => crates/drink/LICENSE (100%) rename Makefile => crates/drink/Makefile (100%) create mode 100644 crates/drink/README.md create mode 100644 crates/drink/drink-cli/Cargo.toml rename {drink-cli => crates/drink/drink-cli}/README.md (100%) rename {drink-cli => crates/drink/drink-cli}/src/app_state/contracts.rs (100%) rename {drink-cli => crates/drink/drink-cli}/src/app_state/mod.rs (100%) rename {drink-cli => crates/drink/drink-cli}/src/app_state/output.rs (100%) rename {drink-cli => crates/drink/drink-cli}/src/app_state/print.rs (100%) rename {drink-cli => crates/drink/drink-cli}/src/app_state/user_input.rs (100%) rename {drink-cli => crates/drink/drink-cli}/src/cli.rs (100%) rename {drink-cli => crates/drink/drink-cli}/src/executor/contract.rs (100%) rename {drink-cli => crates/drink/drink-cli}/src/executor/error.rs (100%) rename {drink-cli => crates/drink/drink-cli}/src/executor/mod.rs (96%) rename {drink-cli => crates/drink/drink-cli}/src/main.rs (100%) rename {drink-cli => crates/drink/drink-cli}/src/ui/contracts.rs (100%) rename {drink-cli => crates/drink/drink-cli}/src/ui/current_env.rs (100%) rename {drink-cli => crates/drink/drink-cli}/src/ui/footer.rs (100%) rename {drink-cli => crates/drink/drink-cli}/src/ui/help.rs (100%) rename {drink-cli => crates/drink/drink-cli}/src/ui/layout.rs (100%) rename {drink-cli => crates/drink/drink-cli}/src/ui/mod.rs (100%) rename {drink-cli => crates/drink/drink-cli}/src/ui/output.rs (100%) rename {drink-cli => crates/drink/drink-cli}/src/ui/user_input.rs (100%) create mode 100644 crates/drink/drink/Cargo.toml rename {drink => crates/drink/drink}/src/errors.rs (94%) rename {drink => crates/drink/drink}/src/lib.rs (65%) rename {drink => crates/drink/drink}/src/pallet_contracts_debugging.rs (100%) rename {drink => crates/drink/drink}/src/pallet_contracts_debugging/intercepting.rs (95%) rename {drink => crates/drink/drink}/src/pallet_contracts_debugging/runtime.rs (98%) rename {drink => crates/drink/drink}/src/pallet_contracts_debugging/tracing.rs (93%) rename {drink => crates/drink/drink}/src/session.rs (94%) rename {drink => crates/drink/drink}/src/session/bundle.rs (100%) rename {drink => crates/drink/drink}/src/session/error.rs (98%) rename {drink => crates/drink/drink}/src/session/mock.rs (100%) rename {drink => crates/drink/drink}/src/session/mock/contract.rs (97%) rename {drink => crates/drink/drink}/src/session/mock/error.rs (86%) rename {drink => crates/drink/drink}/src/session/mock/extension.rs (98%) rename {drink => crates/drink/drink}/src/session/mocking_api.rs (100%) rename {drink => crates/drink/drink}/src/session/record.rs (99%) rename {drink => crates/drink/drink}/src/session/transcoding.rs (100%) rename {drink => crates/drink/drink}/test-macro/Cargo.toml (68%) rename {drink => crates/drink/drink}/test-macro/src/bundle_provision.rs (100%) rename {drink => crates/drink/drink}/test-macro/src/contract_building.rs (100%) rename {drink => crates/drink/drink}/test-macro/src/lib.rs (96%) rename {drink => crates/drink/drink}/test-resources/dummy.wat (100%) rename {examples => crates/drink/examples}/chain-extension/Cargo.lock (100%) rename {examples => crates/drink/examples}/chain-extension/Cargo.toml (94%) rename {examples => crates/drink/examples}/chain-extension/README.md (96%) rename {examples => crates/drink/examples}/chain-extension/src/chain_extension_ink_side.rs (100%) rename {examples => crates/drink/examples}/chain-extension/src/chain_extension_runtime_side.rs (100%) rename {examples => crates/drink/examples}/chain-extension/src/lib.rs (96%) rename {examples => crates/drink/examples}/contract-events/Cargo.lock (100%) rename {examples => crates/drink/examples}/contract-events/Cargo.toml (100%) rename {examples => crates/drink/examples}/contract-events/README.md (100%) rename {examples => crates/drink/examples}/contract-events/lib.rs (91%) rename {examples => crates/drink/examples}/cross-contract-call-tracing/Cargo.lock (100%) rename {examples => crates/drink/examples}/cross-contract-call-tracing/Cargo.toml (100%) rename {examples => crates/drink/examples}/cross-contract-call-tracing/README.md (100%) rename {examples => crates/drink/examples}/cross-contract-call-tracing/lib.rs (96%) rename {examples => crates/drink/examples}/dry-running/Cargo.lock (100%) rename {examples => crates/drink/examples}/dry-running/Cargo.toml (100%) rename {examples => crates/drink/examples}/dry-running/README.md (100%) rename {examples => crates/drink/examples}/dry-running/lib.rs (94%) rename {examples => crates/drink/examples}/flipper/Cargo.lock (100%) rename {examples => crates/drink/examples}/flipper/Cargo.toml (99%) rename {examples => crates/drink/examples}/flipper/lib.rs (81%) rename {examples => crates/drink/examples}/mocking/Cargo.lock (85%) rename {examples => crates/drink/examples}/mocking/Cargo.toml (97%) rename {examples => crates/drink/examples}/mocking/README.md (100%) rename {examples => crates/drink/examples}/mocking/lib.rs (96%) rename {examples => crates/drink/examples}/multiple-contracts/Cargo.lock (85%) rename {examples => crates/drink/examples}/multiple-contracts/Cargo.toml (100%) rename {examples => crates/drink/examples}/multiple-contracts/README.md (100%) rename {examples => crates/drink/examples}/multiple-contracts/lib.rs (90%) rename {examples => crates/drink/examples}/quick-start-with-drink/Cargo.lock (100%) rename {examples => crates/drink/examples}/quick-start-with-drink/Cargo.toml (100%) rename {examples => crates/drink/examples}/quick-start-with-drink/README.md (100%) rename {examples => crates/drink/examples}/quick-start-with-drink/lib.rs (95%) rename {examples => crates/drink/examples}/runtime-interaction/Cargo.lock (100%) rename {examples => crates/drink/examples}/runtime-interaction/Cargo.toml (100%) rename {examples => crates/drink/examples}/runtime-interaction/README.md (100%) rename {examples => crates/drink/examples}/runtime-interaction/lib.rs (100%) rename {resources => crates/drink/resources}/blockchain-onion.svg (100%) rename {resources => crates/drink/resources}/testing-strategies.svg (100%) rename {ink-sandbox => crates/ink-sandbox}/.gitignore (100%) rename {ink-sandbox => crates/ink-sandbox}/Cargo.lock (100%) create mode 100644 crates/ink-sandbox/Cargo.toml rename {ink-sandbox => crates/ink-sandbox}/src/api.rs (100%) rename {ink-sandbox => crates/ink-sandbox}/src/api/assets_api.rs (95%) rename {ink-sandbox => crates/ink-sandbox}/src/api/balances_api.rs (100%) rename {ink-sandbox => crates/ink-sandbox}/src/api/contracts_api.rs (100%) rename {ink-sandbox => crates/ink-sandbox}/src/api/system_api.rs (100%) rename {ink-sandbox => crates/ink-sandbox}/src/api/timestamp_api.rs (100%) rename {ink-sandbox => crates/ink-sandbox}/src/lib.rs (92%) rename {ink-sandbox => crates/ink-sandbox}/src/macros.rs (71%) rename {ink-sandbox => crates/ink-sandbox}/test-resources/dummy.wat (100%) create mode 100644 crates/pop-drink/Cargo.lock create mode 100644 crates/pop-drink/Cargo.toml create mode 100644 crates/pop-drink/README.md create mode 100644 crates/pop-drink/src/lib.rs delete mode 100644 drink-cli/Cargo.toml delete mode 100644 drink/Cargo.toml delete mode 100644 ink-sandbox/Cargo.toml diff --git a/Cargo.lock b/Cargo.lock index e6079a1..74ded32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,18 +14,18 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ - "gimli", + "gimli 0.31.0", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aead" @@ -52,9 +52,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -91,47 +91,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -139,9 +140,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.81" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "approx" @@ -163,7 +164,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -297,52 +298,52 @@ dependencies = [ [[package]] name = "array-bytes" -version = "6.2.2" +version = "6.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f840fb7195bcfc5e17ea40c26e5ce6d5b9ce5d584466e17703209657e459ae0" +checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", - "object", + "object 0.36.4", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -365,9 +366,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" @@ -399,9 +400,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitvec" @@ -411,6 +412,7 @@ checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", "radium", + "serde", "tap", "wyz", ] @@ -455,11 +457,11 @@ dependencies = [ [[package]] name = "bollard" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83545367eb6428eb35c29cdec3a1f350fa8d6d9085d59a7d7bcb637f2e38db5a" +checksum = "0aed08d3adb6ebe0eff737115056652670ae290f177759aac19c30456135f94c" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bollard-stubs", "bytes", "futures-core", @@ -509,6 +511,18 @@ dependencies = [ "serde", ] +[[package]] +name = "bp-xcm-bridge-hub-router" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7dae4d1ec894ee920195dd39070b279ef3c1d4d078c3fcf7336c93a1d502a9d" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", +] + [[package]] name = "brownstone" version = "1.1.0" @@ -520,18 +534,27 @@ dependencies = [ [[package]] name = "bs58" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ "tinyvec", ] +[[package]] +name = "build-helper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" +dependencies = [ + "semver 0.6.0", +] + [[package]] name = "bumpalo" -version = "3.15.4" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-slice-cast" @@ -541,9 +564,9 @@ checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] name = "bytemuck" -version = "1.14.3" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" +checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" [[package]] name = "byteorder" @@ -553,26 +576,40 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "camino" -version = "1.1.6" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.7" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.23", "serde", + "serde_json", + "thiserror", ] [[package]] @@ -583,7 +620,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -597,19 +634,20 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" [[package]] name = "cc" -version = "1.0.90" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] name = "cfg-expr" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa50868b64a9a6fda9d593ce778849ea8715cd2a3d2cc17ffdb4a2f2f2f1961d" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" dependencies = [ "smallvec", ] @@ -622,22 +660,31 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.35" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.4", + "windows-targets 0.52.6", +] + +[[package]] +name = "ckb-merkle-mountain-range" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ccb671c5921be8a84686e6212ca184cb1d7c51cadcdbfcbd1cc3f042f5dfb8" +dependencies = [ + "cfg-if", ] [[package]] name = "clap" -version = "4.5.2" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" +checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" dependencies = [ "clap_builder", "clap_derive", @@ -645,33 +692,33 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.0", + "strsim 0.11.1", ] [[package]] name = "clap_derive" -version = "4.5.0" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "codespan-reporting" @@ -685,9 +732,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "colored" @@ -705,6 +752,19 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.52.0", +] + [[package]] name = "const-oid" version = "0.9.6" @@ -753,9 +813,9 @@ dependencies = [ [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "constcat" @@ -765,30 +825,30 @@ checksum = "cd7e35aee659887cbfb97aaf227ac12cad1a9d7c71e55ff3376839ed4e282d08" [[package]] name = "contract-build" -version = "4.0.0" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f4e6c03a261bc36c858fb67f12c21045d372b731b2239372584ded4648b3538" +checksum = "d30f629d8cb26692c4e5f4155e8ab37649f1b2fd0abab64a4c1b3c95c9bcf3df" dependencies = [ "anyhow", "blake2", "bollard", - "cargo_metadata", + "cargo_metadata 0.18.1", "clap", "colored", "contract-metadata", "crossterm 0.27.0", "duct", - "heck", + "heck 0.5.0", "hex", "impl-serde", "parity-scale-codec", "parity-wasm", "regex", "rustc_version", - "semver", + "semver 1.0.23", "serde", "serde_json", - "strum 0.26.2", + "strum 0.26.3", "tempfile", "term_size", "tokio", @@ -805,13 +865,13 @@ dependencies = [ [[package]] name = "contract-metadata" -version = "4.0.0" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d239a78947aa2d0c63a9936754927551f275d3064a221384427c2c2ff1504b" +checksum = "dd54ed69476dc2076d6ebda17351babe1c2f33751170877f66719e8129078d3a" dependencies = [ "anyhow", "impl-serde", - "semver", + "semver 1.0.23", "serde", "serde_json", "url", @@ -819,9 +879,9 @@ dependencies = [ [[package]] name = "contract-transcode" -version = "4.0.0" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d300ad8af2ba7be1bb77f88be352bdb2e7a78daf998d727128dd090054e1ad3" +checksum = "6c7e979c22d15a6b0615b039bf69427bc0f96c6a984943fa4f4e91149ac2712e" dependencies = [ "anyhow", "base58", @@ -829,7 +889,7 @@ dependencies = [ "contract-metadata", "escape8259", "hex", - "indexmap 2.2.5", + "indexmap 2.5.0", "ink_env", "ink_metadata", "itertools 0.12.1", @@ -840,7 +900,7 @@ dependencies = [ "scale-info", "serde", "serde_json", - "strsim 0.11.0", + "strsim 0.11.1", "thiserror", "tracing", ] @@ -862,33 +922,33 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crossterm" @@ -899,7 +959,7 @@ dependencies = [ "bitflags 1.3.2", "crossterm_winapi", "libc", - "mio", + "mio 0.8.11", "parking_lot", "signal-hook", "signal-hook-mio", @@ -912,10 +972,10 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "crossterm_winapi", "libc", - "mio", + "mio 0.8.11", "parking_lot", "signal-hook", "signal-hook-mio", @@ -970,18 +1030,245 @@ dependencies = [ "subtle", ] +[[package]] +name = "cumulus-pallet-aura-ext" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e8af48090936c45483d489ee681acb54277763586b53fa3dbd17173aa474fc" +dependencies = [ + "cumulus-pallet-parachain-system", + "frame-support", + "frame-system", + "pallet-aura", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-consensus-aura", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "cumulus-pallet-parachain-system" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300d5509bd8ac95bafe158fa475278315175a4eb0422c2cd82e08e8b9dde035c" +dependencies = [ + "bytes", + "cumulus-pallet-parachain-system-proc-macro", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-primitives-proof-size-hostfunction", + "environmental", + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-message-queue", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "scale-info", + "sp-core", + "sp-externalities", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", + "sp-version", + "staging-xcm", + "staging-xcm-builder", + "trie-db", +] + +[[package]] +name = "cumulus-pallet-parachain-system-proc-macro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "befbaf3a1ce23ac8476481484fef5f4d500cbd15b4dad6380ce1d28134b0c1f7" +dependencies = [ + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "cumulus-pallet-session-benchmarking" +version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "506daacefa861aa2909b64f26e76495ce029227fd8355b97e074cc1d5dc54ab2" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-session", + "parity-scale-codec", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "cumulus-pallet-xcm" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d5224285f60e5159bab549f458079d606a7f95ef779def8b89f1a244dc7cf81" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", + "staging-xcm", +] + +[[package]] +name = "cumulus-pallet-xcmp-queue" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0adf5409618b21e754fef0ac70f257878d22d61c48fdeefcab666835dcb8e0f0" +dependencies = [ + "bounded-collections", + "bp-xcm-bridge-hub-router", + "cumulus-primitives-core", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-message-queue", + "parity-scale-codec", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", +] + +[[package]] +name = "cumulus-primitives-aura" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e7977947ad43a4cbc532ca33abcde136ae3deffdc7168b2ae253d73ccd371e4" +dependencies = [ + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-primitives", + "sp-api", + "sp-consensus-aura", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "cumulus-primitives-core" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "751e64b89a839d5cfabebc1c797936e5eee791d0fa2322d91e86f8440a743ddb" +dependencies = [ + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-primitives", + "scale-info", + "sp-api", + "sp-runtime", + "sp-std", + "sp-trie", + "staging-xcm", +] + +[[package]] +name = "cumulus-primitives-parachain-inherent" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df521e13b48278b86d02c61d6e44036d6d263deb5aaec4838b1751da8988d3d2" +dependencies = [ + "async-trait", + "cumulus-primitives-core", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", + "sp-std", + "sp-trie", +] + +[[package]] +name = "cumulus-primitives-proof-size-hostfunction" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f973d2a7262c90e48dcd42062bcb1e0fbf48bbcdac4ea6df3d85212d8d8be5d" +dependencies = [ + "sp-externalities", + "sp-runtime-interface", + "sp-trie", +] + +[[package]] +name = "cumulus-primitives-storage-weight-reclaim" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29a7e13063f593f21534a7b64c96f311c40cd4d3c72649e0bd063a34506fdd70" +dependencies = [ + "cumulus-primitives-core", + "cumulus-primitives-proof-size-hostfunction", + "docify", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "cumulus-primitives-utility" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05742c520065e3870d419683113ed7f6d35de66f0c80af6828e7878d1bb0ea94" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "log", + "pallet-asset-conversion", + "parity-scale-codec", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "sp-io", + "sp-runtime", + "sp-std", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", +] + [[package]] name = "curve25519-dalek" -version = "4.1.2" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "platforms", "rustc_version", "subtle", "zeroize", @@ -995,14 +1282,14 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "cxx" -version = "1.0.119" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "635179be18797d7e10edb9cd06c859580237750c7351f39ed9b298bfc17544ad" +checksum = "54ccead7d199d584d139148b04b4a368d1ec7556a1d9ea2548febb1b9d49f9a4" dependencies = [ "cc", "cxxbridge-flags", @@ -1012,9 +1299,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.119" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9324397d262f63ef77eb795d900c0d682a34a43ac0932bec049ed73055d52f63" +checksum = "c77953e99f01508f89f55c494bfa867171ef3a6c8cea03d26975368f2121a5c1" dependencies = [ "cc", "codespan-reporting", @@ -1022,24 +1309,24 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "cxxbridge-flags" -version = "1.0.119" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a87ff7342ffaa54b7c61618e0ce2bbcf827eba6d55b923b83d82551acbbecfe5" +checksum = "65777e06cc48f0cb0152024c77d6cf9e4bdb4408e7b48bea993d42fa0f5b02b6" [[package]] name = "cxxbridge-macro" -version = "1.0.119" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70b5b86cf65fa0626d85720619d80b288013477a91a0389fa8bc716bf4903ad1" +checksum = "98532a60dedaebc4848cb2cba5023337cc9ea3af16a5b062633fabfd9f18fb60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -1054,12 +1341,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.8", - "darling_macro 0.20.8", + "darling_core 0.20.10", + "darling_macro 0.20.10", ] [[package]] @@ -1078,16 +1365,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn 2.0.58", + "strsim 0.11.1", + "syn 2.0.77", ] [[package]] @@ -1103,20 +1390,20 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.20.8", + "darling_core 0.20.10", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", @@ -1151,20 +1438,20 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case 0.4.0", "proc-macro2", "quote", "rustc_version", - "syn 1.0.109", + "syn 2.0.77", ] [[package]] @@ -1209,7 +1496,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.58", + "syn 2.0.77", "termcolor", "toml", "walkdir", @@ -1217,9 +1504,9 @@ dependencies = [ [[package]] name = "downcast-rs" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "drink" @@ -1260,14 +1547,14 @@ dependencies = [ name = "drink-test-macro" version = "0.17.0" dependencies = [ - "cargo_metadata", + "cargo_metadata 0.18.1", "contract-build", "contract-metadata", "convert_case 0.6.0", - "darling 0.20.8", + "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -1356,7 +1643,7 @@ checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ "curve25519-dalek", "ed25519", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "rand_core", "sha2 0.10.8", @@ -1365,9 +1652,9 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elliptic-curve" @@ -1390,55 +1677,96 @@ dependencies = [ ] [[package]] -name = "environmental" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" - -[[package]] -name = "equivalent" -version = "1.0.1" +name = "encode_unicode" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] -name = "errno" -version = "0.3.8" +name = "enumflags2" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" dependencies = [ - "libc", - "windows-sys 0.52.0", + "enumflags2_derive", ] [[package]] -name = "escape8259" -version = "0.5.2" +name = "enumflags2_derive" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4911e3666fcd7826997b4745c8224295a6f3072f1418c3067b97a67557ee" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ - "rustversion", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "enumn" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "environmental" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", ] +[[package]] +name = "escape8259" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5692dd7b5a1978a5aeb0ce83b7655c58ca8efdcb79d21036ea249da95afec2c6" + [[package]] name = "expander" -version = "2.1.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e83c02035136f1592a47964ea60c05a50e4ed8b5892cfac197063850898d4d" +checksum = "e2c470c71d91ecbd179935b24170459e926382eaaa86b590b78814e180d8a8e2" dependencies = [ "blake2", + "file-guard", "fs-err", - "prettier-please", + "prettyplease", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "ff" @@ -1452,9 +1780,31 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.6" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "file-guard" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21ef72acf95ec3d7dbf61275be556299490a245f017cf084bd23b4f68cf9407c" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "filetime" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1676f435fc1dadde4d03e43f5d62b259e1ce5f40bd4ffb21db2b42ebe59c1382" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.59.0", +] [[package]] name = "fixed-hash" @@ -1483,6 +1833,17 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fortuples" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87630a8087e9cac4b7edfb6ee5e250ddca9112b57b6b17d8f5107375a3a8eace" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "frame-benchmarking" version = "36.0.0" @@ -1509,6 +1870,56 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "frame-election-provider-solution-type" +version = "14.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8156f209055d352994ecd49e19658c6b469d7c6de923bd79868957d0dcfb6f71" +dependencies = [ + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "frame-election-provider-support" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1ec289ebad5e601bb165cf7eb6ec2179ae34280ee310d0710a3111d4f8f8f94" +dependencies = [ + "frame-election-provider-solution-type", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-npos-elections", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "frame-executive" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d878830330eaa9e8b886279c338556b05702d0059989cb51cfb226b70bf3fa4" +dependencies = [ + "aquamarine", + "frame-support", + "frame-system", + "frame-try-runtime", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-tracing", +] + [[package]] name = "frame-metadata" version = "16.0.0" @@ -1521,11 +1932,27 @@ dependencies = [ "serde", ] +[[package]] +name = "frame-metadata-hash-extension" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf37fc730bf4b51e82a34c6357eebe32c04dbacf6525e0a7b9726f6a17ec9427" +dependencies = [ + "array-bytes", + "docify", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", +] + [[package]] name = "frame-support" -version = "36.0.1" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f4d08149c28010bfa568dcfa832aea628fb794d4243794a13b1bdef1aa66fb1" +checksum = "512b517645f29d76c79e4c97bf8b0f4dcb6708a2af3be24b1956085dcdcf6ce5" dependencies = [ "aquamarine", "array-bytes", @@ -1580,7 +2007,7 @@ dependencies = [ "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -1590,10 +2017,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bead15a320be1764cdd50458c4cfacb23e0cee65f64f500f8e34136a94c7eeca" dependencies = [ "frame-support-procedural-tools-derive", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -1604,7 +2031,7 @@ checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -1628,6 +2055,45 @@ dependencies = [ "sp-weights", ] +[[package]] +name = "frame-system-benchmarking" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15afc91c7780e18274dcea58ed1edb700c48d10e086a9785e3f6708099cd3250" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "frame-system-rpc-runtime-api" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9e2b7b85e451e367f4fb85ff3295bd039e17f64de1906154d3976e2638ee8" +dependencies = [ + "parity-scale-codec", + "sp-api", +] + +[[package]] +name = "frame-try-runtime" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6ba8b36a52775ad39ccfb45ff4ad814c3cb45ec74d0a4271889e00bd791c6c" +dependencies = [ + "frame-support", + "parity-scale-codec", + "sp-api", + "sp-runtime", + "sp-std", +] + [[package]] name = "fs-err" version = "2.11.0" @@ -1700,7 +2166,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -1746,9 +2212,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -1770,6 +2236,16 @@ name = "gimli" version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "group" @@ -1814,9 +2290,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -1828,6 +2304,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.3.9" @@ -1846,6 +2328,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + [[package]] name = "hmac" version = "0.8.1" @@ -1898,9 +2386,9 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http", @@ -1908,12 +2396,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", - "futures-core", + "futures-util", "http", "http-body", "pin-project-lite", @@ -1921,15 +2409,15 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "hyper" -version = "1.2.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", @@ -1961,9 +2449,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-channel", @@ -1974,7 +2462,6 @@ dependencies = [ "pin-project-lite", "socket2", "tokio", - "tower", "tower-service", "tracing", ] @@ -1996,9 +2483,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -2064,18 +2551,18 @@ dependencies = [ [[package]] name = "include_dir" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" dependencies = [ "include_dir_macros", ] [[package]] name = "include_dir_macros" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" dependencies = [ "proc-macro2", "quote", @@ -2100,12 +2587,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.5" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "serde", ] @@ -2255,6 +2742,62 @@ dependencies = [ "num-traits", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "ismp" +version = "0.2.0" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" +dependencies = [ + "anyhow", + "derive_more", + "hex", + "parity-scale-codec", + "primitive-types", + "scale-info", + "serde", + "serde-utils", + "serde_json", +] + +[[package]] +name = "ismp-parachain" +version = "1.15.0" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" +dependencies = [ + "cumulus-pallet-parachain-system", + "cumulus-primitives-core", + "frame-support", + "frame-system", + "hex-literal", + "ismp", + "log", + "pallet-ismp", + "parity-scale-codec", + "primitive-types", + "scale-info", + "serde", + "sp-consensus-aura", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-trie", + "substrate-state-machine", +] + +[[package]] +name = "ismp-parachain-runtime-api" +version = "1.15.0" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" +dependencies = [ + "cumulus-pallet-parachain-system", + "sp-api", +] + [[package]] name = "itertools" version = "0.10.5" @@ -2284,15 +2827,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.28" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] @@ -2305,18 +2848,18 @@ checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] [[package]] name = "k256" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", "ecdsa", @@ -2337,9 +2880,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "leb128" @@ -2349,9 +2892,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libm" @@ -2359,6 +2902,17 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", + "redox_syscall", +] + [[package]] name = "libsecp256k1" version = "0.7.1" @@ -2418,22 +2972,22 @@ dependencies = [ [[package]] name = "linkme" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2cfee0de9bd869589fb9a015e155946d1be5ff415cb844c2caccc6cc4b5db9" +checksum = "3c943daedff228392b791b33bba32e75737756e80a613e32e246c6ce9cbab20a" dependencies = [ "linkme-impl", ] [[package]] name = "linkme-impl" -version = "0.3.25" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adf157a4dc5a29b7b464aa8fe7edeff30076e07e13646a1c3874f58477dc99f8" +checksum = "cb26336e6dc7cc76e7927d2c9e7e3bb376d7af65a6f56a0b16c47d18a9b1abc5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -2447,15 +3001,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -2463,9 +3017,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "macro_magic" @@ -2476,7 +3030,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -2490,7 +3044,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -2501,7 +3055,7 @@ checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -2512,7 +3066,7 @@ checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -2526,9 +3080,9 @@ dependencies = [ [[package]] name = "matrixmultiply" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" +checksum = "9380b911e3e96d10c1f415da0876389aaf1b56759054eeb0de7df940c456ba1a" dependencies = [ "autocfg", "rawpointer", @@ -2536,9 +3090,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memory-db" @@ -2569,11 +3123,11 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] @@ -2589,36 +3143,66 @@ dependencies = [ ] [[package]] -name = "multi-stash" -version = "0.2.0" +name = "mio" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685a9ac4b61f4e728e1d2c6a7844609c16527aeb5e6c865915c08e619c16410f" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +dependencies = [ + "hermit-abi", + "libc", + "wasi", + "windows-sys 0.52.0", +] [[package]] -name = "nalgebra" -version = "0.32.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4541eb06dce09c0241ebbaab7102f0a01a0c8994afed2e5d0d66775016e25ac2" +name = "mmr-primitives" +version = "1.15.0" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" dependencies = [ - "approx", - "matrixmultiply", - "nalgebra-macros", - "num-complex", - "num-rational", - "num-traits", + "ckb-merkle-mountain-range", + "frame-system", + "ismp", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "multi-stash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685a9ac4b61f4e728e1d2c6a7844609c16527aeb5e6c865915c08e619c16410f" + +[[package]] +name = "nalgebra" +version = "0.32.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5c17de023a86f59ed79891b2e5d5a94c705dbe904a5b5c9c952ea6221b03e4" +dependencies = [ + "approx", + "matrixmultiply", + "nalgebra-macros", + "num-complex", + "num-rational", + "num-traits", "simba", "typenum", ] [[package]] name = "nalgebra-macros" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" +checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.77", ] [[package]] @@ -2652,20 +3236,19 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "autocfg", "num-integer", "num-traits", ] [[package]] name = "num-complex" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", ] @@ -2684,7 +3267,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -2708,20 +3291,19 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", "num-integer", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -2754,6 +3336,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "object" +version = "0.36.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -2768,12 +3359,83 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "os_pipe" -version = "1.1.5" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57119c3b893986491ec9aa85056780d3a0f3cf4da7cc09dd3650dbd6c6738fb9" +checksum = "5ffd2b0a5634335b135d5728d84c5e0fd726954b87111f7506a61c502280d982" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", +] + +[[package]] +name = "pallet-api" +version = "0.1.0" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-assets", + "parity-scale-codec", + "pop-chain-extension", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-asset-conversion" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f726ebb59401c1844a4a8703047bdafcd99a1827cd5d8b2c82abeb8948a7f25b" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-asset-rate" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e806842bec955190ec64f8b2179f74f5355137c4cadf04f3269e6196cd19caf9" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-asset-tx-payment" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "100a180dfbf30a1c872100ec2dae8a61c0f5e8b3f2d3a5cbb34093826293e2ab" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-transaction-payment", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] @@ -2794,6 +3456,81 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-aura" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0861b2a1ad6526948567bb59a3fdc4c7f02ee79b07be8b931a544350ec35ab0c" +dependencies = [ + "frame-support", + "frame-system", + "log", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-consensus-aura", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-authority-discovery" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2c3666a476132f5846fe4d5e1961a923a58a0f54d873d84566f24ffaa3684f" +dependencies = [ + "frame-support", + "frame-system", + "pallet-session", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-authority-discovery", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-authorship" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38885846dbcf03b025fdbd7edb3649046dbc68fa0b419ffe8837ef853a10d31f" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-babe" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b23d2d814e3cb793659fcf84533f66fdf0ed9cccb66cb2225851f482843ed096" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-application-crypto", + "sp-consensus-babe", + "sp-core", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", +] + [[package]] name = "pallet-balances" version = "37.0.0" @@ -2811,6 +3548,47 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-broker" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0d652c399b6ed776ee3322e60f40e323f86b413719d7696eddb8f64c368ac0" +dependencies = [ + "bitvec", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-collator-selection" +version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f660cc09f2f277a3976da2eef856b5c725ab7ad1192902ef7f4e4bafd992f04f" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-balances", + "pallet-session", + "parity-scale-codec", + "rand", + "scale-info", + "sp-runtime", + "sp-staking", + "sp-std", +] + [[package]] name = "pallet-contracts" version = "35.0.0" @@ -2852,7 +3630,7 @@ checksum = "94226cbd48516b7c310eb5dae8d50798c1ce73a7421dc0977c55b7fc2237a283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -2880,63 +3658,513 @@ dependencies = [ ] [[package]] -name = "pallet-timestamp" +name = "pallet-election-provider-multi-phase" version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae789d344be857679b0b98b28a67c747119724847f81d704d3fd03ee13fb6841" +checksum = "bd1090fdc6ccdd8ff08c60000c970428baaaf0b33e7a6b01a91ec8b697a650a3" dependencies = [ - "docify", "frame-benchmarking", + "frame-election-provider-support", "frame-support", "frame-system", "log", + "pallet-election-provider-support-benchmarking", "parity-scale-codec", + "rand", "scale-info", - "sp-inherents", + "sp-arithmetic", + "sp-core", "sp-io", + "sp-npos-elections", "sp-runtime", "sp-std", - "sp-storage", - "sp-timestamp", + "strum 0.26.3", ] [[package]] -name = "pallet-transaction-payment" -version = "36.0.0" +name = "pallet-election-provider-support-benchmarking" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74fb6114223c8d967c3c2f21cbc845e8ea604ff7e21a8e59d119d5a9257ba886" +checksum = "93475989d2f6900caf8f1c847a55d909295c156525a7510c5f1dde176ec7c714" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-system", + "parity-scale-codec", + "sp-npos-elections", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-fast-unstake" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9155f4f762513e0287320411415c76a647152799ad33db1785c9b71c36a14575" dependencies = [ + "docify", + "frame-benchmarking", + "frame-election-provider-support", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", - "serde", - "sp-core", "sp-io", "sp-runtime", + "sp-staking", "sp-std", ] [[package]] -name = "parity-bip39" -version = "2.0.1" +name = "pallet-identity" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" +checksum = "4555795a3e0e3aa49ea432b7afecb9c71a7db8793a99c68bd8dd3a52a12571f3" dependencies = [ - "bitcoin_hashes", - "rand", - "rand_core", - "serde", - "unicode-normalization", + "enumflags2", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", ] [[package]] -name = "parity-scale-codec" -version = "3.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +name = "pallet-ismp" +version = "1.15.0" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" dependencies = [ - "arrayvec", + "fortuples", + "frame-benchmarking", + "frame-support", + "frame-system", + "ismp", + "log", + "mmr-primitives", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-ismp-runtime-api" +version = "1.15.0" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" +dependencies = [ + "ismp", + "pallet-ismp", + "parity-scale-codec", + "primitive-types", + "serde", + "sp-api", + "sp-mmr-primitives", +] + +[[package]] +name = "pallet-message-queue" +version = "39.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20e65a37881d1998546254a5e50a1f768b3f82deabe774e750f4ea95aba8030c" +dependencies = [ + "environmental", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", +] + +[[package]] +name = "pallet-multisig" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be58483d827602eb8353ecf36aed65c857f0974db5d27981831e5ebf853040bd" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-nft-fractionalization" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dcaa330221f60feaf3b23d495cccc3bf2a3d6254c596b3c032273c2b46d4078" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-assets", + "pallet-nfts", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-nfts" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e1cd476809de3840e19091a083d5a79178af1f108ad489706e1f9e04c8836a4" +dependencies = [ + "enumflags2", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-nfts-runtime-api" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0ca7a0446d2d3c27f726a016c6366218df2e0bfef9ed35886b252cfa9757f6c" +dependencies = [ + "pallet-nfts", + "parity-scale-codec", + "sp-api", + "sp-std", +] + +[[package]] +name = "pallet-preimage" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ac726abc5b1bcd6c8f783514b8e1a48be32c7d15e0b263e4bc28cc1e4e7763" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-proxy" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4e12680e176607815a78a0cd10a52af50790292cb950404f30a885e2a7229e9" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-scheduler" +version = "37.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b170d6aa191197d3f50b1193925546972ffc394376ead4d2739eb40909b73c85" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", + "sp-weights", +] + +[[package]] +name = "pallet-session" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c92b24c911c2cfa5351616edc7f2f93427ea6f4f95efdb13f0f5d51997939c3" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-timestamp", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-state-machine", + "sp-std", + "sp-trie", +] + +[[package]] +name = "pallet-staking" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbebdb060417654f215fc6f03675e5f44cfc83837d9e523e1b8fd9a4a2e1bdc2" +dependencies = [ + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "parity-scale-codec", + "scale-info", + "serde", + "sp-application-crypto", + "sp-io", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "pallet-staking-reward-fn" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "988a7ebeacc84d4bdb0b12409681e956ffe35438447d8f8bc78db547cffb6ebc" +dependencies = [ + "log", + "sp-arithmetic", +] + +[[package]] +name = "pallet-sudo" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bd2a8797c1bb3d3897b4f87a7716111da5eeb8561345277b6e6d70349ec8b35" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-timestamp" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae789d344be857679b0b98b28a67c747119724847f81d704d3fd03ee13fb6841" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-std", + "sp-storage", + "sp-timestamp", +] + +[[package]] +name = "pallet-transaction-payment" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74fb6114223c8d967c3c2f21cbc845e8ea604ff7e21a8e59d119d5a9257ba886" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-transaction-payment-rpc-runtime-api" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4bad1700ad7eb5ab254189e1df894d1d16b3626a3c4b9c45259ec4d9efc262c" +dependencies = [ + "pallet-transaction-payment", + "parity-scale-codec", + "sp-api", + "sp-runtime", + "sp-weights", +] + +[[package]] +name = "pallet-treasury" +version = "35.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c502615bb4fdd02856a131cb2a612ad40c26435ec938f65f11cae4ff230812b" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-utility" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3238fe6ad00da6a137be115904c39cab97eb5c7f03da0bb1a20de1bef03f0c71" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-vesting" +version = "36.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78f7f0f4fe5e1d851e85d81e5e73b6f929f0c35af786ce8be9c9e3363717c136" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-xcm" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe7409458b7fedc5c7d46459da154ccc2dc22a843ce08e8ab6c1743ef5cf972c" +dependencies = [ + "bounded-collections", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-balances", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "xcm-runtime-apis", +] + +[[package]] +name = "parachains-common" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9319e656eebdf161666e54a4d8e24f73137f702f01600247f7be650bc4d46167" +dependencies = [ + "cumulus-primitives-core", + "cumulus-primitives-utility", + "frame-support", + "frame-system", + "log", + "pallet-asset-tx-payment", + "pallet-assets", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-message-queue", + "pallet-xcm", + "parity-scale-codec", + "polkadot-primitives", + "scale-info", + "sp-consensus-aura", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std", + "staging-parachain-info", + "staging-xcm", + "staging-xcm-executor", + "substrate-wasm-builder", +] + +[[package]] +name = "parity-bip39" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" +dependencies = [ + "bitcoin_hashes", + "rand", + "rand_core", + "serde", + "unicode-normalization", +] + +[[package]] +name = "parity-scale-codec" +version = "3.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +dependencies = [ + "arrayvec", "bitvec", "byte-slice-cast", "bytes", @@ -2951,7 +4179,7 @@ version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 1.0.109", @@ -2965,9 +4193,9 @@ checksum = "e1ad0aff30c1da14b1254fcb2af73e1fa9a28670e584a626f53a369d0e157304" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -2975,15 +4203,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -2999,9 +4227,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pbkdf2" @@ -3020,82 +4248,213 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] -name = "pin-project" -version = "1.1.5" +name = "pin-project-lite" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "pin-project-internal", + "der", + "spki", ] [[package]] -name = "pin-project-internal" -version = "1.1.5" +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "polkadot-ckb-merkle-mountain-range" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "a4b44320e5f7ce2c18227537a3032ae5b2c476a7e8eddba45333e1011fc31b92" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.58", + "cfg-if", + "itertools 0.10.5", ] [[package]] -name = "pin-project-lite" -version = "0.2.13" +name = "polkadot-core-primitives" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "17c72ee63bcf920f963cd7ac066759b0b649350c8ab3781a85a6aac87b1488f2" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] [[package]] -name = "pin-utils" -version = "0.1.0" +name = "polkadot-parachain-primitives" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +checksum = "f61070d0ff28f596890def0e0d03c231860796130b2a43e293106fa86a50c9a9" +dependencies = [ + "bounded-collections", + "derive_more", + "parity-scale-codec", + "polkadot-core-primitives", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", + "sp-weights", +] [[package]] -name = "pkcs8" -version = "0.10.2" +name = "polkadot-primitives" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +checksum = "5a4879609f4340138930c3c7313256941104a3ff6f7ecb2569d15223da9b35b2" dependencies = [ - "der", - "spki", + "bitvec", + "hex-literal", + "log", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-authority-discovery", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-staking", + "sp-std", +] + +[[package]] +name = "polkadot-runtime-common" +version = "15.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28fdcb41bb21c7b14d0341a9a17364ccc04ad34de05d41e7938cb03acbc11066" +dependencies = [ + "bitvec", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "libsecp256k1", + "log", + "pallet-asset-rate", + "pallet-authorship", + "pallet-balances", + "pallet-broker", + "pallet-election-provider-multi-phase", + "pallet-fast-unstake", + "pallet-identity", + "pallet-session", + "pallet-staking", + "pallet-staking-reward-fn", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-treasury", + "pallet-vesting", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-parachains", + "rustc-hex", + "scale-info", + "serde", + "serde_derive", + "slot-range-helper", + "sp-api", + "sp-core", + "sp-inherents", + "sp-io", + "sp-npos-elections", + "sp-runtime", + "sp-session", + "sp-staking", + "sp-std", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "static_assertions", ] [[package]] -name = "platforms" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" - -[[package]] -name = "polkadot-core-primitives" -version = "14.0.0" +name = "polkadot-runtime-metrics" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c72ee63bcf920f963cd7ac066759b0b649350c8ab3781a85a6aac87b1488f2" +checksum = "ac75b3fea8464e5681b44733ed11cf09e22ff1e956f6703b918b637bd40e7427" dependencies = [ + "bs58", + "frame-benchmarking", "parity-scale-codec", - "scale-info", - "sp-core", - "sp-runtime", + "polkadot-primitives", "sp-std", + "sp-tracing", ] [[package]] -name = "polkadot-parachain-primitives" -version = "13.0.0" +name = "polkadot-runtime-parachains" +version = "15.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61070d0ff28f596890def0e0d03c231860796130b2a43e293106fa86a50c9a9" +checksum = "cb7e68cb26f9025daaad694d8192fd0e63e92c8761c45a339dd7a5b7925a3cb6" dependencies = [ - "bounded-collections", + "bitflags 1.3.2", + "bitvec", "derive_more", + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-broker", + "pallet-message-queue", + "pallet-session", + "pallet-staking", + "pallet-timestamp", + "pallet-vesting", "parity-scale-codec", "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-runtime-metrics", + "rand", + "rand_chacha", "scale-info", "serde", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", "sp-runtime", + "sp-session", + "sp-staking", "sp-std", - "sp-weights", + "staging-xcm", + "staging-xcm-executor", ] [[package]] @@ -3117,7 +4476,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6380dbe1fb03ecc74ad55d841cfc75480222d153ba69ddcb00977866cbdabdb8" dependencies = [ "polkavm-derive-impl 0.5.0", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -3138,7 +4497,7 @@ dependencies = [ "polkavm-common 0.5.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -3150,7 +4509,7 @@ dependencies = [ "polkavm-common 0.9.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -3160,7 +4519,149 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ "polkavm-derive-impl 0.9.0", - "syn 2.0.58", + "syn 2.0.77", +] + +[[package]] +name = "polkavm-linker" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7be503e60cf56c0eb785f90aaba4b583b36bff00e93997d93fef97f9553c39" +dependencies = [ + "gimli 0.28.1", + "hashbrown 0.14.5", + "log", + "object 0.32.2", + "polkavm-common 0.9.0", + "regalloc2", + "rustc-demangle", +] + +[[package]] +name = "pop-chain-extension" +version = "0.1.0" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "pallet-contracts", + "parity-scale-codec", + "sp-core", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pop-drink" +version = "0.1.0" +dependencies = [ + "drink", + "frame-support", + "ink_sandbox", + "pop-runtime-devnet", + "sp-io", +] + +[[package]] +name = "pop-primitives" +version = "0.0.0" +dependencies = [ + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "pop-runtime-common" +version = "0.0.0" +dependencies = [ + "frame-support", + "parachains-common", + "parity-scale-codec", + "polkadot-primitives", + "scale-info", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pop-runtime-devnet" +version = "0.1.0" +dependencies = [ + "cumulus-pallet-aura-ext", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-aura", + "cumulus-primitives-core", + "cumulus-primitives-storage-weight-reclaim", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-metadata-hash-extension", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "ismp", + "ismp-parachain", + "ismp-parachain-runtime-api", + "log", + "pallet-api", + "pallet-assets", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-contracts", + "pallet-ismp", + "pallet-ismp-runtime-api", + "pallet-message-queue", + "pallet-multisig", + "pallet-nft-fractionalization", + "pallet-nfts", + "pallet-nfts-runtime-api", + "pallet-preimage", + "pallet-proxy", + "pallet-scheduler", + "pallet-session", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-utility", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-runtime-common", + "pop-chain-extension", + "pop-primitives", + "pop-runtime-common", + "scale-info", + "smallvec", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-genesis-builder", + "sp-inherents", + "sp-io", + "sp-mmr-primitives", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std", + "sp-transaction-pool", + "sp-version", + "staging-parachain-info", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", ] [[package]] @@ -3171,18 +4672,21 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] -name = "prettier-please" -version = "0.2.0" +name = "prettyplease" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22020dfcf177fcc7bf5deaf7440af371400c67c0de14c399938d8ed4fb4645d3" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -3210,11 +4714,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.21.1", + "toml_edit 0.22.22", ] [[package]] @@ -3249,23 +4753,23 @@ checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -3328,43 +4832,56 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] name = "ref-cast" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4846d4c50d1721b1a3bef8af76924eef20d5e723647333798c1b519b3a9473f" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", +] + +[[package]] +name = "regalloc2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash", + "slice-group-by", + "smallvec", ] [[package]] name = "regex" -version = "1.10.3" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.2", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -3378,13 +4895,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.4", ] [[package]] @@ -3395,9 +4912,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rfc6979" @@ -3417,9 +4934,15 @@ checksum = "fc874b127765f014d792f16763a81245ab80500e2ad921ed4ee9e82481ee08fe" [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc-hex" @@ -3429,20 +4952,20 @@ checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver", + "semver 1.0.23", ] [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -3451,21 +4974,21 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "safe_arch" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" +checksum = "c3460605018fdc9612bce72735cba0d27efbcd9904780d44c7e3a9948f96148a" dependencies = [ "bytemuck", ] @@ -3563,7 +5086,7 @@ version = "2.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 1.0.109", @@ -3571,9 +5094,9 @@ dependencies = [ [[package]] name = "schemars" -version = "0.8.16" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" dependencies = [ "dyn-clone", "schemars_derive", @@ -3583,21 +5106,21 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.16" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 1.0.109", + "syn 2.0.77", ] [[package]] name = "schnellru" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" +checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" dependencies = [ "ahash", "cfg-if", @@ -3679,80 +5202,106 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + [[package]] name = "serde" -version = "1.0.197" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] +[[package]] +name = "serde-utils" +version = "0.1.0" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" +dependencies = [ + "anyhow", + "hex", + "serde", +] + [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "serde_derive_internals" -version = "0.26.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.77", ] [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "serde_repr" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -3771,15 +5320,15 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.7.0" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" +checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.5", + "indexmap 2.5.0", "serde", "serde_derive", "serde_json", @@ -3841,14 +5390,20 @@ dependencies = [ [[package]] name = "shared_child" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef" +checksum = "09fa9338aed9a1df411814a5b2252f7cd206c55ae9bf2fa763f8de84603aa60c" dependencies = [ "libc", - "winapi", + "windows-sys 0.59.0", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook" version = "0.3.17" @@ -3861,20 +5416,20 @@ dependencies = [ [[package]] name = "signal-hook-mio" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" +checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" dependencies = [ "libc", - "mio", + "mio 0.8.11", "signal-hook", ] [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -3917,17 +5472,36 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + +[[package]] +name = "slot-range-helper" +version = "14.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4d67aa9b1ccfd746c8529754c4ce06445b1d48e189567402ef856340a3a6b14" +dependencies = [ + "enumn", + "parity-scale-codec", + "paste", + "sp-runtime", + "sp-std", +] + [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -3948,57 +5522,129 @@ dependencies = [ "sp-externalities", "sp-metadata-ir", "sp-runtime", - "sp-runtime-interface", - "sp-state-machine", - "sp-std", - "sp-trie", - "sp-version", - "thiserror", + "sp-runtime-interface", + "sp-state-machine", + "sp-std", + "sp-trie", + "sp-version", + "thiserror", +] + +[[package]] +name = "sp-api-proc-macro" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9aadf9e97e694f0e343978aa632938c5de309cbcc8afed4136cb71596737278" +dependencies = [ + "Inflector", + "blake2", + "expander", + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "sp-application-crypto" +version = "37.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d96d1fc0f1c741bbcbd0dd5470eff7b66f011708cc1942b088ebf0d4efb3d93" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-std", +] + +[[package]] +name = "sp-arithmetic" +version = "26.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46d0d0a4c591c421d3231ddd5e27d828618c24456d51445d21a1f79fcee97c23" +dependencies = [ + "docify", + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", + "sp-std", + "static_assertions", +] + +[[package]] +name = "sp-authority-discovery" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a4a1e45abc3277f18484ee0b0f9808e4206eb696ad38500c892c72f33480d69" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-runtime", +] + +[[package]] +name = "sp-block-builder" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cf199dc4f9f77abd3fd91c409759118159ce6ffcd8bc90b229b684ccc8c981f" +dependencies = [ + "sp-api", + "sp-inherents", + "sp-runtime", ] [[package]] -name = "sp-api-proc-macro" -version = "20.0.0" +name = "sp-consensus-aura" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9aadf9e97e694f0e343978aa632938c5de309cbcc8afed4136cb71596737278" +checksum = "05ebb90bf00f331b898eb729a1f707251846c1d5582d7467f083884799a69b89" dependencies = [ - "Inflector", - "blake2", - "expander", - "proc-macro-crate 3.1.0", - "proc-macro2", - "quote", - "syn 2.0.58", + "async-trait", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-application-crypto", + "sp-consensus-slots", + "sp-inherents", + "sp-runtime", + "sp-timestamp", ] [[package]] -name = "sp-application-crypto" -version = "37.0.0" +name = "sp-consensus-babe" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d96d1fc0f1c741bbcbd0dd5470eff7b66f011708cc1942b088ebf0d4efb3d93" +checksum = "3aa2de4c7100a3279658d8dd4affd8f92487528deae5cb4b40322717b9175ed5" dependencies = [ + "async-trait", "parity-scale-codec", "scale-info", "serde", + "sp-api", + "sp-application-crypto", + "sp-consensus-slots", "sp-core", - "sp-io", - "sp-std", + "sp-inherents", + "sp-runtime", + "sp-timestamp", ] [[package]] -name = "sp-arithmetic" -version = "26.0.0" +name = "sp-consensus-slots" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46d0d0a4c591c421d3231ddd5e27d828618c24456d51445d21a1f79fcee97c23" +checksum = "c8ca60d713f8ddb03bbebcc755d5e6463fdc0b6259fabfc4221b20a5f1e428fd" dependencies = [ - "docify", - "integer-sqrt", - "num-traits", "parity-scale-codec", "scale-info", "serde", - "sp-std", - "static_assertions", + "sp-timestamp", ] [[package]] @@ -4070,7 +5716,7 @@ checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -4081,7 +5727,7 @@ checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -4161,6 +5807,16 @@ dependencies = [ "sp-externalities", ] +[[package]] +name = "sp-maybe-compressed-blob" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c768c11afbe698a090386876911da4236af199cd38a5866748df4d8628aeff" +dependencies = [ + "thiserror", + "zstd", +] + [[package]] name = "sp-metadata-ir" version = "0.7.0" @@ -4172,6 +5828,49 @@ dependencies = [ "scale-info", ] +[[package]] +name = "sp-mmr-primitives" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47412a2d2e988430d5f59d7fec1473f229e1ef5ce24c1ea4f601b4b3679cac52" +dependencies = [ + "log", + "parity-scale-codec", + "polkadot-ckb-merkle-mountain-range", + "scale-info", + "serde", + "sp-api", + "sp-core", + "sp-debug-derive", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "sp-npos-elections" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b0c51a7b60cd663f2661e6949069eb316b092f22c239691d5272a4d0cfca0fb" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-arithmetic", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "sp-offchain" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbe721c367760bddf10fcfa24fb48edd64c442f71db971f043c8ac73f51aa6e9" +dependencies = [ + "sp-api", + "sp-core", + "sp-runtime", +] + [[package]] name = "sp-panic-handler" version = "13.0.0" @@ -4185,9 +5884,9 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "38.0.1" +version = "38.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5273900f0b0bef48b2e1ff9c4fb5e188b8168ee5891418a427f4be2af92ee40f" +checksum = "89ef409c414546b655ec1e94aaea178e4a97e21284a91b24c762aebf836d3b49" dependencies = [ "docify", "either", @@ -4207,7 +5906,6 @@ dependencies = [ "sp-io", "sp-std", "sp-weights", - "tracing", ] [[package]] @@ -4238,10 +5936,25 @@ checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" dependencies = [ "Inflector", "expander", - "proc-macro-crate 3.1.0", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", +] + +[[package]] +name = "sp-session" +version = "34.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4daf2e40ffc7e7e8de08efb860eb9534faf614a49c53dc282f430faedb4aed13" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-core", + "sp-keystore", + "sp-runtime", + "sp-staking", ] [[package]] @@ -4323,6 +6036,16 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "sp-transaction-pool" +version = "33.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3c9d1604aadc15b70e95f4388d0b1aa380215520b7ddfd372531a6d8262269c" +dependencies = [ + "sp-api", + "sp-runtime", +] + [[package]] name = "sp-trie" version = "36.0.0" @@ -4374,7 +6097,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -4421,9 +6144,9 @@ dependencies = [ [[package]] name = "ss58-registry" -version = "1.46.0" +version = "1.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1114ee5900b8569bbc8b1a014a942f937b752af4b44f4607430b5f86cedaac0" +checksum = "43fce22ed1df64d04b262351c8f9d5c6da4f76f79f25ad15529792f893fad25d" dependencies = [ "Inflector", "num-format", @@ -4434,6 +6157,27 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "staging-parachain-info" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd00d586b0dac4f42736bdd0ad52213a891b240e011ea82b38938263dd821c25" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + [[package]] name = "staging-xcm" version = "14.1.0" @@ -4511,7 +6255,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c6a0d765f5807e98a091107bae0a56ea3799f66a5de47b2c84c94a39c09974e" dependencies = [ "cfg-if", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "serde", ] @@ -4523,9 +6267,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" @@ -4535,11 +6279,11 @@ checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" [[package]] name = "strum" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros 0.26.2", + "strum_macros 0.26.4", ] [[package]] @@ -4548,7 +6292,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -4557,15 +6301,15 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -4581,11 +6325,49 @@ dependencies = [ "zeroize", ] +[[package]] +name = "substrate-state-machine" +version = "1.15.0" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" +dependencies = [ + "frame-support", + "hash-db", + "ismp", + "pallet-ismp", + "parity-scale-codec", + "primitive-types", + "scale-info", + "serde", + "sp-consensus-aura", + "sp-runtime", + "sp-trie", +] + +[[package]] +name = "substrate-wasm-builder" +version = "23.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dc993ad871b63fbba60362f3ea86583f5e7e1256e8fdcb3b5b249c9ead354bf" +dependencies = [ + "build-helper", + "cargo_metadata 0.15.4", + "console", + "filetime", + "parity-wasm", + "polkavm-linker", + "sp-maybe-compressed-blob", + "strum 0.26.3", + "tempfile", + "toml", + "walkdir", + "wasm-opt", +] + [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -4600,9 +6382,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.58" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -4617,14 +6399,15 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4648,22 +6431,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -4678,9 +6461,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -4701,9 +6484,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -4720,9 +6503,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -4735,37 +6518,36 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", "libc", - "mio", - "num_cpus", + "mio 1.0.2", "pin-project-lite", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -4774,35 +6556,34 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] name = "toml" -version = "0.8.11" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af06656561d28735e9c1cd63dfd57132c8155426aa6af24f36a00a351f88c48e" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.7", + "toml_edit 0.22.22", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] @@ -4813,62 +6594,29 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.5", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.2.5", + "indexmap 2.5.0", "toml_datetime", "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.22.7" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18769cd1cec395d70860ceb4d932812a0b4d06b1a4bb336745a4d21b9496e992" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.5.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.5", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", - "tracing", + "winnow 0.6.20", ] -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -4876,7 +6624,6 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -4890,7 +6637,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -5017,9 +6764,9 @@ checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" @@ -5032,27 +6779,27 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -5062,9 +6809,9 @@ dependencies = [ [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uzers" @@ -5084,15 +6831,15 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "w3f-bls" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7335e4c132c28cc43caef6adb339789e599e39adbe78da0c4d547fad48cbc331" +checksum = "9c5da5fa2c6afa2c9158eaa7cd9aee249765eb32b5fb0c63ad8b9e79336a47ec" dependencies = [ "ark-bls12-377", "ark-bls12-381", @@ -5139,34 +6886,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5174,28 +6922,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasm-encoder" -version = "0.216.0" +version = "0.217.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c23aebea22c8a75833ae08ed31ccc020835b12a41999e58c31464271b94a88" +checksum = "7b88b0814c9a2b323a9b46c687e726996c255ac8b64aa237dd11c81ed4854760" dependencies = [ "leb128", ] @@ -5211,9 +6959,9 @@ dependencies = [ [[package]] name = "wasm-opt" -version = "0.116.0" +version = "0.116.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc942673e7684671f0c5708fc18993569d184265fd5223bb51fc8e5b9b6cfd52" +checksum = "2fd87a4c135535ffed86123b6fb0f0a5a0bc89e50416c942c5f0662c645f679c" dependencies = [ "anyhow", "libc", @@ -5273,7 +7021,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c128c039340ffd50d4195c3f8ce31aac357f06804cfc494c8b9508d4b30dca4" dependencies = [ "ahash", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "string-interner", ] @@ -5300,9 +7048,9 @@ dependencies = [ [[package]] name = "wast" -version = "216.0.0" +version = "217.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7eb1f2eecd913fdde0dc6c3439d0f24530a98ac6db6cb3d14d92a5328554a08" +checksum = "79004ecebded92d3c710d4841383368c7f04b63d0992ddd6b0c7d5029b7629b7" dependencies = [ "bumpalo", "leb128", @@ -5313,31 +7061,30 @@ dependencies = [ [[package]] name = "wat" -version = "1.216.0" +version = "1.217.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac0409090fb5154f95fb5ba3235675fd9e579e731524d63b6a2f653e1280c82a" +checksum = "c126271c3d92ca0f7c63e4e462e40c69cca52fd4245fcda730d1cf558fb55088" dependencies = [ "wast", ] [[package]] name = "which" -version = "6.0.0" +version = "6.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fa5e0c10bf77f44aac573e498d1a82d5fbd5e91f6fc0a99e7be4b38e85e101c" +checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f" dependencies = [ "either", "home", - "once_cell", "rustix", - "windows-sys 0.52.0", + "winsafe", ] [[package]] name = "wide" -version = "0.7.15" +version = "0.7.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89beec544f246e679fc25490e3f8e08003bc4bf612068f325120dad4cea02c1c" +checksum = "b828f995bf1e9622031f8009f8481a85406ce1f4d4588ff746d872043e855690" dependencies = [ "bytemuck", "safe_arch", @@ -5361,11 +7108,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -5380,7 +7127,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -5398,7 +7145,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -5418,17 +7174,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -5439,9 +7196,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -5451,9 +7208,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -5463,9 +7220,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -5475,9 +7238,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -5487,9 +7250,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -5499,9 +7262,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -5511,9 +7274,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -5526,13 +7289,19 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.5" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] +[[package]] +name = "winsafe" +version = "0.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" + [[package]] name = "wyz" version = "0.5.1" @@ -5551,40 +7320,57 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", +] + +[[package]] +name = "xcm-runtime-apis" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30fffcd9128a46abd836c37dd001c2cbe122aeb8904cd7b9bac8358564fb7b56" +dependencies = [ + "frame-support", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-std", + "sp-weights", + "staging-xcm", + "staging-xcm-executor", ] [[package]] name = "xxhash-rust" -version = "0.8.10" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" +checksum = "6a5cbf750400958819fb6178eaa83bee5cd9c29a26a40cc241df8c70fdd46984" [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -5597,7 +7383,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.77", ] [[package]] @@ -5610,3 +7396,32 @@ dependencies = [ "crc32fast", "crossbeam-utils", ] + +[[package]] +name = "zstd" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "6.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.13+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml index 0a8fe7e..762bee8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,18 +1,19 @@ [workspace] resolver = "2" - -members = ["drink", "drink/test-macro", "drink-cli"] - -exclude = ["examples/", "ink-sandbox/"] +members = [ + "crates/ink-sandbox", + "crates/drink/drink", + "crates/drink/drink-cli", + "crates/drink/drink/test-macro", + "crates/pop-drink", +] +exclude = [ + "crates/drink/examples", +] [workspace.package] -authors = ["Cardinal"] edition = "2021" -homepage = "https://github.com/Cardinal-Cryptography/drink" -license = "Apache-2.0" -readme = "README.md" -repository = "https://github.com/Cardinal-Cryptography/drink" -version = "0.17.0" +repository = "https://github.com/r0gue-io/pop-drink" [workspace.dependencies] log = { version = "0.4.21", default-features = false } @@ -25,12 +26,14 @@ contract-transcode = { version = "4.0.0" } convert_case = { version = "0.6.0" } crossterm = { version = "0.26.0" } darling = { version = "0.20.3" } -parity-scale-codec = { version = "3.6.9" } parity-scale-codec-derive = { version = "3.6.9" } paste = { version = "1.0.7" } proc-macro2 = { version = "1" } quote = { version = "1" } ratatui = { version = "0.21.0" } +scale = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = [ + "derive", +] } scale-info = { version = "2.10.0" } serde_json = { version = "1.0" } syn = { version = "2" } @@ -38,14 +41,20 @@ thiserror = { version = "1.0.40" } wat = { version = "1.0.71" } # Substrate dependencies - -frame-support = { version = "36.0.0" } -frame-system = { version = "36.1.0" } -sp-runtime-interface = { version = "28.0.0" } - - -# Local dependencies - -ink_sandbox = { version = "=5.0.0", path = "ink-sandbox" } -drink = { version = "=0.17.0", path = "drink" } -drink-test-macro = { version = "=0.17.0", path = "drink/test-macro" } +frame-metadata = { version = "16.0.0", default-features = false } +frame-support = { version = "36.0.0", default-features = false } +frame-system = { version = "36.1.0", default-features = false } +pallet-assets = { version = "37.0.0", default-features = false } +pallet-balances = { version = "37.0.0", default-features = false } +pallet-contracts = { version = "35.0.0", default-features = false } +pallet-timestamp = { version = "35.0.0", default-features = false } +pop-runtime-devnet = { path = "../pop-node/runtime/devnet", default-features = false, features = ["drink"] } +sp-core = { version = "34.0.0", default-features = false } +sp-externalities = { version = "0.29.0", default-features = false } +sp-io = { version = "37.0.0", default-features = false } +sp-runtime-interface = { version = "28.0.0", default-features = false } + +# Local +drink = { path = "crates/drink/drink" } +ink_sandbox = { path = "crates/ink-sandbox" } +pop-drink = { path = "crates/pop-drink" } diff --git a/README.md b/README.md index 2aa1e0e..f6d6815 100644 --- a/README.md +++ b/README.md @@ -1,120 +1,7 @@ -[![Rust checks](https://github.com/Cardinal-Cryptography/drink/actions/workflows/rust-checks.yml/badge.svg)](https://github.com/Cardinal-Cryptography/drink/actions/workflows/rust-checks.yml) -[![Built for ink!](https://raw.githubusercontent.com/paritytech/ink/master/.images/built-for-ink.svg)](https://github.com/paritytech/ink) -

Pop DRink! (forked from DRink!)

Dechained Ready-to-play ink! playground

> [!IMPORTANT] > This repository is customized and maintained for Pop API contract end-to-end testing. > -> 1. `drink` and `ink_sandbox` must share same version for Substrate dependencies. Current version: `1.7.0` (Can be upgraded using `psvm`). -> 2. Quasi tests must be run with `cargo test --release`. -> 3. Custom runtime provided to `create_sandbox_with_runtime!` must have crates `frame-system`, `frame-support` and `parity-scale-codec` with as same versions as the `drink` crate. - -# What is DRink!? - -## In brief - -DRink! is a toolbox for ink! developers that allows for a fully functional ink! contract development without any running node. -It provides you with a unique, yet very powerful environment for interacting with contracts: - -- deploy and call your contracts synchronously, **without any delays** related to block production or networking -- gain access to **powerful features** that are not available with standard methods like **contract mocking, enhanced debugging and call tracing** -- work with **multiple contracts** at the same time -- work with **arbitrary runtime** configurations, including custom chain extensions and runtime calls -- have **full control over runtime state**, including block number, timestamp, etc. - -## In detail - -The key concept behind DRink! is to provide a nodeless environment. -To understand it fully, we need to have a high-level overview of the Substrate architecture. - -_Note: While here we use Substrate-specific terms, these concepts are pretty universal and apply to at least most of the blockchain designs._ - -### 'Blockchain onion' - - - -Any blockchain network participant runs a single binary, which is usually called a _node_ or a _host_. -It is responsible for the fundamental operations like: - -- communication with other nodes (networking protocols, information dissemination, gossiping, etc.) -- block production and finalization (consensus, block authoring, etc.) -- storage (blockchain state, database, etc.) -- sometimes also transaction pool, RPC, etc. - -When it receives a new transaction (or a block), it has to update the blockchain state. -For that, it uses a _state transition function_, called a _runtime_. -This is an auxiliary binary, which serves as the core logic function, taking as an input the current state and a transaction, and returning the updated state. - -In case the transaction is some smart contract interaction, the runtime has to execute it within an _isolated environment_. -(This is where the _contract pallet_ comes into play and spawns a dedicated sandbox.) - -As a result, we have a layered architecture resembling an onion (actually, there are a few layers more, but we don't need to dig that deep). - -### Testing strategies - -Depending on the part of technology stack involved, we can derive three main testing strategies for smart contracts. - - - -Before DRink!, you could have used ink!'s native test framework to execute either unit tests (with `#[ink::test]` macro) or end-to-end tests (with `#[ink_e2e::test]` macro). -DRink! enabled the third option, i.e. _quasi-end-to-end_ testing. - -### quasi-E2E testing - -This paradigm is a peculiar compromise between the two other strategies. -We give up the node layer (including networking, block production etc.), but we still have a fully functional runtime with attached storage. -In other words, we keep bare blockchain state in-memory, and we can interact with it directly however we want. - -This way, we gain full control over the runtime, sacrificing real simulation of the blockchain environment. -However, usually, this is higly beneficial for the development process, as it allows for a much faster feedback loop, assisted with better insights into execution externalities. - ---- - -# How to use DRink!? - -You can use DRink! in three ways: - -## Directly as a library - -This way you gain access to full DRink! power in your test suites. -Check our helpful and verbose examples in the [examples](examples) directory. - -`drink` library is continuously published to [crates.io](https://crates.io/crates/drink), so you can use it in your project with either `cargo add drink` or by adding the following line to your `Cargo.toml`: - -```toml -drink = { version = "0.8" } -``` - -Full library documentation is available at: https://docs.rs/drink. - -**Quick start guide** is available [here](examples/quick-start-with-drink/README.md). - -## As an alternative backend to ink!'s E2E testing framework - -DRink! is already integrated with ink! and can be used as a drop-in replacement for the standard E2E testing environment. -Just use corresponding argument in the test macro: - -```rust -#[ink_e2e::test(backend = "runtime_only")] -``` - -to your test function and you have just switched from E2E testcase to quasi-E2E one, that doesn't use any running node in the background! - -For a full example check out [ink! repository](https://github.com/paritytech/ink/blob/master/integration-tests/e2e-runtime-only-backend/lib.rs). - -## With a command line tool - -We provide a CLI which puts DRink! behind friendly TUI. -Below you can find a short demo of how it works. -For more details, consult [its README](drink-cli/README.md). - -https://github.com/Cardinal-Cryptography/drink/assets/27450471/4a45ef8a-a7ec-4a2f-84ab-0a2a36c1cb4e - -Similarly to `drink` library, `drink-cli` is published to [crates.io](https://crates.io/crates/drink-cli) as well. -You can install it with: - -```shell -cargo install drink-cli -``` +> Quasi tests must be run with `cargo test --release`. \ No newline at end of file diff --git a/CHANGELOG.md b/crates/drink/CHANGELOG.md similarity index 97% rename from CHANGELOG.md rename to crates/drink/CHANGELOG.md index cec47f6..a607d5e 100644 --- a/CHANGELOG.md +++ b/crates/drink/CHANGELOG.md @@ -93,4 +93,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- `NO_SALT`, `None` contstants added +- `NO_SALT`, `NO_ENDOWMENT` contstants added diff --git a/LICENSE b/crates/drink/LICENSE similarity index 100% rename from LICENSE rename to crates/drink/LICENSE diff --git a/Makefile b/crates/drink/Makefile similarity index 100% rename from Makefile rename to crates/drink/Makefile diff --git a/crates/drink/README.md b/crates/drink/README.md new file mode 100644 index 0000000..34e1090 --- /dev/null +++ b/crates/drink/README.md @@ -0,0 +1,113 @@ +[![Rust checks](https://github.com/Cardinal-Cryptography/drink/actions/workflows/rust-checks.yml/badge.svg)](https://github.com/Cardinal-Cryptography/drink/actions/workflows/rust-checks.yml) +[![Built for ink!](https://raw.githubusercontent.com/paritytech/ink/master/.images/built-for-ink.svg)](https://github.com/paritytech/ink) + +

DRink!

+

Dechained Ready-to-play ink! playground

+ +# What is DRink!? + +## In brief + +DRink! is a toolbox for ink! developers that allows for a fully functional ink! contract development without any running node. +It provides you with a unique, yet very powerful environment for interacting with contracts: + +- deploy and call your contracts synchronously, **without any delays** related to block production or networking +- gain access to **powerful features** that are not available with standard methods like **contract mocking, enhanced debugging and call tracing** +- work with **multiple contracts** at the same time +- work with **arbitrary runtime** configurations, including custom chain extensions and runtime calls +- have **full control over runtime state**, including block number, timestamp, etc. + +## In detail + +The key concept behind DRink! is to provide a nodeless environment. +To understand it fully, we need to have a high-level overview of the Substrate architecture. + +_Note: While here we use Substrate-specific terms, these concepts are pretty universal and apply to at least most of the blockchain designs._ + +### 'Blockchain onion' + + + +Any blockchain network participant runs a single binary, which is usually called a _node_ or a _host_. +It is responsible for the fundamental operations like: + +- communication with other nodes (networking protocols, information dissemination, gossiping, etc.) +- block production and finalization (consensus, block authoring, etc.) +- storage (blockchain state, database, etc.) +- sometimes also transaction pool, RPC, etc. + +When it receives a new transaction (or a block), it has to update the blockchain state. +For that, it uses a _state transition function_, called a _runtime_. +This is an auxiliary binary, which serves as the core logic function, taking as an input the current state and a transaction, and returning the updated state. + +In case the transaction is some smart contract interaction, the runtime has to execute it within an _isolated environment_. +(This is where the _contract pallet_ comes into play and spawns a dedicated sandbox.) + +As a result, we have a layered architecture resembling an onion (actually, there are a few layers more, but we don't need to dig that deep). + +### Testing strategies + +Depending on the part of technology stack involved, we can derive three main testing strategies for smart contracts. + + + +Before DRink!, you could have used ink!'s native test framework to execute either unit tests (with `#[ink::test]` macro) or end-to-end tests (with `#[ink_e2e::test]` macro). +DRink! enabled the third option, i.e. _quasi-end-to-end_ testing. + +### quasi-E2E testing + +This paradigm is a peculiar compromise between the two other strategies. +We give up the node layer (including networking, block production etc.), but we still have a fully functional runtime with attached storage. +In other words, we keep bare blockchain state in-memory, and we can interact with it directly however we want. + +This way, we gain full control over the runtime, sacrificing real simulation of the blockchain environment. +However, usually, this is higly beneficial for the development process, as it allows for a much faster feedback loop, assisted with better insights into execution externalities. + +--- + +# How to use DRink!? + +You can use DRink! in three ways: + +## Directly as a library + +This way you gain access to full DRink! power in your test suites. +Check our helpful and verbose examples in the [examples](examples) directory. + +`drink` library is continuously published to [crates.io](https://crates.io/crates/drink), so you can use it in your project with either `cargo add drink` or by adding the following line to your `Cargo.toml`: + +```toml +drink = { version = "0.8" } +``` + +Full library documentation is available at: https://docs.rs/drink. + +**Quick start guide** is available [here](examples/quick-start-with-drink/README.md). + +## As an alternative backend to ink!'s E2E testing framework + +DRink! is already integrated with ink! and can be used as a drop-in replacement for the standard E2E testing environment. +Just use corresponding argument in the test macro: + +```rust +#[ink_e2e::test(backend = "runtime_only")] +``` + +to your test function and you have just switched from E2E testcase to quasi-E2E one, that doesn't use any running node in the background! + +For a full example check out [ink! repository](https://github.com/paritytech/ink/blob/master/integration-tests/e2e-runtime-only-backend/lib.rs). + +## With a command line tool + +We provide a CLI which puts DRink! behind friendly TUI. +Below you can find a short demo of how it works. +For more details, consult [its README](../drink-cli/README.md). + +https://github.com/Cardinal-Cryptography/drink/assets/27450471/4a45ef8a-a7ec-4a2f-84ab-0a2a36c1cb4e + +Similarly to `drink` library, `drink-cli` is published to [crates.io](https://crates.io/crates/drink-cli) as well. +You can install it with: + +```shell +cargo install drink-cli +``` diff --git a/crates/drink/drink-cli/Cargo.toml b/crates/drink/drink-cli/Cargo.toml new file mode 100644 index 0000000..8a730c5 --- /dev/null +++ b/crates/drink/drink-cli/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "drink-cli" +authors = ["Cardinal"] +edition = "2021" +homepage = "https://github.com/Cardinal-Cryptography/drink" +license = "Apache-2.0" +readme = "README.md" +repository = "https://github.com/Cardinal-Cryptography/drink" +version = "0.17.0" +description = "A CLI for interacting with the `drink` environment" + +[dependencies] +anyhow.workspace = true +clap = { workspace = true, features = ["derive"] } +crossterm.workspace = true +contract-build.workspace = true +contract-transcode.workspace = true +ratatui = { workspace = true, features = ["all-widgets"] } +thiserror.workspace = true + +# Local +ink_sandbox.workspace = true +#drink = { workspace = true, features = ["session"] } +drink.workspace = true diff --git a/drink-cli/README.md b/crates/drink/drink-cli/README.md similarity index 100% rename from drink-cli/README.md rename to crates/drink/drink-cli/README.md diff --git a/drink-cli/src/app_state/contracts.rs b/crates/drink/drink-cli/src/app_state/contracts.rs similarity index 100% rename from drink-cli/src/app_state/contracts.rs rename to crates/drink/drink-cli/src/app_state/contracts.rs diff --git a/drink-cli/src/app_state/mod.rs b/crates/drink/drink-cli/src/app_state/mod.rs similarity index 100% rename from drink-cli/src/app_state/mod.rs rename to crates/drink/drink-cli/src/app_state/mod.rs diff --git a/drink-cli/src/app_state/output.rs b/crates/drink/drink-cli/src/app_state/output.rs similarity index 100% rename from drink-cli/src/app_state/output.rs rename to crates/drink/drink-cli/src/app_state/output.rs diff --git a/drink-cli/src/app_state/print.rs b/crates/drink/drink-cli/src/app_state/print.rs similarity index 100% rename from drink-cli/src/app_state/print.rs rename to crates/drink/drink-cli/src/app_state/print.rs diff --git a/drink-cli/src/app_state/user_input.rs b/crates/drink/drink-cli/src/app_state/user_input.rs similarity index 100% rename from drink-cli/src/app_state/user_input.rs rename to crates/drink/drink-cli/src/app_state/user_input.rs diff --git a/drink-cli/src/cli.rs b/crates/drink/drink-cli/src/cli.rs similarity index 100% rename from drink-cli/src/cli.rs rename to crates/drink/drink-cli/src/cli.rs diff --git a/drink-cli/src/executor/contract.rs b/crates/drink/drink-cli/src/executor/contract.rs similarity index 100% rename from drink-cli/src/executor/contract.rs rename to crates/drink/drink-cli/src/executor/contract.rs diff --git a/drink-cli/src/executor/error.rs b/crates/drink/drink-cli/src/executor/error.rs similarity index 100% rename from drink-cli/src/executor/error.rs rename to crates/drink/drink-cli/src/executor/error.rs diff --git a/drink-cli/src/executor/mod.rs b/crates/drink/drink-cli/src/executor/mod.rs similarity index 96% rename from drink-cli/src/executor/mod.rs rename to crates/drink/drink-cli/src/executor/mod.rs index 9d38784..ed93750 100644 --- a/drink-cli/src/executor/mod.rs +++ b/crates/drink/drink-cli/src/executor/mod.rs @@ -5,7 +5,7 @@ use std::env; use anyhow::Result; use clap::Parser; -use drink::{sandbox_api::prelude::*, AccountId32, Weight}; +use drink::{sandbox_api::prelude::{SystemAPI, BalanceAPI}, AccountId32, Weight}; use crate::{app_state::AppState, cli::CliCommand}; diff --git a/drink-cli/src/main.rs b/crates/drink/drink-cli/src/main.rs similarity index 100% rename from drink-cli/src/main.rs rename to crates/drink/drink-cli/src/main.rs diff --git a/drink-cli/src/ui/contracts.rs b/crates/drink/drink-cli/src/ui/contracts.rs similarity index 100% rename from drink-cli/src/ui/contracts.rs rename to crates/drink/drink-cli/src/ui/contracts.rs diff --git a/drink-cli/src/ui/current_env.rs b/crates/drink/drink-cli/src/ui/current_env.rs similarity index 100% rename from drink-cli/src/ui/current_env.rs rename to crates/drink/drink-cli/src/ui/current_env.rs diff --git a/drink-cli/src/ui/footer.rs b/crates/drink/drink-cli/src/ui/footer.rs similarity index 100% rename from drink-cli/src/ui/footer.rs rename to crates/drink/drink-cli/src/ui/footer.rs diff --git a/drink-cli/src/ui/help.rs b/crates/drink/drink-cli/src/ui/help.rs similarity index 100% rename from drink-cli/src/ui/help.rs rename to crates/drink/drink-cli/src/ui/help.rs diff --git a/drink-cli/src/ui/layout.rs b/crates/drink/drink-cli/src/ui/layout.rs similarity index 100% rename from drink-cli/src/ui/layout.rs rename to crates/drink/drink-cli/src/ui/layout.rs diff --git a/drink-cli/src/ui/mod.rs b/crates/drink/drink-cli/src/ui/mod.rs similarity index 100% rename from drink-cli/src/ui/mod.rs rename to crates/drink/drink-cli/src/ui/mod.rs diff --git a/drink-cli/src/ui/output.rs b/crates/drink/drink-cli/src/ui/output.rs similarity index 100% rename from drink-cli/src/ui/output.rs rename to crates/drink/drink-cli/src/ui/output.rs diff --git a/drink-cli/src/ui/user_input.rs b/crates/drink/drink-cli/src/ui/user_input.rs similarity index 100% rename from drink-cli/src/ui/user_input.rs rename to crates/drink/drink-cli/src/ui/user_input.rs diff --git a/crates/drink/drink/Cargo.toml b/crates/drink/drink/Cargo.toml new file mode 100644 index 0000000..3c33f07 --- /dev/null +++ b/crates/drink/drink/Cargo.toml @@ -0,0 +1,50 @@ +[package] +name = "drink" +authors = ["Cardinal"] +edition = "2021" +homepage = "https://github.com/Cardinal-Cryptography/drink" +license = "Apache-2.0" +readme = "README.md" +repository = "https://github.com/Cardinal-Cryptography/drink" +version = "0.17.0" +description = "Minimal sufficient architecture that allows for a fully functional ink! contract development" + +[dependencies] +log.workspace = true +#contract-metadata = { workspace = true, optional = true } +contract-metadata.workspace = true +#contract-transcode = { workspace = true, optional = true } +contract-transcode.workspace = true +scale.workspace = true +scale-info.workspace = true +#serde_json = { workspace = true, optional = true } +serde_json.workspace = true +thiserror.workspace = true +wat.workspace = true +parity-scale-codec-derive.workspace = true + +# Substrate dependencies +frame-support.workspace = true +frame-system.workspace = true +sp-runtime-interface.workspace = true + +# Local +drink-test-macro = { path = "test-macro" } +ink_sandbox.workspace = true + +[features] +default = [ + # This is required for the runtime-interface to work properly in the std env. + "std", +# "session", +# "macros", +] +#session = ["contract-metadata", "contract-transcode", "serde_json"] +#macros = ["contract-metadata", "contract-transcode", "serde_json"] +std = [ + "frame-support/std", + "frame-system/std", + "scale/std", + "scale-info/std", + "sp-runtime-interface/std", +] diff --git a/drink/src/errors.rs b/crates/drink/drink/src/errors.rs similarity index 94% rename from drink/src/errors.rs rename to crates/drink/drink/src/errors.rs index c8d64dc..9bc6250 100644 --- a/drink/src/errors.rs +++ b/crates/drink/drink/src/errors.rs @@ -25,8 +25,8 @@ pub enum Error { Clone, PartialEq, Eq, - parity_scale_codec::Encode, - parity_scale_codec::Decode, + scale::Encode, + scale::Decode, scale_info::TypeInfo, Error, )] diff --git a/drink/src/lib.rs b/crates/drink/drink/src/lib.rs similarity index 65% rename from drink/src/lib.rs rename to crates/drink/drink/src/lib.rs index 6702cf3..2a64e9f 100644 --- a/drink/src/lib.rs +++ b/crates/drink/drink/src/lib.rs @@ -1,34 +1,29 @@ //! The drink crate provides a sandboxed runtime for testing smart contracts without a need for //! a running node. -#![warn(missing_docs)] - pub mod errors; pub mod pallet_contracts_debugging; /// Necessary exports in ink_e2e_sandbox -#[cfg(feature = "session")] pub mod session; -#[cfg(feature = "macros")] pub use drink_test_macro::{contract_bundle_provider, test}; pub use errors::Error; pub use frame_support; pub use ink_sandbox::{ - self, api as sandbox_api, create_sandbox, create_sandbox_with_runtime, impl_sandbox, + self, api as sandbox_api, create_sandbox, impl_sandbox, pallet_balances, pallet_contracts, pallet_timestamp, sp_externalities, AccountId32, DispatchError, Sandbox, Ss58Codec, Weight, }; -#[cfg(feature = "session")] +// #[cfg(feature = "session")] pub use session::mock::{mock_message, ContractMock, MessageMock, MockedCallResult, Selector}; /// Main result type for the drink crate. pub type DrinkResult = std::result::Result; /// Minimal Sandbox runtime used for testing contracts with drink!. -#[allow(missing_docs)] pub mod minimal { - use ink_sandbox::create_sandbox_with_runtime; + use ink_sandbox::create_sandbox; - // create_sandbox_with_runtime!(MinimalSandbox); - create_sandbox_with_runtime!(MinimalSandbox, (), crate::pallet_contracts_debugging::DrinkDebug); -} + // create_sandbox!(MinimalSandbox); + create_sandbox!(MinimalSandbox, (), crate::pallet_contracts_debugging::DrinkDebug); +} \ No newline at end of file diff --git a/drink/src/pallet_contracts_debugging.rs b/crates/drink/drink/src/pallet_contracts_debugging.rs similarity index 100% rename from drink/src/pallet_contracts_debugging.rs rename to crates/drink/drink/src/pallet_contracts_debugging.rs diff --git a/drink/src/pallet_contracts_debugging/intercepting.rs b/crates/drink/drink/src/pallet_contracts_debugging/intercepting.rs similarity index 95% rename from drink/src/pallet_contracts_debugging/intercepting.rs rename to crates/drink/drink/src/pallet_contracts_debugging/intercepting.rs index 28168e2..fba3a3e 100644 --- a/drink/src/pallet_contracts_debugging/intercepting.rs +++ b/crates/drink/drink/src/pallet_contracts_debugging/intercepting.rs @@ -1,5 +1,5 @@ use ink_sandbox::AccountIdFor; -use parity_scale_codec::{Decode, Encode}; +use scale::{Decode, Encode}; use crate::{ pallet_contracts::{ diff --git a/drink/src/pallet_contracts_debugging/runtime.rs b/crates/drink/drink/src/pallet_contracts_debugging/runtime.rs similarity index 98% rename from drink/src/pallet_contracts_debugging/runtime.rs rename to crates/drink/drink/src/pallet_contracts_debugging/runtime.rs index d62123a..7d62883 100644 --- a/drink/src/pallet_contracts_debugging/runtime.rs +++ b/crates/drink/drink/src/pallet_contracts_debugging/runtime.rs @@ -1,5 +1,5 @@ use ink_sandbox::sp_externalities::{decl_extension, ExternalitiesExt}; -use parity_scale_codec::Encode; +use scale::Encode; use sp_runtime_interface::runtime_interface; /// Contracts pallet outsources debug callbacks through this runtime interface. diff --git a/drink/src/pallet_contracts_debugging/tracing.rs b/crates/drink/drink/src/pallet_contracts_debugging/tracing.rs similarity index 93% rename from drink/src/pallet_contracts_debugging/tracing.rs rename to crates/drink/drink/src/pallet_contracts_debugging/tracing.rs index 2f9cfb2..7aad1f0 100644 --- a/drink/src/pallet_contracts_debugging/tracing.rs +++ b/crates/drink/drink/src/pallet_contracts_debugging/tracing.rs @@ -37,7 +37,7 @@ pub struct DrinkCallSpan { pub input_data: Vec, } -impl CallSpan for DrinkCallSpan { +impl CallSpan for DrinkCallSpan { fn after_call(self, output: &ExecReturnValue) { crate::pallet_contracts_debugging::runtime::contract_call_debugger::after_call( self.contract_address.encode(), diff --git a/drink/src/session.rs b/crates/drink/drink/src/session.rs similarity index 94% rename from drink/src/session.rs rename to crates/drink/drink/src/session.rs index f43ba0d..bd634d8 100644 --- a/drink/src/session.rs +++ b/crates/drink/drink/src/session.rs @@ -13,10 +13,11 @@ use frame_support::{traits::fungible::Inspect, weights::Weight}; use ink_sandbox::{ api::prelude::*, AccountIdFor, ContractExecResultFor, ContractInstantiateResultFor, Sandbox, }; -use parity_scale_codec::Decode; +use scale::Decode; pub use record::{EventBatch, Record}; use crate::{ + minimal::MinimalSandboxRuntime, pallet_contracts::{Config, Determinism}, pallet_contracts_debugging::{InterceptingExt, TracingExt}, session::mock::MockRegistry, @@ -49,6 +50,10 @@ type HashFor = ::Hash; pub const NO_ARGS: &[String] = &[]; /// Convenient value for an empty salt. pub const NO_SALT: Vec = vec![]; +/// Convenient value for no endowment. +/// +/// Compatible with any runtime with `u128` as the balance type. +pub const NO_ENDOWMENT: Option> = None; /// Wrapper around `Sandbox` that provides a convenient API for interacting with multiple contracts. /// @@ -62,7 +67,7 @@ pub const NO_SALT: Vec = vec![]; /// # use ink_sandbox::AccountId32; /// # use drink::{ /// # session::Session, -/// # session::{NO_ARGS, NO_SALT}, +/// # session::{NO_ARGS, NO_SALT, NO_ENDOWMENT}, /// # minimal::MinimalSandbox /// # }; /// # @@ -75,10 +80,10 @@ pub const NO_SALT: Vec = vec![]; /// # fn main() -> Result<(), drink::session::error::SessionError> { /// /// Session::::default() -/// .deploy_and(contract_bytes(), "new", NO_ARGS, NO_SALT, None, &get_transcoder())? -/// .call_and("foo", NO_ARGS, None)? +/// .deploy_and(contract_bytes(), "new", NO_ARGS, NO_SALT, NO_ENDOWMENT, &get_transcoder())? +/// .call_and("foo", NO_ARGS, NO_ENDOWMENT)? /// .with_actor(bob()) -/// .call_and("bar", NO_ARGS, None)?; +/// .call_and("bar", NO_ARGS, NO_ENDOWMENT)?; /// # Ok(()) } /// ``` /// @@ -90,7 +95,7 @@ pub const NO_SALT: Vec = vec![]; /// # use drink::{ /// # session::Session, /// # minimal::MinimalSandbox, -/// # session::{NO_ARGS, NO_SALT} +/// # session::{NO_ARGS, NO_SALT, NO_ENDOWMENT} /// # }; /// # fn get_transcoder() -> Arc { /// # Arc::new(ContractMessageTranscoder::load("").unwrap()) @@ -102,10 +107,10 @@ pub const NO_SALT: Vec = vec![]; /// /// let mut session = Session::::default(); /// let _address = -/// session.deploy(contract_bytes(), "new", NO_ARGS, NO_SALT, None, &get_transcoder())?; -/// let _result: u32 = session.call("foo", NO_ARGS, None)??; +/// session.deploy(contract_bytes(), "new", NO_ARGS, NO_SALT, NO_ENDOWMENT, &get_transcoder())?; +/// let _result: u32 = session.call("foo", NO_ARGS, NO_ENDOWMENT)??; /// session.set_actor(bob()); -/// session.call::<_, ()>("bar", NO_ARGS, None)??; +/// session.call::<_, ()>("bar", NO_ARGS, NO_ENDOWMENT)??; /// # Ok(()) } /// ``` /// @@ -114,7 +119,7 @@ pub const NO_SALT: Vec = vec![]; /// # use drink::{ /// # local_contract_file, /// # session::Session, -/// # session::{ContractBundle, NO_ARGS, NO_SALT}, +/// # session::{ContractBundle, NO_ARGS, NO_SALT, NO_ENDOWMENT}, /// # minimal::MinimalSandbox /// # }; /// @@ -125,13 +130,13 @@ pub const NO_SALT: Vec = vec![]; /// "new", /// NO_ARGS, /// NO_SALT, -/// None, +/// NO_ENDOWMENT, /// )?; // ... /// /// // Or choosing the file explicitly: /// let contract = ContractBundle::load("path/to/your.contract")?; /// Session::::default() -/// .deploy_bundle_and(contract, "new", NO_ARGS, NO_SALT, None)?; // ... +/// .deploy_bundle_and(contract, "new", NO_ARGS, NO_SALT, NO_ENDOWMENT)?; // ... /// # Ok(()) } /// ``` pub struct Session @@ -177,7 +182,7 @@ impl Session where T::Runtime: Config, { - const LOG_TARGET: &'static str = "pop-drink::session"; + const LOG_TARGET: &'static str = "drink::session"; /// Sets a new actor and returns updated `self`. pub fn with_actor(self, actor: AccountIdFor) -> Self { diff --git a/drink/src/session/bundle.rs b/crates/drink/drink/src/session/bundle.rs similarity index 100% rename from drink/src/session/bundle.rs rename to crates/drink/drink/src/session/bundle.rs diff --git a/drink/src/session/error.rs b/crates/drink/drink/src/session/error.rs similarity index 98% rename from drink/src/session/error.rs rename to crates/drink/drink/src/session/error.rs index 33e72a3..8f0bb2f 100644 --- a/drink/src/session/error.rs +++ b/crates/drink/drink/src/session/error.rs @@ -1,7 +1,7 @@ //! Module exposing errors and result types for the session API. use frame_support::sp_runtime::DispatchError; -use parity_scale_codec::Decode; +use scale::Decode; use thiserror::Error; use crate::errors::MessageResult; diff --git a/drink/src/session/mock.rs b/crates/drink/drink/src/session/mock.rs similarity index 100% rename from drink/src/session/mock.rs rename to crates/drink/drink/src/session/mock.rs diff --git a/drink/src/session/mock/contract.rs b/crates/drink/drink/src/session/mock/contract.rs similarity index 97% rename from drink/src/session/mock/contract.rs rename to crates/drink/drink/src/session/mock/contract.rs index 26a5cdd..6d20805 100644 --- a/drink/src/session/mock/contract.rs +++ b/crates/drink/drink/src/session/mock/contract.rs @@ -1,6 +1,6 @@ use std::collections::BTreeMap; -use parity_scale_codec::{Decode, Encode}; +use scale::{Decode, Encode}; use crate::{ errors::LangError, diff --git a/drink/src/session/mock/error.rs b/crates/drink/drink/src/session/mock/error.rs similarity index 86% rename from drink/src/session/mock/error.rs rename to crates/drink/drink/src/session/mock/error.rs index 7cd013e..c712718 100644 --- a/drink/src/session/mock/error.rs +++ b/crates/drink/drink/src/session/mock/error.rs @@ -8,5 +8,5 @@ pub enum MockingError { #[error("Message not found (unknown selector: {0:?})")] MessageNotFound(Selector), #[error("Decoding message arguments failed: {0:?}")] - ArgumentDecoding(parity_scale_codec::Error), + ArgumentDecoding(scale::Error), } diff --git a/drink/src/session/mock/extension.rs b/crates/drink/drink/src/session/mock/extension.rs similarity index 98% rename from drink/src/session/mock/extension.rs rename to crates/drink/drink/src/session/mock/extension.rs index 4fa8dda..a0a8314 100644 --- a/drink/src/session/mock/extension.rs +++ b/crates/drink/drink/src/session/mock/extension.rs @@ -1,6 +1,6 @@ use std::sync::{Arc, Mutex}; -use parity_scale_codec::{Decode, Encode}; +use scale::{Decode, Encode}; use crate::{ errors::MessageResult, diff --git a/drink/src/session/mocking_api.rs b/crates/drink/drink/src/session/mocking_api.rs similarity index 100% rename from drink/src/session/mocking_api.rs rename to crates/drink/drink/src/session/mocking_api.rs diff --git a/drink/src/session/record.rs b/crates/drink/drink/src/session/record.rs similarity index 99% rename from drink/src/session/record.rs rename to crates/drink/drink/src/session/record.rs index b776478..c4807ca 100644 --- a/drink/src/session/record.rs +++ b/crates/drink/drink/src/session/record.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use contract_transcode::{ContractMessageTranscoder, Value}; use frame_system::Config as SysConfig; use ink_sandbox::{pallet_contracts, AccountIdFor, EventRecordOf}; -use parity_scale_codec::{Decode, Encode}; +use scale::{Decode, Encode}; use crate::{ errors::MessageResult, diff --git a/drink/src/session/transcoding.rs b/crates/drink/drink/src/session/transcoding.rs similarity index 100% rename from drink/src/session/transcoding.rs rename to crates/drink/drink/src/session/transcoding.rs diff --git a/drink/test-macro/Cargo.toml b/crates/drink/drink/test-macro/Cargo.toml similarity index 68% rename from drink/test-macro/Cargo.toml rename to crates/drink/drink/test-macro/Cargo.toml index f308883..da5b24a 100644 --- a/drink/test-macro/Cargo.toml +++ b/crates/drink/drink/test-macro/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "drink-test-macro" -authors.workspace = true -edition.workspace = true -homepage.workspace = true -license.workspace = true -readme.workspace = true -repository.workspace = true -version.workspace = true +authors = ["Cardinal"] +edition = "2021" +homepage = "https://github.com/Cardinal-Cryptography/drink" +license = "Apache-2.0" +readme = "README.md" +repository = "https://github.com/Cardinal-Cryptography/drink" +version = "0.17.0" description = "Procedural macro providing a `#[drink::test]` attribute for `drink`-based contract testing" [lib] diff --git a/drink/test-macro/src/bundle_provision.rs b/crates/drink/drink/test-macro/src/bundle_provision.rs similarity index 100% rename from drink/test-macro/src/bundle_provision.rs rename to crates/drink/drink/test-macro/src/bundle_provision.rs diff --git a/drink/test-macro/src/contract_building.rs b/crates/drink/drink/test-macro/src/contract_building.rs similarity index 100% rename from drink/test-macro/src/contract_building.rs rename to crates/drink/drink/test-macro/src/contract_building.rs diff --git a/drink/test-macro/src/lib.rs b/crates/drink/drink/test-macro/src/lib.rs similarity index 96% rename from drink/test-macro/src/lib.rs rename to crates/drink/drink/test-macro/src/lib.rs index 49b1dd8..bc91c65 100644 --- a/drink/test-macro/src/lib.rs +++ b/crates/drink/drink/test-macro/src/lib.rs @@ -46,7 +46,7 @@ type SynResult = Result; /// # Creating a session object /// /// The macro will also create a new mutable session object and pass it to the decorated function by -/// value. You can configure which sandbox should be used (by specifying a path to a type +/// value. You can configure which sandbox should be used by specifying the path to a type /// implementing `ink_sandbox::Sandbox` trait. Thus, your testcase function should accept a single /// argument: `mut session: Session<_>`. /// @@ -58,7 +58,7 @@ type SynResult = Result; /// #[drink::test] /// fn testcase(mut session: Session) { /// session -/// .deploy_bundle(&get_bundle(), "new", NO_ARGS, NO_SALT, None) +/// .deploy_bundle(&get_bundle(), "new", NO_ARGS, NO_SALT, NO_ENDOWMENT) /// .unwrap(); /// } /// ``` @@ -80,7 +80,6 @@ fn test_internal(attr: TokenStream2, item: TokenStream2) -> SynResult(item)?; let macro_args = TestAttributes::from_list(&NestedMeta::parse_meta_list(attr)?)?; - // TODO: why do we build the contracts again? build_contracts(); let fn_vis = item_fn.vis; @@ -140,8 +139,8 @@ fn test_internal(attr: TokenStream2, item: TokenStream2) -> SynResult::default() -/// .deploy_bundle_and(BundleProvider::local()?, "new", NO_ARGS, NO_SALT, None) -/// .deploy_bundle_and(BundleProvider::AnotherContract.bundle()?, "new", NO_ARGS, NO_SALT, None) +/// .deploy_bundle_and(BundleProvider::local()?, "new", NO_ARGS, NO_SALT, NO_ENDOWMENT) +/// .deploy_bundle_and(BundleProvider::AnotherContract.bundle()?, "new", NO_ARGS, NO_SALT, NO_ENDOWMENT) /// .unwrap(); /// } /// ``` diff --git a/drink/test-resources/dummy.wat b/crates/drink/drink/test-resources/dummy.wat similarity index 100% rename from drink/test-resources/dummy.wat rename to crates/drink/drink/test-resources/dummy.wat diff --git a/examples/chain-extension/Cargo.lock b/crates/drink/examples/chain-extension/Cargo.lock similarity index 100% rename from examples/chain-extension/Cargo.lock rename to crates/drink/examples/chain-extension/Cargo.lock diff --git a/examples/chain-extension/Cargo.toml b/crates/drink/examples/chain-extension/Cargo.toml similarity index 94% rename from examples/chain-extension/Cargo.toml rename to crates/drink/examples/chain-extension/Cargo.toml index e671ddc..da2e760 100644 --- a/examples/chain-extension/Cargo.toml +++ b/crates/drink/examples/chain-extension/Cargo.toml @@ -22,7 +22,7 @@ scale-info = { version = "2.6", default-features = false, features = [ [dev-dependencies] drink = { path = "../../drink" } -# If you are creating a custom runtime with `drink::create_sandbox_with_runtime!` macro, unfortunately you need to +# If you are creating a custom runtime with `drink::create_sandbox!` macro, unfortunately you need to # include these dependencies manually. Versions should match the ones in `Cargo.toml` of the `drink` crate. frame-support = { version = "29.0.2" } frame-system = { version = "29.0.0" } diff --git a/examples/chain-extension/README.md b/crates/drink/examples/chain-extension/README.md similarity index 96% rename from examples/chain-extension/README.md rename to crates/drink/examples/chain-extension/README.md index da6ad7d..e7db9c3 100644 --- a/examples/chain-extension/README.md +++ b/crates/drink/examples/chain-extension/README.md @@ -7,7 +7,7 @@ The thing that `drink` makes easier for you is combining an arbitrary chain exte By simply calling: ```rust -create_sandbox_with_runtime!( +create_sandbox!( SandboxWithCustomChainExtension, path::to::MyCustomChainExtension ); diff --git a/examples/chain-extension/src/chain_extension_ink_side.rs b/crates/drink/examples/chain-extension/src/chain_extension_ink_side.rs similarity index 100% rename from examples/chain-extension/src/chain_extension_ink_side.rs rename to crates/drink/examples/chain-extension/src/chain_extension_ink_side.rs diff --git a/examples/chain-extension/src/chain_extension_runtime_side.rs b/crates/drink/examples/chain-extension/src/chain_extension_runtime_side.rs similarity index 100% rename from examples/chain-extension/src/chain_extension_runtime_side.rs rename to crates/drink/examples/chain-extension/src/chain_extension_runtime_side.rs diff --git a/examples/chain-extension/src/lib.rs b/crates/drink/examples/chain-extension/src/lib.rs similarity index 96% rename from examples/chain-extension/src/lib.rs rename to crates/drink/examples/chain-extension/src/lib.rs index 96f3db7..f1ec7bc 100644 --- a/examples/chain-extension/src/lib.rs +++ b/crates/drink/examples/chain-extension/src/lib.rs @@ -36,7 +36,7 @@ mod contract_calling_chain_extension { #[cfg(test)] mod tests { use drink::{ - create_sandbox_with_runtime, + create_sandbox, session::{Session, NO_ARGS, NO_SALT}, }; @@ -46,7 +46,7 @@ mod tests { enum BundleProvider {} // We can inject arbitrary chain extension into the minimal runtime as follows: - create_sandbox_with_runtime!( + create_sandbox!( SandboxWithCE, crate::chain_extension_runtime_side::StakingExtension, drink::pallet_contracts_debugging::DrinkDebug diff --git a/examples/contract-events/Cargo.lock b/crates/drink/examples/contract-events/Cargo.lock similarity index 100% rename from examples/contract-events/Cargo.lock rename to crates/drink/examples/contract-events/Cargo.lock diff --git a/examples/contract-events/Cargo.toml b/crates/drink/examples/contract-events/Cargo.toml similarity index 100% rename from examples/contract-events/Cargo.toml rename to crates/drink/examples/contract-events/Cargo.toml diff --git a/examples/contract-events/README.md b/crates/drink/examples/contract-events/README.md similarity index 100% rename from examples/contract-events/README.md rename to crates/drink/examples/contract-events/README.md diff --git a/examples/contract-events/lib.rs b/crates/drink/examples/contract-events/lib.rs similarity index 91% rename from examples/contract-events/lib.rs rename to crates/drink/examples/contract-events/lib.rs index 4f748e5..b68736e 100644 --- a/examples/contract-events/lib.rs +++ b/crates/drink/examples/contract-events/lib.rs @@ -37,7 +37,7 @@ mod flipper { mod tests { use std::error::Error; - use drink::session::{Session, NO_ARGS}; + use drink::session::{Session, NO_ARGS, NO_ENDOWMENT}; #[drink::contract_bundle_provider] enum BundleProvider {} @@ -47,8 +47,8 @@ mod tests { let bundle = BundleProvider::local()?; // Firstly, we deploy the contract and call its `flip` method. - session.deploy_bundle(bundle.clone(), "new", &["false"], vec![], None)?; - session.call("flip", NO_ARGS, None)??; + session.deploy_bundle(bundle.clone(), "new", &["false"], vec![], NO_ENDOWMENT)?; + session.call("flip", NO_ARGS, NO_ENDOWMENT)??; // Now we can inspect the emitted events. let record = session.record(); diff --git a/examples/cross-contract-call-tracing/Cargo.lock b/crates/drink/examples/cross-contract-call-tracing/Cargo.lock similarity index 100% rename from examples/cross-contract-call-tracing/Cargo.lock rename to crates/drink/examples/cross-contract-call-tracing/Cargo.lock diff --git a/examples/cross-contract-call-tracing/Cargo.toml b/crates/drink/examples/cross-contract-call-tracing/Cargo.toml similarity index 100% rename from examples/cross-contract-call-tracing/Cargo.toml rename to crates/drink/examples/cross-contract-call-tracing/Cargo.toml diff --git a/examples/cross-contract-call-tracing/README.md b/crates/drink/examples/cross-contract-call-tracing/README.md similarity index 100% rename from examples/cross-contract-call-tracing/README.md rename to crates/drink/examples/cross-contract-call-tracing/README.md diff --git a/examples/cross-contract-call-tracing/lib.rs b/crates/drink/examples/cross-contract-call-tracing/lib.rs similarity index 96% rename from examples/cross-contract-call-tracing/lib.rs rename to crates/drink/examples/cross-contract-call-tracing/lib.rs index d3100c8..77cef16 100644 --- a/examples/cross-contract-call-tracing/lib.rs +++ b/crates/drink/examples/cross-contract-call-tracing/lib.rs @@ -65,7 +65,7 @@ mod tests { use drink::{ pallet_contracts_debugging::{TracingExt, TracingExtT}, - session::{contract_transcode::Value, Session, NO_ARGS}, + session::{contract_transcode::Value, Session, NO_ARGS, NO_ENDOWMENT}, AccountId32, }; use ink::storage::traits::Storable; @@ -135,7 +135,7 @@ mod tests { "new", NO_ARGS, vec![1], - None, + NO_ENDOWMENT, )?; OUTER_ADDRESS.with(|a| *a.borrow_mut() = Some(outer_address.clone())); let middle_address = session.deploy_bundle( @@ -143,7 +143,7 @@ mod tests { "new", NO_ARGS, vec![2], - None, + NO_ENDOWMENT, )?; MIDDLE_ADDRESS.with(|a| *a.borrow_mut() = Some(middle_address.clone())); let inner_address = session.deploy_bundle( @@ -151,7 +151,7 @@ mod tests { "new", NO_ARGS, vec![3], - None, + NO_ENDOWMENT, )?; INNER_ADDRESS.with(|a| *a.borrow_mut() = Some(inner_address.clone())); @@ -163,7 +163,7 @@ mod tests { &*inner_address.to_string(), "7", ], - None, + NO_ENDOWMENT, )??; assert_eq!(value, 22); diff --git a/examples/dry-running/Cargo.lock b/crates/drink/examples/dry-running/Cargo.lock similarity index 100% rename from examples/dry-running/Cargo.lock rename to crates/drink/examples/dry-running/Cargo.lock diff --git a/examples/dry-running/Cargo.toml b/crates/drink/examples/dry-running/Cargo.toml similarity index 100% rename from examples/dry-running/Cargo.toml rename to crates/drink/examples/dry-running/Cargo.toml diff --git a/examples/dry-running/README.md b/crates/drink/examples/dry-running/README.md similarity index 100% rename from examples/dry-running/README.md rename to crates/drink/examples/dry-running/README.md diff --git a/examples/dry-running/lib.rs b/crates/drink/examples/dry-running/lib.rs similarity index 94% rename from examples/dry-running/lib.rs rename to crates/drink/examples/dry-running/lib.rs index 3f4a19e..d966cec 100644 --- a/examples/dry-running/lib.rs +++ b/crates/drink/examples/dry-running/lib.rs @@ -33,7 +33,7 @@ mod tests { minimal::{MinimalSandbox, RuntimeCall}, pallet_balances, sandbox_api::prelude::*, - session::{Session, NO_ARGS, NO_SALT}, + session::{Session, NO_ARGS, NO_SALT, NO_ENDOWMENT}, AccountId32, DispatchError, Sandbox, }; @@ -46,7 +46,7 @@ mod tests { ) -> Result<(), Box> { // Firstly, let us dry-run contract instantiation with an incorrect constructor argument. let result = - session.dry_run_deployment(BundleProvider::local()?, "new", &["10"], NO_SALT, None)?; + session.dry_run_deployment(BundleProvider::local()?, "new", &["10"], NO_SALT, NO_ENDOWMENT)?; // Ensure that the contract was trapped. assert!(matches!( @@ -58,17 +58,17 @@ mod tests { // Now, let deploy the contract with a correct constructor argument. let address = - session.deploy_bundle(BundleProvider::local()?, "new", &["5"], NO_SALT, None)?; + session.deploy_bundle(BundleProvider::local()?, "new", &["5"], NO_SALT, NO_ENDOWMENT)?; // Ensure that deployment triggered event emission. assert!(!session.record().event_batches().is_empty()); // Now, let us dry-run a contract call. - let result = session.dry_run_call(address.clone(), "increment", NO_ARGS, None)?; + let result = session.dry_run_call(address.clone(), "increment", NO_ARGS, NO_ENDOWMENT)?; // We can check the estimated gas consumption. let gas_estimation = result.gas_consumed; // In the end, we can execute the call and verify gas consumption. - session.call_with_address::<_, ()>(address, "increment", NO_ARGS, None)??; + session.call_with_address::<_, ()>(address, "increment", NO_ARGS, NO_ENDOWMENT)??; let gas_consumption = session.record().last_call_result().gas_consumed; assert_eq!(gas_estimation, gas_consumption); diff --git a/examples/flipper/Cargo.lock b/crates/drink/examples/flipper/Cargo.lock similarity index 100% rename from examples/flipper/Cargo.lock rename to crates/drink/examples/flipper/Cargo.lock diff --git a/examples/flipper/Cargo.toml b/crates/drink/examples/flipper/Cargo.toml similarity index 99% rename from examples/flipper/Cargo.toml rename to crates/drink/examples/flipper/Cargo.toml index 7e45b4f..efa6bb4 100755 --- a/examples/flipper/Cargo.toml +++ b/crates/drink/examples/flipper/Cargo.toml @@ -8,7 +8,6 @@ version = "0.1.0" [dependencies] ink = { version = "=5.0.0", default-features = false, features = ["ink-debug"] } - scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true } diff --git a/examples/flipper/lib.rs b/crates/drink/examples/flipper/lib.rs similarity index 81% rename from examples/flipper/lib.rs rename to crates/drink/examples/flipper/lib.rs index 0d7f4d4..534391f 100755 --- a/examples/flipper/lib.rs +++ b/crates/drink/examples/flipper/lib.rs @@ -34,7 +34,7 @@ mod flipper { mod tests { use std::error::Error; - use drink::session::{Session, NO_ARGS, NO_SALT}; + use drink::session::{Session, NO_ARGS, NO_SALT, NO_ENDOWMENT}; #[drink::contract_bundle_provider] enum BundleProvider {} @@ -43,8 +43,8 @@ mod tests { fn initialization(mut session: Session) -> Result<(), Box> { let contract = BundleProvider::local()?; let init_value: bool = session - .deploy_bundle_and(contract, "new", &["true"], NO_SALT, None)? - .call_and("get", NO_ARGS, None)? + .deploy_bundle_and(contract, "new", &["true"], NO_SALT, NO_ENDOWMENT)? + .call_and("get", NO_ARGS, NO_ENDOWMENT)? .record() .last_call_return_decoded()? .expect("Call was successful"); @@ -58,11 +58,11 @@ mod tests { fn flipping(mut session: Session) -> Result<(), Box> { let contract = BundleProvider::Flipper.bundle()?; let init_value: bool = session - .deploy_bundle_and(contract, "new", &["true"], NO_SALT, None)? - .call_and("flip", NO_ARGS, None)? - .call_and("flip", NO_ARGS, None)? - .call_and("flip", NO_ARGS, None)? - .call_and("get", NO_ARGS, None)? + .deploy_bundle_and(contract, "new", &["true"], NO_SALT, NO_ENDOWMENT)? + .call_and("flip", NO_ARGS, NO_ENDOWMENT)? + .call_and("flip", NO_ARGS, NO_ENDOWMENT)? + .call_and("flip", NO_ARGS, NO_ENDOWMENT)? + .call_and("get", NO_ARGS, NO_ENDOWMENT)? .record() .last_call_return_decoded()? .expect("Call was successful"); diff --git a/examples/mocking/Cargo.lock b/crates/drink/examples/mocking/Cargo.lock similarity index 85% rename from examples/mocking/Cargo.lock rename to crates/drink/examples/mocking/Cargo.lock index bb45882..93f0d93 100644 --- a/examples/mocking/Cargo.lock +++ b/crates/drink/examples/mocking/Cargo.lock @@ -12,22 +12,13 @@ dependencies = [ "regex", ] -[[package]] -name = "addr2line" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" -dependencies = [ - "gimli 0.27.3", -] - [[package]] name = "addr2line" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.28.1", + "gimli", ] [[package]] @@ -46,17 +37,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.11" @@ -79,6 +59,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -94,15 +80,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - [[package]] name = "anstream" version = "0.6.13" @@ -157,15 +134,6 @@ version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" -[[package]] -name = "approx" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" -dependencies = [ - "num-traits", -] - [[package]] name = "aquamarine" version = "0.5.0" @@ -177,7 +145,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -341,7 +309,7 @@ checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -356,12 +324,12 @@ version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ - "addr2line 0.21.0", + "addr2line", "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.32.2", + "object", "rustc-demangle", ] @@ -402,33 +370,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] -name = "bincode" -version = "1.3.3" +name = "bitcoin-internals" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" [[package]] -name = "bip39" -version = "2.0.0" +name = "bitcoin_hashes" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" dependencies = [ - "bitcoin_hashes", - "rand", - "rand_core 0.6.4", - "serde", - "unicode-normalization", + "bitcoin-internals", + "hex-conservative", ] -[[package]] -name = "bitcoin_hashes" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" - [[package]] name = "bitflags" version = "1.3.2" @@ -577,12 +533,6 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" -[[package]] -name = "bytemuck" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" - [[package]] name = "byteorder" version = "1.5.0" @@ -696,7 +646,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -898,15 +848,6 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" -[[package]] -name = "cpp_demangle" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" -dependencies = [ - "cfg-if", -] - [[package]] name = "cpufeatures" version = "0.2.12" @@ -916,15 +857,6 @@ dependencies = [ "libc", ] -[[package]] -name = "cranelift-entity" -version = "0.95.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" -dependencies = [ - "serde", -] - [[package]] name = "crc32fast" version = "1.4.0" @@ -978,7 +910,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "subtle", "zeroize", ] @@ -990,7 +922,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "typenum", ] @@ -1004,29 +936,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "crypto-mac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" -dependencies = [ - "generic-array", - "subtle", -] - -[[package]] -name = "curve25519-dalek" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle", - "zeroize", -] - [[package]] name = "curve25519-dalek" version = "4.1.2" @@ -1052,7 +961,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1079,7 +988,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1096,7 +1005,7 @@ checksum = "b404f596046b0bb2d903a9c786b875a126261b52b7c3a64bbb66382c41c771df" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1144,7 +1053,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1166,7 +1075,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core 0.20.8", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1200,17 +1109,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive-syn-parse" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "derive-syn-parse" version = "0.2.0" @@ -1219,7 +1117,7 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1272,12 +1170,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a081e51fb188742f5a7a1164ad752121abcb22874b21e2c3b0dd040c515fdad" dependencies = [ "common-path", - "derive-syn-parse 0.2.0", + "derive-syn-parse", "once_cell", "proc-macro2", "quote", "regex", - "syn 2.0.57", + "syn 2.0.77", "termcolor", "toml", "walkdir", @@ -1299,6 +1197,7 @@ dependencies = [ "frame-support", "frame-system", "ink_sandbox", + "log", "parity-scale-codec", "parity-scale-codec-derive", "scale-info", @@ -1319,7 +1218,7 @@ dependencies = [ "darling 0.20.8", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1371,6 +1270,7 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", + "serdect", "signature", "spki", ] @@ -1391,7 +1291,7 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ - "curve25519-dalek 4.1.2", + "curve25519-dalek", "ed25519", "serde", "sha2 0.10.8", @@ -1401,15 +1301,16 @@ dependencies = [ [[package]] name = "ed25519-zebra" -version = "3.1.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ - "curve25519-dalek 3.2.0", - "hashbrown 0.12.3", + "curve25519-dalek", + "ed25519", + "hashbrown 0.14.3", "hex", - "rand_core 0.6.4", - "sha2 0.9.9", + "rand_core", + "sha2 0.10.8", "zeroize", ] @@ -1432,8 +1333,9 @@ dependencies = [ "generic-array", "group", "pkcs8", - "rand_core 0.6.4", + "rand_core", "sec1", + "serdect", "subtle", "zeroize", ] @@ -1480,15 +1382,9 @@ dependencies = [ "prettier-please", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - [[package]] name = "fastrand" version = "2.0.2" @@ -1501,7 +1397,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -1538,32 +1434,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "frame-benchmarking" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34134abd64876c2cba150b703d8c74b1b222147e61dbc33cbb9db72f7c1cdb2f" -dependencies = [ - "frame-support", - "frame-support-procedural", - "frame-system", - "linregress", - "log", - "parity-scale-codec", - "paste", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-io", - "sp-runtime", - "sp-runtime-interface", - "sp-std", - "sp-storage", - "static_assertions", -] - [[package]] name = "frame-metadata" version = "16.0.0" @@ -1578,9 +1448,9 @@ dependencies = [ [[package]] name = "frame-support" -version = "30.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bde5b74ac70a1c9fe4f846220ea10e78b81b0ffcdb567d16d28472bc332f95" +checksum = "2f4d08149c28010bfa568dcfa832aea628fb794d4243794a13b1bdef1aa66fb1" dependencies = [ "aquamarine", "array-bytes", @@ -1620,35 +1490,36 @@ dependencies = [ [[package]] name = "frame-support-procedural" -version = "25.0.0" +version = "30.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bf871c6655636a40a74d06f7f1bf69813f8037ad269704ae35b1c56c42ec" +checksum = "09237f309782a51551c12c4264a2cee5b870751004cdea29a6408ef8b9150c25" dependencies = [ "Inflector", "cfg-expr", - "derive-syn-parse 0.1.5", + "derive-syn-parse", + "docify", "expander", "frame-support-procedural-tools", - "itertools 0.10.5", + "itertools 0.11.0", "macro_magic", "proc-macro-warning", "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "frame-support-procedural-tools" -version = "11.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be30b1ce0b477476a3fe13cd8ff479007582340d14f0ddea9e832b01e706a07" +checksum = "bead15a320be1764cdd50458c4cfacb23e0cee65f64f500f8e34136a94c7eeca" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1659,14 +1530,14 @@ checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "frame-system" -version = "30.0.0" +version = "36.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c302f711acf3196b4bf2b4629a07a2ac6e44cd1782434ec88b85d59adfb1204d" +checksum = "64d6a0e7bb6503facdcc6f8e19c83cd0bfc8bbbd268522b1a50e107dfc6b972d" dependencies = [ "cfg-if", "docify", @@ -1755,7 +1626,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1817,18 +1688,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ "rand", - "rand_core 0.6.4", -] - -[[package]] -name = "gimli" -version = "0.27.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" -dependencies = [ - "fallible-iterator", - "indexmap 1.9.3", - "stable_deref_trait", + "rand_core", ] [[package]] @@ -1844,7 +1704,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -1868,9 +1728,6 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.8", -] [[package]] name = "hashbrown" @@ -1878,7 +1735,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.11", + "ahash", ] [[package]] @@ -1886,6 +1743,10 @@ name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] [[package]] name = "heck" @@ -1912,22 +1773,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "hmac" -version = "0.8.1" +name = "hex-conservative" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" -dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", -] +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" [[package]] name = "hmac" -version = "0.11.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" dependencies = [ - "crypto-mac 0.11.0", + "crypto-mac", "digest 0.9.0", ] @@ -2236,7 +2093,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -2298,7 +2155,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -2313,7 +2170,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", "synstructure", ] @@ -2361,12 +2218,12 @@ dependencies = [ [[package]] name = "ink_sandbox" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "503461a34d86043375b4206fec7c3f46e9efafa7b6617290ad3430142296801a" dependencies = [ "frame-metadata", "frame-support", "frame-system", + "log", + "pallet-assets", "pallet-balances", "pallet-contracts", "pallet-timestamp", @@ -2376,6 +2233,7 @@ dependencies = [ "sp-core", "sp-externalities", "sp-io", + "sp-runtime-interface", "wat", ] @@ -2421,21 +2279,19 @@ dependencies = [ ] [[package]] -name = "io-lifetimes" -version = "1.0.11" +name = "itertools" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", + "either", ] [[package]] name = "itertools" -version = "0.10.5" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" dependencies = [ "either", ] @@ -2489,6 +2345,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", + "serdect", "sha2 0.10.8", ] @@ -2599,24 +2456,9 @@ checksum = "adf157a4dc5a29b7b464aa8fe7edeff30076e07e13646a1c3874f58477dc99f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", -] - -[[package]] -name = "linregress" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de04dcecc58d366391f9920245b85ffa684558a5ef6e7736e754347c3aea9c2" -dependencies = [ - "nalgebra", + "syn 2.0.77", ] -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -2639,106 +2481,69 @@ version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - [[package]] name = "macro_magic" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e03844fc635e92f3a0067e25fa4bf3e3dbf3f2927bf3aa01bb7bc8f1c428949d" +checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d" dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "macro_magic_core" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d" +checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" dependencies = [ "const-random", - "derive-syn-parse 0.1.5", + "derive-syn-parse", "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "macro_magic_core_macros" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" +checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "macro_magic_macros" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" +checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "matchers" -version = "0.0.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ "regex-automata 0.1.10", ] -[[package]] -name = "matrixmultiply" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" -dependencies = [ - "autocfg", - "rawpointer", -] - [[package]] name = "memchr" version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" -[[package]] -name = "memfd" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" -dependencies = [ - "rustix 0.38.32", -] - -[[package]] -name = "memoffset" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" -dependencies = [ - "autocfg", -] - [[package]] name = "memory-db" version = "0.32.0" @@ -2756,7 +2561,7 @@ checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" dependencies = [ "byteorder", "keccak", - "rand_core 0.6.4", + "rand_core", "zeroize", ] @@ -2798,31 +2603,10 @@ dependencies = [ ] [[package]] -name = "nalgebra" -version = "0.32.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea4908d4f23254adda3daa60ffef0f1ac7b8c3e9a864cf3cc154b251908a2ef" -dependencies = [ - "approx", - "matrixmultiply", - "nalgebra-macros", - "num-complex", - "num-rational", - "num-traits", - "simba", - "typenum", -] - -[[package]] -name = "nalgebra-macros" -version = "0.2.1" +name = "multi-stash" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] +checksum = "685a9ac4b61f4e728e1d2c6a7844609c16527aeb5e6c865915c08e619c16410f" [[package]] name = "nohash-hasher" @@ -2854,22 +2638,23 @@ dependencies = [ ] [[package]] -name = "num-bigint" -version = "0.4.4" +name = "nu-ansi-term" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ - "autocfg", - "num-integer", - "num-traits", + "overload", + "winapi", ] [[package]] -name = "num-complex" -version = "0.4.5" +name = "num-bigint" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ + "autocfg", + "num-integer", "num-traits", ] @@ -2879,6 +2664,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "num-format" version = "0.4.4" @@ -2898,17 +2694,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.18" @@ -2930,21 +2715,9 @@ dependencies = [ [[package]] name = "object" -version = "0.30.4" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" -dependencies = [ - "crc32fast", - "hashbrown 0.13.2", - "indexmap 1.9.3", - "memchr", -] - -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] @@ -2971,14 +2744,36 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "pallet-assets" +version = "37.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f79ef6a7763fc08177f014052469ee12aefcdad0d99a747372360c2f648d2cc4" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-balances" -version = "30.0.0" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f68b79a1f9f10c63377177155a4ac3ac08db356027a3d8bc826e1af65c885b8d" +checksum = "6878e240962d3887f0e0654ac343a18845adb95ad493c9d4d5e803c015d4a4c3" dependencies = [ "docify", - "frame-benchmarking", "frame-support", "frame-system", "log", @@ -2990,24 +2785,21 @@ dependencies = [ [[package]] name = "pallet-contracts" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d67a473c8b28c22d998cc948fa2131ce2981af23dd65a5f7199518ac6d02c86" +checksum = "3e6989ac82690f981959b0d38ac6d6d52fc06bf00a035548d62b9a2e9c220376" dependencies = [ "bitflags 1.3.2", "environmental", - "frame-benchmarking", "frame-support", "frame-system", "impl-trait-for-tuples", "log", - "pallet-balances", "pallet-contracts-proc-macro", "pallet-contracts-uapi", "parity-scale-codec", - "rand", + "paste", "scale-info", - "serde", "smallvec", "sp-api", "sp-core", @@ -3016,31 +2808,30 @@ dependencies = [ "sp-std", "staging-xcm", "staging-xcm-builder", - "wasm-instrument", "wasmi", ] [[package]] name = "pallet-contracts-proc-macro" -version = "20.0.0" +version = "23.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c46c4f00188ed27e1cbe8eab750147d63daf25e9b7d66749646cf46d8a21ab96" +checksum = "94226cbd48516b7c310eb5dae8d50798c1ce73a7421dc0977c55b7fc2237a283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "pallet-contracts-uapi" -version = "7.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0a220fabeb1e7484f691248aa68101dc045ef8dc2cad5b5cc88c31df022c6e6" +checksum = "e1330375dcced95509e3cca7ef6b1c3fac648df995b86d39467d082ba981dc46" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", "paste", - "polkavm-derive 0.5.0", + "polkavm-derive 0.9.1", "scale-info", ] @@ -3057,19 +2848,17 @@ dependencies = [ [[package]] name = "pallet-timestamp" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c307589adc04a0d578ae00231bc04f1a53ef07a0aa2f3e9d4c7e4bf419bf6e3d" +checksum = "ae789d344be857679b0b98b28a67c747119724847f81d704d3fd03ee13fb6841" dependencies = [ "docify", - "frame-benchmarking", "frame-support", "frame-system", "log", "parity-scale-codec", "scale-info", "sp-inherents", - "sp-io", "sp-runtime", "sp-std", "sp-storage", @@ -3078,26 +2867,38 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "30.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d598d0ad779d19fa44ce6f80c57192537fa9f84995953bf2a8c104b7676b6b7" +checksum = "74fb6114223c8d967c3c2f21cbc845e8ea604ff7e21a8e59d119d5a9257ba886" dependencies = [ "frame-support", "frame-system", "parity-scale-codec", "scale-info", - "serde", "sp-core", "sp-io", "sp-runtime", "sp-std", ] +[[package]] +name = "parity-bip39" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" +dependencies = [ + "bitcoin_hashes", + "rand", + "rand_core", + "serde", + "unicode-normalization", +] + [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ "arrayvec", "bitvec", @@ -3110,11 +2911,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 1.0.109", @@ -3149,6 +2950,17 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + [[package]] name = "paste" version = "1.0.14" @@ -3157,11 +2969,12 @@ checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pbkdf2" -version = "0.8.0" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ - "crypto-mac 0.11.0", + "digest 0.10.7", + "password-hash", ] [[package]] @@ -3187,7 +3000,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -3220,9 +3033,9 @@ checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" [[package]] name = "polkadot-core-primitives" -version = "9.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89a881f63ab7a652aba19300f95f9341ee245ad45a3f89cf02053ecace474769" +checksum = "17c72ee63bcf920f963cd7ac066759b0b649350c8ab3781a85a6aac87b1488f2" dependencies = [ "parity-scale-codec", "scale-info", @@ -3233,9 +3046,9 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" -version = "8.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567c738aa6b8d7eb113fe73e50fb9b6292f818f54da98bb25c7fe73e98d1709a" +checksum = "f61070d0ff28f596890def0e0d03c231860796130b2a43e293106fa86a50c9a9" dependencies = [ "bounded-collections", "derive_more", @@ -3257,9 +3070,9 @@ checksum = "88b4e215c80fe876147f3d58158d5dfeae7dabdd6047e175af77095b78d0035c" [[package]] name = "polkavm-common" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c99f7eee94e7be43ba37eef65ad0ee8cbaf89b7c00001c3f6d2be985cb1817" +checksum = "1d9428a5cfcc85c5d7b9fc4b6a18c4b802d0173d768182a51cc7751640f08b92" [[package]] name = "polkavm-derive" @@ -3268,14 +3081,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6380dbe1fb03ecc74ad55d841cfc75480222d153ba69ddcb00977866cbdabdb8" dependencies = [ "polkavm-derive-impl 0.5.0", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "polkavm-derive" -version = "0.8.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79fa916f7962348bd1bb1a65a83401675e6fc86c51a0fdbcf92a3108e58e6125" +checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" dependencies = [ "polkavm-derive-impl-macro", ] @@ -3289,29 +3102,29 @@ dependencies = [ "polkavm-common 0.5.0", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "polkavm-derive-impl" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c10b2654a8a10a83c260bfb93e97b262cf0017494ab94a65d389e0eda6de6c9c" +checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c" dependencies = [ - "polkavm-common 0.8.0", + "polkavm-common 0.9.0", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "polkavm-derive-impl-macro" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e85319a0d5129dc9f021c62607e0804f5fb777a05cdda44d750ac0732def66" +checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ - "polkavm-derive-impl 0.8.0", - "syn 2.0.57", + "polkavm-derive-impl 0.9.0", + "syn 2.0.77", ] [[package]] @@ -3333,7 +3146,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22020dfcf177fcc7bf5deaf7440af371400c67c0de14c399938d8ed4fb4645d3" dependencies = [ "proc-macro2", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -3359,15 +3172,6 @@ dependencies = [ "toml_edit 0.19.15", ] -[[package]] -name = "proc-macro-crate" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" -dependencies = [ - "toml_edit 0.20.7", -] - [[package]] name = "proc-macro-crate" version = "3.1.0" @@ -3409,32 +3213,23 @@ checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] -[[package]] -name = "psm" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" -dependencies = [ - "cc", -] - [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -3453,7 +3248,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -3463,15 +3258,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", + "rand_core", ] -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" - [[package]] name = "rand_core" version = "0.6.4" @@ -3481,12 +3270,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - [[package]] name = "redox_syscall" version = "0.4.1" @@ -3513,7 +3296,7 @@ checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -3597,20 +3380,6 @@ dependencies = [ "semver", ] -[[package]] -name = "rustix" -version = "0.36.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - [[package]] name = "rustix" version = "0.38.32" @@ -3620,7 +3389,7 @@ dependencies = [ "bitflags 2.5.0", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys", "windows-sys 0.52.0", ] @@ -3636,15 +3405,6 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" -[[package]] -name = "safe_arch" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" -dependencies = [ - "bytemuck", -] - [[package]] name = "same-file" version = "1.0.6" @@ -3774,7 +3534,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.11", + "ahash", "cfg-if", "hashbrown 0.13.2", ] @@ -3788,10 +3548,10 @@ dependencies = [ "aead", "arrayref", "arrayvec", - "curve25519-dalek 4.1.2", + "curve25519-dalek", "getrandom_or_panic", "merlin", - "rand_core 0.6.4", + "rand_core", "serde_bytes", "sha2 0.10.8", "subtle", @@ -3820,6 +3580,7 @@ dependencies = [ "der", "generic-array", "pkcs8", + "serdect", "subtle", "zeroize", ] @@ -3886,7 +3647,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -3919,7 +3680,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -3960,6 +3721,16 @@ dependencies = [ "time", ] +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "sha2" version = "0.9.9" @@ -4050,20 +3821,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", - "rand_core 0.6.4", -] - -[[package]] -name = "simba" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" -dependencies = [ - "approx", - "num-complex", - "num-traits", - "paste", - "wide", + "rand_core", ] [[package]] @@ -4099,9 +3857,9 @@ dependencies = [ [[package]] name = "sp-api" -version = "28.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "298331cb47a948244f6fb4921b5cbeece267d72139fb90760993b6ec37b2212c" +checksum = "b7e43fbf034e9dbaa8ffc6a238a22808777eb38c580f66fc6736d8511631789e" dependencies = [ "hash-db", "log", @@ -4122,9 +3880,9 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "16.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18cfbb3ae0216e842dfb805ea8e896e85b07a7c34d432a6c7b7d770924431ed2" +checksum = "c9aadf9e97e694f0e343978aa632938c5de309cbcc8afed4136cb71596737278" dependencies = [ "Inflector", "blake2", @@ -4132,14 +3890,14 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "sp-application-crypto" -version = "32.0.0" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b4b7b12922cb90cf8dff0cab14087ba0ca25c1f04ba060c7294ce42c78d89ab" +checksum = "0d96d1fc0f1c741bbcbd0dd5470eff7b66f011708cc1942b088ebf0d4efb3d93" dependencies = [ "parity-scale-codec", "scale-info", @@ -4151,10 +3909,11 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "25.0.0" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "910c07fa263b20bf7271fdd4adcb5d3217dfdac14270592e0780223542e7e114" +checksum = "46d0d0a4c591c421d3231ddd5e27d828618c24456d51445d21a1f79fcee97c23" dependencies = [ + "docify", "integer-sqrt", "num-traits", "parity-scale-codec", @@ -4166,12 +3925,11 @@ dependencies = [ [[package]] name = "sp-core" -version = "30.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "586e0d5185e4545f465fc9a04fb9c4572d3e294137312496db2b67b0bb579e1f" +checksum = "c961a5e33fb2962fa775c044ceba43df9c6f917e2c35d63bfe23738468fa76a7" dependencies = [ "array-bytes", - "bip39", "bitflags 1.3.2", "blake2", "bounded-collections", @@ -4182,10 +3940,12 @@ dependencies = [ "hash-db", "hash256-std-hasher", "impl-serde", - "itertools 0.10.5", + "itertools 0.11.0", + "k256", "libsecp256k1", "log", "merlin", + "parity-bip39", "parity-scale-codec", "parking_lot", "paste", @@ -4232,7 +3992,7 @@ checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -4243,59 +4003,59 @@ checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "sp-externalities" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d6a4572eadd4a63cff92509a210bf425501a0c5e76574b30a366ac77653787" +checksum = "a904407d61cb94228c71b55a9d3708e9d6558991f9e83bd42bd91df37a159d30" dependencies = [ "environmental", "parity-scale-codec", - "sp-std", "sp-storage", ] [[package]] name = "sp-genesis-builder" -version = "0.9.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a862db099e8a799417b63ea79c90079811cdf68fcf3013d81cdceeddcec8f142" +checksum = "fcd065854d96fd81521c103d0aaa287d4f08b9b15c9fae2a3bfb208b0812bf44" dependencies = [ + "parity-scale-codec", + "scale-info", "serde_json", "sp-api", "sp-runtime", - "sp-std", ] [[package]] name = "sp-inherents" -version = "28.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42eb3c88572c7c80e7ecb6365601a490350b09d11000fcc7839efd304e172177" +checksum = "53407ba38ec22ca4a16381722c4bd0b559a0428bc1713079b0d5163ada63186a" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", "thiserror", ] [[package]] name = "sp-io" -version = "32.0.0" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca29e042628cb94cbcaefa935e624a9b48f9230dbce6324908e9b4f768317ef" +checksum = "5036cad2e48d41f5caf6785226c8be1a7db15bec14a9fd7aa6cca84f34cf689f" dependencies = [ "bytes", "ed25519-dalek", "libsecp256k1", "log", "parity-scale-codec", + "polkavm-derive 0.9.1", "rustversion", "secp256k1", "sp-core", @@ -4313,9 +4073,9 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.36.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd4bf9e5fa486416c92c2bb497b7ce2c43eac80cbdc407ffe2d34b365694ac29" +checksum = "0248b4d784cb4a01472276928977121fa39d977a5bb24793b6b15e64b046df42" dependencies = [ "parity-scale-codec", "parking_lot", @@ -4325,14 +4085,13 @@ dependencies = [ [[package]] name = "sp-metadata-ir" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0b5e87e56c1bb26d9524d48dd127121d630f895bd5914a34f0b017489f7c1d" +checksum = "a616fa51350b35326682a472ee8e6ba742fdacb18babac38ecd46b3e05ead869" dependencies = [ "frame-metadata", "parity-scale-codec", "scale-info", - "sp-std", ] [[package]] @@ -4348,15 +4107,16 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "33.0.0" +version = "38.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b28fcf8f53d917e420e783dd27d06fd276f55160301c5bc977cc5898c4130f6f" +checksum = "5273900f0b0bef48b2e1ff9c4fb5e188b8168ee5891418a427f4be2af92ee40f" dependencies = [ "docify", "either", "hash256-std-hasher", "impl-trait-for-tuples", "log", + "num-traits", "parity-scale-codec", "paste", "rand", @@ -4369,18 +4129,19 @@ dependencies = [ "sp-io", "sp-std", "sp-weights", + "tracing", ] [[package]] name = "sp-runtime-interface" -version = "26.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a675ea4858333d4d755899ed5ed780174aa34fec15953428d516af5452295" +checksum = "985eb981f40c689c6a0012c937b68ed58dabb4341d06f2dfe4dfd5ed72fa4017" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", - "polkavm-derive 0.8.0", + "polkavm-derive 0.9.1", "primitive-types", "sp-externalities", "sp-runtime-interface-proc-macro", @@ -4402,14 +4163,14 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "sp-staking" -version = "28.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48b92f4f66b40cbf7cf00d7808d8eec16e25cb420a29ec4060a74c0e9f7c2938" +checksum = "0a0b7abfe66c07a3b6eb99e1286dfa9b6f3b057b0e986e7da2ccbf707f6c781a" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -4417,14 +4178,13 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", ] [[package]] name = "sp-state-machine" -version = "0.37.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ae47765916d342b53d07be012a71efc4c1377d875ade31340cc4fb784b9921" +checksum = "211e528aa6e902261a343f7b40840aa3d66fe4ad3aadbd04a035f10baf96dbc5" dependencies = [ "hash-db", "log", @@ -4435,7 +4195,6 @@ dependencies = [ "sp-core", "sp-externalities", "sp-panic-handler", - "sp-std", "sp-trie", "thiserror", "tracing", @@ -4450,40 +4209,35 @@ checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" [[package]] name = "sp-storage" -version = "20.0.0" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dba5791cb3978e95daf99dad919ecb3ec35565604e88cd38d805d9d4981e8bd" +checksum = "99c82989b3a4979a7e1ad848aad9f5d0b4388f1f454cc131766526601ab9e8f8" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", "serde", "sp-debug-derive", - "sp-std", ] [[package]] name = "sp-timestamp" -version = "28.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee9532c2e4c8fcd7753cb4c741daeb8d9e3ac7cbc15a84c78d4c96492ed20eba" +checksum = "78becf144a76f6fd108dfe94a90e20a185b38c0b310dc5482328196143c8266b" dependencies = [ - "async-trait", "parity-scale-codec", "sp-inherents", "sp-runtime", - "sp-std", - "thiserror", ] [[package]] name = "sp-tracing" -version = "16.0.0" +version = "17.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0351810b9d074df71c4514c5228ed05c250607cba131c1c9d1526760ab69c05c" +checksum = "cf641a1d17268c8fcfdb8e0fa51a79c2d4222f4cfda5f3944dbdbc384dced8d5" dependencies = [ "parity-scale-codec", - "sp-std", "tracing", "tracing-core", "tracing-subscriber", @@ -4491,11 +4245,11 @@ dependencies = [ [[package]] name = "sp-trie" -version = "31.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5791e2e310cf88abedbd5f60ff3d9c9a09d95b182b4a7510f3648a2170ace593" +checksum = "841d717c0f465f5371569e6fdc25b6f32d47c15d6e4c92b3b779e1c9b18b951d" dependencies = [ - "ahash 0.8.11", + "ahash", "hash-db", "lazy_static", "memory-db", @@ -4507,7 +4261,6 @@ dependencies = [ "schnellru", "sp-core", "sp-externalities", - "sp-std", "thiserror", "tracing", "trie-db", @@ -4516,9 +4269,9 @@ dependencies = [ [[package]] name = "sp-version" -version = "31.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "973478ac076be7cb8e0a7968ee43cd7c46fb26e323d36020a9f3bb229e033cd2" +checksum = "bccf96fefae339dee7c4453f91be64eb28cce4c2fe82130445cf096b18b2c081" dependencies = [ "impl-serde", "parity-scale-codec", @@ -4534,35 +4287,32 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" -version = "13.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9bc3fed32d6dacbbbfb28dd1fe0224affbb737cb6cbfca1d9149351c2b69a7d" +checksum = "5aee8f6730641a65fcf0c8f9b1e448af4b3bb083d08058b47528188bccc7b7a7" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "sp-wasm-interface" -version = "20.0.0" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef97172c42eb4c6c26506f325f48463e9bc29b2034a587f1b9e48c751229bee" +checksum = "3b04b919e150b4736d85089d49327eab65507deb1485eec929af69daa2278eb3" dependencies = [ - "anyhow", "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-std", - "wasmtime", ] [[package]] name = "sp-weights" -version = "29.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8a9c7a1b64fa7dba38622ad1de26f0b2e595727c0e42c7b109ecb8e7120688" +checksum = "93cdaf72a1dad537bbb130ba4d47307ebe5170405280ed1aa31fa712718a400e" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -4571,7 +4321,6 @@ dependencies = [ "smallvec", "sp-arithmetic", "sp-debug-derive", - "sp-std", ] [[package]] @@ -4605,17 +4354,11 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "staging-xcm" -version = "9.0.0" +version = "14.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3028e3a4ee8493767ee66266571f5cf1fc3edc546bba650b2040c5418b318340" +checksum = "f2b7b5f531c6bf9629514ef8e5fda0e9e80dd84516957f710940d0e01d3fb36c" dependencies = [ "array-bytes", "bounded-collections", @@ -4632,9 +4375,9 @@ dependencies = [ [[package]] name = "staging-xcm-builder" -version = "9.0.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea27e235bcca331e5ba693fd224fcc16c17b53f53fca875c8dc54b733dba3c6" +checksum = "847fa2afe1bed2751eaabf7b91fa4043037947f17653d7cc59ea202cc44c6bb8" dependencies = [ "frame-support", "frame-system", @@ -4655,12 +4398,11 @@ dependencies = [ [[package]] name = "staging-xcm-executor" -version = "9.0.1" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe8c62fe1eee71592828a513693106ff301cdafd5ac5bd52e06d9315fd4f4f7a" +checksum = "26b98d8219449eaf02e71a7edf1a14b14d4c713dd01d9df66fde1ce30dba4d6d" dependencies = [ "environmental", - "frame-benchmarking", "frame-support", "impl-trait-for-tuples", "log", @@ -4681,6 +4423,16 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "string-interner" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c6a0d765f5807e98a091107bae0a56ea3799f66a5de47b2c84c94a39c09974e" +dependencies = [ + "cfg-if", + "hashbrown 0.14.3", +] + [[package]] name = "strsim" version = "0.10.0" @@ -4731,19 +4483,19 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "substrate-bip39" -version = "0.4.6" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" +checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" dependencies = [ - "hmac 0.11.0", + "hmac 0.12.1", "pbkdf2", "schnorrkel", - "sha2 0.9.9", + "sha2 0.10.8", "zeroize", ] @@ -4766,9 +4518,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.57" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a6ae1e52eb25aab8f3fb9fca13be982a373b8f1157ca14b897a825ba4a2d35" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -4783,7 +4535,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -4792,12 +4544,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" -[[package]] -name = "target-lexicon" -version = "0.12.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" - [[package]] name = "tempfile" version = "3.10.1" @@ -4806,7 +4552,7 @@ checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", - "rustix 0.38.32", + "rustix", "windows-sys 0.52.0", ] @@ -4846,7 +4592,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -4939,7 +4685,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -4999,17 +4745,6 @@ dependencies = [ "winnow 0.5.40", ] -[[package]] -name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.21.1" @@ -5082,7 +4817,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -5097,55 +4832,41 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.4" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ "log", "once_cell", "tracing-core", ] -[[package]] -name = "tracing-serde" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" -dependencies = [ - "serde", - "tracing-core", -] - [[package]] name = "tracing-subscriber" -version = "0.2.25" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ - "ansi_term", - "chrono", - "lazy_static", "matchers", + "nu-ansi-term", + "once_cell", "regex", - "serde", - "serde_json", "sharded-slab", "smallvec", "thread_local", + "time", "tracing", "tracing-core", "tracing-log", - "tracing-serde", ] [[package]] name = "trie-db" -version = "0.28.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff28e0f815c2fea41ebddf148e008b077d2faddb026c9555b29696114d602642" +checksum = "0c992b4f40c234a074d48a757efeabb1a6be88af84c0c23f7ca158950cb0ae7f" dependencies = [ "hash-db", - "hashbrown 0.13.2", "log", "rustc-hex", "smallvec", @@ -5298,7 +5019,7 @@ dependencies = [ "digest 0.10.7", "rand", "rand_chacha", - "rand_core 0.6.4", + "rand_core", "sha2 0.10.8", "sha3", "thiserror", @@ -5351,7 +5072,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", "wasm-bindgen-shared", ] @@ -5373,7 +5094,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5393,15 +5114,6 @@ dependencies = [ "leb128", ] -[[package]] -name = "wasm-instrument" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a47ecb37b9734d1085eaa5ae1a81e60801fd8c28d4cabdd8aedb982021918bc" -dependencies = [ - "parity-wasm", -] - [[package]] name = "wasm-opt" version = "0.116.0" @@ -5444,28 +5156,37 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.31.2" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8281d1d660cdf54c76a3efa9ddd0c270cada1383a995db3ccb43d166456c7" +checksum = "50386c99b9c32bd2ed71a55b6dd4040af2580530fae8bdb9a6576571a80d0cca" dependencies = [ + "arrayvec", + "multi-stash", + "num-derive", + "num-traits", "smallvec", "spin", - "wasmi_arena", + "wasmi_collections", "wasmi_core", "wasmparser-nostd", ] [[package]] -name = "wasmi_arena" -version = "0.4.1" +name = "wasmi_collections" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" +checksum = "9c128c039340ffd50d4195c3f8ce31aac357f06804cfc494c8b9508d4b30dca4" +dependencies = [ + "ahash", + "hashbrown 0.14.3", + "string-interner", +] [[package]] name = "wasmi_core" -version = "0.13.0" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" +checksum = "a23b3a7f6c8c3ceeec6b83531ee61f0013c56e51cbf2b14b0f213548b23a4b41" dependencies = [ "downcast-rs", "libm", @@ -5473,157 +5194,15 @@ dependencies = [ "paste", ] -[[package]] -name = "wasmparser" -version = "0.102.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" -dependencies = [ - "indexmap 1.9.3", - "url", -] - [[package]] name = "wasmparser-nostd" -version = "0.100.1" +version = "0.100.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9157cab83003221bfd385833ab587a039f5d6fa7304854042ba358a3b09e0724" +checksum = "d5a015fe95f3504a94bb1462c717aae75253e39b9dd6c3fb1062c934535c64aa" dependencies = [ "indexmap-nostd", ] -[[package]] -name = "wasmtime" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" -dependencies = [ - "anyhow", - "bincode", - "cfg-if", - "indexmap 1.9.3", - "libc", - "log", - "object 0.30.4", - "once_cell", - "paste", - "psm", - "serde", - "target-lexicon", - "wasmparser", - "wasmtime-environ", - "wasmtime-jit", - "wasmtime-runtime", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-asm-macros" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "wasmtime-environ" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" -dependencies = [ - "anyhow", - "cranelift-entity", - "gimli 0.27.3", - "indexmap 1.9.3", - "log", - "object 0.30.4", - "serde", - "target-lexicon", - "thiserror", - "wasmparser", - "wasmtime-types", -] - -[[package]] -name = "wasmtime-jit" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" -dependencies = [ - "addr2line 0.19.0", - "anyhow", - "bincode", - "cfg-if", - "cpp_demangle", - "gimli 0.27.3", - "log", - "object 0.30.4", - "rustc-demangle", - "serde", - "target-lexicon", - "wasmtime-environ", - "wasmtime-jit-icache-coherence", - "wasmtime-runtime", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-jit-debug" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" -dependencies = [ - "once_cell", -] - -[[package]] -name = "wasmtime-jit-icache-coherence" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" -dependencies = [ - "cfg-if", - "libc", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-runtime" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" -dependencies = [ - "anyhow", - "cc", - "cfg-if", - "indexmap 1.9.3", - "libc", - "log", - "mach", - "memfd", - "memoffset", - "paste", - "rand", - "rustix 0.36.17", - "wasmtime-asm-macros", - "wasmtime-environ", - "wasmtime-jit-debug", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-types" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" -dependencies = [ - "cranelift-entity", - "serde", - "thiserror", - "wasmparser", -] - [[package]] name = "wast" version = "202.0.0" @@ -5654,20 +5233,10 @@ checksum = "8211e4f58a2b2805adfbefbc07bab82958fc91e3836339b1ab7ae32465dce0d7" dependencies = [ "either", "home", - "rustix 0.38.32", + "rustix", "winsafe", ] -[[package]] -name = "wide" -version = "0.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89beec544f246e679fc25490e3f8e08003bc4bf612068f325120dad4cea02c1c" -dependencies = [ - "bytemuck", - "safe_arch", -] - [[package]] name = "winapi" version = "0.3.9" @@ -5708,15 +5277,6 @@ dependencies = [ "windows-targets 0.52.4", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -5735,21 +5295,6 @@ dependencies = [ "windows-targets 0.52.4", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.48.5" @@ -5780,12 +5325,6 @@ dependencies = [ "windows_x86_64_msvc 0.52.4", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -5798,12 +5337,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -5816,12 +5349,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -5834,12 +5361,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -5852,12 +5373,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -5870,12 +5385,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -5888,12 +5397,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -5941,14 +5444,14 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "8.0.0" +version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4717a97970a9cda70d7db53cf50d2615c2f6f6b7c857445325b4a39ea7aa2cd" +checksum = "87fb4f14094d65c500a59bcf540cf42b99ee82c706edd6226a92e769ad60563e" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -5974,7 +5477,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -5994,7 +5497,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] diff --git a/examples/mocking/Cargo.toml b/crates/drink/examples/mocking/Cargo.toml similarity index 97% rename from examples/mocking/Cargo.toml rename to crates/drink/examples/mocking/Cargo.toml index dca7803..ca038e5 100755 --- a/examples/mocking/Cargo.toml +++ b/crates/drink/examples/mocking/Cargo.toml @@ -22,6 +22,7 @@ path = "lib.rs" default = ["std"] std = [ "ink/std", + "drink/std", "scale/std", "scale-info/std", ] diff --git a/examples/mocking/README.md b/crates/drink/examples/mocking/README.md similarity index 100% rename from examples/mocking/README.md rename to crates/drink/examples/mocking/README.md diff --git a/examples/mocking/lib.rs b/crates/drink/examples/mocking/lib.rs similarity index 96% rename from examples/mocking/lib.rs rename to crates/drink/examples/mocking/lib.rs index 40c0a2f..8f51a1e 100755 --- a/examples/mocking/lib.rs +++ b/crates/drink/examples/mocking/lib.rs @@ -41,7 +41,7 @@ mod tests { use drink::{ mock_message, - session::{mocking_api::MockingApi, Session, NO_ARGS, NO_SALT}, + session::{mocking_api::MockingApi, Session, NO_ARGS, NO_SALT, NO_ENDOWMENT}, ContractMock, }; @@ -62,8 +62,8 @@ mod tests { // Now, we can deploy our proper contract and verify its behavior. let result: (u8, u8) = session - .deploy_bundle_and(BundleProvider::local()?, "new", NO_ARGS, NO_SALT, None)? - .call_and("forward_call", &[mock_address.to_string()], None)? + .deploy_bundle_and(BundleProvider::local()?, "new", NO_ARGS, NO_SALT, NO_ENDOWMENT)? + .call_and("forward_call", &[mock_address.to_string()], NO_ENDOWMENT)? .record() .last_call_return_decoded()? .expect("Call was successful"); diff --git a/examples/multiple-contracts/Cargo.lock b/crates/drink/examples/multiple-contracts/Cargo.lock similarity index 85% rename from examples/multiple-contracts/Cargo.lock rename to crates/drink/examples/multiple-contracts/Cargo.lock index c2b5d6d..b68d9c7 100644 --- a/examples/multiple-contracts/Cargo.lock +++ b/crates/drink/examples/multiple-contracts/Cargo.lock @@ -12,22 +12,13 @@ dependencies = [ "regex", ] -[[package]] -name = "addr2line" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" -dependencies = [ - "gimli 0.27.3", -] - [[package]] name = "addr2line" version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.28.1", + "gimli", ] [[package]] @@ -46,17 +37,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.11" @@ -79,6 +59,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -94,15 +80,6 @@ dependencies = [ "libc", ] -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - [[package]] name = "anstream" version = "0.6.13" @@ -157,15 +134,6 @@ version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" -[[package]] -name = "approx" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" -dependencies = [ - "num-traits", -] - [[package]] name = "aquamarine" version = "0.5.0" @@ -177,7 +145,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -341,7 +309,7 @@ checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -356,12 +324,12 @@ version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ - "addr2line 0.21.0", + "addr2line", "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.32.2", + "object", "rustc-demangle", ] @@ -402,33 +370,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] -name = "bincode" -version = "1.3.3" +name = "bitcoin-internals" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" [[package]] -name = "bip39" -version = "2.0.0" +name = "bitcoin_hashes" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" dependencies = [ - "bitcoin_hashes", - "rand", - "rand_core 0.6.4", - "serde", - "unicode-normalization", + "bitcoin-internals", + "hex-conservative", ] -[[package]] -name = "bitcoin_hashes" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" - [[package]] name = "bitflags" version = "1.3.2" @@ -577,12 +533,6 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" -[[package]] -name = "bytemuck" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" - [[package]] name = "byteorder" version = "1.5.0" @@ -696,7 +646,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -898,15 +848,6 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" -[[package]] -name = "cpp_demangle" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" -dependencies = [ - "cfg-if", -] - [[package]] name = "cpufeatures" version = "0.2.12" @@ -916,15 +857,6 @@ dependencies = [ "libc", ] -[[package]] -name = "cranelift-entity" -version = "0.95.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" -dependencies = [ - "serde", -] - [[package]] name = "crc32fast" version = "1.4.0" @@ -978,7 +910,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "subtle", "zeroize", ] @@ -990,7 +922,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "typenum", ] @@ -1004,29 +936,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "crypto-mac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" -dependencies = [ - "generic-array", - "subtle", -] - -[[package]] -name = "curve25519-dalek" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle", - "zeroize", -] - [[package]] name = "curve25519-dalek" version = "4.1.2" @@ -1052,7 +961,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1079,7 +988,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1096,7 +1005,7 @@ checksum = "b404f596046b0bb2d903a9c786b875a126261b52b7c3a64bbb66382c41c771df" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1144,7 +1053,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1166,7 +1075,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core 0.20.8", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1200,17 +1109,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive-syn-parse" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "derive-syn-parse" version = "0.2.0" @@ -1219,7 +1117,7 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1272,12 +1170,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a081e51fb188742f5a7a1164ad752121abcb22874b21e2c3b0dd040c515fdad" dependencies = [ "common-path", - "derive-syn-parse 0.2.0", + "derive-syn-parse", "once_cell", "proc-macro2", "quote", "regex", - "syn 2.0.57", + "syn 2.0.77", "termcolor", "toml", "walkdir", @@ -1299,6 +1197,7 @@ dependencies = [ "frame-support", "frame-system", "ink_sandbox", + "log", "parity-scale-codec", "parity-scale-codec-derive", "scale-info", @@ -1319,7 +1218,7 @@ dependencies = [ "darling 0.20.8", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1371,6 +1270,7 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", + "serdect", "signature", "spki", ] @@ -1391,7 +1291,7 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ - "curve25519-dalek 4.1.2", + "curve25519-dalek", "ed25519", "serde", "sha2 0.10.8", @@ -1401,15 +1301,16 @@ dependencies = [ [[package]] name = "ed25519-zebra" -version = "3.1.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ - "curve25519-dalek 3.2.0", - "hashbrown 0.12.3", + "curve25519-dalek", + "ed25519", + "hashbrown 0.14.3", "hex", - "rand_core 0.6.4", - "sha2 0.9.9", + "rand_core", + "sha2 0.10.8", "zeroize", ] @@ -1432,8 +1333,9 @@ dependencies = [ "generic-array", "group", "pkcs8", - "rand_core 0.6.4", + "rand_core", "sec1", + "serdect", "subtle", "zeroize", ] @@ -1480,15 +1382,9 @@ dependencies = [ "prettier-please", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - [[package]] name = "fastrand" version = "2.0.2" @@ -1501,7 +1397,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -1538,32 +1434,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "frame-benchmarking" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34134abd64876c2cba150b703d8c74b1b222147e61dbc33cbb9db72f7c1cdb2f" -dependencies = [ - "frame-support", - "frame-support-procedural", - "frame-system", - "linregress", - "log", - "parity-scale-codec", - "paste", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-io", - "sp-runtime", - "sp-runtime-interface", - "sp-std", - "sp-storage", - "static_assertions", -] - [[package]] name = "frame-metadata" version = "16.0.0" @@ -1578,9 +1448,9 @@ dependencies = [ [[package]] name = "frame-support" -version = "30.0.0" +version = "36.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40bde5b74ac70a1c9fe4f846220ea10e78b81b0ffcdb567d16d28472bc332f95" +checksum = "2f4d08149c28010bfa568dcfa832aea628fb794d4243794a13b1bdef1aa66fb1" dependencies = [ "aquamarine", "array-bytes", @@ -1620,35 +1490,36 @@ dependencies = [ [[package]] name = "frame-support-procedural" -version = "25.0.0" +version = "30.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bf871c6655636a40a74d06f7f1bf69813f8037ad269704ae35b1c56c42ec" +checksum = "09237f309782a51551c12c4264a2cee5b870751004cdea29a6408ef8b9150c25" dependencies = [ "Inflector", "cfg-expr", - "derive-syn-parse 0.1.5", + "derive-syn-parse", + "docify", "expander", "frame-support-procedural-tools", - "itertools 0.10.5", + "itertools 0.11.0", "macro_magic", "proc-macro-warning", "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "frame-support-procedural-tools" -version = "11.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be30b1ce0b477476a3fe13cd8ff479007582340d14f0ddea9e832b01e706a07" +checksum = "bead15a320be1764cdd50458c4cfacb23e0cee65f64f500f8e34136a94c7eeca" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1659,14 +1530,14 @@ checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "frame-system" -version = "30.0.0" +version = "36.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c302f711acf3196b4bf2b4629a07a2ac6e44cd1782434ec88b85d59adfb1204d" +checksum = "64d6a0e7bb6503facdcc6f8e19c83cd0bfc8bbbd268522b1a50e107dfc6b972d" dependencies = [ "cfg-if", "docify", @@ -1755,7 +1626,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -1817,18 +1688,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ "rand", - "rand_core 0.6.4", -] - -[[package]] -name = "gimli" -version = "0.27.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" -dependencies = [ - "fallible-iterator", - "indexmap 1.9.3", - "stable_deref_trait", + "rand_core", ] [[package]] @@ -1844,7 +1704,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -1868,9 +1728,6 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.8", -] [[package]] name = "hashbrown" @@ -1878,7 +1735,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.11", + "ahash", ] [[package]] @@ -1886,6 +1743,10 @@ name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] [[package]] name = "heck" @@ -1912,22 +1773,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "hmac" -version = "0.8.1" +name = "hex-conservative" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" -dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", -] +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" [[package]] name = "hmac" -version = "0.11.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" dependencies = [ - "crypto-mac 0.11.0", + "crypto-mac", "digest 0.9.0", ] @@ -2236,7 +2093,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -2298,7 +2155,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -2313,7 +2170,7 @@ dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", "synstructure", ] @@ -2361,12 +2218,12 @@ dependencies = [ [[package]] name = "ink_sandbox" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "503461a34d86043375b4206fec7c3f46e9efafa7b6617290ad3430142296801a" dependencies = [ "frame-metadata", "frame-support", "frame-system", + "log", + "pallet-assets", "pallet-balances", "pallet-contracts", "pallet-timestamp", @@ -2376,6 +2233,7 @@ dependencies = [ "sp-core", "sp-externalities", "sp-io", + "sp-runtime-interface", "wat", ] @@ -2421,21 +2279,19 @@ dependencies = [ ] [[package]] -name = "io-lifetimes" -version = "1.0.11" +name = "itertools" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", + "either", ] [[package]] name = "itertools" -version = "0.10.5" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" dependencies = [ "either", ] @@ -2489,6 +2345,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", + "serdect", "sha2 0.10.8", ] @@ -2599,24 +2456,9 @@ checksum = "adf157a4dc5a29b7b464aa8fe7edeff30076e07e13646a1c3874f58477dc99f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", -] - -[[package]] -name = "linregress" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4de04dcecc58d366391f9920245b85ffa684558a5ef6e7736e754347c3aea9c2" -dependencies = [ - "nalgebra", + "syn 2.0.77", ] -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -2639,106 +2481,69 @@ version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - [[package]] name = "macro_magic" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e03844fc635e92f3a0067e25fa4bf3e3dbf3f2927bf3aa01bb7bc8f1c428949d" +checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d" dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "macro_magic_core" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d" +checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" dependencies = [ "const-random", - "derive-syn-parse 0.1.5", + "derive-syn-parse", "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "macro_magic_core_macros" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" +checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "macro_magic_macros" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" +checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "matchers" -version = "0.0.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ "regex-automata 0.1.10", ] -[[package]] -name = "matrixmultiply" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" -dependencies = [ - "autocfg", - "rawpointer", -] - [[package]] name = "memchr" version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" -[[package]] -name = "memfd" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" -dependencies = [ - "rustix 0.38.32", -] - -[[package]] -name = "memoffset" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" -dependencies = [ - "autocfg", -] - [[package]] name = "memory-db" version = "0.32.0" @@ -2756,7 +2561,7 @@ checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" dependencies = [ "byteorder", "keccak", - "rand_core 0.6.4", + "rand_core", "zeroize", ] @@ -2787,6 +2592,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "multi-stash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685a9ac4b61f4e728e1d2c6a7844609c16527aeb5e6c865915c08e619c16410f" + [[package]] name = "multiple-contracts" version = "0.1.0" @@ -2796,33 +2607,6 @@ dependencies = [ "psp22", ] -[[package]] -name = "nalgebra" -version = "0.32.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea4908d4f23254adda3daa60ffef0f1ac7b8c3e9a864cf3cc154b251908a2ef" -dependencies = [ - "approx", - "matrixmultiply", - "nalgebra-macros", - "num-complex", - "num-rational", - "num-traits", - "simba", - "typenum", -] - -[[package]] -name = "nalgebra-macros" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "nohash-hasher" version = "0.2.0" @@ -2853,22 +2637,23 @@ dependencies = [ ] [[package]] -name = "num-bigint" -version = "0.4.4" +name = "nu-ansi-term" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ - "autocfg", - "num-integer", - "num-traits", + "overload", + "winapi", ] [[package]] -name = "num-complex" -version = "0.4.5" +name = "num-bigint" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ + "autocfg", + "num-integer", "num-traits", ] @@ -2878,6 +2663,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "num-format" version = "0.4.4" @@ -2898,21 +2694,10 @@ dependencies = [ ] [[package]] -name = "num-rational" -version = "0.4.1" +name = "num-traits" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -2927,18 +2712,6 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.30.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" -dependencies = [ - "crc32fast", - "hashbrown 0.13.2", - "indexmap 1.9.3", - "memchr", -] - [[package]] name = "object" version = "0.32.2" @@ -2970,14 +2743,36 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "pallet-assets" +version = "37.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f79ef6a7763fc08177f014052469ee12aefcdad0d99a747372360c2f648d2cc4" +dependencies = [ + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-balances" -version = "30.0.0" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f68b79a1f9f10c63377177155a4ac3ac08db356027a3d8bc826e1af65c885b8d" +checksum = "6878e240962d3887f0e0654ac343a18845adb95ad493c9d4d5e803c015d4a4c3" dependencies = [ "docify", - "frame-benchmarking", "frame-support", "frame-system", "log", @@ -2989,24 +2784,21 @@ dependencies = [ [[package]] name = "pallet-contracts" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d67a473c8b28c22d998cc948fa2131ce2981af23dd65a5f7199518ac6d02c86" +checksum = "3e6989ac82690f981959b0d38ac6d6d52fc06bf00a035548d62b9a2e9c220376" dependencies = [ "bitflags 1.3.2", "environmental", - "frame-benchmarking", "frame-support", "frame-system", "impl-trait-for-tuples", "log", - "pallet-balances", "pallet-contracts-proc-macro", "pallet-contracts-uapi", "parity-scale-codec", - "rand", + "paste", "scale-info", - "serde", "smallvec", "sp-api", "sp-core", @@ -3015,31 +2807,30 @@ dependencies = [ "sp-std", "staging-xcm", "staging-xcm-builder", - "wasm-instrument", "wasmi", ] [[package]] name = "pallet-contracts-proc-macro" -version = "20.0.0" +version = "23.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c46c4f00188ed27e1cbe8eab750147d63daf25e9b7d66749646cf46d8a21ab96" +checksum = "94226cbd48516b7c310eb5dae8d50798c1ce73a7421dc0977c55b7fc2237a283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "pallet-contracts-uapi" -version = "7.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0a220fabeb1e7484f691248aa68101dc045ef8dc2cad5b5cc88c31df022c6e6" +checksum = "e1330375dcced95509e3cca7ef6b1c3fac648df995b86d39467d082ba981dc46" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", "paste", - "polkavm-derive 0.5.0", + "polkavm-derive 0.9.1", "scale-info", ] @@ -3056,19 +2847,17 @@ dependencies = [ [[package]] name = "pallet-timestamp" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c307589adc04a0d578ae00231bc04f1a53ef07a0aa2f3e9d4c7e4bf419bf6e3d" +checksum = "ae789d344be857679b0b98b28a67c747119724847f81d704d3fd03ee13fb6841" dependencies = [ "docify", - "frame-benchmarking", "frame-support", "frame-system", "log", "parity-scale-codec", "scale-info", "sp-inherents", - "sp-io", "sp-runtime", "sp-std", "sp-storage", @@ -3077,26 +2866,38 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "30.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d598d0ad779d19fa44ce6f80c57192537fa9f84995953bf2a8c104b7676b6b7" +checksum = "74fb6114223c8d967c3c2f21cbc845e8ea604ff7e21a8e59d119d5a9257ba886" dependencies = [ "frame-support", "frame-system", "parity-scale-codec", "scale-info", - "serde", "sp-core", "sp-io", "sp-runtime", "sp-std", ] +[[package]] +name = "parity-bip39" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" +dependencies = [ + "bitcoin_hashes", + "rand", + "rand_core", + "serde", + "unicode-normalization", +] + [[package]] name = "parity-scale-codec" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" dependencies = [ "arrayvec", "bitvec", @@ -3109,11 +2910,11 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.9" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 2.0.0", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 1.0.109", @@ -3148,6 +2949,17 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + [[package]] name = "paste" version = "1.0.14" @@ -3156,11 +2968,12 @@ checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pbkdf2" -version = "0.8.0" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ - "crypto-mac 0.11.0", + "digest 0.10.7", + "password-hash", ] [[package]] @@ -3186,7 +2999,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -3219,9 +3032,9 @@ checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" [[package]] name = "polkadot-core-primitives" -version = "9.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89a881f63ab7a652aba19300f95f9341ee245ad45a3f89cf02053ecace474769" +checksum = "17c72ee63bcf920f963cd7ac066759b0b649350c8ab3781a85a6aac87b1488f2" dependencies = [ "parity-scale-codec", "scale-info", @@ -3232,9 +3045,9 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" -version = "8.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567c738aa6b8d7eb113fe73e50fb9b6292f818f54da98bb25c7fe73e98d1709a" +checksum = "f61070d0ff28f596890def0e0d03c231860796130b2a43e293106fa86a50c9a9" dependencies = [ "bounded-collections", "derive_more", @@ -3256,9 +3069,9 @@ checksum = "88b4e215c80fe876147f3d58158d5dfeae7dabdd6047e175af77095b78d0035c" [[package]] name = "polkavm-common" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c99f7eee94e7be43ba37eef65ad0ee8cbaf89b7c00001c3f6d2be985cb1817" +checksum = "1d9428a5cfcc85c5d7b9fc4b6a18c4b802d0173d768182a51cc7751640f08b92" [[package]] name = "polkavm-derive" @@ -3267,14 +3080,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6380dbe1fb03ecc74ad55d841cfc75480222d153ba69ddcb00977866cbdabdb8" dependencies = [ "polkavm-derive-impl 0.5.0", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "polkavm-derive" -version = "0.8.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79fa916f7962348bd1bb1a65a83401675e6fc86c51a0fdbcf92a3108e58e6125" +checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" dependencies = [ "polkavm-derive-impl-macro", ] @@ -3288,29 +3101,29 @@ dependencies = [ "polkavm-common 0.5.0", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "polkavm-derive-impl" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c10b2654a8a10a83c260bfb93e97b262cf0017494ab94a65d389e0eda6de6c9c" +checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c" dependencies = [ - "polkavm-common 0.8.0", + "polkavm-common 0.9.0", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "polkavm-derive-impl-macro" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e85319a0d5129dc9f021c62607e0804f5fb777a05cdda44d750ac0732def66" +checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" dependencies = [ - "polkavm-derive-impl 0.8.0", - "syn 2.0.57", + "polkavm-derive-impl 0.9.0", + "syn 2.0.77", ] [[package]] @@ -3332,7 +3145,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22020dfcf177fcc7bf5deaf7440af371400c67c0de14c399938d8ed4fb4645d3" dependencies = [ "proc-macro2", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -3358,15 +3171,6 @@ dependencies = [ "toml_edit 0.19.15", ] -[[package]] -name = "proc-macro-crate" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" -dependencies = [ - "toml_edit 0.20.7", -] - [[package]] name = "proc-macro-crate" version = "3.1.0" @@ -3408,27 +3212,18 @@ checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] -[[package]] -name = "psm" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" -dependencies = [ - "cc", -] - [[package]] name = "psp22" version = "0.3.0" @@ -3439,9 +3234,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -3460,7 +3255,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -3470,15 +3265,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", + "rand_core", ] -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" - [[package]] name = "rand_core" version = "0.6.4" @@ -3488,12 +3277,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - [[package]] name = "redox_syscall" version = "0.4.1" @@ -3520,7 +3303,7 @@ checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -3604,20 +3387,6 @@ dependencies = [ "semver", ] -[[package]] -name = "rustix" -version = "0.36.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - [[package]] name = "rustix" version = "0.38.32" @@ -3627,7 +3396,7 @@ dependencies = [ "bitflags 2.5.0", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys", "windows-sys 0.52.0", ] @@ -3643,15 +3412,6 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" -[[package]] -name = "safe_arch" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" -dependencies = [ - "bytemuck", -] - [[package]] name = "same-file" version = "1.0.6" @@ -3781,7 +3541,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" dependencies = [ - "ahash 0.8.11", + "ahash", "cfg-if", "hashbrown 0.13.2", ] @@ -3795,10 +3555,10 @@ dependencies = [ "aead", "arrayref", "arrayvec", - "curve25519-dalek 4.1.2", + "curve25519-dalek", "getrandom_or_panic", "merlin", - "rand_core 0.6.4", + "rand_core", "serde_bytes", "sha2 0.10.8", "subtle", @@ -3827,6 +3587,7 @@ dependencies = [ "der", "generic-array", "pkcs8", + "serdect", "subtle", "zeroize", ] @@ -3893,7 +3654,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -3926,7 +3687,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -3967,6 +3728,16 @@ dependencies = [ "time", ] +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "sha2" version = "0.9.9" @@ -4057,20 +3828,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", - "rand_core 0.6.4", -] - -[[package]] -name = "simba" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061507c94fc6ab4ba1c9a0305018408e312e17c041eb63bef8aa726fa33aceae" -dependencies = [ - "approx", - "num-complex", - "num-traits", - "paste", - "wide", + "rand_core", ] [[package]] @@ -4106,9 +3864,9 @@ dependencies = [ [[package]] name = "sp-api" -version = "28.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "298331cb47a948244f6fb4921b5cbeece267d72139fb90760993b6ec37b2212c" +checksum = "b7e43fbf034e9dbaa8ffc6a238a22808777eb38c580f66fc6736d8511631789e" dependencies = [ "hash-db", "log", @@ -4129,9 +3887,9 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "16.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18cfbb3ae0216e842dfb805ea8e896e85b07a7c34d432a6c7b7d770924431ed2" +checksum = "c9aadf9e97e694f0e343978aa632938c5de309cbcc8afed4136cb71596737278" dependencies = [ "Inflector", "blake2", @@ -4139,14 +3897,14 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "sp-application-crypto" -version = "32.0.0" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b4b7b12922cb90cf8dff0cab14087ba0ca25c1f04ba060c7294ce42c78d89ab" +checksum = "0d96d1fc0f1c741bbcbd0dd5470eff7b66f011708cc1942b088ebf0d4efb3d93" dependencies = [ "parity-scale-codec", "scale-info", @@ -4158,10 +3916,11 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "25.0.0" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "910c07fa263b20bf7271fdd4adcb5d3217dfdac14270592e0780223542e7e114" +checksum = "46d0d0a4c591c421d3231ddd5e27d828618c24456d51445d21a1f79fcee97c23" dependencies = [ + "docify", "integer-sqrt", "num-traits", "parity-scale-codec", @@ -4173,12 +3932,11 @@ dependencies = [ [[package]] name = "sp-core" -version = "30.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "586e0d5185e4545f465fc9a04fb9c4572d3e294137312496db2b67b0bb579e1f" +checksum = "c961a5e33fb2962fa775c044ceba43df9c6f917e2c35d63bfe23738468fa76a7" dependencies = [ "array-bytes", - "bip39", "bitflags 1.3.2", "blake2", "bounded-collections", @@ -4189,10 +3947,12 @@ dependencies = [ "hash-db", "hash256-std-hasher", "impl-serde", - "itertools 0.10.5", + "itertools 0.11.0", + "k256", "libsecp256k1", "log", "merlin", + "parity-bip39", "parity-scale-codec", "parking_lot", "paste", @@ -4239,7 +3999,7 @@ checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -4250,59 +4010,59 @@ checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "sp-externalities" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d6a4572eadd4a63cff92509a210bf425501a0c5e76574b30a366ac77653787" +checksum = "a904407d61cb94228c71b55a9d3708e9d6558991f9e83bd42bd91df37a159d30" dependencies = [ "environmental", "parity-scale-codec", - "sp-std", "sp-storage", ] [[package]] name = "sp-genesis-builder" -version = "0.9.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a862db099e8a799417b63ea79c90079811cdf68fcf3013d81cdceeddcec8f142" +checksum = "fcd065854d96fd81521c103d0aaa287d4f08b9b15c9fae2a3bfb208b0812bf44" dependencies = [ + "parity-scale-codec", + "scale-info", "serde_json", "sp-api", "sp-runtime", - "sp-std", ] [[package]] name = "sp-inherents" -version = "28.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42eb3c88572c7c80e7ecb6365601a490350b09d11000fcc7839efd304e172177" +checksum = "53407ba38ec22ca4a16381722c4bd0b559a0428bc1713079b0d5163ada63186a" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", "thiserror", ] [[package]] name = "sp-io" -version = "32.0.0" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca29e042628cb94cbcaefa935e624a9b48f9230dbce6324908e9b4f768317ef" +checksum = "5036cad2e48d41f5caf6785226c8be1a7db15bec14a9fd7aa6cca84f34cf689f" dependencies = [ "bytes", "ed25519-dalek", "libsecp256k1", "log", "parity-scale-codec", + "polkavm-derive 0.9.1", "rustversion", "secp256k1", "sp-core", @@ -4320,9 +4080,9 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.36.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd4bf9e5fa486416c92c2bb497b7ce2c43eac80cbdc407ffe2d34b365694ac29" +checksum = "0248b4d784cb4a01472276928977121fa39d977a5bb24793b6b15e64b046df42" dependencies = [ "parity-scale-codec", "parking_lot", @@ -4332,14 +4092,13 @@ dependencies = [ [[package]] name = "sp-metadata-ir" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0b5e87e56c1bb26d9524d48dd127121d630f895bd5914a34f0b017489f7c1d" +checksum = "a616fa51350b35326682a472ee8e6ba742fdacb18babac38ecd46b3e05ead869" dependencies = [ "frame-metadata", "parity-scale-codec", "scale-info", - "sp-std", ] [[package]] @@ -4355,15 +4114,16 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "33.0.0" +version = "38.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b28fcf8f53d917e420e783dd27d06fd276f55160301c5bc977cc5898c4130f6f" +checksum = "5273900f0b0bef48b2e1ff9c4fb5e188b8168ee5891418a427f4be2af92ee40f" dependencies = [ "docify", "either", "hash256-std-hasher", "impl-trait-for-tuples", "log", + "num-traits", "parity-scale-codec", "paste", "rand", @@ -4376,18 +4136,19 @@ dependencies = [ "sp-io", "sp-std", "sp-weights", + "tracing", ] [[package]] name = "sp-runtime-interface" -version = "26.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a675ea4858333d4d755899ed5ed780174aa34fec15953428d516af5452295" +checksum = "985eb981f40c689c6a0012c937b68ed58dabb4341d06f2dfe4dfd5ed72fa4017" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", - "polkavm-derive 0.8.0", + "polkavm-derive 0.9.1", "primitive-types", "sp-externalities", "sp-runtime-interface-proc-macro", @@ -4409,14 +4170,14 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "sp-staking" -version = "28.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48b92f4f66b40cbf7cf00d7808d8eec16e25cb420a29ec4060a74c0e9f7c2938" +checksum = "0a0b7abfe66c07a3b6eb99e1286dfa9b6f3b057b0e986e7da2ccbf707f6c781a" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -4424,14 +4185,13 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", ] [[package]] name = "sp-state-machine" -version = "0.37.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ae47765916d342b53d07be012a71efc4c1377d875ade31340cc4fb784b9921" +checksum = "211e528aa6e902261a343f7b40840aa3d66fe4ad3aadbd04a035f10baf96dbc5" dependencies = [ "hash-db", "log", @@ -4442,7 +4202,6 @@ dependencies = [ "sp-core", "sp-externalities", "sp-panic-handler", - "sp-std", "sp-trie", "thiserror", "tracing", @@ -4457,40 +4216,35 @@ checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" [[package]] name = "sp-storage" -version = "20.0.0" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dba5791cb3978e95daf99dad919ecb3ec35565604e88cd38d805d9d4981e8bd" +checksum = "99c82989b3a4979a7e1ad848aad9f5d0b4388f1f454cc131766526601ab9e8f8" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", "serde", "sp-debug-derive", - "sp-std", ] [[package]] name = "sp-timestamp" -version = "28.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee9532c2e4c8fcd7753cb4c741daeb8d9e3ac7cbc15a84c78d4c96492ed20eba" +checksum = "78becf144a76f6fd108dfe94a90e20a185b38c0b310dc5482328196143c8266b" dependencies = [ - "async-trait", "parity-scale-codec", "sp-inherents", "sp-runtime", - "sp-std", - "thiserror", ] [[package]] name = "sp-tracing" -version = "16.0.0" +version = "17.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0351810b9d074df71c4514c5228ed05c250607cba131c1c9d1526760ab69c05c" +checksum = "cf641a1d17268c8fcfdb8e0fa51a79c2d4222f4cfda5f3944dbdbc384dced8d5" dependencies = [ "parity-scale-codec", - "sp-std", "tracing", "tracing-core", "tracing-subscriber", @@ -4498,11 +4252,11 @@ dependencies = [ [[package]] name = "sp-trie" -version = "31.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5791e2e310cf88abedbd5f60ff3d9c9a09d95b182b4a7510f3648a2170ace593" +checksum = "841d717c0f465f5371569e6fdc25b6f32d47c15d6e4c92b3b779e1c9b18b951d" dependencies = [ - "ahash 0.8.11", + "ahash", "hash-db", "lazy_static", "memory-db", @@ -4514,7 +4268,6 @@ dependencies = [ "schnellru", "sp-core", "sp-externalities", - "sp-std", "thiserror", "tracing", "trie-db", @@ -4523,9 +4276,9 @@ dependencies = [ [[package]] name = "sp-version" -version = "31.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "973478ac076be7cb8e0a7968ee43cd7c46fb26e323d36020a9f3bb229e033cd2" +checksum = "bccf96fefae339dee7c4453f91be64eb28cce4c2fe82130445cf096b18b2c081" dependencies = [ "impl-serde", "parity-scale-codec", @@ -4541,35 +4294,32 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" -version = "13.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9bc3fed32d6dacbbbfb28dd1fe0224affbb737cb6cbfca1d9149351c2b69a7d" +checksum = "5aee8f6730641a65fcf0c8f9b1e448af4b3bb083d08058b47528188bccc7b7a7" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "sp-wasm-interface" -version = "20.0.0" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef97172c42eb4c6c26506f325f48463e9bc29b2034a587f1b9e48c751229bee" +checksum = "3b04b919e150b4736d85089d49327eab65507deb1485eec929af69daa2278eb3" dependencies = [ - "anyhow", "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-std", - "wasmtime", ] [[package]] name = "sp-weights" -version = "29.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8a9c7a1b64fa7dba38622ad1de26f0b2e595727c0e42c7b109ecb8e7120688" +checksum = "93cdaf72a1dad537bbb130ba4d47307ebe5170405280ed1aa31fa712718a400e" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -4578,7 +4328,6 @@ dependencies = [ "smallvec", "sp-arithmetic", "sp-debug-derive", - "sp-std", ] [[package]] @@ -4612,17 +4361,11 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "staging-xcm" -version = "9.0.0" +version = "14.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3028e3a4ee8493767ee66266571f5cf1fc3edc546bba650b2040c5418b318340" +checksum = "f2b7b5f531c6bf9629514ef8e5fda0e9e80dd84516957f710940d0e01d3fb36c" dependencies = [ "array-bytes", "bounded-collections", @@ -4639,9 +4382,9 @@ dependencies = [ [[package]] name = "staging-xcm-builder" -version = "9.0.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea27e235bcca331e5ba693fd224fcc16c17b53f53fca875c8dc54b733dba3c6" +checksum = "847fa2afe1bed2751eaabf7b91fa4043037947f17653d7cc59ea202cc44c6bb8" dependencies = [ "frame-support", "frame-system", @@ -4662,12 +4405,11 @@ dependencies = [ [[package]] name = "staging-xcm-executor" -version = "9.0.1" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe8c62fe1eee71592828a513693106ff301cdafd5ac5bd52e06d9315fd4f4f7a" +checksum = "26b98d8219449eaf02e71a7edf1a14b14d4c713dd01d9df66fde1ce30dba4d6d" dependencies = [ "environmental", - "frame-benchmarking", "frame-support", "impl-trait-for-tuples", "log", @@ -4688,6 +4430,16 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "string-interner" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c6a0d765f5807e98a091107bae0a56ea3799f66a5de47b2c84c94a39c09974e" +dependencies = [ + "cfg-if", + "hashbrown 0.14.3", +] + [[package]] name = "strsim" version = "0.10.0" @@ -4738,19 +4490,19 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] name = "substrate-bip39" -version = "0.4.6" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" +checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" dependencies = [ - "hmac 0.11.0", + "hmac 0.12.1", "pbkdf2", "schnorrkel", - "sha2 0.9.9", + "sha2 0.10.8", "zeroize", ] @@ -4773,9 +4525,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.57" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a6ae1e52eb25aab8f3fb9fca13be982a373b8f1157ca14b897a825ba4a2d35" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -4790,7 +4542,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -4799,12 +4551,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" -[[package]] -name = "target-lexicon" -version = "0.12.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" - [[package]] name = "tempfile" version = "3.10.1" @@ -4813,7 +4559,7 @@ checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", - "rustix 0.38.32", + "rustix", "windows-sys 0.52.0", ] @@ -4853,7 +4599,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -4946,7 +4692,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -5006,17 +4752,6 @@ dependencies = [ "winnow 0.5.40", ] -[[package]] -name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.21.1" @@ -5089,7 +4824,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -5104,55 +4839,41 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.4" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ "log", "once_cell", "tracing-core", ] -[[package]] -name = "tracing-serde" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" -dependencies = [ - "serde", - "tracing-core", -] - [[package]] name = "tracing-subscriber" -version = "0.2.25" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ - "ansi_term", - "chrono", - "lazy_static", "matchers", + "nu-ansi-term", + "once_cell", "regex", - "serde", - "serde_json", "sharded-slab", "smallvec", "thread_local", + "time", "tracing", "tracing-core", "tracing-log", - "tracing-serde", ] [[package]] name = "trie-db" -version = "0.28.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff28e0f815c2fea41ebddf148e008b077d2faddb026c9555b29696114d602642" +checksum = "0c992b4f40c234a074d48a757efeabb1a6be88af84c0c23f7ca158950cb0ae7f" dependencies = [ "hash-db", - "hashbrown 0.13.2", "log", "rustc-hex", "smallvec", @@ -5305,7 +5026,7 @@ dependencies = [ "digest 0.10.7", "rand", "rand_chacha", - "rand_core 0.6.4", + "rand_core", "sha2 0.10.8", "sha3", "thiserror", @@ -5358,7 +5079,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", "wasm-bindgen-shared", ] @@ -5380,7 +5101,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5400,15 +5121,6 @@ dependencies = [ "leb128", ] -[[package]] -name = "wasm-instrument" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a47ecb37b9734d1085eaa5ae1a81e60801fd8c28d4cabdd8aedb982021918bc" -dependencies = [ - "parity-wasm", -] - [[package]] name = "wasm-opt" version = "0.116.0" @@ -5451,28 +5163,37 @@ dependencies = [ [[package]] name = "wasmi" -version = "0.31.2" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8281d1d660cdf54c76a3efa9ddd0c270cada1383a995db3ccb43d166456c7" +checksum = "50386c99b9c32bd2ed71a55b6dd4040af2580530fae8bdb9a6576571a80d0cca" dependencies = [ + "arrayvec", + "multi-stash", + "num-derive", + "num-traits", "smallvec", "spin", - "wasmi_arena", + "wasmi_collections", "wasmi_core", "wasmparser-nostd", ] [[package]] -name = "wasmi_arena" -version = "0.4.1" +name = "wasmi_collections" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" +checksum = "9c128c039340ffd50d4195c3f8ce31aac357f06804cfc494c8b9508d4b30dca4" +dependencies = [ + "ahash", + "hashbrown 0.14.3", + "string-interner", +] [[package]] name = "wasmi_core" -version = "0.13.0" +version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" +checksum = "a23b3a7f6c8c3ceeec6b83531ee61f0013c56e51cbf2b14b0f213548b23a4b41" dependencies = [ "downcast-rs", "libm", @@ -5480,157 +5201,15 @@ dependencies = [ "paste", ] -[[package]] -name = "wasmparser" -version = "0.102.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" -dependencies = [ - "indexmap 1.9.3", - "url", -] - [[package]] name = "wasmparser-nostd" -version = "0.100.1" +version = "0.100.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9157cab83003221bfd385833ab587a039f5d6fa7304854042ba358a3b09e0724" +checksum = "d5a015fe95f3504a94bb1462c717aae75253e39b9dd6c3fb1062c934535c64aa" dependencies = [ "indexmap-nostd", ] -[[package]] -name = "wasmtime" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" -dependencies = [ - "anyhow", - "bincode", - "cfg-if", - "indexmap 1.9.3", - "libc", - "log", - "object 0.30.4", - "once_cell", - "paste", - "psm", - "serde", - "target-lexicon", - "wasmparser", - "wasmtime-environ", - "wasmtime-jit", - "wasmtime-runtime", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-asm-macros" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "wasmtime-environ" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" -dependencies = [ - "anyhow", - "cranelift-entity", - "gimli 0.27.3", - "indexmap 1.9.3", - "log", - "object 0.30.4", - "serde", - "target-lexicon", - "thiserror", - "wasmparser", - "wasmtime-types", -] - -[[package]] -name = "wasmtime-jit" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" -dependencies = [ - "addr2line 0.19.0", - "anyhow", - "bincode", - "cfg-if", - "cpp_demangle", - "gimli 0.27.3", - "log", - "object 0.30.4", - "rustc-demangle", - "serde", - "target-lexicon", - "wasmtime-environ", - "wasmtime-jit-icache-coherence", - "wasmtime-runtime", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-jit-debug" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" -dependencies = [ - "once_cell", -] - -[[package]] -name = "wasmtime-jit-icache-coherence" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" -dependencies = [ - "cfg-if", - "libc", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-runtime" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" -dependencies = [ - "anyhow", - "cc", - "cfg-if", - "indexmap 1.9.3", - "libc", - "log", - "mach", - "memfd", - "memoffset", - "paste", - "rand", - "rustix 0.36.17", - "wasmtime-asm-macros", - "wasmtime-environ", - "wasmtime-jit-debug", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-types" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" -dependencies = [ - "cranelift-entity", - "serde", - "thiserror", - "wasmparser", -] - [[package]] name = "wast" version = "202.0.0" @@ -5661,20 +5240,10 @@ checksum = "8211e4f58a2b2805adfbefbc07bab82958fc91e3836339b1ab7ae32465dce0d7" dependencies = [ "either", "home", - "rustix 0.38.32", + "rustix", "winsafe", ] -[[package]] -name = "wide" -version = "0.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89beec544f246e679fc25490e3f8e08003bc4bf612068f325120dad4cea02c1c" -dependencies = [ - "bytemuck", - "safe_arch", -] - [[package]] name = "winapi" version = "0.3.9" @@ -5715,15 +5284,6 @@ dependencies = [ "windows-targets 0.52.4", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -5742,21 +5302,6 @@ dependencies = [ "windows-targets 0.52.4", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.48.5" @@ -5787,12 +5332,6 @@ dependencies = [ "windows_x86_64_msvc 0.52.4", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -5805,12 +5344,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -5823,12 +5356,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -5841,12 +5368,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -5859,12 +5380,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -5877,12 +5392,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -5895,12 +5404,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -5948,14 +5451,14 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "8.0.0" +version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4717a97970a9cda70d7db53cf50d2615c2f6f6b7c857445325b4a39ea7aa2cd" +checksum = "87fb4f14094d65c500a59bcf540cf42b99ee82c706edd6226a92e769ad60563e" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -5981,7 +5484,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] @@ -6001,7 +5504,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.57", + "syn 2.0.77", ] [[package]] diff --git a/examples/multiple-contracts/Cargo.toml b/crates/drink/examples/multiple-contracts/Cargo.toml similarity index 100% rename from examples/multiple-contracts/Cargo.toml rename to crates/drink/examples/multiple-contracts/Cargo.toml diff --git a/examples/multiple-contracts/README.md b/crates/drink/examples/multiple-contracts/README.md similarity index 100% rename from examples/multiple-contracts/README.md rename to crates/drink/examples/multiple-contracts/README.md diff --git a/examples/multiple-contracts/lib.rs b/crates/drink/examples/multiple-contracts/lib.rs similarity index 90% rename from examples/multiple-contracts/lib.rs rename to crates/drink/examples/multiple-contracts/lib.rs index 134a3d7..f86a884 100755 --- a/examples/multiple-contracts/lib.rs +++ b/crates/drink/examples/multiple-contracts/lib.rs @@ -41,7 +41,7 @@ mod balance_checker { mod tests { use std::error::Error; - use drink::session::{Session, NO_ARGS, NO_SALT}; + use drink::session::{Session, NO_ARGS, NO_SALT, NO_ENDOWMENT}; #[drink::contract_bundle_provider] enum BundleProvider {} @@ -53,7 +53,7 @@ mod tests { "new", &["10", "None", "None", "1"], NO_SALT, - None, + NO_ENDOWMENT, )?; let user_account = session.get_actor(); @@ -62,10 +62,10 @@ mod tests { "new", &[user_account.to_string(), token_contract.to_string()], NO_SALT, - None, + NO_ENDOWMENT, )?; - let balance: u128 = session.call("check", NO_ARGS, None)??; + let balance: u128 = session.call("check", NO_ARGS, NO_ENDOWMENT)??; assert_eq!(balance, 10); Ok(()) diff --git a/examples/quick-start-with-drink/Cargo.lock b/crates/drink/examples/quick-start-with-drink/Cargo.lock similarity index 100% rename from examples/quick-start-with-drink/Cargo.lock rename to crates/drink/examples/quick-start-with-drink/Cargo.lock diff --git a/examples/quick-start-with-drink/Cargo.toml b/crates/drink/examples/quick-start-with-drink/Cargo.toml similarity index 100% rename from examples/quick-start-with-drink/Cargo.toml rename to crates/drink/examples/quick-start-with-drink/Cargo.toml diff --git a/examples/quick-start-with-drink/README.md b/crates/drink/examples/quick-start-with-drink/README.md similarity index 100% rename from examples/quick-start-with-drink/README.md rename to crates/drink/examples/quick-start-with-drink/README.md diff --git a/examples/quick-start-with-drink/lib.rs b/crates/drink/examples/quick-start-with-drink/lib.rs similarity index 95% rename from examples/quick-start-with-drink/lib.rs rename to crates/drink/examples/quick-start-with-drink/lib.rs index 3e44b47..37bfcef 100644 --- a/examples/quick-start-with-drink/lib.rs +++ b/crates/drink/examples/quick-start-with-drink/lib.rs @@ -44,7 +44,7 @@ mod flipper { mod tests { use drink::{ sandbox_api::contracts_api::decode_debug_buffer, - session::{Session, NO_ARGS, NO_SALT}, + session::{Session, NO_ARGS, NO_SALT, NO_ENDOWMENT}, }; /// `drink` automatically discovers all the contract projects that your tests will need. For @@ -90,7 +90,7 @@ mod tests { // Salt for the contract address derivation. NO_SALT, // Initial endowment (the amount of tokens that we want to transfer to the contract). - None, + NO_ENDOWMENT, )?; // Once the contract is instantiated, we can call the `flip` method on the contract. @@ -101,7 +101,7 @@ mod tests { // constant, which spares us from typing `&[]`. NO_ARGS, // Endowment (the amount of tokens that we want to transfer to the contract). - None, + NO_ENDOWMENT, )??; // Finally, we can call the `get` method on the contract and ensure that the value has been @@ -110,7 +110,7 @@ mod tests { // `Session::call` returns a `Result, SessionError>`, where `T` is the // type of the message result. In this case, the `get` message returns a `bool`, and we have // to explicitly hint the compiler about it. - let result: bool = session.call("get", NO_ARGS, None)??; + let result: bool = session.call("get", NO_ARGS, NO_ENDOWMENT)??; assert_eq!(result, false); Ok(()) @@ -119,7 +119,7 @@ mod tests { /// In this testcase we will see how to get and read debug logs from the contract. #[drink::test] fn get_debug_logs(mut session: Session) -> Result<(), Box> { - session.deploy_bundle(BundleProvider::local()?, "new", &["true"], NO_SALT, None)?; + session.deploy_bundle(BundleProvider::local()?, "new", &["true"], NO_SALT, NO_ENDOWMENT)?; // `deploy_bundle` returns just a contract address. If we are interested in more details // about last operation (either deploy or call), we can get a `Record` object and use its @@ -147,19 +147,19 @@ mod tests { // derived contract addresses are different. We can do this by providing using different // arguments for the constructor or by providing a different salt. let first_address = - session.deploy_bundle(bundle.clone(), "new", &["true"], NO_SALT, None)?; + session.deploy_bundle(bundle.clone(), "new", &["true"], NO_SALT, NO_ENDOWMENT)?; let _second_address = - session.deploy_bundle(bundle.clone(), "new", &["true"], vec![0], None)?; - let _third_address = session.deploy_bundle(bundle, "new", &["false"], NO_SALT, None)?; + session.deploy_bundle(bundle.clone(), "new", &["true"], vec![0], NO_ENDOWMENT)?; + let _third_address = session.deploy_bundle(bundle, "new", &["false"], NO_SALT, NO_ENDOWMENT)?; // By default, when we run `session.call`, `drink` will interact with the last deployed // contract. - let value_at_third_contract: bool = session.call("get", NO_ARGS, None)??; + let value_at_third_contract: bool = session.call("get", NO_ARGS, NO_ENDOWMENT)??; assert_eq!(value_at_third_contract, false); // However, we can also call a specific contract by providing its address. let value_at_first_contract: bool = - session.call_with_address(first_address, "get", NO_ARGS, None)??; + session.call_with_address(first_address, "get", NO_ARGS, NO_ENDOWMENT)??; assert_eq!(value_at_first_contract, true); Ok(()) diff --git a/examples/runtime-interaction/Cargo.lock b/crates/drink/examples/runtime-interaction/Cargo.lock similarity index 100% rename from examples/runtime-interaction/Cargo.lock rename to crates/drink/examples/runtime-interaction/Cargo.lock diff --git a/examples/runtime-interaction/Cargo.toml b/crates/drink/examples/runtime-interaction/Cargo.toml similarity index 100% rename from examples/runtime-interaction/Cargo.toml rename to crates/drink/examples/runtime-interaction/Cargo.toml diff --git a/examples/runtime-interaction/README.md b/crates/drink/examples/runtime-interaction/README.md similarity index 100% rename from examples/runtime-interaction/README.md rename to crates/drink/examples/runtime-interaction/README.md diff --git a/examples/runtime-interaction/lib.rs b/crates/drink/examples/runtime-interaction/lib.rs similarity index 100% rename from examples/runtime-interaction/lib.rs rename to crates/drink/examples/runtime-interaction/lib.rs diff --git a/resources/blockchain-onion.svg b/crates/drink/resources/blockchain-onion.svg similarity index 100% rename from resources/blockchain-onion.svg rename to crates/drink/resources/blockchain-onion.svg diff --git a/resources/testing-strategies.svg b/crates/drink/resources/testing-strategies.svg similarity index 100% rename from resources/testing-strategies.svg rename to crates/drink/resources/testing-strategies.svg diff --git a/ink-sandbox/.gitignore b/crates/ink-sandbox/.gitignore similarity index 100% rename from ink-sandbox/.gitignore rename to crates/ink-sandbox/.gitignore diff --git a/ink-sandbox/Cargo.lock b/crates/ink-sandbox/Cargo.lock similarity index 100% rename from ink-sandbox/Cargo.lock rename to crates/ink-sandbox/Cargo.lock diff --git a/crates/ink-sandbox/Cargo.toml b/crates/ink-sandbox/Cargo.toml new file mode 100644 index 0000000..989e316 --- /dev/null +++ b/crates/ink-sandbox/Cargo.toml @@ -0,0 +1,47 @@ +[package] +name = "ink_sandbox" +version = "5.0.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +log.workspace = true +paste.workspace = true +scale.workspace = true +scale-info.workspace = true +wat.workspace = true + +# Substrate dependencies +frame-metadata.workspace = true +frame-support.workspace = true +frame-system.workspace = true +pallet-assets.workspace = true +pallet-balances.workspace = true +pallet-contracts.workspace = true +pallet-timestamp.workspace = true +sp-core.workspace = true +sp-externalities.workspace = true +sp-io.workspace = true +sp-runtime-interface.workspace = true + +[features] +default = [ + # This is required for the runtime-interface to work properly in the std env. + "std", +] +std = [ + "frame-metadata/std", + "frame-support/std", + "frame-system/std", + "pallet-assets/std", + "pallet-balances/std", + "pallet-contracts/std", + "pallet-timestamp/std", + "scale/std", + "scale-info/std", + "sp-core/std", + "sp-externalities/std", + "sp-io/std", + "sp-runtime-interface/std", +] diff --git a/ink-sandbox/src/api.rs b/crates/ink-sandbox/src/api.rs similarity index 100% rename from ink-sandbox/src/api.rs rename to crates/ink-sandbox/src/api.rs diff --git a/ink-sandbox/src/api/assets_api.rs b/crates/ink-sandbox/src/api/assets_api.rs similarity index 95% rename from ink-sandbox/src/api/assets_api.rs rename to crates/ink-sandbox/src/api/assets_api.rs index 586fe54..03bcaa4 100644 --- a/ink-sandbox/src/api/assets_api.rs +++ b/crates/ink-sandbox/src/api/assets_api.rs @@ -19,9 +19,6 @@ where T: Sandbox, T::Runtime: pallet_assets::Config, { - /// The runtime pallet-assets config. - type T: pallet_assets::Config; - /// Creates `value` amount of tokens and assigns them to `account`, increasing the total supply. /// /// # Arguments @@ -48,7 +45,7 @@ where /// * `name` - Token name. /// * `symbol` - Token symbol. /// * `decimals` - Token decimals. - fn set_metadata as Dispatchable>::RuntimeOrigin>>( + fn set_metadata as Dispatchable>::RuntimeOrigin>>( &mut self, origin: Origin, asset: &AssetIdOf, @@ -115,7 +112,7 @@ where delegate: &AccountIdFor, ) -> BalanceOf; - /// Check if the asset is created. + /// Check if the asset exists. /// /// # Arguments /// * `asset` - ID of the asset. @@ -127,8 +124,6 @@ where T: Sandbox, T::Runtime: pallet_assets::Config, { - type T = T::Runtime; - fn create( &mut self, id: &AssetIdOf, @@ -142,7 +137,7 @@ where self.execute_with(|| as Destroy>>::start_destroy(asset.clone(), None)) } - fn set_metadata as Dispatchable>::RuntimeOrigin>>( + fn set_metadata as Dispatchable>::RuntimeOrigin>>( &mut self, origin: Origin, asset: &AssetIdOf, diff --git a/ink-sandbox/src/api/balances_api.rs b/crates/ink-sandbox/src/api/balances_api.rs similarity index 100% rename from ink-sandbox/src/api/balances_api.rs rename to crates/ink-sandbox/src/api/balances_api.rs diff --git a/ink-sandbox/src/api/contracts_api.rs b/crates/ink-sandbox/src/api/contracts_api.rs similarity index 100% rename from ink-sandbox/src/api/contracts_api.rs rename to crates/ink-sandbox/src/api/contracts_api.rs diff --git a/ink-sandbox/src/api/system_api.rs b/crates/ink-sandbox/src/api/system_api.rs similarity index 100% rename from ink-sandbox/src/api/system_api.rs rename to crates/ink-sandbox/src/api/system_api.rs diff --git a/ink-sandbox/src/api/timestamp_api.rs b/crates/ink-sandbox/src/api/timestamp_api.rs similarity index 100% rename from ink-sandbox/src/api/timestamp_api.rs rename to crates/ink-sandbox/src/api/timestamp_api.rs diff --git a/ink-sandbox/src/lib.rs b/crates/ink-sandbox/src/lib.rs similarity index 92% rename from ink-sandbox/src/lib.rs rename to crates/ink-sandbox/src/lib.rs index 8e6549a..66054ba 100644 --- a/ink-sandbox/src/lib.rs +++ b/crates/ink-sandbox/src/lib.rs @@ -9,7 +9,7 @@ use frame_support::{sp_runtime::traits::Dispatchable, traits::fungible::Inspect} use frame_system::{pallet_prelude::BlockNumberFor, EventRecord}; pub use macros::{BlockBuilder, DefaultSandbox}; use pallet_contracts::{ContractExecResult, ContractInstantiateResult}; -/// Export pallets that are used in [`crate::create_sandbox_with_runtime`] +/// Export pallets that are used in [`crate::create_sandbox`] pub use { frame_support::{ self, @@ -23,7 +23,7 @@ pub use { }; /// Alias for the balance type. -type BalanceOf = +pub type BalanceFor = <::Currency as Inspect>>::Balance; /// Alias for the account ID type. @@ -40,11 +40,11 @@ pub type EventRecordOf = EventRecord< /// Alias for the contract instantiate result. pub type ContractInstantiateResultFor = - ContractInstantiateResult, BalanceOf, EventRecordOf>; + ContractInstantiateResult, BalanceFor, EventRecordOf>; /// Alias for the contract exec result. pub type ContractExecResultFor = - ContractExecResult, EventRecordOf>; + ContractExecResult, EventRecordOf>; /// Alias for the runtime of a sandbox. pub type RuntimeOf = ::Runtime; diff --git a/ink-sandbox/src/macros.rs b/crates/ink-sandbox/src/macros.rs similarity index 71% rename from ink-sandbox/src/macros.rs rename to crates/ink-sandbox/src/macros.rs index fa10532..a181304 100644 --- a/ink-sandbox/src/macros.rs +++ b/crates/ink-sandbox/src/macros.rs @@ -63,9 +63,12 @@ impl< } } +// Macro that implements the sandbox trait on the provided runtime. #[macro_export] macro_rules! impl_sandbox { - ($sandbox:ident, $runtime:ident, $block_builder:ident, $default_account:ident) => { + ($sandbox:ident, $runtime:ident, $account:ident) => { + use $crate::macros::BlockBuilder; + impl $crate::Sandbox for $sandbox { type Runtime = $runtime; @@ -94,17 +97,17 @@ macro_rules! impl_sandbox { height: $crate::frame_system::pallet_prelude::BlockNumberFor, parent_hash: ::Hash, ) { - $block_builder::::initialize_block(height, parent_hash) + BlockBuilder::::initialize_block(height, parent_hash) } fn finalize_block( height: $crate::frame_system::pallet_prelude::BlockNumberFor, ) -> ::Hash { - $block_builder::::finalize_block(height) + BlockBuilder::::finalize_block(height) } fn default_actor() -> $crate::AccountIdFor { - $default_account + $account } fn get_metadata() -> $crate::RuntimeMetadataPrefixed { @@ -120,94 +123,61 @@ macro_rules! impl_sandbox { }; } -#[macro_export] -macro_rules! create_sandbox { - ($sandbox:ident, $runtime:ident) => { - use $crate::frame_support::sp_runtime::AccountId32; - use $crate::macros::BlockBuilder; - - // Implement `crate::Sandbox` trait - - /// Default initial balance for the default account. - pub const UNIT: u128 = 10_000_000_000; - pub const INIT_AMOUNT: u128 = 100_000_000 * UNIT; - pub const DEFAULT_ACCOUNT: AccountId32 = AccountId32::new([1u8; 32]); - - pub struct $sandbox { - ext: $crate::TestExternalities, - } - - impl ::std::default::Default for $sandbox { - fn default() -> Self { - let ext = BlockBuilder::<$runtime>::new_ext(vec![(DEFAULT_ACCOUNT, INIT_AMOUNT)]); - Self { ext } - } - } - - $crate::impl_sandbox!($sandbox, $runtime, BlockBuilder, DEFAULT_ACCOUNT); - }; -} - /// Macro creating a minimal runtime with the given name. Optionally can take a chain /// extension type as a second argument. /// /// The new macro will automatically implement `crate::Sandbox`. #[macro_export] -macro_rules! create_sandbox_with_runtime { +macro_rules! create_sandbox { ($name:ident) => { $crate::paste::paste! { - $crate::create_sandbox_with_runtime!($crate, $name, [<$name Runtime>], (), (), {}); + $crate::create_sandbox!($name, [<$name Runtime>], (), (), {}); } }; ($name:ident, $chain_extension: ty, $debug: ty) => { $crate::paste::paste! { - $crate::create_sandbox_with_runtime!($crate, $name, [<$name Runtime>], $chain_extension, $debug, {}); + $crate::create_sandbox!($name, [<$name Runtime>], $chain_extension, $debug, {}); } }; ($name:ident, $chain_extension: ty, $debug: ty, { $( $pallet_name:tt : $pallet:ident ),* $(,)? }) => { $crate::paste::paste! { - $crate::create_sandbox_with_runtime!($crate, $name, [<$name Runtime>], $chain_extension, $debug, { + $crate::create_sandbox!($name, [<$name Runtime>], $chain_extension, $debug, { $( $pallet_name : $pallet, )* }); } }; - ($module_path:ident, $name:ident, $chain_extension: ty, $debug: ty) => { - $crate::paste::paste! { - $crate::create_sandbox_with_runtime!($module_path, $name, [<$name Runtime>], $chain_extension, $debug, {}); - } - }; - ($module_path:ident, $sandbox:ident, $runtime:ident, $chain_extension: ty, $debug: ty, { $( $pallet_name:tt : $pallet:ident ),* $(,)? }) => { + ($sandbox:ident, $runtime:ident, $chain_extension: ty, $debug: ty, { $( $pallet_name:tt : $pallet:ident ),* $(,)? }) => { // Put all the boilerplate into an auxiliary module mod construct_runtime { // Bring some common types into the scope - use $module_path::frame_support::{ + use $crate::frame_support::{ construct_runtime, derive_impl, parameter_types, sp_runtime::{ testing::H256, traits::Convert, - Perbill, + AccountId32, Perbill, }, traits::{AsEnsureOriginWithArg, ConstBool, ConstU128, ConstU32, ConstU64, Currency, Randomness}, weights::Weight, }; - use $module_path::frame_system::EnsureSigned; - use $module_path::pallet_assets::Instance1; + use $crate::frame_system::EnsureSigned; + use $crate::pallet_assets::Instance1; // Define the runtime type as a collection of pallets construct_runtime!( pub enum $runtime { - System: $module_path::frame_system, - Assets: $module_path::pallet_assets::, - Balances: $module_path::pallet_balances, - Timestamp: $module_path::pallet_timestamp, - Contracts: $module_path::pallet_contracts, + System: $crate::frame_system, + Assets: $crate::pallet_assets::, + Balances: $crate::pallet_balances, + Timestamp: $crate::pallet_timestamp, + Contracts: $crate::pallet_contracts, $( $pallet_name: $pallet, )* @@ -215,15 +185,16 @@ mod construct_runtime { ); // Configure pallet system - #[derive_impl($module_path::frame_system::config_preludes::SolochainDefaultConfig as $module_path::frame_system::DefaultConfig)] - impl $module_path::frame_system::Config for $runtime { - type Block = $module_path::frame_system::mocking::MockBlockU32<$runtime>; + #[derive_impl($crate::frame_system::config_preludes::SolochainDefaultConfig as $crate::frame_system::DefaultConfig)] + impl $crate::frame_system::Config for $runtime { + type Block = $crate::frame_system::mocking::MockBlockU32<$runtime>; type Version = (); type BlockHashCount = ConstU32<250>; - type AccountData = $module_path::pallet_balances::AccountData<<$runtime as $module_path::pallet_balances::Config>::Balance>; + type AccountData = $crate::pallet_balances::AccountData<<$runtime as $crate::pallet_balances::Config>::Balance>; } - impl $module_path::pallet_assets::Config for $runtime { + // Configure pallet assets + impl $crate::pallet_assets::Config for $runtime { type ApprovalDeposit = ConstU128<1>; type AssetAccountDeposit = ConstU128<10>; type AssetDeposit = ConstU128<1>; @@ -245,7 +216,7 @@ mod construct_runtime { } // Configure pallet balances - impl $module_path::pallet_balances::Config for $runtime { + impl $crate::pallet_balances::Config for $runtime { type RuntimeEvent = RuntimeEvent; type WeightInfo = (); type Balance = u128; @@ -262,14 +233,13 @@ mod construct_runtime { } // Configure pallet timestamp - impl $module_path::pallet_timestamp::Config for $runtime { + impl $crate::pallet_timestamp::Config for $runtime { type Moment = u64; type OnTimestampSet = (); type MinimumPeriod = ConstU64<1>; type WeightInfo = (); } - // Configure pallet contracts pub enum SandboxRandomness {} impl Randomness for SandboxRandomness { fn random(_subject: &[u8]) -> (H256, u32) { @@ -285,8 +255,8 @@ mod construct_runtime { } parameter_types! { - pub SandboxSchedule: $module_path::pallet_contracts::Schedule<$runtime> = { - <$module_path::pallet_contracts::Schedule<$runtime>>::default() + pub SandboxSchedule: $crate::pallet_contracts::Schedule<$runtime> = { + <$crate::pallet_contracts::Schedule<$runtime>>::default() }; pub DeletionWeightLimit: Weight = Weight::zero(); pub DefaultDepositLimit: BalanceOf = 10_000_000; @@ -294,44 +264,61 @@ mod construct_runtime { pub MaxDelegateDependencies: u32 = 32; } - impl $module_path::pallet_contracts::Config for $runtime { - type AddressGenerator = $module_path::pallet_contracts::DefaultAddressGenerator; - type ApiVersion = (); + // Configure pallet contracts + impl $crate::pallet_contracts::Config for $runtime { + type Time = Timestamp; + type Randomness = SandboxRandomness; + type Currency = Balances; + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; type CallFilter = (); - // TestFilter; - type CallStack = [$module_path::pallet_contracts::Frame; 5]; + type WeightPrice = Self; + type WeightInfo = (); type ChainExtension = $chain_extension; - type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; - type Currency = Balances; - type Debug = $debug; - // TestDebug; - type DefaultDepositLimit = DefaultDepositLimit; + type Schedule = SandboxSchedule; + type CallStack = [$crate::pallet_contracts::Frame; 5]; type DepositPerByte = ConstU128<1>; type DepositPerItem = ConstU128<1>; - type Environment = (); - type InstantiateOrigin = EnsureSigned; + type AddressGenerator = $crate::pallet_contracts::DefaultAddressGenerator; type MaxCodeLen = ConstU32<{ 123 * 1024 }>; - type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>; - type MaxDelegateDependencies = MaxDelegateDependencies; type MaxStorageKeyLen = ConstU32<128>; + type UnsafeUnstableInterface = ConstBool; + type UploadOrigin = $crate::frame_system::EnsureSigned; + type InstantiateOrigin = $crate::frame_system::EnsureSigned; + type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>; type Migrations = (); - // crate::migration::codegen::BenchMigrations; - type Randomness = SandboxRandomness; - type RuntimeCall = RuntimeCall; - type RuntimeEvent = RuntimeEvent; + type DefaultDepositLimit = DefaultDepositLimit; + type Debug = $debug; + type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; + type MaxDelegateDependencies = MaxDelegateDependencies; type RuntimeHoldReason = RuntimeHoldReason; - type Schedule = SandboxSchedule; - type Time = Timestamp; - type UnsafeUnstableInterface = ConstBool; - // UnstableInterface; - type UploadOrigin = EnsureSigned; - type WeightInfo = (); - type WeightPrice = (); - // Self; + type Environment = (); type Xcm = (); + type ApiVersion = (); } - $crate::create_sandbox!($sandbox, $runtime); + /// Unit base for balances. + pub const UNIT: u128 = 10_000_000_000; + /// Default initial balance for the default account. + pub const INIT_AMOUNT: u128 = 100_000_000 * UNIT; + /// Default account. + pub const DEFAULT_ACCOUNT: AccountId32 = AccountId32::new([1u8; 32]); + + /// The sandbox. + pub struct $sandbox { + ext: $crate::TestExternalities, + } + + impl ::std::default::Default for $sandbox { + fn default() -> Self { + let ext = BlockBuilder::<$runtime>::new_ext(vec![(DEFAULT_ACCOUNT, INIT_AMOUNT)]); + Self { ext } + } + } + + // Implement `Sandbox` trait. + $crate::impl_sandbox!($sandbox, $runtime, DEFAULT_ACCOUNT); + } // Export runtime type itself, pallets and useful types from the auxiliary module @@ -342,4 +329,4 @@ pub use construct_runtime::{ }; } -create_sandbox_with_runtime!(DefaultSandbox); +create_sandbox!(DefaultSandbox); \ No newline at end of file diff --git a/ink-sandbox/test-resources/dummy.wat b/crates/ink-sandbox/test-resources/dummy.wat similarity index 100% rename from ink-sandbox/test-resources/dummy.wat rename to crates/ink-sandbox/test-resources/dummy.wat diff --git a/crates/pop-drink/Cargo.lock b/crates/pop-drink/Cargo.lock new file mode 100644 index 0000000..948214c --- /dev/null +++ b/crates/pop-drink/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "pop-sandbox" +version = "0.1.0" diff --git a/crates/pop-drink/Cargo.toml b/crates/pop-drink/Cargo.toml new file mode 100644 index 0000000..7639943 --- /dev/null +++ b/crates/pop-drink/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "pop-drink" +version = "0.1.0" +edition = "2021" + +[dependencies] +drink.workspace = true +ink_sandbox.workspace = true +pop-runtime-devnet.workspace = true +frame-support.workspace = true +sp-io.workspace = true + +[features] +default = [ + "std", +] +std = [ + "pop-runtime-devnet/std", + "frame-support/std", + "sp-io/std", +] diff --git a/crates/pop-drink/README.md b/crates/pop-drink/README.md new file mode 100644 index 0000000..cacfdc2 --- /dev/null +++ b/crates/pop-drink/README.md @@ -0,0 +1,60 @@ +# Pop Sandbox + +Implementation of the [`pop_drink::Sandbox`](https://github.com/r0gue-io/pop-drink) struct for the Pop Network runtimes (located in `pop-node/runtime`) required for the quasi testing with `drink`. + +In the context of quasi-testing with pop-drink, a sandbox refers to an isolated runtime environment that simulates the behavior of a full node, without requiring an actual node. It can emulate key processes (where runtime `pallets` are involved) such as block initialization, execution, and block finalization. + +## Getting Started + +### Installation + +```toml +pop_drink = { version = "1.0.0", package = "pop-drink" } +``` + +### Import Sandbox for the specific runtime + +- For `devnet` runtime + +Implementation of the sandbox runtime environment for `devnet` runtime located in `pop-node/runtime/devnet` + +```rs +use pop_sandbox::DevnetSandbox; +``` + +- For `testnet` runtime + +Implementation of the sandbox runtime environment for `testnet` runtime located in `pop-node/runtime/testnet` + +```rs +use pop_sandbox::TestnetSandbox; +``` + +- For `mainnet` runtime + +Implementation of the sandbox runtime environment for `mainnet` runtime located in `pop-node/runtime/mainnet` + +```rs +use pop_sandbox::MainnetSandbox; +``` + +### Setup test environment for your contract + +Below is an example for the contract testing with `pop_drink` and `pop_sandbox` for `devnet` environment using `DevnetSandbox`. + +```rs +use pop_drink::session::Session; +use pop_sandbox::DevnetSandbox as Sandbox; + +#[drink::contract_bundle_provider] +enum BundleProvider {} + +#[drink::test(sandbox = Sandbox)] +fn test(mut session: Session) { + // Your test case +} +``` + +## Examples + +Please find more examples of `pop_drink` tests in the [`pop_drink/examples`](https://github.com/r0gue-io/pop-drink/tree/main/examples). diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs new file mode 100644 index 0000000..4daab0f --- /dev/null +++ b/crates/pop-drink/src/lib.rs @@ -0,0 +1,13 @@ +pub use drink::*; +pub use ink_sandbox::api::{assets_api::AssetsAPI}; +pub use sp_io::TestExternalities; +pub use frame_support::{self, sp_runtime::DispatchError, assert_ok}; +pub mod devnet { + pub use pop_runtime_devnet::{BuildStorage, Runtime}; + use ink_sandbox::{AccountIdFor, BalanceFor}; + + /// Balance type used in the pop runtime. + pub type Balance = BalanceFor; + pub type AccountId = AccountIdFor; +} + diff --git a/drink-cli/Cargo.toml b/drink-cli/Cargo.toml deleted file mode 100644 index fe43655..0000000 --- a/drink-cli/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "drink-cli" -authors.workspace = true -edition.workspace = true -homepage.workspace = true -license.workspace = true -readme.workspace = true -repository.workspace = true -version.workspace = true -description = "A CLI for interacting with the `drink` environment" - -[dependencies] -anyhow = { workspace = true } -clap = { workspace = true, features = ["derive"] } -crossterm = { workspace = true } -contract-build = { workspace = true } -contract-transcode = { workspace = true } -ratatui = { workspace = true, features = ["all-widgets"] } -thiserror = { workspace = true } - -ink_sandbox = { workspace = true } -drink = { workspace = true, features = ["session"] } diff --git a/drink/Cargo.toml b/drink/Cargo.toml deleted file mode 100644 index 662937a..0000000 --- a/drink/Cargo.toml +++ /dev/null @@ -1,39 +0,0 @@ -[package] -name = "drink" -authors.workspace = true -edition.workspace = true -homepage.workspace = true -license.workspace = true -readme.workspace = true -repository.workspace = true -version.workspace = true -description = "Minimal sufficient architecture that allows for a fully functional ink! contract development" - -[dependencies] -log = { workspace = true } -contract-metadata = { workspace = true, optional = true } -contract-transcode = { workspace = true, optional = true } -frame-support = { workspace = true } -frame-system = { workspace = true } -parity-scale-codec = { workspace = true } -parity-scale-codec-derive = { workspace = true } -sp-runtime-interface = { workspace = true } -ink_sandbox = { workspace = true } - -scale-info = { workspace = true } -serde_json = { workspace = true, optional = true } -thiserror = { workspace = true } -wat = { workspace = true } - -drink-test-macro = { workspace = true } - -[features] -default = [ - # This is required for the runtime-interface to work properly in the std env. - "std", - "session", - "macros", -] -session = ["contract-metadata", "contract-transcode", "serde_json"] -macros = ["contract-metadata", "contract-transcode", "serde_json"] -std = [] diff --git a/ink-sandbox/Cargo.toml b/ink-sandbox/Cargo.toml deleted file mode 100644 index 2c04481..0000000 --- a/ink-sandbox/Cargo.toml +++ /dev/null @@ -1,49 +0,0 @@ -[package] -name = "ink_sandbox" -version = "5.0.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -frame-metadata = { version = "16.0.0", default-features = false } -frame-support = { version = "36.0.0", default-features = false } -frame-system = { version = "36.1.0", default-features = false } -pallet-contracts = { version = "35.0.0", default-features = false } -pallet-assets = { version = "37.0.0", default-features = false } -pallet-balances = { version = "37.0.0", default-features = false } -pallet-timestamp = { version = "35.0.0", default-features = false } -scale = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = [ - "derive", -] } -sp-core = { version = "34.0.0", default-features = false } -sp-externalities = { version = "0.29.0", default-features = false } -sp-io = { version = "37.0.0", default-features = false } -sp-runtime-interface = { version = "28.0.0" } - -log = { version = "0.4.21", default-features = false } -paste = { version = "1.0" } -scale-info = { version = "2.11", default-features = false } -wat = { version = "1.207.0" } - - -[features] -default = [ - # This is required for the runtime-interface to work properly in the std env. - "std", -] -std = [ - "frame-metadata/std", - "frame-support/std", - "frame-system/std", - "pallet-assets/std", - "pallet-balances/std", - "pallet-contracts/std", - "pallet-timestamp/std", - "scale/std", - "scale-info/std", - "sp-core/std", - "sp-externalities/std", - "sp-runtime-interface/std", - "sp-io/std", -] From b210bfa7bb34b55d668ddb5c1c3ff5e778970a6a Mon Sep 17 00:00:00 2001 From: Daanvdplas Date: Fri, 27 Sep 2024 11:47:32 +0200 Subject: [PATCH 08/43] chore: default --- Cargo.toml | 28 ++++++++++++++-------------- crates/drink/drink-cli/Cargo.toml | 3 +-- crates/drink/drink/Cargo.toml | 27 ++++++++------------------- crates/drink/drink/src/lib.rs | 4 +++- crates/ink-sandbox/Cargo.toml | 16 +--------------- crates/pop-drink/Cargo.toml | 10 ---------- 6 files changed, 27 insertions(+), 61 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 762bee8..1c34e07 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ edition = "2021" repository = "https://github.com/r0gue-io/pop-drink" [workspace.dependencies] -log = { version = "0.4.21", default-features = false } +log = { version = "0.4.21" } anyhow = { version = "1.0.71" } cargo_metadata = { version = "0.18.1" } clap = { version = "4.3.4" } @@ -31,7 +31,7 @@ paste = { version = "1.0.7" } proc-macro2 = { version = "1" } quote = { version = "1" } ratatui = { version = "0.21.0" } -scale = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = [ +scale = { package = "parity-scale-codec", version = "3.6.9", features = [ "derive", ] } scale-info = { version = "2.10.0" } @@ -41,20 +41,20 @@ thiserror = { version = "1.0.40" } wat = { version = "1.0.71" } # Substrate dependencies -frame-metadata = { version = "16.0.0", default-features = false } -frame-support = { version = "36.0.0", default-features = false } -frame-system = { version = "36.1.0", default-features = false } -pallet-assets = { version = "37.0.0", default-features = false } -pallet-balances = { version = "37.0.0", default-features = false } -pallet-contracts = { version = "35.0.0", default-features = false } -pallet-timestamp = { version = "35.0.0", default-features = false } -pop-runtime-devnet = { path = "../pop-node/runtime/devnet", default-features = false, features = ["drink"] } -sp-core = { version = "34.0.0", default-features = false } -sp-externalities = { version = "0.29.0", default-features = false } -sp-io = { version = "37.0.0", default-features = false } -sp-runtime-interface = { version = "28.0.0", default-features = false } +frame-metadata = { version = "16.0.0" } +frame-support = { version = "36.0.0" } +frame-system = { version = "36.1.0" } +pallet-assets = { version = "37.0.0" } +pallet-balances = { version = "37.0.0" } +pallet-contracts = { version = "35.0.0" } +pallet-timestamp = { version = "35.0.0" } +sp-core = { version = "34.0.0" } +sp-externalities = { version = "0.29.0" } +sp-io = { version = "37.0.0" } +sp-runtime-interface = { version = "28.0.0", features = ["std"] } # Local drink = { path = "crates/drink/drink" } ink_sandbox = { path = "crates/ink-sandbox" } pop-drink = { path = "crates/pop-drink" } +pop-runtime-devnet = { path = "../pop-node/runtime/devnet" } diff --git a/crates/drink/drink-cli/Cargo.toml b/crates/drink/drink-cli/Cargo.toml index 8a730c5..871ed64 100644 --- a/crates/drink/drink-cli/Cargo.toml +++ b/crates/drink/drink-cli/Cargo.toml @@ -20,5 +20,4 @@ thiserror.workspace = true # Local ink_sandbox.workspace = true -#drink = { workspace = true, features = ["session"] } -drink.workspace = true +drink = { workspace = true, features = ["session"] } diff --git a/crates/drink/drink/Cargo.toml b/crates/drink/drink/Cargo.toml index 3c33f07..90e803e 100644 --- a/crates/drink/drink/Cargo.toml +++ b/crates/drink/drink/Cargo.toml @@ -11,19 +11,14 @@ description = "Minimal sufficient architecture that allows for a fully functiona [dependencies] log.workspace = true -#contract-metadata = { workspace = true, optional = true } -contract-metadata.workspace = true -#contract-transcode = { workspace = true, optional = true } -contract-transcode.workspace = true +contract-metadata = { workspace = true, optional = true } +contract-transcode = { workspace = true, optional = true } scale.workspace = true scale-info.workspace = true -#serde_json = { workspace = true, optional = true } -serde_json.workspace = true +serde_json = { workspace = true, optional = true } thiserror.workspace = true wat.workspace = true parity-scale-codec-derive.workspace = true - -# Substrate dependencies frame-support.workspace = true frame-system.workspace = true sp-runtime-interface.workspace = true @@ -36,15 +31,9 @@ ink_sandbox.workspace = true default = [ # This is required for the runtime-interface to work properly in the std env. "std", -# "session", -# "macros", -] -#session = ["contract-metadata", "contract-transcode", "serde_json"] -#macros = ["contract-metadata", "contract-transcode", "serde_json"] -std = [ - "frame-support/std", - "frame-system/std", - "scale/std", - "scale-info/std", - "sp-runtime-interface/std", + "session", + "macros", ] +session = ["contract-metadata", "contract-transcode", "serde_json"] +macros = ["contract-metadata", "contract-transcode", "serde_json"] +std = [] diff --git a/crates/drink/drink/src/lib.rs b/crates/drink/drink/src/lib.rs index 2a64e9f..b029000 100644 --- a/crates/drink/drink/src/lib.rs +++ b/crates/drink/drink/src/lib.rs @@ -4,8 +4,10 @@ pub mod errors; pub mod pallet_contracts_debugging; /// Necessary exports in ink_e2e_sandbox +#[cfg(feature = "session")] pub mod session; +#[cfg(feature = "macros")] pub use drink_test_macro::{contract_bundle_provider, test}; pub use errors::Error; pub use frame_support; @@ -14,7 +16,7 @@ pub use ink_sandbox::{ pallet_balances, pallet_contracts, pallet_timestamp, sp_externalities, AccountId32, DispatchError, Sandbox, Ss58Codec, Weight, }; -// #[cfg(feature = "session")] +#[cfg(feature = "session")] pub use session::mock::{mock_message, ContractMock, MessageMock, MockedCallResult, Selector}; /// Main result type for the drink crate. diff --git a/crates/ink-sandbox/Cargo.toml b/crates/ink-sandbox/Cargo.toml index 989e316..5fdf5f4 100644 --- a/crates/ink-sandbox/Cargo.toml +++ b/crates/ink-sandbox/Cargo.toml @@ -30,18 +30,4 @@ default = [ # This is required for the runtime-interface to work properly in the std env. "std", ] -std = [ - "frame-metadata/std", - "frame-support/std", - "frame-system/std", - "pallet-assets/std", - "pallet-balances/std", - "pallet-contracts/std", - "pallet-timestamp/std", - "scale/std", - "scale-info/std", - "sp-core/std", - "sp-externalities/std", - "sp-io/std", - "sp-runtime-interface/std", -] +std = [] diff --git a/crates/pop-drink/Cargo.toml b/crates/pop-drink/Cargo.toml index 7639943..a19243a 100644 --- a/crates/pop-drink/Cargo.toml +++ b/crates/pop-drink/Cargo.toml @@ -9,13 +9,3 @@ ink_sandbox.workspace = true pop-runtime-devnet.workspace = true frame-support.workspace = true sp-io.workspace = true - -[features] -default = [ - "std", -] -std = [ - "pop-runtime-devnet/std", - "frame-support/std", - "sp-io/std", -] From 00597be1174986c640268a17f85e2fd397d8b0c5 Mon Sep 17 00:00:00 2001 From: Daanvdplas Date: Fri, 27 Sep 2024 12:07:02 +0200 Subject: [PATCH 09/43] refactor: ci --- .github/workflows/ci.yml | 32 ++++--------------- .taplo.toml | 17 ---------- README.md | 63 +++++++++++++++++++++++++++++++++++++- crates/pop-drink/README.md | 60 ------------------------------------ 4 files changed, 68 insertions(+), 104 deletions(-) delete mode 100644 .taplo.toml delete mode 100644 crates/pop-drink/README.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b33fe6..ecb3cf2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,19 +19,6 @@ jobs: rustup toolchain install nightly --profile minimal --component rustfmt cargo +nightly fmt --all -- --check - - name: Check manifests - run: | - cargo install taplo-cli --locked - taplo format --check - - - name: Check features - run: | - cargo install zepter --locked - zepter lint propagate-feature --feature try-runtime --left-side-feature-missing=ignore --workspace --feature-enables-dep="try-runtime:frame-try-runtime" --locked - zepter lint propagate-feature --feature runtime-benchmarks --left-side-feature-missing=ignore --workspace --feature-enables-dep="runtime-benchmarks:frame-benchmarking" --locked - zepter lint propagate-feature --feature std --left-side-feature-missing=ignore --workspace --locked - zepter format features - check: needs: lint runs-on: ubuntu-latest @@ -42,7 +29,11 @@ jobs: - name: Check Build run: | - cargo check --release --locked --features=runtime-benchmarks,try-runtime + cargo check --release --locked +# +# - name: Run tests for examples +# shell: bash +# run: make test_examples clippy: needs: lint @@ -61,15 +52,4 @@ jobs: uses: actions-rs/clippy-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} - args: --release --locked --features=runtime-benchmarks - - test: - needs: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: "./.github/actions/init" - - - name: Run tests - run: cargo test --release --locked --workspace --features=runtime-benchmarks --exclude integration-tests + args: --release --locked \ No newline at end of file diff --git a/.taplo.toml b/.taplo.toml deleted file mode 100644 index ea64cf5..0000000 --- a/.taplo.toml +++ /dev/null @@ -1,17 +0,0 @@ -# all options https://taplo.tamasfe.dev/configuration/formatter-options.html - -exclude = [ "networks/**", "target/**" ] - -# global rules -[formatting] -array_auto_collapse = false -array_auto_expand = true -compact_arrays = false # zepter compatibility -indent_string = " " # tab -inline_table_expand = false -reorder_arrays = true -reorder_keys = true - -[[rule]] -include = [ "Cargo.toml" ] -keys = [ "workspace.dependencies" ] diff --git a/README.md b/README.md index f6d6815..2e17b48 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,65 @@ > [!IMPORTANT] > This repository is customized and maintained for Pop API contract end-to-end testing. > -> Quasi tests must be run with `cargo test --release`. \ No newline at end of file +> Quasi tests must be run with `cargo test --release`. + +# Pop Sandbox + +Implementation of the [`pop_drink::Sandbox`](https://github.com/r0gue-io/pop-drink) struct for the Pop Network runtimes (located in `pop-node/runtime`) required for the quasi testing with `drink`. + +In the context of quasi-testing with pop-drink, a sandbox refers to an isolated runtime environment that simulates the behavior of a full node, without requiring an actual node. It can emulate key processes (where runtime `pallets` are involved) such as block initialization, execution, and block finalization. + +## Getting Started + +### Installation + +```toml +pop_drink = { version = "1.0.0", package = "pop-drink" } +``` + +### Import Sandbox for the specific runtime + +- For `devnet` runtime + +Implementation of the sandbox runtime environment for `devnet` runtime located in `pop-node/runtime/devnet` + +```rs +use pop_sandbox::DevnetSandbox; +``` + +- For `testnet` runtime + +Implementation of the sandbox runtime environment for `testnet` runtime located in `pop-node/runtime/testnet` + +```rs +use pop_sandbox::TestnetSandbox; +``` + +- For `mainnet` runtime + +Implementation of the sandbox runtime environment for `mainnet` runtime located in `pop-node/runtime/mainnet` + +```rs +use pop_sandbox::MainnetSandbox; +``` + +### Setup test environment for your contract + +Below is an example for the contract testing with `pop_drink` and `pop_sandbox` for `devnet` environment using `DevnetSandbox`. + +```rs +use pop_drink::session::Session; +use pop_sandbox::DevnetSandbox as Sandbox; + +#[drink::contract_bundle_provider] +enum BundleProvider {} + +#[drink::test(sandbox = Sandbox)] +fn test(mut session: Session) { + // Your test case +} +``` + +## Examples + +Please find more examples of `pop_drink` tests in the [`pop_drink/examples`](https://github.com/r0gue-io/pop-drink/tree/main/examples). diff --git a/crates/pop-drink/README.md b/crates/pop-drink/README.md deleted file mode 100644 index cacfdc2..0000000 --- a/crates/pop-drink/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# Pop Sandbox - -Implementation of the [`pop_drink::Sandbox`](https://github.com/r0gue-io/pop-drink) struct for the Pop Network runtimes (located in `pop-node/runtime`) required for the quasi testing with `drink`. - -In the context of quasi-testing with pop-drink, a sandbox refers to an isolated runtime environment that simulates the behavior of a full node, without requiring an actual node. It can emulate key processes (where runtime `pallets` are involved) such as block initialization, execution, and block finalization. - -## Getting Started - -### Installation - -```toml -pop_drink = { version = "1.0.0", package = "pop-drink" } -``` - -### Import Sandbox for the specific runtime - -- For `devnet` runtime - -Implementation of the sandbox runtime environment for `devnet` runtime located in `pop-node/runtime/devnet` - -```rs -use pop_sandbox::DevnetSandbox; -``` - -- For `testnet` runtime - -Implementation of the sandbox runtime environment for `testnet` runtime located in `pop-node/runtime/testnet` - -```rs -use pop_sandbox::TestnetSandbox; -``` - -- For `mainnet` runtime - -Implementation of the sandbox runtime environment for `mainnet` runtime located in `pop-node/runtime/mainnet` - -```rs -use pop_sandbox::MainnetSandbox; -``` - -### Setup test environment for your contract - -Below is an example for the contract testing with `pop_drink` and `pop_sandbox` for `devnet` environment using `DevnetSandbox`. - -```rs -use pop_drink::session::Session; -use pop_sandbox::DevnetSandbox as Sandbox; - -#[drink::contract_bundle_provider] -enum BundleProvider {} - -#[drink::test(sandbox = Sandbox)] -fn test(mut session: Session) { - // Your test case -} -``` - -## Examples - -Please find more examples of `pop_drink` tests in the [`pop_drink/examples`](https://github.com/r0gue-io/pop-drink/tree/main/examples). From 4e7a27d27f40f7a0e48def4dbfcfa94bd7404069 Mon Sep 17 00:00:00 2001 From: Daanvdplas Date: Fri, 27 Sep 2024 19:47:35 +0200 Subject: [PATCH 10/43] feat: helper functions --- Cargo.lock | 123 +++++++++++++++++++++++++++++++++++- Cargo.toml | 1 + crates/pop-drink/Cargo.toml | 4 ++ crates/pop-drink/src/lib.rs | 86 ++++++++++++++++++++++++- 4 files changed, 211 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 74ded32..7baf68a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -302,6 +302,12 @@ version = "6.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" +[[package]] +name = "array-init" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" + [[package]] name = "arrayref" version = "0.3.9" @@ -2602,6 +2608,24 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" +[[package]] +name = "ink" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d4a862aedbfda93175ddf75c9aaa2ae4c4b39ee5cee06c16d50bccce05bf5c7" +dependencies = [ + "derive_more", + "ink_env", + "ink_macro", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "ink_storage", + "pallet-contracts-uapi-next", + "parity-scale-codec", + "scale-info", +] + [[package]] name = "ink_allocator" version = "5.0.0" @@ -2611,6 +2635,28 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "ink_codegen" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a1f8473fa09e0f9b6f3cb3f8d18c07c14ebf9ea1f7cdfee270f009d45ee8e9" +dependencies = [ + "blake2", + "derive_more", + "either", + "heck 0.4.1", + "impl-serde", + "ink_ir", + "ink_primitives", + "itertools 0.12.1", + "parity-scale-codec", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn 2.0.77", +] + [[package]] name = "ink_engine" version = "5.0.0" @@ -2657,6 +2703,38 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "ink_ir" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b1ad2975551c4ed800af971289ed6d2c68ac41ffc03a42010b3e01d7360dfb2" +dependencies = [ + "blake2", + "either", + "impl-serde", + "ink_prelude", + "itertools 0.12.1", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "ink_macro" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aee1a546f37eae3b3cd223832d31702033c5369dcfa3405899587c110a7908d3" +dependencies = [ + "ink_codegen", + "ink_ir", + "ink_primitives", + "parity-scale-codec", + "proc-macro2", + "quote", + "syn 2.0.77", + "synstructure", +] + [[package]] name = "ink_metadata" version = "5.0.0" @@ -2720,6 +2798,25 @@ dependencies = [ "wat", ] +[[package]] +name = "ink_storage" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbdb04cad74df858c05bc9cb6f30bbf12da33c3e2cb7ca211749c001fa761aa9" +dependencies = [ + "array-init", + "cfg-if", + "derive_more", + "ink_env", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "ink_storage_traits", + "pallet-contracts-uapi-next", + "parity-scale-codec", + "scale-info", +] + [[package]] name = "ink_storage_traits" version = "5.0.0" @@ -4537,6 +4634,15 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "pop-api" +version = "0.0.0" +dependencies = [ + "ink", + "pop-primitives", + "sp-io", +] + [[package]] name = "pop-chain-extension" version = "0.1.0" @@ -4558,7 +4664,11 @@ version = "0.1.0" dependencies = [ "drink", "frame-support", + "frame-system", "ink_sandbox", + "pallet-contracts", + "parity-scale-codec", + "pop-api", "pop-runtime-devnet", "sp-io", ] @@ -6391,6 +6501,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "tap" version = "1.0.1" @@ -7112,7 +7233,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 1c34e07..1765c11 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -58,3 +58,4 @@ drink = { path = "crates/drink/drink" } ink_sandbox = { path = "crates/ink-sandbox" } pop-drink = { path = "crates/pop-drink" } pop-runtime-devnet = { path = "../pop-node/runtime/devnet" } +pop-api = { path = "../pop-node/pop-api" } diff --git a/crates/pop-drink/Cargo.toml b/crates/pop-drink/Cargo.toml index a19243a..a70b5fa 100644 --- a/crates/pop-drink/Cargo.toml +++ b/crates/pop-drink/Cargo.toml @@ -7,5 +7,9 @@ edition = "2021" drink.workspace = true ink_sandbox.workspace = true pop-runtime-devnet.workspace = true +pallet-contracts.workspace = true +frame-system.workspace = true frame-support.workspace = true sp-io.workspace = true +scale.workspace = true +pop-api.workspace = true diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index 4daab0f..26efbbc 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -2,12 +2,94 @@ pub use drink::*; pub use ink_sandbox::api::{assets_api::AssetsAPI}; pub use sp_io::TestExternalities; pub use frame_support::{self, sp_runtime::DispatchError, assert_ok}; +pub use session::{error::SessionError, ContractBundle, Session, NO_SALT}; +use scale::Decode; +use ink_sandbox::{AccountIdFor, BalanceFor}; + pub mod devnet { + use super::*; pub use pop_runtime_devnet::{BuildStorage, Runtime}; - use ink_sandbox::{AccountIdFor, BalanceFor}; - /// Balance type used in the pop runtime. + // Types used in the pop runtime. pub type Balance = BalanceFor; pub type AccountId = AccountIdFor; + + // This is used to resolve type mismatches between the `AccountId` in the quasi testing + // environment and the contract environment. + pub fn account_id_from_slice(s: &AccountId) -> pop_api::primitives::AccountId { + let account: [u8; 32] = s.clone().into(); + utils::account_id_from_slice(&account) + } } +pub mod utils { + use super::*; + pub fn deploy + ( + session: &mut Session, + bundle: ContractBundle, + method: &str, + input: Vec, + salt: Vec, + init_value: Option>, + ) + -> Result, E> + where + S: Sandbox, + S::Runtime: pallet_contracts::Config, + E: Decode, + { + let result = session.deploy_bundle(bundle, method, &input, salt, init_value); + if result.is_err() { + let deployment_result = session.record().last_deploy_result().result.clone(); + let error = deployment_result.unwrap().result.data; + return Err(E::decode(&mut &error[2..]).unwrap()); + } + Ok(result.unwrap()) + } + + // Call a contract method and decode the returned data. + pub fn call( + session: &mut Session, + func_name: &str, + input: Vec, + endowment: Option>, + ) -> Result + where + S: Sandbox, + S::Runtime: pallet_contracts::Config, + O: Decode, + E: Decode, + { + match session.call::(func_name, &input, endowment) { + // If the call is reverted, decode the error into `PSP22Error`. + Err(SessionError::CallReverted(error)) => + Err(E::decode(&mut &error[2..]) + .unwrap_or_else(|_| panic!("Decoding failed"))), + // If the call is successful, decode the last returned value. + Ok(_) => Ok(session + .record() + .last_call_return_decoded::() + .unwrap_or_else(|_| panic!("Expected a return value")) + .unwrap_or_else(|_| panic!("Decoding failed"))), + // Catch-all for unexpected results. + _ => panic!("Expected call to revert or return a value"), + } + } + + // This is used to resolve type mismatches between the `AccountId` in the quasi testing + // environment and the contract environment. + fn account_id_from_slice(s: &[u8; 32]) -> pop_api::primitives::AccountId { + pop_api::primitives::AccountId::decode(&mut &s[..]).expect("Should be decoded to AccountId") + } + + // Get the last event from pallet contracts. + pub fn last_contract_event(session: &Session) -> Option> + where + S: Sandbox, + S::Runtime: pallet_contracts::Config, + ::RuntimeEvent: TryInto>, + { + session.record().last_event_batch().contract_events().last().cloned() + } +} From 340d358adb7e30210dfa1dbddbb69ba0fadd9b75 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Mon, 30 Sep 2024 19:23:49 +0700 Subject: [PATCH 11/43] fix: pub visibility of util method --- crates/pop-drink/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index 26efbbc..6b055c8 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -79,7 +79,7 @@ pub mod utils { // This is used to resolve type mismatches between the `AccountId` in the quasi testing // environment and the contract environment. - fn account_id_from_slice(s: &[u8; 32]) -> pop_api::primitives::AccountId { + pub fn account_id_from_slice(s: &[u8; 32]) -> pop_api::primitives::AccountId { pop_api::primitives::AccountId::decode(&mut &s[..]).expect("Should be decoded to AccountId") } From ddb58064091eab3cf6027d7c2b526f7f0e18e0dc Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Thu, 3 Oct 2024 19:38:38 +0700 Subject: [PATCH 12/43] feat: add runtime error --- Cargo.lock | 1 + Cargo.toml | 5 +- crates/drink/drink/src/lib.rs | 8 +- crates/pop-drink/Cargo.toml | 3 +- crates/pop-drink/src/lib.rs | 217 +++++++++++++++++++++------------- 5 files changed, 144 insertions(+), 90 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7baf68a..74e6953 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4666,6 +4666,7 @@ dependencies = [ "frame-support", "frame-system", "ink_sandbox", + "pallet-api", "pallet-contracts", "parity-scale-codec", "pop-api", diff --git a/Cargo.toml b/Cargo.toml index 1765c11..af99044 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,9 +7,7 @@ members = [ "crates/drink/drink/test-macro", "crates/pop-drink", ] -exclude = [ - "crates/drink/examples", -] +exclude = ["crates/drink/examples"] [workspace.package] edition = "2021" @@ -56,6 +54,7 @@ sp-runtime-interface = { version = "28.0.0", features = ["std"] } # Local drink = { path = "crates/drink/drink" } ink_sandbox = { path = "crates/ink-sandbox" } +pallet-api = { path = "../pop-node/pallets/api" } pop-drink = { path = "crates/pop-drink" } pop-runtime-devnet = { path = "../pop-node/runtime/devnet" } pop-api = { path = "../pop-node/pop-api" } diff --git a/crates/drink/drink/src/lib.rs b/crates/drink/drink/src/lib.rs index b029000..8b94a05 100644 --- a/crates/drink/drink/src/lib.rs +++ b/crates/drink/drink/src/lib.rs @@ -12,9 +12,9 @@ pub use drink_test_macro::{contract_bundle_provider, test}; pub use errors::Error; pub use frame_support; pub use ink_sandbox::{ - self, api as sandbox_api, create_sandbox, impl_sandbox, - pallet_balances, pallet_contracts, pallet_timestamp, sp_externalities, AccountId32, - DispatchError, Sandbox, Ss58Codec, Weight, + self, api as sandbox_api, create_sandbox, impl_sandbox, pallet_assets, pallet_balances, + pallet_contracts, pallet_timestamp, sp_externalities, AccountId32, DispatchError, Sandbox, + Ss58Codec, Weight, }; #[cfg(feature = "session")] pub use session::mock::{mock_message, ContractMock, MessageMock, MockedCallResult, Selector}; @@ -28,4 +28,4 @@ pub mod minimal { // create_sandbox!(MinimalSandbox); create_sandbox!(MinimalSandbox, (), crate::pallet_contracts_debugging::DrinkDebug); -} \ No newline at end of file +} diff --git a/crates/pop-drink/Cargo.toml b/crates/pop-drink/Cargo.toml index a70b5fa..b826b85 100644 --- a/crates/pop-drink/Cargo.toml +++ b/crates/pop-drink/Cargo.toml @@ -6,8 +6,9 @@ edition = "2021" [dependencies] drink.workspace = true ink_sandbox.workspace = true -pop-runtime-devnet.workspace = true +pallet-api.workspace = true pallet-contracts.workspace = true +pop-runtime-devnet.workspace = true frame-system.workspace = true frame-support.workspace = true sp-io.workspace = true diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index 6b055c8..d07b1cb 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -1,95 +1,148 @@ pub use drink::*; -pub use ink_sandbox::api::{assets_api::AssetsAPI}; -pub use sp_io::TestExternalities; -pub use frame_support::{self, sp_runtime::DispatchError, assert_ok}; -pub use session::{error::SessionError, ContractBundle, Session, NO_SALT}; -use scale::Decode; +pub use frame_support::{self, assert_ok, sp_runtime::DispatchError, traits::PalletInfoAccess}; +pub use ink_sandbox::api::assets_api::AssetsAPI; use ink_sandbox::{AccountIdFor, BalanceFor}; +use scale::Decode; +pub use session::{error::SessionError, ContractBundle, Session, NO_SALT}; +pub use sp_io::TestExternalities; pub mod devnet { - use super::*; - pub use pop_runtime_devnet::{BuildStorage, Runtime}; + use super::*; + pub use frame_support::sp_runtime::{ + ArithmeticError, DispatchError, ModuleError, TokenError, TransactionalError, + }; + pub use pop_runtime_devnet::{ + config::api::versioning::V0Error, Assets, Balances, BuildStorage, Contracts, Runtime, + }; + + // Types used in the pop runtime. + pub type Balance = BalanceFor; + pub type AccountId = AccountIdFor; + // Error type aliases for the pop runtime modules. + type AssetsInstance = ::AssetsInstance; + pub type AssetsError = pallet_assets::Error>; + pub type BalancesError = pallet_balances::Error; + pub type ContractsError = pallet_contracts::Error; + + // This is used to resolve type mismatches between the `AccountId` in the quasi testing + // environment and the contract environment. + pub fn account_id_from_slice(s: &AccountId) -> pop_api::primitives::AccountId { + let account: [u8; 32] = s.clone().into(); + utils::account_id_from_slice(&account) + } + + /// Runtime module error. + pub struct Error(pub DispatchError); + impl Into for Error { + fn into(self) -> u32 { + V0Error::from(self.0).into() + } + } - // Types used in the pop runtime. - pub type Balance = BalanceFor; - pub type AccountId = AccountIdFor; + #[cfg(test)] + mod test { + use crate::devnet::{AssetsError, BalancesError, Error}; + use frame_support::sp_runtime::ArithmeticError; + use pop_api::primitives::{ArithmeticError::Overflow, Error as PopApiError}; - // This is used to resolve type mismatches between the `AccountId` in the quasi testing - // environment and the contract environment. - pub fn account_id_from_slice(s: &AccountId) -> pop_api::primitives::AccountId { - let account: [u8; 32] = s.clone().into(); - utils::account_id_from_slice(&account) - } + #[test] + fn module_error_conversion_works() { + vec![ + (Error(ArithmeticError::Overflow.into()), PopApiError::Arithmetic(Overflow)), + ( + Error(AssetsError::BalanceLow.into()), + PopApiError::Module { index: 52, error: [0, 0] }, + ), + ( + Error(AssetsError::NoAccount.into()), + PopApiError::Module { index: 52, error: [1, 0] }, + ), + ( + Error(AssetsError::NoPermission.into()), + PopApiError::Module { index: 52, error: [2, 0] }, + ), + ( + Error(BalancesError::VestingBalance.into()), + PopApiError::Module { index: 10, error: [0, 0] }, + ), + ] + .into_iter() + .for_each(|t| { + let module_error: u32 = t.0.into(); + let pop_api_error: u32 = t.1.into(); + assert_eq!(module_error, pop_api_error); + }); + } + } } pub mod utils { - use super::*; - pub fn deploy - ( - session: &mut Session, - bundle: ContractBundle, - method: &str, - input: Vec, - salt: Vec, - init_value: Option>, - ) - -> Result, E> - where - S: Sandbox, - S::Runtime: pallet_contracts::Config, - E: Decode, - { - let result = session.deploy_bundle(bundle, method, &input, salt, init_value); - if result.is_err() { - let deployment_result = session.record().last_deploy_result().result.clone(); - let error = deployment_result.unwrap().result.data; - return Err(E::decode(&mut &error[2..]).unwrap()); - } - Ok(result.unwrap()) - } + use super::*; + pub fn deploy( + session: &mut Session, + bundle: ContractBundle, + method: &str, + input: Vec, + salt: Vec, + init_value: Option>, + ) -> Result, E> + where + S: Sandbox, + S::Runtime: pallet_contracts::Config, + E: Decode, + { + let result = session.deploy_bundle(bundle, method, &input, salt, init_value); + if result.is_err() { + let deployment_result = session.record().last_deploy_result().result.clone(); + let error = deployment_result.unwrap().result.data; + return Err(E::decode(&mut &error[2..]).unwrap()); + } + Ok(result.unwrap()) + } - // Call a contract method and decode the returned data. - pub fn call( - session: &mut Session, - func_name: &str, - input: Vec, - endowment: Option>, - ) -> Result - where - S: Sandbox, - S::Runtime: pallet_contracts::Config, - O: Decode, - E: Decode, - { - match session.call::(func_name, &input, endowment) { - // If the call is reverted, decode the error into `PSP22Error`. - Err(SessionError::CallReverted(error)) => - Err(E::decode(&mut &error[2..]) - .unwrap_or_else(|_| panic!("Decoding failed"))), - // If the call is successful, decode the last returned value. - Ok(_) => Ok(session - .record() - .last_call_return_decoded::() - .unwrap_or_else(|_| panic!("Expected a return value")) - .unwrap_or_else(|_| panic!("Decoding failed"))), - // Catch-all for unexpected results. - _ => panic!("Expected call to revert or return a value"), - } - } + // Call a contract method and decode the returned data. + pub fn call( + session: &mut Session, + func_name: &str, + input: Vec, + endowment: Option>, + ) -> Result + where + S: Sandbox, + S::Runtime: pallet_contracts::Config, + O: Decode, + E: Decode, + { + match session.call::(func_name, &input, endowment) { + // If the call is reverted, decode the error into `PSP22Error`. + Err(SessionError::CallReverted(error)) => { + Err(E::decode(&mut &error[2..]).unwrap_or_else(|_| panic!("Decoding failed"))) + }, + // If the call is successful, decode the last returned value. + Ok(_) => Ok(session + .record() + .last_call_return_decoded::() + .unwrap_or_else(|_| panic!("Expected a return value")) + .unwrap_or_else(|_| panic!("Decoding failed"))), + // Catch-all for unexpected results. + _ => panic!("Expected call to revert or return a value"), + } + } - // This is used to resolve type mismatches between the `AccountId` in the quasi testing - // environment and the contract environment. - pub fn account_id_from_slice(s: &[u8; 32]) -> pop_api::primitives::AccountId { - pop_api::primitives::AccountId::decode(&mut &s[..]).expect("Should be decoded to AccountId") - } + // This is used to resolve type mismatches between the `AccountId` in the quasi testing + // environment and the contract environment. + pub fn account_id_from_slice(s: &[u8; 32]) -> pop_api::primitives::AccountId { + pop_api::primitives::AccountId::decode(&mut &s[..]).expect("Should be decoded to AccountId") + } - // Get the last event from pallet contracts. - pub fn last_contract_event(session: &Session) -> Option> - where - S: Sandbox, - S::Runtime: pallet_contracts::Config, - ::RuntimeEvent: TryInto>, - { - session.record().last_event_batch().contract_events().last().cloned() - } + // Get the last event from pallet contracts. + pub fn last_contract_event(session: &Session) -> Option> + where + S: Sandbox, + S::Runtime: pallet_contracts::Config, + ::RuntimeEvent: + TryInto>, + { + session.record().last_event_batch().contract_events().last().cloned() + } } From 315bb65ddedcb72ac5bcd8d1763b219b399c4bc7 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Thu, 3 Oct 2024 19:49:29 +0700 Subject: [PATCH 13/43] fix: comments --- crates/pop-drink/src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index 6b055c8..d3a3d8c 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -10,12 +10,12 @@ pub mod devnet { use super::*; pub use pop_runtime_devnet::{BuildStorage, Runtime}; - // Types used in the pop runtime. + /// Types used in the pop runtime. pub type Balance = BalanceFor; pub type AccountId = AccountIdFor; - // This is used to resolve type mismatches between the `AccountId` in the quasi testing - // environment and the contract environment. + /// This is used to resolve type mismatches between the `AccountId` in the quasi testing + /// environment and the contract environment. pub fn account_id_from_slice(s: &AccountId) -> pop_api::primitives::AccountId { let account: [u8; 32] = s.clone().into(); utils::account_id_from_slice(&account) @@ -48,7 +48,7 @@ pub mod utils { Ok(result.unwrap()) } - // Call a contract method and decode the returned data. + /// Call a contract method and decode the returned data. pub fn call( session: &mut Session, func_name: &str, @@ -77,13 +77,13 @@ pub mod utils { } } - // This is used to resolve type mismatches between the `AccountId` in the quasi testing - // environment and the contract environment. + /// This is used to resolve type mismatches between the `AccountId` in the quasi testing + /// environment and the contract environment. pub fn account_id_from_slice(s: &[u8; 32]) -> pop_api::primitives::AccountId { pop_api::primitives::AccountId::decode(&mut &s[..]).expect("Should be decoded to AccountId") } - // Get the last event from pallet contracts. + /// Get the last event from pallet contracts. pub fn last_contract_event(session: &Session) -> Option> where S: Sandbox, From be47f839dc29b89e980b15e6a8fce10398865545 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Thu, 3 Oct 2024 19:55:52 +0700 Subject: [PATCH 14/43] fix: bracket --- crates/pop-drink/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index d3a3d8c..cb7c986 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -1,5 +1,5 @@ pub use drink::*; -pub use ink_sandbox::api::{assets_api::AssetsAPI}; +pub use ink_sandbox::api::assets_api::AssetsAPI; pub use sp_io::TestExternalities; pub use frame_support::{self, sp_runtime::DispatchError, assert_ok}; pub use session::{error::SessionError, ContractBundle, Session, NO_SALT}; From 6f609f2b5f4cc56c7fdd3bca62fb6c0c6e7d13c4 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Fri, 4 Oct 2024 00:59:48 +0700 Subject: [PATCH 15/43] feat: into psp22 error --- crates/pop-drink/Cargo.toml | 2 +- crates/pop-drink/src/lib.rs | 72 ++++++++++++++++++++++++++++++------- 2 files changed, 60 insertions(+), 14 deletions(-) diff --git a/crates/pop-drink/Cargo.toml b/crates/pop-drink/Cargo.toml index b826b85..b6efcc1 100644 --- a/crates/pop-drink/Cargo.toml +++ b/crates/pop-drink/Cargo.toml @@ -13,4 +13,4 @@ frame-system.workspace = true frame-support.workspace = true sp-io.workspace = true scale.workspace = true -pop-api.workspace = true +pop-api = { workspace = true, features = ["fungibles"] } diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index d07b1cb..ad77b28 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -2,6 +2,7 @@ pub use drink::*; pub use frame_support::{self, assert_ok, sp_runtime::DispatchError, traits::PalletInfoAccess}; pub use ink_sandbox::api::assets_api::AssetsAPI; use ink_sandbox::{AccountIdFor, BalanceFor}; +use pop_api::v0::fungibles::PSP22Error; use scale::Decode; pub use session::{error::SessionError, ContractBundle, Session, NO_SALT}; pub use sp_io::TestExternalities; @@ -14,6 +15,7 @@ pub mod devnet { pub use pop_runtime_devnet::{ config::api::versioning::V0Error, Assets, Balances, BuildStorage, Contracts, Runtime, }; + use scale::Encode; // Types used in the pop runtime. pub type Balance = BalanceFor; @@ -31,46 +33,90 @@ pub mod devnet { utils::account_id_from_slice(&account) } - /// Runtime module error. - pub struct Error(pub DispatchError); - impl Into for Error { + pub struct RuntimeError(pub DispatchError); + impl Into for RuntimeError { fn into(self) -> u32 { V0Error::from(self.0).into() } } + impl Into for RuntimeError { + // Convert `RuntimeError` into `PSP22Error::Custom` error type. + fn into(self) -> PSP22Error { + let mut padded_vec = self.0.encode().to_vec(); + padded_vec.resize(4, 0); + let array: [u8; 4] = padded_vec.try_into().map_err(|_| "Invalid length").unwrap(); + let status_code = u32::from_le_bytes(array); + PSP22Error::Custom(status_code.to_string()) + } + } + #[cfg(test)] mod test { - use crate::devnet::{AssetsError, BalancesError, Error}; + use crate::devnet::{AssetsError, BalancesError, RuntimeError}; use frame_support::sp_runtime::ArithmeticError; - use pop_api::primitives::{ArithmeticError::Overflow, Error as PopApiError}; + use pop_api::{ + fungibles::PSP22Error, + primitives::{ArithmeticError::Overflow, Error as PopApiError}, + }; #[test] - fn module_error_conversion_works() { + fn runtime_error_to_primitives_error_conversion_works() { vec![ - (Error(ArithmeticError::Overflow.into()), PopApiError::Arithmetic(Overflow)), + (RuntimeError(ArithmeticError::Overflow.into()), PopApiError::Arithmetic(Overflow)), ( - Error(AssetsError::BalanceLow.into()), + RuntimeError(AssetsError::BalanceLow.into()), PopApiError::Module { index: 52, error: [0, 0] }, ), ( - Error(AssetsError::NoAccount.into()), + RuntimeError(AssetsError::NoAccount.into()), PopApiError::Module { index: 52, error: [1, 0] }, ), ( - Error(AssetsError::NoPermission.into()), + RuntimeError(AssetsError::NoPermission.into()), PopApiError::Module { index: 52, error: [2, 0] }, ), ( - Error(BalancesError::VestingBalance.into()), + RuntimeError(BalancesError::VestingBalance.into()), PopApiError::Module { index: 10, error: [0, 0] }, ), ] .into_iter() .for_each(|t| { - let module_error: u32 = t.0.into(); + let runtime_error: u32 = t.0.into(); let pop_api_error: u32 = t.1.into(); - assert_eq!(module_error, pop_api_error); + assert_eq!(runtime_error, pop_api_error); + }); + } + + #[test] + fn runtime_error_to_psp22_error_conversion_works() { + vec![ + ( + RuntimeError(ArithmeticError::Overflow.into()), + PSP22Error::Custom(String::from("264")), + ), + ( + RuntimeError(AssetsError::BalanceLow.into()), + PSP22Error::Custom(String::from("13315")), + ), + ( + RuntimeError(AssetsError::NoAccount.into()), + PSP22Error::Custom(String::from("78851")), + ), + ( + RuntimeError(AssetsError::NoPermission.into()), + PSP22Error::Custom(String::from("144387")), + ), + ( + RuntimeError(BalancesError::VestingBalance.into()), + PSP22Error::Custom(String::from("2563")), + ), + ] + .into_iter() + .for_each(|t| { + let runtime_error: PSP22Error = t.0.into(); + assert_eq!(runtime_error, t.1); }); } } From 4b9c94a9729dcd7657edc3b1da4d79853bec92bd Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Fri, 4 Oct 2024 15:47:19 +0700 Subject: [PATCH 16/43] feat: u32 conversion --- crates/pop-drink/Cargo.toml | 2 +- crates/pop-drink/src/lib.rs | 53 ++++--------------------------------- 2 files changed, 6 insertions(+), 49 deletions(-) diff --git a/crates/pop-drink/Cargo.toml b/crates/pop-drink/Cargo.toml index b6efcc1..b826b85 100644 --- a/crates/pop-drink/Cargo.toml +++ b/crates/pop-drink/Cargo.toml @@ -13,4 +13,4 @@ frame-system.workspace = true frame-support.workspace = true sp-io.workspace = true scale.workspace = true -pop-api = { workspace = true, features = ["fungibles"] } +pop-api.workspace = true diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index ad77b28..030a71d 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -2,7 +2,6 @@ pub use drink::*; pub use frame_support::{self, assert_ok, sp_runtime::DispatchError, traits::PalletInfoAccess}; pub use ink_sandbox::api::assets_api::AssetsAPI; use ink_sandbox::{AccountIdFor, BalanceFor}; -use pop_api::v0::fungibles::PSP22Error; use scale::Decode; pub use session::{error::SessionError, ContractBundle, Session, NO_SALT}; pub use sp_io::TestExternalities; @@ -15,7 +14,6 @@ pub mod devnet { pub use pop_runtime_devnet::{ config::api::versioning::V0Error, Assets, Balances, BuildStorage, Contracts, Runtime, }; - use scale::Encode; // Types used in the pop runtime. pub type Balance = BalanceFor; @@ -33,32 +31,20 @@ pub mod devnet { utils::account_id_from_slice(&account) } + #[derive(Debug, PartialEq)] pub struct RuntimeError(pub DispatchError); + impl Into for RuntimeError { fn into(self) -> u32 { V0Error::from(self.0).into() } } - impl Into for RuntimeError { - // Convert `RuntimeError` into `PSP22Error::Custom` error type. - fn into(self) -> PSP22Error { - let mut padded_vec = self.0.encode().to_vec(); - padded_vec.resize(4, 0); - let array: [u8; 4] = padded_vec.try_into().map_err(|_| "Invalid length").unwrap(); - let status_code = u32::from_le_bytes(array); - PSP22Error::Custom(status_code.to_string()) - } - } - #[cfg(test)] mod test { use crate::devnet::{AssetsError, BalancesError, RuntimeError}; use frame_support::sp_runtime::ArithmeticError; - use pop_api::{ - fungibles::PSP22Error, - primitives::{ArithmeticError::Overflow, Error as PopApiError}, - }; + use pop_api::primitives::{ArithmeticError::Overflow, Error as PopApiError}; #[test] fn runtime_error_to_primitives_error_conversion_works() { @@ -83,42 +69,13 @@ pub mod devnet { ] .into_iter() .for_each(|t| { + println!("t"); let runtime_error: u32 = t.0.into(); let pop_api_error: u32 = t.1.into(); + // `u32` assertion. assert_eq!(runtime_error, pop_api_error); }); } - - #[test] - fn runtime_error_to_psp22_error_conversion_works() { - vec![ - ( - RuntimeError(ArithmeticError::Overflow.into()), - PSP22Error::Custom(String::from("264")), - ), - ( - RuntimeError(AssetsError::BalanceLow.into()), - PSP22Error::Custom(String::from("13315")), - ), - ( - RuntimeError(AssetsError::NoAccount.into()), - PSP22Error::Custom(String::from("78851")), - ), - ( - RuntimeError(AssetsError::NoPermission.into()), - PSP22Error::Custom(String::from("144387")), - ), - ( - RuntimeError(BalancesError::VestingBalance.into()), - PSP22Error::Custom(String::from("2563")), - ), - ] - .into_iter() - .for_each(|t| { - let runtime_error: PSP22Error = t.0.into(); - assert_eq!(runtime_error, t.1); - }); - } } } From a6c4b5c4e4f256fb296b6e473a1e0a966f092171 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Fri, 4 Oct 2024 17:15:45 +0700 Subject: [PATCH 17/43] feat: better runtime error --- crates/pop-drink/src/lib.rs | 99 +++++++++++++++++++++++++++++++------ 1 file changed, 84 insertions(+), 15 deletions(-) diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index 030a71d..ae7b0f5 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -14,6 +14,7 @@ pub mod devnet { pub use pop_runtime_devnet::{ config::api::versioning::V0Error, Assets, Balances, BuildStorage, Contracts, Runtime, }; + use scale::Encode; // Types used in the pop runtime. pub type Balance = BalanceFor; @@ -24,22 +25,50 @@ pub mod devnet { pub type BalancesError = pallet_balances::Error; pub type ContractsError = pallet_contracts::Error; - // This is used to resolve type mismatches between the `AccountId` in the quasi testing - // environment and the contract environment. - pub fn account_id_from_slice(s: &AccountId) -> pop_api::primitives::AccountId { - let account: [u8; 32] = s.clone().into(); - utils::account_id_from_slice(&account) + #[derive(Encode, Decode, Debug)] + pub enum RuntimeError { + Raw(DispatchError), + #[codec(index = 52)] + Assets(AssetsError), + #[codec(index = 10)] + Balances(BalancesError), + #[codec(index = 40)] + Contracts(ContractsError), } - #[derive(Debug, PartialEq)] - pub struct RuntimeError(pub DispatchError); - impl Into for RuntimeError { fn into(self) -> u32 { - V0Error::from(self.0).into() + let dispatch_error = match self { + RuntimeError::Raw(dispatch_error) => dispatch_error, + RuntimeError::Assets(error) => error.into(), + RuntimeError::Balances(error) => error.into(), + RuntimeError::Contracts(error) => error.into(), + }; + V0Error::from(dispatch_error).into() } } + impl From for RuntimeError { + fn from(value: u32) -> Self { + let encoded = value.to_le_bytes(); + match encoded { + [3, module_error @ ..] => { + RuntimeError::decode(&mut &module_error[..]).expect("Decoding failed") + }, + _ => RuntimeError::Raw( + DispatchError::decode(&mut &encoded[..]).expect("Decoding failed"), + ), + } + } + } + + // This is used to resolve type mismatches between the `AccountId` in the quasi testing + // environment and the contract environment. + pub fn account_id_from_slice(s: &AccountId) -> pop_api::primitives::AccountId { + let account: [u8; 32] = s.clone().into(); + utils::account_id_from_slice(&account) + } + #[cfg(test)] mod test { use crate::devnet::{AssetsError, BalancesError, RuntimeError}; @@ -49,27 +78,29 @@ pub mod devnet { #[test] fn runtime_error_to_primitives_error_conversion_works() { vec![ - (RuntimeError(ArithmeticError::Overflow.into()), PopApiError::Arithmetic(Overflow)), ( - RuntimeError(AssetsError::BalanceLow.into()), + RuntimeError::Raw(ArithmeticError::Overflow.into()), + PopApiError::Arithmetic(Overflow), + ), + ( + RuntimeError::Assets(AssetsError::BalanceLow), PopApiError::Module { index: 52, error: [0, 0] }, ), ( - RuntimeError(AssetsError::NoAccount.into()), + RuntimeError::Assets(AssetsError::NoAccount), PopApiError::Module { index: 52, error: [1, 0] }, ), ( - RuntimeError(AssetsError::NoPermission.into()), + RuntimeError::Assets(AssetsError::NoPermission), PopApiError::Module { index: 52, error: [2, 0] }, ), ( - RuntimeError(BalancesError::VestingBalance.into()), + RuntimeError::Balances(BalancesError::VestingBalance), PopApiError::Module { index: 10, error: [0, 0] }, ), ] .into_iter() .for_each(|t| { - println!("t"); let runtime_error: u32 = t.0.into(); let pop_api_error: u32 = t.1.into(); // `u32` assertion. @@ -79,6 +110,44 @@ pub mod devnet { } } +pub mod error { + use crate::devnet::RuntimeError; + + #[track_caller] + pub fn assert_runtime_err_inner>( + result: Result, + expected_error: RuntimeError, + ) { + let expected_code: u32 = expected_error.into(); + if let Err(error) = result { + let error_code: u32 = error.into(); + if error_code != expected_code { + panic!( + r#"assertion `left == right` failed + left: {:?} + right: {:?}"#, + RuntimeError::from(error_code), + RuntimeError::from(expected_code), + ); + } + } else { + panic!( + r#"assertion `left == right` failed + left: Ok() + right: {:?}"#, + RuntimeError::from(expected_code), + ); + } + } + + #[macro_export] + macro_rules! assert_runtime_err { + ($result:expr, $error:expr $(,)?) => { + $crate::error::assert_runtime_err_inner($result, $error); + }; + } +} + pub mod utils { use super::*; pub fn deploy( From 6cf56a6ac01b159b98ccf873d0546c55cc20d9e1 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Fri, 4 Oct 2024 19:59:12 +0700 Subject: [PATCH 18/43] refactor: pop_primitive dispatch error conversion --- Cargo.lock | 2 ++ Cargo.toml | 15 ++++++++------- crates/pop-drink/Cargo.toml | 1 + crates/pop-drink/src/lib.rs | 38 +++++++++++++++++++++++++++---------- 4 files changed, 39 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 74e6953..4fc49b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4670,6 +4670,7 @@ dependencies = [ "pallet-contracts", "parity-scale-codec", "pop-api", + "pop-primitives", "pop-runtime-devnet", "sp-io", ] @@ -4680,6 +4681,7 @@ version = "0.0.0" dependencies = [ "parity-scale-codec", "scale-info", + "sp-runtime", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index af99044..600b4d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,11 @@ [workspace] resolver = "2" members = [ - "crates/ink-sandbox", - "crates/drink/drink", - "crates/drink/drink-cli", - "crates/drink/drink/test-macro", - "crates/pop-drink", + "crates/ink-sandbox", + "crates/drink/drink", + "crates/drink/drink-cli", + "crates/drink/drink/test-macro", + "crates/pop-drink", ] exclude = ["crates/drink/examples"] @@ -30,7 +30,7 @@ proc-macro2 = { version = "1" } quote = { version = "1" } ratatui = { version = "0.21.0" } scale = { package = "parity-scale-codec", version = "3.6.9", features = [ - "derive", + "derive", ] } scale-info = { version = "2.10.0" } serde_json = { version = "1.0" } @@ -55,6 +55,7 @@ sp-runtime-interface = { version = "28.0.0", features = ["std"] } drink = { path = "crates/drink/drink" } ink_sandbox = { path = "crates/ink-sandbox" } pallet-api = { path = "../pop-node/pallets/api" } +pop-api = { path = "../pop-node/pop-api" } pop-drink = { path = "crates/pop-drink" } +pop-primitives = { path = "../pop-node/primitives" } pop-runtime-devnet = { path = "../pop-node/runtime/devnet" } -pop-api = { path = "../pop-node/pop-api" } diff --git a/crates/pop-drink/Cargo.toml b/crates/pop-drink/Cargo.toml index b826b85..87b728f 100644 --- a/crates/pop-drink/Cargo.toml +++ b/crates/pop-drink/Cargo.toml @@ -14,3 +14,4 @@ frame-support.workspace = true sp-io.workspace = true scale.workspace = true pop-api.workspace = true +pop-primitives.workspace = true diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index ae7b0f5..a0feccb 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -1,20 +1,19 @@ pub use drink::*; -pub use frame_support::{self, assert_ok, sp_runtime::DispatchError, traits::PalletInfoAccess}; +pub use frame_support::{self, assert_ok}; pub use ink_sandbox::api::assets_api::AssetsAPI; use ink_sandbox::{AccountIdFor, BalanceFor}; -use scale::Decode; +use scale::{Decode, Encode}; pub use session::{error::SessionError, ContractBundle, Session, NO_SALT}; pub use sp_io::TestExternalities; +pub const DECODING_FAILED_ERROR: [u8; 4] = [11, 0, 0, 0]; + pub mod devnet { use super::*; pub use frame_support::sp_runtime::{ ArithmeticError, DispatchError, ModuleError, TokenError, TransactionalError, }; - pub use pop_runtime_devnet::{ - config::api::versioning::V0Error, Assets, Balances, BuildStorage, Contracts, Runtime, - }; - use scale::Encode; + pub use pop_runtime_devnet::{Assets, Balances, BuildStorage, Contracts, Runtime}; // Types used in the pop runtime. pub type Balance = BalanceFor; @@ -36,15 +35,34 @@ pub mod devnet { Contracts(ContractsError), } - impl Into for RuntimeError { - fn into(self) -> u32 { - let dispatch_error = match self { + impl From for u32 { + fn from(value: RuntimeError) -> Self { + use pop_primitives::Error; + let dispatch_error = match value { RuntimeError::Raw(dispatch_error) => dispatch_error, RuntimeError::Assets(error) => error.into(), RuntimeError::Balances(error) => error.into(), RuntimeError::Contracts(error) => error.into(), }; - V0Error::from(dispatch_error).into() + let primitive_error = match dispatch_error { + DispatchError::Module(error) => { + // Note: message not used + let ModuleError { index, error, message: _message } = error; + // Map `pallet-contracts::Error::DecodingFailed` to `Error::DecodingFailed` + if index as usize + == ::index() + && error == DECODING_FAILED_ERROR + { + Error::DecodingFailed + } else { + // Note: lossy conversion of error value due to returned contract status code + // size limitation + Error::Module { index, error: [error[0], error[1]] } + } + }, + _ => dispatch_error.into(), + }; + Error::from(primitive_error).into() } } From 63ed93d60701e7a180d3a4c8986a5bba04258cd7 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Tue, 8 Oct 2024 00:29:00 +0700 Subject: [PATCH 19/43] refactor: error module conversion --- Cargo.lock | 5 +- crates/pop-drink/Cargo.toml | 11 +- crates/pop-drink/src/error.rs | 154 +++++++++++++++++++++++ crates/pop-drink/src/lib.rs | 224 ++-------------------------------- crates/pop-drink/src/mock.rs | 107 ++++++++++++++++ crates/pop-drink/src/utils.rs | 73 +++++++++++ 6 files changed, 356 insertions(+), 218 deletions(-) create mode 100644 crates/pop-drink/src/error.rs create mode 100644 crates/pop-drink/src/mock.rs create mode 100644 crates/pop-drink/src/utils.rs diff --git a/Cargo.lock b/Cargo.lock index 4fc49b7..ee37cbc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4667,11 +4667,15 @@ dependencies = [ "frame-system", "ink_sandbox", "pallet-api", + "pallet-assets", + "pallet-balances", "pallet-contracts", + "pallet-timestamp", "parity-scale-codec", "pop-api", "pop-primitives", "pop-runtime-devnet", + "scale-info", "sp-io", ] @@ -4681,7 +4685,6 @@ version = "0.0.0" dependencies = [ "parity-scale-codec", "scale-info", - "sp-runtime", ] [[package]] diff --git a/crates/pop-drink/Cargo.toml b/crates/pop-drink/Cargo.toml index 87b728f..dca7cec 100644 --- a/crates/pop-drink/Cargo.toml +++ b/crates/pop-drink/Cargo.toml @@ -4,9 +4,12 @@ version = "0.1.0" edition = "2021" [dependencies] +scale-info = { workspace = true, default-features = false, features = [ + "derive", +] } + drink.workspace = true ink_sandbox.workspace = true -pallet-api.workspace = true pallet-contracts.workspace = true pop-runtime-devnet.workspace = true frame-system.workspace = true @@ -14,4 +17,10 @@ frame-support.workspace = true sp-io.workspace = true scale.workspace = true pop-api.workspace = true + +[dev-dependencies] +pallet-api.workspace = true +pallet-assets.workspace = true +pallet-balances.workspace = true +pallet-timestamp.workspace = true pop-primitives.workspace = true diff --git a/crates/pop-drink/src/error.rs b/crates/pop-drink/src/error.rs new file mode 100644 index 0000000..ade3fe2 --- /dev/null +++ b/crates/pop-drink/src/error.rs @@ -0,0 +1,154 @@ +use std::fmt::Debug; + +pub use drink::{ + pallet_assets::Error as AssetsError, pallet_balances::Error as BalancesError, + pallet_contracts::Error as ContractsError, +}; +pub use frame_support::sp_runtime::{ + ArithmeticError, DispatchError, ModuleError, TokenError, TransactionalError, +}; +use scale::{Decode, Encode}; + +fn decode(data: &[u8]) -> T { + T::decode(&mut &data[..]).expect("Decoding failed") +} + +#[derive(Encode, Decode, Debug)] +pub enum DrinkError +where + E: Decode + Encode + Debug, +{ + Raw(DispatchError), + Module(E), +} + +impl From> for u32 +where + E: Decode + Encode + Debug, +{ + fn from(error: DrinkError) -> Self { + let mut value = match error { + DrinkError::Raw(dispatch_error) => dispatch_error.encode(), + DrinkError::Module(module_error) => { + let mut module_error = module_error.encode(); + module_error.insert(0, 3); + module_error + }, + }; + value.resize(4, 0); + u32::from_le_bytes(value.try_into().expect("qed, resized to 4 bytes line above")) + } +} + +impl From for DrinkError +where + E: Decode + Encode + Debug, +{ + fn from(value: u32) -> Self { + let encoded = value.to_le_bytes(); + match encoded { + [3, module_error @ ..] => DrinkError::Module(decode(&module_error)), + _ => DrinkError::Raw(decode(&encoded)), + } + } +} + +#[track_caller] +pub fn assert_runtime_err_inner(result: Result, expected_error: DrinkError) +where + T: Decode + Encode + Debug, + E: Into, +{ + let expected_code: u32 = expected_error.into(); + let expected_error = DrinkError::::from(expected_code); + if let Err(error) = result { + let error_code: u32 = error.into(); + if error_code != expected_code { + panic!( + r#"assertion `left == right` failed + left: {:?} + right: {:?}"#, + DrinkError::::from(error_code), + expected_error, + ); + } + } else { + panic!( + r#"assertion `left == right` failed + left: Ok() + right: {:?}"#, + expected_error, + ); + } +} + +#[macro_export] +macro_rules! assert_runtime_err { + ($result:expr, $error:expr $(,)?) => { + $crate::error::assert_runtime_err_inner($result, $error); + }; +} + +#[cfg(test)] +mod test { + use pop_api::primitives::Error as PopApiError; + + use super::{ + AssetsError::*, + BalancesError::*, + DrinkError::{self, *}, + }; + + fn test_cases() -> Vec<(DrinkError, PopApiError)> { + use frame_support::traits::PalletInfoAccess; + + use crate::mock::RuntimeError::*; + vec![ + ( + Raw(frame_support::sp_runtime::ArithmeticError::Overflow.into()), + PopApiError::Arithmetic(pop_api::primitives::ArithmeticError::Overflow), + ), + ( + Module(Assets(BalanceLow)), + PopApiError::Module { index: crate::mock::Assets::index() as u8, error: [0, 0] }, + ), + ( + Module(Assets(NoAccount)), + PopApiError::Module { index: crate::mock::Assets::index() as u8, error: [1, 0] }, + ), + ( + Module(Assets(NoPermission)), + PopApiError::Module { index: crate::mock::Assets::index() as u8, error: [2, 0] }, + ), + ( + Module(Balances(VestingBalance)), + PopApiError::Module { index: crate::mock::Balances::index() as u8, error: [0, 0] }, + ), + ( + Module(Balances(LiquidityRestrictions)), + PopApiError::Module { index: crate::mock::Balances::index() as u8, error: [1, 0] }, + ), + ( + Module(Balances(InsufficientBalance)), + PopApiError::Module { index: crate::mock::Balances::index() as u8, error: [2, 0] }, + ), + ] + } + + #[test] + fn runtime_error_to_primitives_error_conversion_works() { + test_cases().into_iter().for_each(|t| { + let runtime_error: u32 = t.0.into(); + let pop_api_error: u32 = t.1.into(); + assert_eq!(runtime_error, pop_api_error); + }); + } + + #[test] + fn assert_runtime_error_works() { + use crate::error::assert_runtime_err_inner; + test_cases().into_iter().for_each(|t| { + assert_runtime_err_inner(Result::<(), pop_primitives::Error>::Err(t.1), t.0); + }); + } +} diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index a0feccb..549dbf6 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -2,83 +2,24 @@ pub use drink::*; pub use frame_support::{self, assert_ok}; pub use ink_sandbox::api::assets_api::AssetsAPI; use ink_sandbox::{AccountIdFor, BalanceFor}; -use scale::{Decode, Encode}; pub use session::{error::SessionError, ContractBundle, Session, NO_SALT}; pub use sp_io::TestExternalities; -pub const DECODING_FAILED_ERROR: [u8; 4] = [11, 0, 0, 0]; +pub mod error; +#[cfg(test)] +pub mod mock; +pub mod utils; pub mod devnet { + use error::DrinkError as DrinkErrorOf; + pub use pop_runtime_devnet::{Runtime, RuntimeError}; + use super::*; - pub use frame_support::sp_runtime::{ - ArithmeticError, DispatchError, ModuleError, TokenError, TransactionalError, - }; - pub use pop_runtime_devnet::{Assets, Balances, BuildStorage, Contracts, Runtime}; // Types used in the pop runtime. pub type Balance = BalanceFor; pub type AccountId = AccountIdFor; - // Error type aliases for the pop runtime modules. - type AssetsInstance = ::AssetsInstance; - pub type AssetsError = pallet_assets::Error>; - pub type BalancesError = pallet_balances::Error; - pub type ContractsError = pallet_contracts::Error; - - #[derive(Encode, Decode, Debug)] - pub enum RuntimeError { - Raw(DispatchError), - #[codec(index = 52)] - Assets(AssetsError), - #[codec(index = 10)] - Balances(BalancesError), - #[codec(index = 40)] - Contracts(ContractsError), - } - - impl From for u32 { - fn from(value: RuntimeError) -> Self { - use pop_primitives::Error; - let dispatch_error = match value { - RuntimeError::Raw(dispatch_error) => dispatch_error, - RuntimeError::Assets(error) => error.into(), - RuntimeError::Balances(error) => error.into(), - RuntimeError::Contracts(error) => error.into(), - }; - let primitive_error = match dispatch_error { - DispatchError::Module(error) => { - // Note: message not used - let ModuleError { index, error, message: _message } = error; - // Map `pallet-contracts::Error::DecodingFailed` to `Error::DecodingFailed` - if index as usize - == ::index() - && error == DECODING_FAILED_ERROR - { - Error::DecodingFailed - } else { - // Note: lossy conversion of error value due to returned contract status code - // size limitation - Error::Module { index, error: [error[0], error[1]] } - } - }, - _ => dispatch_error.into(), - }; - Error::from(primitive_error).into() - } - } - - impl From for RuntimeError { - fn from(value: u32) -> Self { - let encoded = value.to_le_bytes(); - match encoded { - [3, module_error @ ..] => { - RuntimeError::decode(&mut &module_error[..]).expect("Decoding failed") - }, - _ => RuntimeError::Raw( - DispatchError::decode(&mut &encoded[..]).expect("Decoding failed"), - ), - } - } - } + pub type DrinkError = DrinkErrorOf; // This is used to resolve type mismatches between the `AccountId` in the quasi testing // environment and the contract environment. @@ -86,153 +27,4 @@ pub mod devnet { let account: [u8; 32] = s.clone().into(); utils::account_id_from_slice(&account) } - - #[cfg(test)] - mod test { - use crate::devnet::{AssetsError, BalancesError, RuntimeError}; - use frame_support::sp_runtime::ArithmeticError; - use pop_api::primitives::{ArithmeticError::Overflow, Error as PopApiError}; - - #[test] - fn runtime_error_to_primitives_error_conversion_works() { - vec![ - ( - RuntimeError::Raw(ArithmeticError::Overflow.into()), - PopApiError::Arithmetic(Overflow), - ), - ( - RuntimeError::Assets(AssetsError::BalanceLow), - PopApiError::Module { index: 52, error: [0, 0] }, - ), - ( - RuntimeError::Assets(AssetsError::NoAccount), - PopApiError::Module { index: 52, error: [1, 0] }, - ), - ( - RuntimeError::Assets(AssetsError::NoPermission), - PopApiError::Module { index: 52, error: [2, 0] }, - ), - ( - RuntimeError::Balances(BalancesError::VestingBalance), - PopApiError::Module { index: 10, error: [0, 0] }, - ), - ] - .into_iter() - .for_each(|t| { - let runtime_error: u32 = t.0.into(); - let pop_api_error: u32 = t.1.into(); - // `u32` assertion. - assert_eq!(runtime_error, pop_api_error); - }); - } - } -} - -pub mod error { - use crate::devnet::RuntimeError; - - #[track_caller] - pub fn assert_runtime_err_inner>( - result: Result, - expected_error: RuntimeError, - ) { - let expected_code: u32 = expected_error.into(); - if let Err(error) = result { - let error_code: u32 = error.into(); - if error_code != expected_code { - panic!( - r#"assertion `left == right` failed - left: {:?} - right: {:?}"#, - RuntimeError::from(error_code), - RuntimeError::from(expected_code), - ); - } - } else { - panic!( - r#"assertion `left == right` failed - left: Ok() - right: {:?}"#, - RuntimeError::from(expected_code), - ); - } - } - - #[macro_export] - macro_rules! assert_runtime_err { - ($result:expr, $error:expr $(,)?) => { - $crate::error::assert_runtime_err_inner($result, $error); - }; - } -} - -pub mod utils { - use super::*; - pub fn deploy( - session: &mut Session, - bundle: ContractBundle, - method: &str, - input: Vec, - salt: Vec, - init_value: Option>, - ) -> Result, E> - where - S: Sandbox, - S::Runtime: pallet_contracts::Config, - E: Decode, - { - let result = session.deploy_bundle(bundle, method, &input, salt, init_value); - if result.is_err() { - let deployment_result = session.record().last_deploy_result().result.clone(); - let error = deployment_result.unwrap().result.data; - return Err(E::decode(&mut &error[2..]).unwrap()); - } - Ok(result.unwrap()) - } - - // Call a contract method and decode the returned data. - pub fn call( - session: &mut Session, - func_name: &str, - input: Vec, - endowment: Option>, - ) -> Result - where - S: Sandbox, - S::Runtime: pallet_contracts::Config, - O: Decode, - E: Decode, - { - match session.call::(func_name, &input, endowment) { - // If the call is reverted, decode the error into `PSP22Error`. - Err(SessionError::CallReverted(error)) => { - Err(E::decode(&mut &error[2..]).unwrap_or_else(|_| panic!("Decoding failed"))) - }, - // If the call is successful, decode the last returned value. - Ok(_) => Ok(session - .record() - .last_call_return_decoded::() - .unwrap_or_else(|_| panic!("Expected a return value")) - .unwrap_or_else(|_| panic!("Decoding failed"))), - // Catch-all for unexpected results. - _ => panic!("Expected call to revert or return a value"), - } - } - - // This is used to resolve type mismatches between the `AccountId` in the quasi testing - // environment and the contract environment. - pub fn account_id_from_slice(s: &[u8; 32]) -> pop_api::primitives::AccountId { - pop_api::primitives::AccountId::decode(&mut &s[..]).expect("Should be decoded to AccountId") - } - - // Get the last event from pallet contracts. - pub fn last_contract_event(session: &Session) -> Option> - where - S: Sandbox, - S::Runtime: pallet_contracts::Config, - ::RuntimeEvent: - TryInto>, - { - session.record().last_event_batch().contract_events().last().cloned() - } } diff --git a/crates/pop-drink/src/mock.rs b/crates/pop-drink/src/mock.rs new file mode 100644 index 0000000..5dcfd68 --- /dev/null +++ b/crates/pop-drink/src/mock.rs @@ -0,0 +1,107 @@ +use frame_support::{ + derive_impl, parameter_types, + traits::{AsEnsureOriginWithArg, ConstU32}, +}; +use frame_system::{pallet_prelude::BlockNumberFor, EnsureRoot, EnsureSigned}; +use pallet_contracts::{ + config_preludes::{ + CodeHashLockupDepositPercent, DefaultDepositLimit, DepositPerByte, DepositPerItem, + MaxDelegateDependencies, + }, + DefaultAddressGenerator, Frame, Schedule, +}; + +type HashOf = ::Hash; + +frame_support::construct_runtime!( + pub enum Test { + System: frame_system, + Assets: pallet_assets::, + Balances: pallet_balances, + Timestamp: pallet_timestamp, + Contracts: pallet_contracts, + Fungibles: pallet_api::fungibles, + } +); + +#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] +impl frame_system::Config for Test { + type AccountData = pallet_balances::AccountData; + type AccountId = u64; + type Block = frame_system::mocking::MockBlock; +} + +#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig)] +impl pallet_balances::Config for Test { + type AccountStore = System; + type ReserveIdentifier = [u8; 8]; +} + +#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig as pallet_timestamp::DefaultConfig)] +impl pallet_timestamp::Config for Test {} + +impl pallet_contracts::Config for Test { + type AddressGenerator = DefaultAddressGenerator; + type ApiVersion = (); + type CallFilter = (); + // TestFilter; + type CallStack = [Frame; 5]; + type ChainExtension = (); + type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; + type Currency = Balances; + type Debug = (); + // TestDebug; + type DefaultDepositLimit = DefaultDepositLimit; + type DepositPerByte = DepositPerByte; + type DepositPerItem = DepositPerItem; + type Environment = (); + type InstantiateOrigin = EnsureSigned; + type MaxCodeLen = ConstU32<{ 100 * 1024 }>; + type MaxDebugBufferLen = ConstU32<{ 2 * 1024 * 1024 }>; + type MaxDelegateDependencies = MaxDelegateDependencies; + type MaxStorageKeyLen = ConstU32<128>; + type Migrations = (); + // crate::migration::codegen::BenchMigrations; + type Randomness = Test; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type RuntimeHoldReason = RuntimeHoldReason; + type Schedule = MySchedule; + type Time = Timestamp; + type UnsafeUnstableInterface = (); + // UnstableInterface; + type UploadOrigin = EnsureSigned; + type WeightInfo = (); + type WeightPrice = (); + // Self; + type Xcm = (); +} + +type AssetsInstance = pallet_assets::Instance1; +#[derive_impl(pallet_assets::config_preludes::TestDefaultConfig as pallet_assets::DefaultConfig)] +impl pallet_assets::Config for Test { + type CreateOrigin = AsEnsureOriginWithArg>; + type Currency = Balances; + type ForceOrigin = EnsureRoot; + type Freezer = (); + type RuntimeEvent = RuntimeEvent; +} + +impl pallet_api::fungibles::Config for Test { + type AssetsInstance = AssetsInstance; + type RuntimeEvent = RuntimeEvent; + type WeightInfo = (); +} + +parameter_types! { + pub MySchedule: Schedule = { + let schedule = >::default(); + schedule + }; +} + +impl frame_support::traits::Randomness, BlockNumberFor> for Test { + fn random(_subject: &[u8]) -> (HashOf, BlockNumberFor) { + (Default::default(), Default::default()) + } +} diff --git a/crates/pop-drink/src/utils.rs b/crates/pop-drink/src/utils.rs new file mode 100644 index 0000000..57abad7 --- /dev/null +++ b/crates/pop-drink/src/utils.rs @@ -0,0 +1,73 @@ +use drink::{ + session::{error::SessionError, ContractBundle, Session}, + Sandbox, +}; +use ink_sandbox::{AccountIdFor, BalanceFor}; +use scale::Decode; + +pub fn deploy( + session: &mut Session, + bundle: ContractBundle, + method: &str, + input: Vec, + salt: Vec, + init_value: Option>, +) -> Result, E> +where + S: Sandbox, + S::Runtime: pallet_contracts::Config, + E: Decode, +{ + let result = session.deploy_bundle(bundle, method, &input, salt, init_value); + if result.is_err() { + let deployment_result = session.record().last_deploy_result().result.clone(); + let error = deployment_result.unwrap().result.data; + return Err(E::decode(&mut &error[2..]).unwrap()); + } + Ok(result.unwrap()) +} + +// Call a contract method and decode the returned data. +pub fn call( + session: &mut Session, + func_name: &str, + input: Vec, + endowment: Option>, +) -> Result +where + S: Sandbox, + S::Runtime: pallet_contracts::Config, + O: Decode, + E: Decode, +{ + match session.call::(func_name, &input, endowment) { + // If the call is reverted, decode the error into `PSP22Error`. + Err(SessionError::CallReverted(error)) => + Err(E::decode(&mut &error[2..]).unwrap_or_else(|_| panic!("Decoding failed"))), + // If the call is successful, decode the last returned value. + Ok(_) => Ok(session + .record() + .last_call_return_decoded::() + .unwrap_or_else(|_| panic!("Expected a return value")) + .unwrap_or_else(|_| panic!("Decoding failed"))), + // Catch-all for unexpected results. + _ => panic!("Expected call to revert or return a value"), + } +} + +// This is used to resolve type mismatches between the `AccountId` in the quasi testing +// environment and the contract environment. +pub fn account_id_from_slice(s: &[u8; 32]) -> pop_api::primitives::AccountId { + pop_api::primitives::AccountId::decode(&mut &s[..]).expect("Should be decoded to AccountId") +} + +// Get the last event from pallet contracts. +pub fn last_contract_event(session: &Session) -> Option> +where + S: Sandbox, + S::Runtime: pallet_contracts::Config, + ::RuntimeEvent: + TryInto>, +{ + session.record().last_event_batch().contract_events().last().cloned() +} From 201a9b9eac1deb3bfcec3fea2b38d4418fb6b60a Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Tue, 8 Oct 2024 19:33:59 +0700 Subject: [PATCH 20/43] feat: add versioning --- crates/pop-drink/Cargo.toml | 2 +- crates/pop-drink/src/error.rs | 154 ----------------------------- crates/pop-drink/src/errors/mod.rs | 45 +++++++++ crates/pop-drink/src/errors/v0.rs | 150 ++++++++++++++++++++++++++++ crates/pop-drink/src/lib.rs | 21 +++- crates/pop-drink/src/utils.rs | 4 + 6 files changed, 217 insertions(+), 159 deletions(-) delete mode 100644 crates/pop-drink/src/error.rs create mode 100644 crates/pop-drink/src/errors/mod.rs create mode 100644 crates/pop-drink/src/errors/v0.rs diff --git a/crates/pop-drink/Cargo.toml b/crates/pop-drink/Cargo.toml index dca7cec..d05b10b 100644 --- a/crates/pop-drink/Cargo.toml +++ b/crates/pop-drink/Cargo.toml @@ -17,10 +17,10 @@ frame-support.workspace = true sp-io.workspace = true scale.workspace = true pop-api.workspace = true +pop-primitives.workspace = true [dev-dependencies] pallet-api.workspace = true pallet-assets.workspace = true pallet-balances.workspace = true pallet-timestamp.workspace = true -pop-primitives.workspace = true diff --git a/crates/pop-drink/src/error.rs b/crates/pop-drink/src/error.rs deleted file mode 100644 index ade3fe2..0000000 --- a/crates/pop-drink/src/error.rs +++ /dev/null @@ -1,154 +0,0 @@ -use std::fmt::Debug; - -pub use drink::{ - pallet_assets::Error as AssetsError, pallet_balances::Error as BalancesError, - pallet_contracts::Error as ContractsError, -}; -pub use frame_support::sp_runtime::{ - ArithmeticError, DispatchError, ModuleError, TokenError, TransactionalError, -}; -use scale::{Decode, Encode}; - -fn decode(data: &[u8]) -> T { - T::decode(&mut &data[..]).expect("Decoding failed") -} - -#[derive(Encode, Decode, Debug)] -pub enum DrinkError -where - E: Decode + Encode + Debug, -{ - Raw(DispatchError), - Module(E), -} - -impl From> for u32 -where - E: Decode + Encode + Debug, -{ - fn from(error: DrinkError) -> Self { - let mut value = match error { - DrinkError::Raw(dispatch_error) => dispatch_error.encode(), - DrinkError::Module(module_error) => { - let mut module_error = module_error.encode(); - module_error.insert(0, 3); - module_error - }, - }; - value.resize(4, 0); - u32::from_le_bytes(value.try_into().expect("qed, resized to 4 bytes line above")) - } -} - -impl From for DrinkError -where - E: Decode + Encode + Debug, -{ - fn from(value: u32) -> Self { - let encoded = value.to_le_bytes(); - match encoded { - [3, module_error @ ..] => DrinkError::Module(decode(&module_error)), - _ => DrinkError::Raw(decode(&encoded)), - } - } -} - -#[track_caller] -pub fn assert_runtime_err_inner(result: Result, expected_error: DrinkError) -where - T: Decode + Encode + Debug, - E: Into, -{ - let expected_code: u32 = expected_error.into(); - let expected_error = DrinkError::::from(expected_code); - if let Err(error) = result { - let error_code: u32 = error.into(); - if error_code != expected_code { - panic!( - r#"assertion `left == right` failed - left: {:?} - right: {:?}"#, - DrinkError::::from(error_code), - expected_error, - ); - } - } else { - panic!( - r#"assertion `left == right` failed - left: Ok() - right: {:?}"#, - expected_error, - ); - } -} - -#[macro_export] -macro_rules! assert_runtime_err { - ($result:expr, $error:expr $(,)?) => { - $crate::error::assert_runtime_err_inner($result, $error); - }; -} - -#[cfg(test)] -mod test { - use pop_api::primitives::Error as PopApiError; - - use super::{ - AssetsError::*, - BalancesError::*, - DrinkError::{self, *}, - }; - - fn test_cases() -> Vec<(DrinkError, PopApiError)> { - use frame_support::traits::PalletInfoAccess; - - use crate::mock::RuntimeError::*; - vec![ - ( - Raw(frame_support::sp_runtime::ArithmeticError::Overflow.into()), - PopApiError::Arithmetic(pop_api::primitives::ArithmeticError::Overflow), - ), - ( - Module(Assets(BalanceLow)), - PopApiError::Module { index: crate::mock::Assets::index() as u8, error: [0, 0] }, - ), - ( - Module(Assets(NoAccount)), - PopApiError::Module { index: crate::mock::Assets::index() as u8, error: [1, 0] }, - ), - ( - Module(Assets(NoPermission)), - PopApiError::Module { index: crate::mock::Assets::index() as u8, error: [2, 0] }, - ), - ( - Module(Balances(VestingBalance)), - PopApiError::Module { index: crate::mock::Balances::index() as u8, error: [0, 0] }, - ), - ( - Module(Balances(LiquidityRestrictions)), - PopApiError::Module { index: crate::mock::Balances::index() as u8, error: [1, 0] }, - ), - ( - Module(Balances(InsufficientBalance)), - PopApiError::Module { index: crate::mock::Balances::index() as u8, error: [2, 0] }, - ), - ] - } - - #[test] - fn runtime_error_to_primitives_error_conversion_works() { - test_cases().into_iter().for_each(|t| { - let runtime_error: u32 = t.0.into(); - let pop_api_error: u32 = t.1.into(); - assert_eq!(runtime_error, pop_api_error); - }); - } - - #[test] - fn assert_runtime_error_works() { - use crate::error::assert_runtime_err_inner; - test_cases().into_iter().for_each(|t| { - assert_runtime_err_inner(Result::<(), pop_primitives::Error>::Err(t.1), t.0); - }); - } -} diff --git a/crates/pop-drink/src/errors/mod.rs b/crates/pop-drink/src/errors/mod.rs new file mode 100644 index 0000000..281abb5 --- /dev/null +++ b/crates/pop-drink/src/errors/mod.rs @@ -0,0 +1,45 @@ +//! A set of errors used for testing smart contracts. + +use std::fmt::Debug; + +pub use drink::{ + pallet_assets::Error as AssetsError, pallet_balances::Error as BalancesError, + pallet_contracts::Error as ContractsError, +}; + +pub mod v0; + +#[track_caller] +pub fn assert_runtime_err_inner( + result: Result, + expected_error: RuntimeError, +) where + // V: Version of Pop API. + VersionedApiError: Into, + // E: Returned Err() value of a method result. Must be convertable to `u32`. + E: Into, + // D: Expected RuntimeError. + RuntimeError: From + Into + Debug, +{ + let expected_code: u32 = expected_error.into(); + let expected_error = RuntimeError::from(expected_code); + if let Err(error) = result { + let error_code: u32 = error.into(); + if error_code != expected_code { + panic!( + r#"assertion `left == right` failed + left: {:?} + right: {:?}"#, + RuntimeError::from(error_code), + expected_error + ); + } + } else { + panic!( + r#"assertion `left == right` failed + left: Ok() + right: {:?}"#, + expected_error + ); + } +} diff --git a/crates/pop-drink/src/errors/v0.rs b/crates/pop-drink/src/errors/v0.rs new file mode 100644 index 0000000..40b88a7 --- /dev/null +++ b/crates/pop-drink/src/errors/v0.rs @@ -0,0 +1,150 @@ +//! Runtime error type for testing Pop API V0. + +use std::fmt::Debug; + +use pop_api::primitives::v0::Error as PopApiError; +pub use pop_api::primitives::v0::*; +use scale::{Decode, Encode}; + +use crate::utils::decode; + +/// Runtime error type for testing Pop API V0. +#[derive(Encode, Decode, Debug)] +#[repr(u8)] +pub enum RuntimeError +where + E: Decode + Encode + Debug, +{ + Module(E), + Raw(PopApiError), +} + +impl From> for u32 +where + E: Decode + Encode + Debug, +{ + /// Converts a `RuntimeError` into a numerical value of `pop_api::primitives::v0::Error`. + /// + /// This conversion is necessary for comparing `RuntimeError` instances with other types + /// that implement `Into`, as `RuntimeError` does not implement `Eq`. + /// Use this function to obtain a numerical representation of the error for comparison or + /// further processing. + fn from(error: RuntimeError) -> Self { + let pop_api_error = match error { + RuntimeError::Module(error) => { + let encoded = error.encode(); + let (index, mut runtime_error) = (encoded[0], encoded[1..].to_vec()); + runtime_error.resize(2, 0); + PopApiError::Module { index, error: [runtime_error[0], runtime_error[1]] } + }, + RuntimeError::Raw(error) => decode::(&error.encode()), + }; + pop_api_error.into() + } +} + +impl From for RuntimeError +where + E: Decode + Encode + Debug, +{ + /// Converts a numerical value of `pop_api::primitives::v0::Error` into a `RuntimeError`. + /// + /// This is used to reconstruct and display a `RuntimeError` from its numerical representation + /// when an error is thrown. + fn from(value: u32) -> Self { + let error = PopApiError::from(value); + match error { + PopApiError::Module { index, error } => { + let data = vec![vec![index], error.to_vec()].concat(); + RuntimeError::Module(decode(&data)) + }, + _ => RuntimeError::Raw(error), + } + } +} + +/// A method to assert that an error returned from a method matches +/// the `RuntimeError` type using `pop_api::primitives::v0::Error`. +pub fn assert_runtime_err_inner( + result: Result, + expected_error: RuntimeError, +) where + // E: Returned Err() value of a method result. Must be convertable to `u32`. + E: Into, + // D: Expected RuntimeError. + RuntimeError: From + Into + Debug, +{ + crate::errors::assert_runtime_err_inner::( + result, + expected_error, + ) +} + +/// A utility macro to assert that an error returned from a smart contract method using +/// `pop_api::primitives::v0::Error` matches the `RuntimeError`. +#[macro_export] +macro_rules! __assert_runtime_err_v0 { + ($result:expr, $error:expr $(,)?) => { + $crate::errors::v0::assert_runtime_err_inner::<_, _, _>($result, $error); + }; +} + +pub use __assert_runtime_err_v0 as assert_runtime_err; + +#[cfg(test)] +mod test { + use pop_primitives::v0::Error as PopApiError; + use v0::RuntimeError; + + use crate::errors::{AssetsError::*, BalancesError::*, *}; + + fn test_cases() -> Vec<(RuntimeError, PopApiError)> { + use frame_support::traits::PalletInfoAccess; + use pop_api::primitives::{ArithmeticError::*, TokenError::*}; + + use crate::mock::RuntimeError::*; + vec![ + (RuntimeError::Raw(PopApiError::BadOrigin), PopApiError::BadOrigin), + (RuntimeError::Raw(PopApiError::Token(BelowMinimum)), PopApiError::Token(BelowMinimum)), + ( + RuntimeError::Raw(PopApiError::Arithmetic(Overflow)), + PopApiError::Arithmetic(Overflow), + ), + ( + RuntimeError::Module(Assets(BalanceLow)), + PopApiError::Module { index: crate::mock::Assets::index() as u8, error: [0, 0] }, + ), + ( + RuntimeError::Module(Assets(NoAccount)), + PopApiError::Module { index: crate::mock::Assets::index() as u8, error: [1, 0] }, + ), + ( + RuntimeError::Module(Balances(VestingBalance)), + PopApiError::Module { index: crate::mock::Balances::index() as u8, error: [0, 0] }, + ), + ( + RuntimeError::Module(Balances(LiquidityRestrictions)), + PopApiError::Module { index: crate::mock::Balances::index() as u8, error: [1, 0] }, + ), + ] + } + + #[test] + fn runtime_error_to_primitives_error_conversion_works() { + test_cases().into_iter().for_each(|t| { + let runtime_error: u32 = t.0.into(); + let pop_api_error: u32 = t.1.into(); + assert_eq!(runtime_error, pop_api_error); + }); + } + + #[test] + fn assert_runtime_error_works() { + test_cases().into_iter().for_each(|t| { + crate::errors::v0::assert_runtime_err!( + Result::<(), pop_primitives::Error>::Err(t.1), + t.0, + ); + }); + } +} diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index 549dbf6..1a89401 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -5,21 +5,34 @@ use ink_sandbox::{AccountIdFor, BalanceFor}; pub use session::{error::SessionError, ContractBundle, Session, NO_SALT}; pub use sp_io::TestExternalities; -pub mod error; +pub mod errors; #[cfg(test)] pub mod mock; pub mod utils; pub mod devnet { - use error::DrinkError as DrinkErrorOf; - pub use pop_runtime_devnet::{Runtime, RuntimeError}; + pub use pop_runtime_devnet::Runtime; use super::*; + /// A set of primitive runtime errors and versioned runtime errors used for testing. + pub mod error { + pub use pop_runtime_devnet::RuntimeError::{self as PopRuntimeError, *}; + + pub use crate::errors::*; + /// A collection of error types from the `v0` module used for smart contract testing in the + /// `devnet` environment. + pub mod v0 { + use super::*; + pub use crate::errors::v0::*; + /// Runtime error type used for testing smart contract methods using Pop API `v0`. + pub type RuntimeError = crate::errors::v0::RuntimeError; + } + } + // Types used in the pop runtime. pub type Balance = BalanceFor; pub type AccountId = AccountIdFor; - pub type DrinkError = DrinkErrorOf; // This is used to resolve type mismatches between the `AccountId` in the quasi testing // environment and the contract environment. diff --git a/crates/pop-drink/src/utils.rs b/crates/pop-drink/src/utils.rs index 57abad7..5478483 100644 --- a/crates/pop-drink/src/utils.rs +++ b/crates/pop-drink/src/utils.rs @@ -71,3 +71,7 @@ where { session.record().last_event_batch().contract_events().last().cloned() } + +pub(crate) fn decode(data: &[u8]) -> T { + T::decode(&mut &data[..]).expect("Decoding failed") +} From 5851852ab0f06bdfb936c19af947f054a5cd8770 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Tue, 8 Oct 2024 22:37:01 +0700 Subject: [PATCH 21/43] feat: generic runtime error --- crates/pop-drink/src/error.rs | 196 +++++++++++++++++++++++++++++ crates/pop-drink/src/errors/mod.rs | 45 ------- crates/pop-drink/src/errors/v0.rs | 150 ---------------------- crates/pop-drink/src/lib.rs | 22 +++- 4 files changed, 213 insertions(+), 200 deletions(-) create mode 100644 crates/pop-drink/src/error.rs delete mode 100644 crates/pop-drink/src/errors/mod.rs delete mode 100644 crates/pop-drink/src/errors/v0.rs diff --git a/crates/pop-drink/src/error.rs b/crates/pop-drink/src/error.rs new file mode 100644 index 0000000..72e65d6 --- /dev/null +++ b/crates/pop-drink/src/error.rs @@ -0,0 +1,196 @@ +//! A set of errors used for testing smart contracts. + +use std::fmt::Debug; + +pub use drink::{ + pallet_assets::Error as AssetsError, pallet_balances::Error as BalancesError, + pallet_contracts::Error as ContractsError, +}; +pub use pop_api::primitives::v0::*; +use scale::{Decode, Encode}; + +use crate::utils::decode; + +/// Configuration for the runtime error. +pub trait RuntimeErrorConfig: Debug { + type ModuleError: Decode + Encode + Debug; + type PopApiError: Decode + Encode + Debug + From + Into; + const MODULE_INDEX: u8; +} + +/// Runtime error type for testing Pop API V0. +#[derive(Encode, Decode, Debug)] +pub enum RuntimeError { + Module(T::ModuleError), + Raw(T::PopApiError), +} + +impl From> for u32 { + /// Converts a `RuntimeError` into a numerical value of `pop_api::primitives::v0::Error`. + /// + /// This conversion is necessary for comparing `RuntimeError` instances with other types + /// that implement `Into`, as `RuntimeError` does not implement `Eq`. + /// Use this function to obtain a numerical representation of the error for comparison or + /// further processing. + fn from(error: RuntimeError) -> Self { + let pop_api_error = match error { + RuntimeError::Module(error) => { + let mut encoded = error.encode(); + encoded.insert(0, T::MODULE_INDEX); + encoded.resize(4, 0); + decode::(&encoded) + }, + RuntimeError::Raw(error) => decode::(&error.encode()), + }; + pop_api_error.into() + } +} + +impl From for RuntimeError { + /// Converts a numerical value of `pop_api::primitives::v0::Error` into a `RuntimeError`. + /// + /// This is used to reconstruct and display a `RuntimeError` from its numerical representation + /// when an error is thrown. + fn from(value: u32) -> Self { + let error = T::PopApiError::from(value); + let encoded = error.encode(); + if encoded[0] == T::MODULE_INDEX { + let (index, module_error) = (encoded[1], &encoded[2..]); + let data = vec![vec![index], module_error.to_vec()].concat(); + return RuntimeError::Module(decode(&data)); + } + RuntimeError::Raw(error) + } +} + +pub mod v0 { + use std::fmt::Debug; + pub fn assert_runtime_err_inner( + result: Result, + expected_error: RuntimeError, + ) where + // E: Returned `Err()` value of a method result. Must be convertable to `u32`. + E: Into, + // D: Expected `RuntimeError`. + RuntimeError: From + Into + Debug, + { + crate::error::assert_runtime_err_inner::( + result, + expected_error, + ) + } + + /// A utility macro to assert that an error returned from a smart contract method using + /// `pop_api::primitives::v0::Error` matches the `RuntimeError`. + #[macro_export] + macro_rules! __assert_runtime_err { + ($result:expr, $error:expr $(,)?) => { + $crate::error::v0::assert_runtime_err_inner::<_, _, _>($result, $error); + }; + } + + pub use __assert_runtime_err as assert_runtime_err; +} + +/// * 'R': Type returned if Ok() +/// * 'V': Version of Pop API. +/// * 'E': Returned Err() value of a method result. Must be convertable to `u32`. +/// * 'D': Expected RuntimeError. +#[track_caller] +pub fn assert_runtime_err_inner( + result: Result, + expected_error: RuntimeError, +) where + VersionedApiError: Into, + E: Into, + RuntimeError: From + Into + Debug, +{ + let expected_code: u32 = expected_error.into(); + let expected_error = RuntimeError::from(expected_code); + if let Err(error) = result { + let error_code: u32 = error.into(); + if error_code != expected_code { + panic!( + r#"assertion `left == right` failed + left: {:?} + right: {:?}"#, + RuntimeError::from(error_code), + expected_error + ); + } + } else { + panic!( + r#"assertion `left == right` failed + left: Ok() + right: {:?}"#, + expected_error + ); + } +} + +#[cfg(test)] +mod test { + use pop_primitives::v0::Error as PopApiError; + + use crate::error::{AssetsError::*, BalancesError::*, *}; + + #[derive(Debug)] + struct Config; + + impl RuntimeErrorConfig for Config { + type ModuleError = crate::mock::RuntimeError; + type PopApiError = PopApiError; + + const MODULE_INDEX: u8 = 3; + } + + fn test_cases() -> Vec<(RuntimeError, PopApiError)> { + use frame_support::traits::PalletInfoAccess; + use pop_api::primitives::{ArithmeticError::*, TokenError::*}; + + use crate::mock::RuntimeError::*; + vec![ + (RuntimeError::Raw(PopApiError::BadOrigin), PopApiError::BadOrigin), + (RuntimeError::Raw(PopApiError::Token(BelowMinimum)), PopApiError::Token(BelowMinimum)), + ( + RuntimeError::Raw(PopApiError::Arithmetic(Overflow)), + PopApiError::Arithmetic(Overflow), + ), + ( + RuntimeError::Module(Assets(BalanceLow)), + PopApiError::Module { index: crate::mock::Assets::index() as u8, error: [0, 0] }, + ), + ( + RuntimeError::Module(Assets(NoAccount)), + PopApiError::Module { index: crate::mock::Assets::index() as u8, error: [1, 0] }, + ), + ( + RuntimeError::Module(Balances(VestingBalance)), + PopApiError::Module { index: crate::mock::Balances::index() as u8, error: [0, 0] }, + ), + ( + RuntimeError::Module(Balances(LiquidityRestrictions)), + PopApiError::Module { index: crate::mock::Balances::index() as u8, error: [1, 0] }, + ), + ] + } + + #[test] + fn runtime_error_to_primitives_error_conversion_works() { + test_cases().into_iter().for_each(|t| { + let runtime_error: u32 = t.0.into(); + let pop_api_error: u32 = t.1.into(); + assert_eq!(runtime_error, pop_api_error); + }); + } + + #[test] + fn assert_runtime_error_works() { + test_cases().into_iter().for_each(|t| { + crate::error::v0::assert_runtime_err!( + Result::<(), pop_primitives::Error>::Err(t.1), + t.0, + ); + }); + } +} diff --git a/crates/pop-drink/src/errors/mod.rs b/crates/pop-drink/src/errors/mod.rs deleted file mode 100644 index 281abb5..0000000 --- a/crates/pop-drink/src/errors/mod.rs +++ /dev/null @@ -1,45 +0,0 @@ -//! A set of errors used for testing smart contracts. - -use std::fmt::Debug; - -pub use drink::{ - pallet_assets::Error as AssetsError, pallet_balances::Error as BalancesError, - pallet_contracts::Error as ContractsError, -}; - -pub mod v0; - -#[track_caller] -pub fn assert_runtime_err_inner( - result: Result, - expected_error: RuntimeError, -) where - // V: Version of Pop API. - VersionedApiError: Into, - // E: Returned Err() value of a method result. Must be convertable to `u32`. - E: Into, - // D: Expected RuntimeError. - RuntimeError: From + Into + Debug, -{ - let expected_code: u32 = expected_error.into(); - let expected_error = RuntimeError::from(expected_code); - if let Err(error) = result { - let error_code: u32 = error.into(); - if error_code != expected_code { - panic!( - r#"assertion `left == right` failed - left: {:?} - right: {:?}"#, - RuntimeError::from(error_code), - expected_error - ); - } - } else { - panic!( - r#"assertion `left == right` failed - left: Ok() - right: {:?}"#, - expected_error - ); - } -} diff --git a/crates/pop-drink/src/errors/v0.rs b/crates/pop-drink/src/errors/v0.rs deleted file mode 100644 index 40b88a7..0000000 --- a/crates/pop-drink/src/errors/v0.rs +++ /dev/null @@ -1,150 +0,0 @@ -//! Runtime error type for testing Pop API V0. - -use std::fmt::Debug; - -use pop_api::primitives::v0::Error as PopApiError; -pub use pop_api::primitives::v0::*; -use scale::{Decode, Encode}; - -use crate::utils::decode; - -/// Runtime error type for testing Pop API V0. -#[derive(Encode, Decode, Debug)] -#[repr(u8)] -pub enum RuntimeError -where - E: Decode + Encode + Debug, -{ - Module(E), - Raw(PopApiError), -} - -impl From> for u32 -where - E: Decode + Encode + Debug, -{ - /// Converts a `RuntimeError` into a numerical value of `pop_api::primitives::v0::Error`. - /// - /// This conversion is necessary for comparing `RuntimeError` instances with other types - /// that implement `Into`, as `RuntimeError` does not implement `Eq`. - /// Use this function to obtain a numerical representation of the error for comparison or - /// further processing. - fn from(error: RuntimeError) -> Self { - let pop_api_error = match error { - RuntimeError::Module(error) => { - let encoded = error.encode(); - let (index, mut runtime_error) = (encoded[0], encoded[1..].to_vec()); - runtime_error.resize(2, 0); - PopApiError::Module { index, error: [runtime_error[0], runtime_error[1]] } - }, - RuntimeError::Raw(error) => decode::(&error.encode()), - }; - pop_api_error.into() - } -} - -impl From for RuntimeError -where - E: Decode + Encode + Debug, -{ - /// Converts a numerical value of `pop_api::primitives::v0::Error` into a `RuntimeError`. - /// - /// This is used to reconstruct and display a `RuntimeError` from its numerical representation - /// when an error is thrown. - fn from(value: u32) -> Self { - let error = PopApiError::from(value); - match error { - PopApiError::Module { index, error } => { - let data = vec![vec![index], error.to_vec()].concat(); - RuntimeError::Module(decode(&data)) - }, - _ => RuntimeError::Raw(error), - } - } -} - -/// A method to assert that an error returned from a method matches -/// the `RuntimeError` type using `pop_api::primitives::v0::Error`. -pub fn assert_runtime_err_inner( - result: Result, - expected_error: RuntimeError, -) where - // E: Returned Err() value of a method result. Must be convertable to `u32`. - E: Into, - // D: Expected RuntimeError. - RuntimeError: From + Into + Debug, -{ - crate::errors::assert_runtime_err_inner::( - result, - expected_error, - ) -} - -/// A utility macro to assert that an error returned from a smart contract method using -/// `pop_api::primitives::v0::Error` matches the `RuntimeError`. -#[macro_export] -macro_rules! __assert_runtime_err_v0 { - ($result:expr, $error:expr $(,)?) => { - $crate::errors::v0::assert_runtime_err_inner::<_, _, _>($result, $error); - }; -} - -pub use __assert_runtime_err_v0 as assert_runtime_err; - -#[cfg(test)] -mod test { - use pop_primitives::v0::Error as PopApiError; - use v0::RuntimeError; - - use crate::errors::{AssetsError::*, BalancesError::*, *}; - - fn test_cases() -> Vec<(RuntimeError, PopApiError)> { - use frame_support::traits::PalletInfoAccess; - use pop_api::primitives::{ArithmeticError::*, TokenError::*}; - - use crate::mock::RuntimeError::*; - vec![ - (RuntimeError::Raw(PopApiError::BadOrigin), PopApiError::BadOrigin), - (RuntimeError::Raw(PopApiError::Token(BelowMinimum)), PopApiError::Token(BelowMinimum)), - ( - RuntimeError::Raw(PopApiError::Arithmetic(Overflow)), - PopApiError::Arithmetic(Overflow), - ), - ( - RuntimeError::Module(Assets(BalanceLow)), - PopApiError::Module { index: crate::mock::Assets::index() as u8, error: [0, 0] }, - ), - ( - RuntimeError::Module(Assets(NoAccount)), - PopApiError::Module { index: crate::mock::Assets::index() as u8, error: [1, 0] }, - ), - ( - RuntimeError::Module(Balances(VestingBalance)), - PopApiError::Module { index: crate::mock::Balances::index() as u8, error: [0, 0] }, - ), - ( - RuntimeError::Module(Balances(LiquidityRestrictions)), - PopApiError::Module { index: crate::mock::Balances::index() as u8, error: [1, 0] }, - ), - ] - } - - #[test] - fn runtime_error_to_primitives_error_conversion_works() { - test_cases().into_iter().for_each(|t| { - let runtime_error: u32 = t.0.into(); - let pop_api_error: u32 = t.1.into(); - assert_eq!(runtime_error, pop_api_error); - }); - } - - #[test] - fn assert_runtime_error_works() { - test_cases().into_iter().for_each(|t| { - crate::errors::v0::assert_runtime_err!( - Result::<(), pop_primitives::Error>::Err(t.1), - t.0, - ); - }); - } -} diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index 1a89401..37c0bba 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -5,7 +5,7 @@ use ink_sandbox::{AccountIdFor, BalanceFor}; pub use session::{error::SessionError, ContractBundle, Session, NO_SALT}; pub use sp_io::TestExternalities; -pub mod errors; +pub mod error; #[cfg(test)] pub mod mock; pub mod utils; @@ -17,16 +17,28 @@ pub mod devnet { /// A set of primitive runtime errors and versioned runtime errors used for testing. pub mod error { - pub use pop_runtime_devnet::RuntimeError::{self as PopRuntimeError, *}; + pub use pop_runtime_devnet::RuntimeError::*; + + pub use crate::error::*; - pub use crate::errors::*; /// A collection of error types from the `v0` module used for smart contract testing in the /// `devnet` environment. pub mod v0 { use super::*; - pub use crate::errors::v0::*; + pub use crate::error::v0::*; + + /// Configuration for the runtime error used to test smart contract. + #[derive(Debug)] + pub struct Config; + impl RuntimeErrorConfig for Config { + type ModuleError = pop_runtime_devnet::RuntimeError; + type PopApiError = pop_primitives::v0::Error; + + const MODULE_INDEX: u8 = 3; + } + /// Runtime error type used for testing smart contract methods using Pop API `v0`. - pub type RuntimeError = crate::errors::v0::RuntimeError; + pub type RuntimeError = crate::error::RuntimeError; } } From 6cd8dbb3dfced80f7edba2050716f5f3be38f043 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Tue, 8 Oct 2024 23:16:00 +0700 Subject: [PATCH 22/43] fix: comments --- crates/pop-drink/src/error.rs | 84 ++++++++++++++++++++++++++++++----- crates/pop-drink/src/lib.rs | 2 +- 2 files changed, 74 insertions(+), 12 deletions(-) diff --git a/crates/pop-drink/src/error.rs b/crates/pop-drink/src/error.rs index 72e65d6..cb54cf7 100644 --- a/crates/pop-drink/src/error.rs +++ b/crates/pop-drink/src/error.rs @@ -13,20 +13,27 @@ use crate::utils::decode; /// Configuration for the runtime error. pub trait RuntimeErrorConfig: Debug { + /// Error type of the runtime modules. + /// Reference: https://paritytech.github.io/polkadot-sdk/master/solochain_template_runtime/enum.RuntimeError.html. type ModuleError: Decode + Encode + Debug; + /// Error type of the Pop API depends on the version. type PopApiError: Decode + Encode + Debug + From + Into; + /// Index of the variant `RuntimeError::Module`. This is based on the index of + /// `PopApiError::Module`. const MODULE_INDEX: u8; } -/// Runtime error type for testing Pop API V0. +/// Runtime error for testing. #[derive(Encode, Decode, Debug)] pub enum RuntimeError { + /// Module errors of the runtime. Module(T::ModuleError), + /// Every `PopApiError`. Raw(T::PopApiError), } impl From> for u32 { - /// Converts a `RuntimeError` into a numerical value of `pop_api::primitives::v0::Error`. + /// Converts a `RuntimeError` into a numerical value of `PopApiError`. /// /// This conversion is necessary for comparing `RuntimeError` instances with other types /// that implement `Into`, as `RuntimeError` does not implement `Eq`. @@ -47,7 +54,7 @@ impl From> for u32 { } impl From for RuntimeError { - /// Converts a numerical value of `pop_api::primitives::v0::Error` into a `RuntimeError`. + /// Converts a numerical value of `PopApiError` into a `RuntimeError`. /// /// This is used to reconstruct and display a `RuntimeError` from its numerical representation /// when an error is thrown. @@ -65,13 +72,24 @@ impl From for RuntimeError { pub mod v0 { use std::fmt::Debug; + /// A utility macro to assert that an error returned from a smart contract method matches the + /// `RuntimeError`. + /// + /// # Generic parameters: + /// + /// - `R` - Success type returned if Ok(). + /// - `E` - Returned `Err()` value of a method result. Must be convertable to `u32`. + /// - `RuntimeError` - Runtime error type. + /// + /// # Parameters: + /// + /// - `result` - Result returned by a smart contract method. + /// - `expected_error` - `RuntimeError` to be asserted. pub fn assert_runtime_err_inner( result: Result, expected_error: RuntimeError, ) where - // E: Returned `Err()` value of a method result. Must be convertable to `u32`. E: Into, - // D: Expected `RuntimeError`. RuntimeError: From + Into + Debug, { crate::error::assert_runtime_err_inner::( @@ -80,8 +98,42 @@ pub mod v0 { ) } - /// A utility macro to assert that an error returned from a smart contract method using - /// `pop_api::primitives::v0::Error` matches the `RuntimeError`. + /// A utility macro to assert that an error returned from a smart contract method using Pop API + /// V0. + /// + /// # Parameters: + /// + /// - `result` - The result returned by a smart contract method. It is of type `Result`, + /// where the error type `E` must implement a conversion to `u32`. + /// - `error` - A `RuntimeError` type configured specifically for the Pop API V0. + /// + /// # Example: + /// + /// ```rs + /// use drink::devnet::{ + /// error::{ + /// v0::{assert_runtime_error, RuntimeError}, + /// Assets, + /// AssetsError::AssetNotLive, + /// } + /// }; + /// + /// /// Example `pop-drink` testing method to interact with PSP22 contract. + /// fn mint(session: &mut Session, account: AccountId, amount: Balance) -> Result<(), PSP22Error> { + /// call::( + /// session, + /// "Psp22Mintable::mint", + /// vec![account.to_string(), amount.to_string()], + /// None, + /// ) + /// } + /// + /// /// Using macro to test the returned error. + /// assert_runtime_error!( + /// mint(&mut session, BOB, AMOUNT), + /// RuntimeError::Module(Assets(AssetNotLive)) + /// ); + /// ``` #[macro_export] macro_rules! __assert_runtime_err { ($result:expr, $error:expr $(,)?) => { @@ -92,10 +144,20 @@ pub mod v0 { pub use __assert_runtime_err as assert_runtime_err; } -/// * 'R': Type returned if Ok() -/// * 'V': Version of Pop API. -/// * 'E': Returned Err() value of a method result. Must be convertable to `u32`. -/// * 'D': Expected RuntimeError. +/// A utility macro to assert that an error returned from a smart contract method matches the +/// `RuntimeError`. +/// +/// # Generic parameters: +/// +/// - `VersionedApiError` - Version of Pop API. +/// - `R` - Success type returned if Ok(). +/// - `E` - Returned `Err()` value of a method result. Must be convertable to `u32`. +/// - `RuntimeError` - Runtime error type. +/// +/// # Parameters: +/// +/// - `result` - Result returned by a smart contract method. +/// - `expected_error` - `RuntimeError` to be asserted. #[track_caller] pub fn assert_runtime_err_inner( result: Result, diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index 37c0bba..9e44dbc 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -37,7 +37,7 @@ pub mod devnet { const MODULE_INDEX: u8 = 3; } - /// Runtime error type used for testing smart contract methods using Pop API `v0`. + /// Runtime error for testing contracts using the Pop API V0. pub type RuntimeError = crate::error::RuntimeError; } } From b17157f676521ce2acc9f44c4ca06e7291f0a7f8 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Thu, 10 Oct 2024 00:00:22 +0700 Subject: [PATCH 23/43] fix: resolve comments --- Cargo.lock | 5 +- Cargo.toml | 1 - crates/pop-drink/Cargo.toml | 1 - crates/pop-drink/src/error.rs | 265 ++++++++++++++-------------------- crates/pop-drink/src/lib.rs | 131 ++++++++++++++--- crates/pop-drink/src/utils.rs | 77 ---------- 6 files changed, 227 insertions(+), 253 deletions(-) delete mode 100644 crates/pop-drink/src/utils.rs diff --git a/Cargo.lock b/Cargo.lock index ee37cbc..4b5fb1e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4673,7 +4673,6 @@ dependencies = [ "pallet-timestamp", "parity-scale-codec", "pop-api", - "pop-primitives", "pop-runtime-devnet", "scale-info", "sp-io", @@ -6481,9 +6480,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.6.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" diff --git a/Cargo.toml b/Cargo.toml index 600b4d1..9b65db7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,5 +57,4 @@ ink_sandbox = { path = "crates/ink-sandbox" } pallet-api = { path = "../pop-node/pallets/api" } pop-api = { path = "../pop-node/pop-api" } pop-drink = { path = "crates/pop-drink" } -pop-primitives = { path = "../pop-node/primitives" } pop-runtime-devnet = { path = "../pop-node/runtime/devnet" } diff --git a/crates/pop-drink/Cargo.toml b/crates/pop-drink/Cargo.toml index d05b10b..cd95815 100644 --- a/crates/pop-drink/Cargo.toml +++ b/crates/pop-drink/Cargo.toml @@ -17,7 +17,6 @@ frame-support.workspace = true sp-io.workspace = true scale.workspace = true pop-api.workspace = true -pop-primitives.workspace = true [dev-dependencies] pallet-api.workspace = true diff --git a/crates/pop-drink/src/error.rs b/crates/pop-drink/src/error.rs index cb54cf7..4835370 100644 --- a/crates/pop-drink/src/error.rs +++ b/crates/pop-drink/src/error.rs @@ -6,169 +6,144 @@ pub use drink::{ pallet_assets::Error as AssetsError, pallet_balances::Error as BalancesError, pallet_contracts::Error as ContractsError, }; -pub use pop_api::primitives::v0::*; use scale::{Decode, Encode}; -use crate::utils::decode; - -/// Configuration for the runtime error. -pub trait RuntimeErrorConfig: Debug { - /// Error type of the runtime modules. - /// Reference: https://paritytech.github.io/polkadot-sdk/master/solochain_template_runtime/enum.RuntimeError.html. - type ModuleError: Decode + Encode + Debug; - /// Error type of the Pop API depends on the version. - type PopApiError: Decode + Encode + Debug + From + Into; - /// Index of the variant `RuntimeError::Module`. This is based on the index of - /// `PopApiError::Module`. - const MODULE_INDEX: u8; +fn decode(data: &[u8]) -> T { + T::decode(&mut &data[..]).expect("Decoding failed") } /// Runtime error for testing. +/// +/// # Generic Parameters: +/// +/// - `ModuleError` - Error type of the runtime modules. Reference: https://paritytech.github.io/polkadot-sdk/master/solochain_template_runtime/enum.Error.html. +/// - `ApiError` - Error type of the API, which depends on version. +/// - `MODULE_INDEX` - Index of the variant `Error::Module`. This is based on the index of +/// `ApiError::Module` #[derive(Encode, Decode, Debug)] -pub enum RuntimeError { +pub enum Error +where + ModuleError: Decode + Encode + Debug, + ApiError: Decode + Encode + Debug + From + Into, +{ /// Module errors of the runtime. - Module(T::ModuleError), - /// Every `PopApiError`. - Raw(T::PopApiError), + Module(ModuleError), + /// Every `ApiError`. + Api(ApiError), } -impl From> for u32 { - /// Converts a `RuntimeError` into a numerical value of `PopApiError`. +impl From> + for u32 +where + ModuleError: Decode + Encode + Debug, + ApiError: Decode + Encode + Debug + From + Into, +{ + /// Converts a `Error` into a numerical value of `ApiError`. /// - /// This conversion is necessary for comparing `RuntimeError` instances with other types - /// that implement `Into`, as `RuntimeError` does not implement `Eq`. - /// Use this function to obtain a numerical representation of the error for comparison or - /// further processing. - fn from(error: RuntimeError) -> Self { - let pop_api_error = match error { - RuntimeError::Module(error) => { + /// This conversion is necessary for comparing `Error` instances with other types. + // Compared types must implement `Into`, as `Error` does not implement `Eq`. + // Use this function to obtain a numerical representation of the error for comparison or + // further processing. + fn from(error: Error) -> Self { + match error { + Error::Module(error) => { let mut encoded = error.encode(); - encoded.insert(0, T::MODULE_INDEX); + encoded.insert(0, MODULE_INDEX); encoded.resize(4, 0); - decode::(&encoded) + decode::(&encoded) }, - RuntimeError::Raw(error) => decode::(&error.encode()), - }; - pop_api_error.into() + Error::Api(error) => decode::(&error.encode()), + } + .into() } } -impl From for RuntimeError { - /// Converts a numerical value of `PopApiError` into a `RuntimeError`. +impl From + for Error +where + ModuleError: Decode + Encode + Debug, + ApiError: Decode + Encode + Debug + From + Into, +{ + /// Converts a numerical value of `ApiError` into a `Error`. /// - /// This is used to reconstruct and display a `RuntimeError` from its numerical representation + /// This is used to reconstruct and display a `Error` from its numerical representation /// when an error is thrown. fn from(value: u32) -> Self { - let error = T::PopApiError::from(value); + let error = ApiError::from(value); let encoded = error.encode(); - if encoded[0] == T::MODULE_INDEX { + if encoded[0] == MODULE_INDEX { let (index, module_error) = (encoded[1], &encoded[2..]); let data = vec![vec![index], module_error.to_vec()].concat(); - return RuntimeError::Module(decode(&data)); + return Error::Module(decode(&data)); } - RuntimeError::Raw(error) + Error::Api(error) } } -pub mod v0 { - use std::fmt::Debug; - /// A utility macro to assert that an error returned from a smart contract method matches the - /// `RuntimeError`. - /// - /// # Generic parameters: - /// - /// - `R` - Success type returned if Ok(). - /// - `E` - Returned `Err()` value of a method result. Must be convertable to `u32`. - /// - `RuntimeError` - Runtime error type. - /// - /// # Parameters: - /// - /// - `result` - Result returned by a smart contract method. - /// - `expected_error` - `RuntimeError` to be asserted. - pub fn assert_runtime_err_inner( - result: Result, - expected_error: RuntimeError, - ) where - E: Into, - RuntimeError: From + Into + Debug, - { - crate::error::assert_runtime_err_inner::( - result, - expected_error, - ) - } - - /// A utility macro to assert that an error returned from a smart contract method using Pop API - /// V0. - /// - /// # Parameters: - /// - /// - `result` - The result returned by a smart contract method. It is of type `Result`, - /// where the error type `E` must implement a conversion to `u32`. - /// - `error` - A `RuntimeError` type configured specifically for the Pop API V0. - /// - /// # Example: - /// - /// ```rs - /// use drink::devnet::{ - /// error::{ - /// v0::{assert_runtime_error, RuntimeError}, - /// Assets, - /// AssetsError::AssetNotLive, - /// } - /// }; - /// - /// /// Example `pop-drink` testing method to interact with PSP22 contract. - /// fn mint(session: &mut Session, account: AccountId, amount: Balance) -> Result<(), PSP22Error> { - /// call::( - /// session, - /// "Psp22Mintable::mint", - /// vec![account.to_string(), amount.to_string()], - /// None, - /// ) - /// } - /// - /// /// Using macro to test the returned error. - /// assert_runtime_error!( - /// mint(&mut session, BOB, AMOUNT), - /// RuntimeError::Module(Assets(AssetNotLive)) - /// ); - /// ``` - #[macro_export] - macro_rules! __assert_runtime_err { - ($result:expr, $error:expr $(,)?) => { - $crate::error::v0::assert_runtime_err_inner::<_, _, _>($result, $error); - }; - } - - pub use __assert_runtime_err as assert_runtime_err; +/// A utility macro to assert that an error returned from a smart contract method using API +/// V0. +/// +/// # Parameters: +/// +/// - `result` - The result returned by a smart contract method. It is of type `Result`, where +/// the error type `E` must implement a conversion to `u32`. +/// - `error` - A `Error` type configured specifically for the API V0. +/// +/// # Example: +/// +/// ```rs +/// use drink::devnet::{ +/// error::{ +/// v0::{assert_err, Error}, +/// Assets, +/// AssetsError::AssetNotLive, +/// } +/// }; +/// +/// /// Example `pop-drink` testing method to interact with PSP22 contract. +/// fn transfer(session: &mut Session, to: AccountId, amount: Balance) -> Result<(), PSP22Error> { +/// call::( +/// session, +/// "Psp22::transfer", +/// vec![to.to_string(), amount.to_string(), serde_json::to_string::<[u8; 0]>(&[]).unwrap()], +/// None, +/// ) +/// } +/// +/// /// Using macro to test the returned error. +/// assert_err!( +/// mint(&mut session, BOB, AMOUNT), +/// Error::Module(Assets(AssetNotLive)) +/// ); +/// ``` +#[macro_export] +macro_rules! assert_err { + ($result:expr, $error:expr $(,)?) => { + $crate::error::assert_err_inner::<_, _, _>($result, $error); + }; } /// A utility macro to assert that an error returned from a smart contract method matches the -/// `RuntimeError`. +/// `Error`. /// /// # Generic parameters: /// -/// - `VersionedApiError` - Version of Pop API. /// - `R` - Success type returned if Ok(). /// - `E` - Returned `Err()` value of a method result. Must be convertable to `u32`. -/// - `RuntimeError` - Runtime error type. +/// - `Error` - Runtime error type. /// /// # Parameters: /// /// - `result` - Result returned by a smart contract method. -/// - `expected_error` - `RuntimeError` to be asserted. +/// - `expected_error` - `Error` to be asserted. #[track_caller] -pub fn assert_runtime_err_inner( - result: Result, - expected_error: RuntimeError, -) where - VersionedApiError: Into, +pub fn assert_err_inner(result: Result, expected_error: Error) +where E: Into, - RuntimeError: From + Into + Debug, + Error: From + Into + Debug, { let expected_code: u32 = expected_error.into(); - let expected_error = RuntimeError::from(expected_code); + let expected_error = Error::from(expected_code); if let Err(error) = result { let error_code: u32 = error.into(); if error_code != expected_code { @@ -176,7 +151,7 @@ pub fn assert_runtime_err_inner( r#"assertion `left == right` failed left: {:?} right: {:?}"#, - RuntimeError::from(error_code), + Error::from(error_code), expected_error ); } @@ -192,47 +167,34 @@ pub fn assert_runtime_err_inner( #[cfg(test)] mod test { - use pop_primitives::v0::Error as PopApiError; + use pop_api::primitives::v0::Error as ApiError; use crate::error::{AssetsError::*, BalancesError::*, *}; - #[derive(Debug)] - struct Config; - - impl RuntimeErrorConfig for Config { - type ModuleError = crate::mock::RuntimeError; - type PopApiError = PopApiError; - - const MODULE_INDEX: u8 = 3; - } - - fn test_cases() -> Vec<(RuntimeError, PopApiError)> { + fn test_cases() -> Vec<(Error, ApiError)> { use frame_support::traits::PalletInfoAccess; use pop_api::primitives::{ArithmeticError::*, TokenError::*}; use crate::mock::RuntimeError::*; vec![ - (RuntimeError::Raw(PopApiError::BadOrigin), PopApiError::BadOrigin), - (RuntimeError::Raw(PopApiError::Token(BelowMinimum)), PopApiError::Token(BelowMinimum)), - ( - RuntimeError::Raw(PopApiError::Arithmetic(Overflow)), - PopApiError::Arithmetic(Overflow), - ), + (Error::Api(ApiError::BadOrigin), ApiError::BadOrigin), + (Error::Api(ApiError::Token(BelowMinimum)), ApiError::Token(BelowMinimum)), + (Error::Api(ApiError::Arithmetic(Overflow)), ApiError::Arithmetic(Overflow)), ( - RuntimeError::Module(Assets(BalanceLow)), - PopApiError::Module { index: crate::mock::Assets::index() as u8, error: [0, 0] }, + Error::Module(Assets(BalanceLow)), + ApiError::Module { index: crate::mock::Assets::index() as u8, error: [0, 0] }, ), ( - RuntimeError::Module(Assets(NoAccount)), - PopApiError::Module { index: crate::mock::Assets::index() as u8, error: [1, 0] }, + Error::Module(Assets(NoAccount)), + ApiError::Module { index: crate::mock::Assets::index() as u8, error: [1, 0] }, ), ( - RuntimeError::Module(Balances(VestingBalance)), - PopApiError::Module { index: crate::mock::Balances::index() as u8, error: [0, 0] }, + Error::Module(Balances(VestingBalance)), + ApiError::Module { index: crate::mock::Balances::index() as u8, error: [0, 0] }, ), ( - RuntimeError::Module(Balances(LiquidityRestrictions)), - PopApiError::Module { index: crate::mock::Balances::index() as u8, error: [1, 0] }, + Error::Module(Balances(LiquidityRestrictions)), + ApiError::Module { index: crate::mock::Balances::index() as u8, error: [1, 0] }, ), ] } @@ -247,12 +209,9 @@ mod test { } #[test] - fn assert_runtime_error_works() { + fn assert_err_works() { test_cases().into_iter().for_each(|t| { - crate::error::v0::assert_runtime_err!( - Result::<(), pop_primitives::Error>::Err(t.1), - t.0, - ); + crate::assert_err!(Result::<(), pop_api::primitives::v0::Error>::Err(t.1), t.0,); }); } } diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index 9e44dbc..d67639a 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -2,13 +2,13 @@ pub use drink::*; pub use frame_support::{self, assert_ok}; pub use ink_sandbox::api::assets_api::AssetsAPI; use ink_sandbox::{AccountIdFor, BalanceFor}; +use scale::Decode; pub use session::{error::SessionError, ContractBundle, Session, NO_SALT}; pub use sp_io::TestExternalities; pub mod error; #[cfg(test)] pub mod mock; -pub mod utils; pub mod devnet { pub use pop_runtime_devnet::Runtime; @@ -24,21 +24,10 @@ pub mod devnet { /// A collection of error types from the `v0` module used for smart contract testing in the /// `devnet` environment. pub mod v0 { - use super::*; - pub use crate::error::v0::*; + pub use pop_api::primitives::v0::{Error as ApiError, *}; - /// Configuration for the runtime error used to test smart contract. - #[derive(Debug)] - pub struct Config; - impl RuntimeErrorConfig for Config { - type ModuleError = pop_runtime_devnet::RuntimeError; - type PopApiError = pop_primitives::v0::Error; - - const MODULE_INDEX: u8 = 3; - } - - /// Runtime error for testing contracts using the Pop API V0. - pub type RuntimeError = crate::error::RuntimeError; + /// Error type for testing contracts using the API V0. + pub type Error = crate::error::Error; } } @@ -46,10 +35,116 @@ pub mod devnet { pub type Balance = BalanceFor; pub type AccountId = AccountIdFor; - // This is used to resolve type mismatches between the `AccountId` in the quasi testing - // environment and the contract environment. + /// This is used to resolve type mismatches between the `AccountId` in the quasi testing + /// environment and the contract environment. pub fn account_id_from_slice(s: &AccountId) -> pop_api::primitives::AccountId { let account: [u8; 32] = s.clone().into(); - utils::account_id_from_slice(&account) + super::account_id_from_slice(&account) + } +} + +/// Deploys a contract with a given constructo methodr, arguments, salt and initial value. In case +/// of success, returns the address of the deployed contract. +/// +/// # Generic Parameters: +/// +/// - `S`: Sandbox defines the API of a sandboxed runtime. +/// - `E`: Decodable error type returned if the contract deployment fails. +/// +/// # Parameters: +/// +/// - `session` - Wrapper around `Sandbox`` that provides a convenient API for interacting with +/// multiple contracts. +/// - `bundle` - A struct representing the result of parsing a `.contract` bundle file. +/// - `method` - The name of the constructor method. +/// - `input` - Arguments passed to the constructor method. +/// - `salt` - Additional data used to influence the contract deployment address. +/// - `init_value` - Initial funds allocated for the contract. +pub fn deploy( + session: &mut Session, + bundle: ContractBundle, + method: &str, + input: Vec, + salt: Vec, + init_value: Option>, +) -> Result, E> +where + S: Sandbox, + S::Runtime: pallet_contracts::Config, + E: Decode, +{ + let result = session.deploy_bundle(bundle, method, &input, salt, init_value); + if result.is_err() { + let deployment_result = session.record().last_deploy_result().result.clone(); + let error = deployment_result.unwrap().result.data; + return Err(E::decode(&mut &error[2..]).unwrap()); + } + Ok(result.unwrap()) +} + +/// Call a contract method and decode the returned data. +/// +/// # Generic Parameters: +/// +/// - `S` - Sandbox defines the API of a sandboxed runtime. +/// - `O` - Decodable output type returned if the contract deployment succeeds. +/// - `E` - Decodable error type returned if the contract deployment fails. +/// +/// # Parameters: +/// +/// - `session` - Wrapper around `Sandbox`` that provides a convenient API for interacting with +/// multiple contracts. +/// - `func_name` - The name of the contract method. +/// - `input` - Arguments passed to the contract method. +/// - `endowment` - Funds allocated for the contract execution. +pub fn call( + session: &mut Session, + func_name: &str, + input: Vec, + endowment: Option>, +) -> Result +where + S: Sandbox, + S::Runtime: pallet_contracts::Config, + O: Decode, + E: Decode, +{ + match session.call::(func_name, &input, endowment) { + // If the call is reverted, decode the error into the specified error type. + Err(SessionError::CallReverted(error)) => { + Err(E::decode(&mut &error[2..]).unwrap_or_else(|_| panic!("Decoding failed"))) + }, + // If the call is successful, decode the last returned value. + Ok(_) => Ok(session + .record() + .last_call_return_decoded::() + .unwrap_or_else(|_| panic!("Expected a return value")) + .unwrap_or_else(|_| panic!("Decoding failed"))), + // Catch-all for unexpected results. + _ => panic!("Expected call to revert or return a value"), } } + +fn account_id_from_slice(s: &[u8; 32]) -> pop_api::primitives::AccountId { + pop_api::primitives::AccountId::decode(&mut &s[..]).expect("Should be decoded to AccountId") +} + +/// Get the last event from pallet contracts. +/// +/// # Generic Parameters: +/// +/// - `S` - Sandbox defines the API of a sandboxed runtime. +/// +/// # Parameters: +/// +/// - `session` - Wrapper around `Sandbox`` that provides a convenient API for interacting with +/// multiple contracts. +pub fn last_contract_event(session: &Session) -> Option> +where + S: Sandbox, + S::Runtime: pallet_contracts::Config, + ::RuntimeEvent: + TryInto>, +{ + session.record().last_event_batch().contract_events().last().cloned() +} diff --git a/crates/pop-drink/src/utils.rs b/crates/pop-drink/src/utils.rs deleted file mode 100644 index 5478483..0000000 --- a/crates/pop-drink/src/utils.rs +++ /dev/null @@ -1,77 +0,0 @@ -use drink::{ - session::{error::SessionError, ContractBundle, Session}, - Sandbox, -}; -use ink_sandbox::{AccountIdFor, BalanceFor}; -use scale::Decode; - -pub fn deploy( - session: &mut Session, - bundle: ContractBundle, - method: &str, - input: Vec, - salt: Vec, - init_value: Option>, -) -> Result, E> -where - S: Sandbox, - S::Runtime: pallet_contracts::Config, - E: Decode, -{ - let result = session.deploy_bundle(bundle, method, &input, salt, init_value); - if result.is_err() { - let deployment_result = session.record().last_deploy_result().result.clone(); - let error = deployment_result.unwrap().result.data; - return Err(E::decode(&mut &error[2..]).unwrap()); - } - Ok(result.unwrap()) -} - -// Call a contract method and decode the returned data. -pub fn call( - session: &mut Session, - func_name: &str, - input: Vec, - endowment: Option>, -) -> Result -where - S: Sandbox, - S::Runtime: pallet_contracts::Config, - O: Decode, - E: Decode, -{ - match session.call::(func_name, &input, endowment) { - // If the call is reverted, decode the error into `PSP22Error`. - Err(SessionError::CallReverted(error)) => - Err(E::decode(&mut &error[2..]).unwrap_or_else(|_| panic!("Decoding failed"))), - // If the call is successful, decode the last returned value. - Ok(_) => Ok(session - .record() - .last_call_return_decoded::() - .unwrap_or_else(|_| panic!("Expected a return value")) - .unwrap_or_else(|_| panic!("Decoding failed"))), - // Catch-all for unexpected results. - _ => panic!("Expected call to revert or return a value"), - } -} - -// This is used to resolve type mismatches between the `AccountId` in the quasi testing -// environment and the contract environment. -pub fn account_id_from_slice(s: &[u8; 32]) -> pop_api::primitives::AccountId { - pop_api::primitives::AccountId::decode(&mut &s[..]).expect("Should be decoded to AccountId") -} - -// Get the last event from pallet contracts. -pub fn last_contract_event(session: &Session) -> Option> -where - S: Sandbox, - S::Runtime: pallet_contracts::Config, - ::RuntimeEvent: - TryInto>, -{ - session.record().last_event_batch().contract_events().last().cloned() -} - -pub(crate) fn decode(data: &[u8]) -> T { - T::decode(&mut &data[..]).expect("Decoding failed") -} From 945044457edb69a29a578c5c23ac2bd3b6617e74 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Thu, 10 Oct 2024 00:05:53 +0700 Subject: [PATCH 24/43] refactor: unwrap_or_else --- crates/pop-drink/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index d67639a..d6a9ff0 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -112,14 +112,14 @@ where match session.call::(func_name, &input, endowment) { // If the call is reverted, decode the error into the specified error type. Err(SessionError::CallReverted(error)) => { - Err(E::decode(&mut &error[2..]).unwrap_or_else(|_| panic!("Decoding failed"))) + Err(E::decode(&mut &error[2..]).expect("Decoding failed")) }, // If the call is successful, decode the last returned value. Ok(_) => Ok(session .record() .last_call_return_decoded::() - .unwrap_or_else(|_| panic!("Expected a return value")) - .unwrap_or_else(|_| panic!("Decoding failed"))), + .expect("Expected a return value") + .expect("Decoding failed")), // Catch-all for unexpected results. _ => panic!("Expected call to revert or return a value"), } From c1a6fea3585c828ca10f05bc56e08873d9e28173 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Thu, 10 Oct 2024 00:06:21 +0700 Subject: [PATCH 25/43] fix: example --- crates/pop-drink/src/error.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/pop-drink/src/error.rs b/crates/pop-drink/src/error.rs index 4835370..0ca925c 100644 --- a/crates/pop-drink/src/error.rs +++ b/crates/pop-drink/src/error.rs @@ -112,7 +112,7 @@ where /// /// /// Using macro to test the returned error. /// assert_err!( -/// mint(&mut session, BOB, AMOUNT), +/// transfer(&mut session, ALICE, AMOUNT), /// Error::Module(Assets(AssetNotLive)) /// ); /// ``` From c598eae0d8091e4c93084b70c0e11fe36d392691 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Thu, 10 Oct 2024 12:08:59 +0700 Subject: [PATCH 26/43] fix: comments --- crates/pop-drink/src/error.rs | 52 +++++++------ crates/pop-drink/src/lib.rs | 139 +++++++++++++++++++++++++++------- 2 files changed, 137 insertions(+), 54 deletions(-) diff --git a/crates/pop-drink/src/error.rs b/crates/pop-drink/src/error.rs index 0ca925c..1c7c07c 100644 --- a/crates/pop-drink/src/error.rs +++ b/crates/pop-drink/src/error.rs @@ -14,21 +14,20 @@ fn decode(data: &[u8]) -> T { /// Runtime error for testing. /// -/// # Generic Parameters: +/// # Generic Parameters /// -/// - `ModuleError` - Error type of the runtime modules. Reference: https://paritytech.github.io/polkadot-sdk/master/solochain_template_runtime/enum.Error.html. -/// - `ApiError` - Error type of the API, which depends on version. -/// - `MODULE_INDEX` - Index of the variant `Error::Module`. This is based on the index of -/// `ApiError::Module` +/// - `ModuleError` - Error type of the runtime modules. [Reference](https://paritytech.github.io/polkadot-sdk/master/solochain_template_runtime/enum.Error.html). +/// - `ApiError` - Error type of the API, which depends on version. [Reference](https://github.com/r0gue-io/pop-node/tree/main/pop-api). +/// - `MODULE_INDEX` - Index of the variant `Error::Module`. This is based on the index of [`ApiError::Module`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L38). #[derive(Encode, Decode, Debug)] pub enum Error where ModuleError: Decode + Encode + Debug, ApiError: Decode + Encode + Debug + From + Into, { - /// Module errors of the runtime. + /// Error type of the runtime modules. [Reference](https://paritytech.github.io/polkadot-sdk/master/solochain_template_runtime/enum.Error.html). Module(ModuleError), - /// Every `ApiError`. + /// Every [`ApiError`](https://github.com/r0gue-io/pop-node/blob/52fb7f06a89955d462900e33d2b9c9170c4534a0/primitives/src/lib.rs#L30). Api(ApiError), } @@ -38,7 +37,7 @@ where ModuleError: Decode + Encode + Debug, ApiError: Decode + Encode + Debug + From + Into, { - /// Converts a `Error` into a numerical value of `ApiError`. + /// Converts an `Error` into a numerical value of `ApiError`. /// /// This conversion is necessary for comparing `Error` instances with other types. // Compared types must implement `Into`, as `Error` does not implement `Eq`. @@ -64,9 +63,9 @@ where ModuleError: Decode + Encode + Debug, ApiError: Decode + Encode + Debug + From + Into, { - /// Converts a numerical value of `ApiError` into a `Error`. + /// Converts a numerical value of `ApiError` into an `Error`. /// - /// This is used to reconstruct and display a `Error` from its numerical representation + /// This is used to reconstruct and display an `Error` from its numerical representation /// when an error is thrown. fn from(value: u32) -> Self { let error = ApiError::from(value); @@ -80,16 +79,17 @@ where } } -/// A utility macro to assert that an error returned from a smart contract method using API -/// V0. +/// Asserts that a `Result` with an error type convertible to `u32` matches the expected `Error` +/// from pop-drink. /// -/// # Parameters: +/// # Parameters /// -/// - `result` - The result returned by a smart contract method. It is of type `Result`, where -/// the error type `E` must implement a conversion to `u32`. -/// - `error` - A `Error` type configured specifically for the API V0. +/// - `result` - The `Result` from a smart contract method, where `E` must be convertible to +/// `u32`. +/// - `error` - The expected runtime specific `Error` to assert against the `E` error type from +/// `result`. /// -/// # Example: +/// # Examples /// /// ```rs /// use drink::devnet::{ @@ -123,19 +123,21 @@ macro_rules! assert_err { }; } -/// A utility macro to assert that an error returned from a smart contract method matches the -/// `Error`. +/// Asserts that a `Result` with an error type convertible to `u32` matches the expected `Error` +/// from pop-drink. /// -/// # Generic parameters: +/// # Generic parameters /// -/// - `R` - Success type returned if Ok(). -/// - `E` - Returned `Err()` value of a method result. Must be convertable to `u32`. +/// - `R` - Type returned if `result` is `Ok()`. +/// - `E` - Type returend if `result` is `Err()`. Must be convertible to `u32`. /// - `Error` - Runtime error type. /// -/// # Parameters: +/// # Parameters /// -/// - `result` - Result returned by a smart contract method. -/// - `expected_error` - `Error` to be asserted. +/// - `result` - The `Result` from a smart contract method, where `E` must be convertible to +/// `u32`. +/// - `expected_error` - The expected runtime specific `Error` to assert against the `E` error type +/// from `result`. #[track_caller] pub fn assert_err_inner(result: Result, expected_error: Error) where diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index d6a9ff0..6406fac 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -8,7 +8,7 @@ pub use sp_io::TestExternalities; pub mod error; #[cfg(test)] -pub mod mock; +mod mock; pub mod devnet { pub use pop_runtime_devnet::Runtime; @@ -43,23 +43,56 @@ pub mod devnet { } } -/// Deploys a contract with a given constructo methodr, arguments, salt and initial value. In case -/// of success, returns the address of the deployed contract. +/// Deploys a contract with a given constructor method, arguments, salt and an initial value. In +/// case of success, returns the address of the deployed contract. /// -/// # Generic Parameters: +/// # Generic Parameters /// -/// - `S`: Sandbox defines the API of a sandboxed runtime. -/// - `E`: Decodable error type returned if the contract deployment fails. +/// - `S` - [`Sandbox`](https://github.com/r0gue-io/pop-drink/blob/main/crates/ink-sandbox/src/lib.rs) +/// environment for the Pop Network runtime. +/// - `E` - Decodable error type returned if the contract deployment fails. /// -/// # Parameters: +/// # Parameters /// -/// - `session` - Wrapper around `Sandbox`` that provides a convenient API for interacting with -/// multiple contracts. -/// - `bundle` - A struct representing the result of parsing a `.contract` bundle file. -/// - `method` - The name of the constructor method. +/// - `session` - Wrapper around [`Sandbox`](https://github.com/r0gue-io/pop-drink/blob/main/crates/ink-sandbox/src/lib.rs) +/// that provides methods to interact with multiple contracts. [Reference](https://github.com/r0gue-io/pop-drink/blob/main/crates/drink/drink/src/session.rs). +/// - `bundle` - A struct representing the result of parsing a `.contract` bundle file. [Reference](https://github.com/r0gue-io/pop-drink/blob/main/crates/drink/drink/src/session/bundle.rs). +/// - `method` - The name of the contract constructor method. For trait methods, use +/// `trait_name::method_name` (e.g., `Psp22::transfer`). /// - `input` - Arguments passed to the constructor method. /// - `salt` - Additional data used to influence the contract deployment address. -/// - `init_value` - Initial funds allocated for the contract. +/// - `init_value` - Initial funds allocated for the contract. Requires the contract method to be +/// `payable`. +/// +/// # Examples +/// +/// ```rs +/// /// The contract bundle provider. +/// #[drink::contract_bundle_provider] +/// enum BundleProvider {} +/// +/// /// Sandbox environment for Pop Devnet Runtime. +/// pub struct Pop { +/// ext: TestExternalities, +/// } +/// +/// // Implement core functionalities for the `Pop` sandbox. +/// drink::impl_sandbox!(Pop, Runtime, ALICE); +/// +/// #[drink::test(sandbox = Pop)] +/// fn test_constructor_works() { +/// let local_contract = BundleProvider::local().unwrap(); +/// // Contract address is returned if a deployment succeeds. +/// let contract = deploy( +/// &mut session, +/// local_contract, +/// "new", +/// vec![TOKEN.to_string(), MIN_BALANCE.to_string()], +/// vec![], +/// None +/// ).unwrap(); +/// } +/// ``` pub fn deploy( session: &mut Session, bundle: ContractBundle, @@ -84,19 +117,50 @@ where /// Call a contract method and decode the returned data. /// -/// # Generic Parameters: +/// # Generic Parameters /// -/// - `S` - Sandbox defines the API of a sandboxed runtime. -/// - `O` - Decodable output type returned if the contract deployment succeeds. -/// - `E` - Decodable error type returned if the contract deployment fails. +/// - `S` - [`Sandbox`](https://github.com/r0gue-io/pop-drink/blob/main/crates/ink-sandbox/src/lib.rs) +/// environment for the Pop Network runtime. +/// - `O` - Decodable output type returned if the contract execution succeeds. +/// - `E` - Decodable error type returned if the contract execution fails. /// -/// # Parameters: +/// # Parameters /// -/// - `session` - Wrapper around `Sandbox`` that provides a convenient API for interacting with -/// multiple contracts. -/// - `func_name` - The name of the contract method. +/// - `session` - Wrapper around [`Sandbox`](https://github.com/r0gue-io/pop-drink/blob/main/crates/ink-sandbox/src/lib.rs) +/// that provides methods to interact with multiple contracts. [Reference](https://github.com/r0gue-io/pop-drink/blob/main/crates/drink/drink/src/session.rs). +/// - `func_name`: The name of the contract method. For trait methods, use `trait_name::method_name` +/// (e.g., `Psp22::transfer`). /// - `input` - Arguments passed to the contract method. -/// - `endowment` - Funds allocated for the contract execution. +/// - `endowment` - Funds allocated for the contract execution. Requires the contract method to be +/// `payable`. +/// +/// # Examples +/// +/// ```rs +/// /// The contract bundle provider. +/// #[drink::contract_bundle_provider] +/// enum BundleProvider {} +/// +/// /// Sandbox environment for Pop Devnet Runtime. +/// pub struct Pop { +/// ext: TestExternalities, +/// } +/// +/// // Implement core functionalities for the `Pop` sandbox. +/// drink::impl_sandbox!(Pop, Runtime, ALICE); +/// +/// /// Call to a contract method `Psp22::transfer` and return error `PSP22Error` if fails. +/// fn transfer(session: &mut Session, to: AccountId, amount: Balance) -> Result<(), PSP22Error> { +/// // Convert empty array into string. +/// let empty_array = serde_json::to_string::<[u8; 0]>(&[]).unwrap(); +/// call::( +/// session, +/// "Psp22::transfer", +/// vec![to.to_string(), amount.to_string(), empty_array], +/// None, +/// ) +/// } +/// ``` pub fn call( session: &mut Session, func_name: &str, @@ -111,9 +175,8 @@ where { match session.call::(func_name, &input, endowment) { // If the call is reverted, decode the error into the specified error type. - Err(SessionError::CallReverted(error)) => { - Err(E::decode(&mut &error[2..]).expect("Decoding failed")) - }, + Err(SessionError::CallReverted(error)) => + Err(E::decode(&mut &error[2..]).expect("Decoding failed")), // If the call is successful, decode the last returned value. Ok(_) => Ok(session .record() @@ -131,14 +194,32 @@ fn account_id_from_slice(s: &[u8; 32]) -> pop_api::primitives::AccountId { /// Get the last event from pallet contracts. /// -/// # Generic Parameters: +/// # Generic Parameters +/// +/// - `S` - [`Sandbox`](https://github.com/r0gue-io/pop-drink/blob/main/crates/ink-sandbox/src/lib.rs) +/// environment for the Pop Network runtime. +/// +/// # Parameters +/// +/// - `session` - Wrapper around [`Sandbox`](https://github.com/r0gue-io/pop-drink/blob/main/crates/ink-sandbox/src/lib.rs) +/// that provides methods to interact with multiple contracts. [Reference](https://github.com/r0gue-io/pop-drink/blob/main/crates/drink/drink/src/session.rs). /// -/// - `S` - Sandbox defines the API of a sandboxed runtime. +/// # Examples /// -/// # Parameters: +/// ```rs +/// use drink::{assert_ok, devnet::account_id_from_slice, last_contract_event}; /// -/// - `session` - Wrapper around `Sandbox`` that provides a convenient API for interacting with -/// multiple contracts. +/// assert_eq!( +/// last_contract_event(&session).unwrap(), +/// Transfer { +/// from: Some(account_id_from_slice(&ALICE)), +/// to: Some(account_id_from_slice(&BOB)), +/// value, +/// } +/// .encode() +/// .as_slice() +/// ); +/// ``` pub fn last_contract_event(session: &Session) -> Option> where S: Sandbox, From c3a13c301fdb2195e06d9c1bab0b6a6cf862f610 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Fri, 11 Oct 2024 17:55:41 +0700 Subject: [PATCH 27/43] fix: update doc --- crates/pop-drink/src/error.rs | 98 +++++++++++++++++++++++++++++++---- 1 file changed, 89 insertions(+), 9 deletions(-) diff --git a/crates/pop-drink/src/error.rs b/crates/pop-drink/src/error.rs index 1c7c07c..35b49de 100644 --- a/crates/pop-drink/src/error.rs +++ b/crates/pop-drink/src/error.rs @@ -12,13 +12,65 @@ fn decode(data: &[u8]) -> T { T::decode(&mut &data[..]).expect("Decoding failed") } -/// Runtime error for testing. +/// Runtime error for efficiently testing both runtime module errors and API errors. +/// It is designed for use with the `assert_err!` macro. /// /// # Generic Parameters /// /// - `ModuleError` - Error type of the runtime modules. [Reference](https://paritytech.github.io/polkadot-sdk/master/solochain_template_runtime/enum.Error.html). /// - `ApiError` - Error type of the API, which depends on version. [Reference](https://github.com/r0gue-io/pop-node/tree/main/pop-api). /// - `MODULE_INDEX` - Index of the variant `Error::Module`. This is based on the index of [`ApiError::Module`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L38). +/// +/// # Examples +/// +/// ### Runtime module errors +/// +/// - Import types to construct runtime module errors: +/// +/// ```rs +/// use drink::devnet::{ +/// Assets, +/// AssetsError::AssetNotLive, +/// Balances::BelowMinimum, +/// BalancesError::BelowMinimum +/// }; +/// ``` +/// +/// - Construct a runtime module error [`Assets(AssetNotLive)`](https://paritytech.github.io/polkadot-sdk/master/pallet_assets/pallet/enum.Error.html#variant.AssetNotLive): +/// +/// ```rs +/// Error::Module(Assets(AssetNotLive)) +/// ``` +/// +/// - Construct a runtime module error [`Balances(InsufficientBalance)`](https://docs.rs/pallet-balances/latest/pallet_balances/pallet/enum.Error.html#variant.InsufficientBalance): +/// +/// ```rs +/// Error::Module(Balances(InsufficientBalance)) +/// ``` +/// +/// ### API errors +/// +/// - Import types to construct API errors: +/// +/// ```rs +/// use drink::devnet::v0::{ +/// Arithmetic, +/// ArithmeticError::Overflow, +/// BadOrigin +/// }; +/// ``` +/// +/// - API error [`Arithmetic(Overflow)`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L55): +/// +/// ```rs +/// Error::Api(Arithmetic(Overflow)) +/// ``` +/// +/// - API error [`BadOrigin`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L36C4-L36C18): +/// +/// ```rs +/// Error::Api(BadOrigin) +/// ``` #[derive(Encode, Decode, Debug)] pub enum Error where @@ -91,16 +143,41 @@ where /// /// # Examples /// +/// The below example interacts with a [PSP22](https://github.com/w3f/PSPs/blob/master/PSPs/psp-22.md) contract that uses [Pop API](https://github.com/r0gue-io/pop-node/tree/main/pop-api). The contract method returns [`PSP22Error`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/v0/fungibles/errors.rs#L73C1-L73C22) which is provided by Pop API library. +/// Learn more in the [PSP22 example contract](https://github.com/r0gue-io/pop-node/blob/main/pop-api/examples/fungibles/lib.rs). +/// +/// The macro is used to test a customer error which is returned by the API if the error doesn't conform to the [`PSP22Error`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/v0/fungibles/errors.rs#L73C1-L73C22) standard. +/// The custom error is represented by a [`StatusCode`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/lib.rs#L33), which encapsulates a `u32` value indicating the success or failure of a runtime call via the Pop API. +/// +/// Pop DRink! provides an error type and a [macro](https://doc.rust-lang.org/book/ch19-06-macros.html) to simplify testing both runtime module errors and API errors. +/// +/// - `Error`: Runtime error for efficiently testing both runtime module errors and API errors. +/// - `assert_err`: Asserts that a `Result` with an error type convertible to `u32` matches the +/// expected `Error` from pop-drink. +/// +/// Note: `PSP22Error` is used here only as an example. The test suite utility library provided by +/// Pop DRink! is not limited to a single specific error type. +/// /// ```rs -/// use drink::devnet::{ -/// error::{ -/// v0::{assert_err, Error}, -/// Assets, -/// AssetsError::AssetNotLive, -/// } +/// // Required imports to test the custom error. +/// use drink::{ +/// assert_err, +/// devnet::{ +/// error::{ +/// v0::Error, +/// Assets, +/// AssetsError::AssetNotLive, +/// }, +/// }, /// }; /// -/// /// Example `pop-drink` testing method to interact with PSP22 contract. +/// // `PSP22Error` is provided by the API library. +/// use pop_api::v0::fungibles::PSP22Error; +/// ``` +/// +/// - Example `pop-drink` testing method to interact with PSP22 contract. +/// +/// ```rs /// fn transfer(session: &mut Session, to: AccountId, amount: Balance) -> Result<(), PSP22Error> { /// call::( /// session, @@ -109,8 +186,11 @@ where /// None, /// ) /// } +/// ``` /// -/// /// Using macro to test the returned error. +/// - Using macro to test the returned error. +/// +/// ```rs /// assert_err!( /// transfer(&mut session, ALICE, AMOUNT), /// Error::Module(Assets(AssetNotLive)) From c4f6a8782a6e258a48907b09be14f4afd841a353 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Fri, 11 Oct 2024 17:55:51 +0700 Subject: [PATCH 28/43] fix: doc --- Cargo.lock | 2927 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 1959 insertions(+), 968 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4b5fb1e..67c09c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,6 +12,15 @@ dependencies = [ "regex", ] +[[package]] +name = "addr2line" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +dependencies = [ + "gimli 0.27.3", +] + [[package]] name = "addr2line" version = "0.24.1" @@ -37,6 +46,17 @@ dependencies = [ "generic-array", ] +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + [[package]] name = "ahash" version = "0.8.11" @@ -343,7 +363,7 @@ version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "addr2line", + "addr2line 0.24.1", "cfg-if", "libc", "miniz_oxide", @@ -382,6 +402,28 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bip39" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33415e24172c1b7d6066f6d999545375ab8e1d95421d6784bdfff9496f292387" +dependencies = [ + "bitcoin_hashes", + "rand", + "rand_core 0.6.4", + "serde", + "unicode-normalization", +] + [[package]] name = "bitcoin-internals" version = "0.2.0" @@ -519,14 +561,14 @@ dependencies = [ [[package]] name = "bp-xcm-bridge-hub-router" -version = "0.13.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7dae4d1ec894ee920195dd39070b279ef3c1d4d078c3fcf7336c93a1d502a9d" +checksum = "86ff4abe93be7bc1663adc41817b1aa3476fbec953ce361537419924310d5dd4" dependencies = [ "parity-scale-codec", "scale-info", - "sp-core", - "sp-runtime", + "sp-core 29.0.0", + "sp-runtime 32.0.0", ] [[package]] @@ -677,15 +719,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "ckb-merkle-mountain-range" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ccb671c5921be8a84686e6212ca184cb1d7c51cadcdbfcbd1cc3f042f5dfb8" -dependencies = [ - "cfg-if", -] - [[package]] name = "clap" version = "4.5.18" @@ -932,6 +965,15 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "cpp_demangle" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" +dependencies = [ + "cfg-if", +] + [[package]] name = "cpufeatures" version = "0.2.14" @@ -941,6 +983,15 @@ dependencies = [ "libc", ] +[[package]] +name = "cranelift-entity" +version = "0.95.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" +dependencies = [ + "serde", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -1010,7 +1061,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -1022,7 +1073,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "typenum", ] @@ -1036,30 +1087,40 @@ dependencies = [ "subtle", ] +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array", + "subtle", +] + [[package]] name = "cumulus-pallet-aura-ext" -version = "0.15.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e8af48090936c45483d489ee681acb54277763586b53fa3dbd17173aa474fc" +checksum = "9e8e78b18548ae3454bc8a46e2bc2e3f521ea547844cbaecc9344d4741f4b1ef" dependencies = [ "cumulus-pallet-parachain-system", - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "pallet-aura", - "pallet-timestamp", + "pallet-timestamp 28.0.0", "parity-scale-codec", "scale-info", - "sp-application-crypto", + "sp-application-crypto 31.0.0", "sp-consensus-aura", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "cumulus-pallet-parachain-system" -version = "0.15.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300d5509bd8ac95bafe158fa475278315175a4eb0422c2cd82e08e8b9dde035c" +checksum = "1a215fe4d66d23e8f3956bd21b9d80d2b33239f3b150b36d56fa238cfc9421a5" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -1067,29 +1128,28 @@ dependencies = [ "cumulus-primitives-parachain-inherent", "cumulus-primitives-proof-size-hostfunction", "environmental", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "impl-trait-for-tuples", "log", "pallet-message-queue", "parity-scale-codec", - "polkadot-parachain-primitives", + "polkadot-parachain-primitives 7.0.0", "polkadot-runtime-common", "polkadot-runtime-parachains", "scale-info", - "sp-core", - "sp-externalities", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-state-machine", + "sp-core 29.0.0", + "sp-externalities 0.26.0", + "sp-inherents 27.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", + "sp-state-machine 0.36.0", "sp-std", - "sp-trie", - "sp-version", - "staging-xcm", - "staging-xcm-builder", - "trie-db", + "sp-trie 30.0.0", + "sp-version 30.0.0", + "staging-xcm 8.0.1", + "trie-db 0.28.0", ] [[package]] @@ -1106,162 +1166,154 @@ dependencies = [ [[package]] name = "cumulus-pallet-session-benchmarking" -version = "17.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "506daacefa861aa2909b64f26e76495ce029227fd8355b97e074cc1d5dc54ab2" +checksum = "2f3259f743f70f39baa3abf2d9d8de864e18120465f8731b99bef039a3bf9329" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "pallet-session", "parity-scale-codec", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "cumulus-pallet-xcm" -version = "0.15.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5224285f60e5159bab549f458079d606a7f95ef779def8b89f1a244dc7cf81" +checksum = "8e802291060763f8d1176bf808da97aafe5afe7351f62bb093c317c1d35c5cee" dependencies = [ "cumulus-primitives-core", - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "parity-scale-codec", "scale-info", - "sp-io", - "sp-runtime", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", - "staging-xcm", + "staging-xcm 8.0.1", ] [[package]] name = "cumulus-pallet-xcmp-queue" -version = "0.15.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0adf5409618b21e754fef0ac70f257878d22d61c48fdeefcab666835dcb8e0f0" +checksum = "0fa22d6e479a4d3a2790bab291269ba0917a1ac384255a54a2ebc3f7c37e505e" dependencies = [ "bounded-collections", "bp-xcm-bridge-hub-router", "cumulus-primitives-core", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", "pallet-message-queue", "parity-scale-codec", "polkadot-runtime-common", "polkadot-runtime-parachains", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", + "staging-xcm 8.0.1", + "staging-xcm-executor 8.0.2", ] [[package]] name = "cumulus-primitives-aura" -version = "0.14.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e7977947ad43a4cbc532ca33abcde136ae3deffdc7168b2ae253d73ccd371e4" +checksum = "2f07d6177692154043d7ddcc0b87ca5365ae8e4d94b90d9931f6b2f76e162f09" dependencies = [ "parity-scale-codec", - "polkadot-core-primitives", + "polkadot-core-primitives 8.0.0", "polkadot-primitives", - "sp-api", + "sp-api 27.0.1", "sp-consensus-aura", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "cumulus-primitives-core" -version = "0.14.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "751e64b89a839d5cfabebc1c797936e5eee791d0fa2322d91e86f8440a743ddb" +checksum = "9df07f6825fd50ea30aae335e43dc1a615a05de7465f5f329b9e414f2c886a12" dependencies = [ "parity-scale-codec", - "polkadot-core-primitives", - "polkadot-parachain-primitives", + "polkadot-core-primitives 8.0.0", + "polkadot-parachain-primitives 7.0.0", "polkadot-primitives", "scale-info", - "sp-api", - "sp-runtime", + "sp-api 27.0.1", + "sp-runtime 32.0.0", "sp-std", - "sp-trie", - "staging-xcm", + "sp-trie 30.0.0", + "staging-xcm 8.0.1", ] [[package]] name = "cumulus-primitives-parachain-inherent" -version = "0.14.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df521e13b48278b86d02c61d6e44036d6d263deb5aaec4838b1751da8988d3d2" +checksum = "38ad140a065a6b8001fb26ec42b91391e90fde120f5b4e57986698249a9b98c8" dependencies = [ "async-trait", "cumulus-primitives-core", "parity-scale-codec", "scale-info", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-state-machine", + "sp-core 29.0.0", + "sp-inherents 27.0.0", "sp-std", - "sp-trie", + "sp-trie 30.0.0", ] [[package]] name = "cumulus-primitives-proof-size-hostfunction" -version = "0.9.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f973d2a7262c90e48dcd42062bcb1e0fbf48bbcdac4ea6df3d85212d8d8be5d" +checksum = "c1b74f9141190b9f4bf96a947ade46da64097b77f1ebfa8d611c81724250e119" dependencies = [ - "sp-externalities", - "sp-runtime-interface", - "sp-trie", + "sp-externalities 0.26.0", + "sp-runtime-interface 25.0.0", + "sp-trie 30.0.0", ] [[package]] -name = "cumulus-primitives-storage-weight-reclaim" -version = "6.0.2" +name = "cumulus-primitives-utility" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29a7e13063f593f21534a7b64c96f311c40cd4d3c72649e0bd063a34506fdd70" +checksum = "e65466e56d642f979b556d098a03755ae51972fff5fa0f9b1cdcfdb3df062ea3" dependencies = [ "cumulus-primitives-core", - "cumulus-primitives-proof-size-hostfunction", - "docify", - "frame-support", - "frame-system", + "frame-support 29.0.2", "log", + "pallet-asset-conversion", "parity-scale-codec", - "scale-info", - "sp-runtime", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", + "staging-xcm 8.0.1", + "staging-xcm-builder 8.0.3", + "staging-xcm-executor 8.0.2", ] [[package]] -name = "cumulus-primitives-utility" -version = "0.15.0" +name = "curve25519-dalek" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05742c520065e3870d419683113ed7f6d35de66f0c80af6828e7878d1bb0ea94" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" dependencies = [ - "cumulus-primitives-core", - "frame-support", - "log", - "pallet-asset-conversion", - "parity-scale-codec", - "polkadot-runtime-common", - "polkadot-runtime-parachains", - "sp-io", - "sp-runtime", - "sp-std", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", ] [[package]] @@ -1436,6 +1488,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive-syn-parse" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive-syn-parse" version = "0.2.0" @@ -1497,7 +1560,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a081e51fb188742f5a7a1164ad752121abcb22874b21e2c3b0dd040c515fdad" dependencies = [ "common-path", - "derive-syn-parse", + "derive-syn-parse 0.2.0", "once_cell", "proc-macro2", "quote", @@ -1521,15 +1584,15 @@ dependencies = [ "contract-metadata", "contract-transcode", "drink-test-macro", - "frame-support", - "frame-system", + "frame-support 36.0.0", + "frame-system 36.1.0", "ink_sandbox", "log", "parity-scale-codec", "parity-scale-codec-derive", "scale-info", "serde_json", - "sp-runtime-interface", + "sp-runtime-interface 28.0.0", "thiserror", "wat", ] @@ -1633,7 +1696,7 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ - "curve25519-dalek", + "curve25519-dalek 4.1.3", "ed25519", "serde", "sha2 0.10.8", @@ -1641,17 +1704,31 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ed25519-zebra" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +dependencies = [ + "curve25519-dalek 3.2.0", + "hashbrown 0.12.3", + "hex", + "rand_core 0.6.4", + "sha2 0.9.9", + "zeroize", +] + [[package]] name = "ed25519-zebra" version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ - "curve25519-dalek", + "curve25519-dalek 4.1.3", "ed25519", "hashbrown 0.14.5", "hex", - "rand_core", + "rand_core 0.6.4", "sha2 0.10.8", "zeroize", ] @@ -1675,7 +1752,7 @@ dependencies = [ "generic-array", "group", "pkcs8", - "rand_core", + "rand_core 0.6.4", "sec1", "serdect", "subtle", @@ -1764,9 +1841,9 @@ dependencies = [ [[package]] name = "fallible-iterator" -version = "0.3.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" @@ -1780,7 +1857,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1840,14 +1917,29 @@ dependencies = [ ] [[package]] -name = "fortuples" -version = "0.9.1" +name = "frame-benchmarking" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87630a8087e9cac4b7edfb6ee5e250ddca9112b57b6b17d8f5107375a3a8eace" +checksum = "4090659c6aaa3c4d5b6c6ec909b4b0a25dec10ad92aad5f729efa8d5bd4d806a" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "frame-support 29.0.2", + "frame-support-procedural 24.0.0", + "frame-system 29.0.0", + "linregress", + "log", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "sp-api 27.0.1", + "sp-application-crypto 31.0.0", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", + "sp-runtime-interface 25.0.0", + "sp-std", + "sp-storage 20.0.0", + "static_assertions", ] [[package]] @@ -1856,31 +1948,31 @@ version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "709b26657ebbba53dc7bb616577375ca462b20fef1b00e8d9b20d2435e87f7bc" dependencies = [ - "frame-support", - "frame-support-procedural", - "frame-system", + "frame-support 36.0.0", + "frame-support-procedural 30.0.1", + "frame-system 36.1.0", "linregress", "log", "parity-scale-codec", "paste", "scale-info", "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-io", - "sp-runtime", - "sp-runtime-interface", + "sp-api 33.0.0", + "sp-application-crypto 37.0.0", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.0", + "sp-runtime-interface 28.0.0", "sp-std", - "sp-storage", + "sp-storage 21.0.0", "static_assertions", ] [[package]] name = "frame-election-provider-solution-type" -version = "14.0.1" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8156f209055d352994ecd49e19658c6b469d7c6de923bd79868957d0dcfb6f71" +checksum = "c5c3bff645e46577c69c272733c53fa3a77d1ee6e40dfb66157bc94b0740b8fc" dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", @@ -1890,40 +1982,39 @@ dependencies = [ [[package]] name = "frame-election-provider-support" -version = "36.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1ec289ebad5e601bb165cf7eb6ec2179ae34280ee310d0710a3111d4f8f8f94" +checksum = "87da19ee99e6473cd057ead84337d20011fe5e299c6750e88e43b8b7963b8852" dependencies = [ "frame-election-provider-solution-type", - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "parity-scale-codec", "scale-info", - "sp-arithmetic", - "sp-core", + "sp-arithmetic 24.0.0", + "sp-core 29.0.0", "sp-npos-elections", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "frame-executive" -version = "36.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d878830330eaa9e8b886279c338556b05702d0059989cb51cfb226b70bf3fa4" +checksum = "09bff9574ee2dcc349f646e1d2faadf76afd688c2ea1bbac5e4a0e19a0c19c59" dependencies = [ - "aquamarine", - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "frame-try-runtime", "log", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", - "sp-tracing", + "sp-tracing 16.0.0", ] [[package]] @@ -1939,19 +2030,45 @@ dependencies = [ ] [[package]] -name = "frame-metadata-hash-extension" -version = "0.4.0" +name = "frame-support" +version = "29.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf37fc730bf4b51e82a34c6357eebe32c04dbacf6525e0a7b9726f6a17ec9427" +checksum = "b8e52c84b611d2049d9253f83a62ab0f093e4be5c42a7ef42ea5bb16d6611e32" dependencies = [ + "aquamarine", "array-bytes", + "bitflags 1.3.2", "docify", - "frame-support", - "frame-system", + "environmental", + "frame-metadata", + "frame-support-procedural 24.0.0", + "impl-trait-for-tuples", + "k256", "log", + "macro_magic", "parity-scale-codec", + "paste", "scale-info", - "sp-runtime", + "serde", + "serde_json", + "smallvec", + "sp-api 27.0.1", + "sp-arithmetic 24.0.0", + "sp-core 29.0.0", + "sp-crypto-hashing-proc-macro", + "sp-debug-derive", + "sp-genesis-builder 0.8.0", + "sp-inherents 27.0.0", + "sp-io 31.0.0", + "sp-metadata-ir 0.6.0", + "sp-runtime 32.0.0", + "sp-staking 27.0.0", + "sp-state-machine 0.36.0", + "sp-std", + "sp-tracing 16.0.0", + "sp-weights 28.0.0", + "static_assertions", + "tt-call", ] [[package]] @@ -1966,7 +2083,7 @@ dependencies = [ "docify", "environmental", "frame-metadata", - "frame-support-procedural", + "frame-support-procedural 30.0.1", "impl-trait-for-tuples", "k256", "log", @@ -1977,25 +2094,45 @@ dependencies = [ "serde", "serde_json", "smallvec", - "sp-api", - "sp-arithmetic", - "sp-core", + "sp-api 33.0.0", + "sp-arithmetic 26.0.0", + "sp-core 34.0.0", "sp-crypto-hashing-proc-macro", "sp-debug-derive", - "sp-genesis-builder", - "sp-inherents", - "sp-io", - "sp-metadata-ir", - "sp-runtime", - "sp-staking", - "sp-state-machine", + "sp-genesis-builder 0.14.0", + "sp-inherents 33.0.0", + "sp-io 37.0.0", + "sp-metadata-ir 0.7.0", + "sp-runtime 38.0.0", + "sp-staking 33.0.0", + "sp-state-machine 0.42.0", "sp-std", - "sp-tracing", - "sp-weights", + "sp-tracing 17.0.0", + "sp-weights 31.0.0", "static_assertions", "tt-call", ] +[[package]] +name = "frame-support-procedural" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bf1d648c4007d421b9677b3c893256913498fff159dc2d85022cdd9cc432f3c" +dependencies = [ + "Inflector", + "cfg-expr", + "derive-syn-parse 0.1.5", + "expander", + "frame-support-procedural-tools 10.0.0", + "itertools 0.10.5", + "macro_magic", + "proc-macro-warning", + "proc-macro2", + "quote", + "sp-crypto-hashing", + "syn 2.0.77", +] + [[package]] name = "frame-support-procedural" version = "30.0.1" @@ -2004,9 +2141,9 @@ checksum = "fd94af68373e179c32c360b3c280497a9cf0f45a4f47f0ee6539a6c6c9cf2343" dependencies = [ "Inflector", "cfg-expr", - "derive-syn-parse", + "derive-syn-parse 0.2.0", "expander", - "frame-support-procedural-tools", + "frame-support-procedural-tools 13.0.0", "itertools 0.11.0", "macro_magic", "proc-macro-warning", @@ -2016,19 +2153,43 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "frame-support-procedural-tools" +version = "10.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3363df38464c47a73eb521a4f648bfcc7537a82d70347ef8af3f73b6d019e910" +dependencies = [ + "frame-support-procedural-tools-derive 11.0.0", + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "frame-support-procedural-tools" version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bead15a320be1764cdd50458c4cfacb23e0cee65f64f500f8e34136a94c7eeca" dependencies = [ - "frame-support-procedural-tools-derive", + "frame-support-procedural-tools-derive 12.0.0", "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.77", ] +[[package]] +name = "frame-support-procedural-tools-derive" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68672b9ec6fe72d259d3879dc212c5e42e977588cdac830c76f54d9f492aeb58" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "frame-support-procedural-tools-derive" version = "12.0.0" @@ -2040,6 +2201,27 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "frame-system" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bc20a793c3cec0b11165c1075fe11a255b2491f3eef8230bb3073cb296e7383" +dependencies = [ + "cfg-if", + "docify", + "frame-support 29.0.2", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", + "sp-std", + "sp-version 30.0.0", + "sp-weights 28.0.0", +] + [[package]] name = "frame-system" version = "36.1.0" @@ -2048,55 +2230,55 @@ checksum = "64d6a0e7bb6503facdcc6f8e19c83cd0bfc8bbbd268522b1a50e107dfc6b972d" dependencies = [ "cfg-if", "docify", - "frame-support", + "frame-support 36.0.0", "log", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.0", "sp-std", - "sp-version", - "sp-weights", + "sp-version 36.0.0", + "sp-weights 31.0.0", ] [[package]] name = "frame-system-benchmarking" -version = "36.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15afc91c7780e18274dcea58ed1edb700c48d10e086a9785e3f6708099cd3250" +checksum = "ac47ee48fee3a0b49c9ab9ee68997dee3733776a355f780cf2858449cf495d69" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "parity-scale-codec", "scale-info", - "sp-core", - "sp-runtime", + "sp-core 29.0.0", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "frame-system-rpc-runtime-api" -version = "33.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e9e2b7b85e451e367f4fb85ff3295bd039e17f64de1906154d3976e2638ee8" +checksum = "4c1b20433c3c76b56ce905ed971631ec8c34fa64cf6c20e590afe46455fc0cc8" dependencies = [ "parity-scale-codec", - "sp-api", + "sp-api 27.0.1", ] [[package]] name = "frame-try-runtime" -version = "0.42.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6ba8b36a52775ad39ccfb45ff4ad814c3cb45ec74d0a4271889e00bd791c6c" +checksum = "0eab87d07bc2f9a2160b818d1b7506c303b3b28b6a8a5f01dc5e2641390450b5" dependencies = [ - "frame-support", + "frame-support 29.0.2", "parity-scale-codec", - "sp-api", - "sp-runtime", + "sp-api 27.0.1", + "sp-runtime 32.0.0", "sp-std", ] @@ -2234,16 +2416,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ "rand", - "rand_core", + "rand_core 0.6.4", ] [[package]] name = "gimli" -version = "0.28.1" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" dependencies = [ "fallible-iterator", + "indexmap 1.9.3", "stable_deref_trait", ] @@ -2260,7 +2443,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -2284,6 +2467,9 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.8", +] [[package]] name = "hashbrown" @@ -2291,7 +2477,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash", + "ahash 0.8.11", ] [[package]] @@ -2300,7 +2486,7 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash", + "ahash 0.8.11", "allocator-api2", ] @@ -2346,7 +2532,17 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" dependencies = [ - "crypto-mac", + "crypto-mac 0.8.0", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.1", "digest 0.9.0", ] @@ -2781,20 +2977,20 @@ name = "ink_sandbox" version = "5.0.0" dependencies = [ "frame-metadata", - "frame-support", - "frame-system", + "frame-support 36.0.0", + "frame-system 36.1.0", "log", - "pallet-assets", - "pallet-balances", - "pallet-contracts", - "pallet-timestamp", + "pallet-assets 37.0.0", + "pallet-balances 37.0.0", + "pallet-contracts 35.0.0", + "pallet-timestamp 35.0.0", "parity-scale-codec", "paste", "scale-info", - "sp-core", - "sp-externalities", - "sp-io", - "sp-runtime-interface", + "sp-core 34.0.0", + "sp-externalities 0.29.0", + "sp-io 37.0.0", + "sp-runtime-interface 28.0.0", "wat", ] @@ -2840,60 +3036,21 @@ dependencies = [ ] [[package]] -name = "is_terminal_polyfill" -version = "1.70.1" +name = "io-lifetimes" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - -[[package]] -name = "ismp" -version = "0.2.0" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" -dependencies = [ - "anyhow", - "derive_more", - "hex", - "parity-scale-codec", - "primitive-types", - "scale-info", - "serde", - "serde-utils", - "serde_json", -] - -[[package]] -name = "ismp-parachain" -version = "1.15.0" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "cumulus-pallet-parachain-system", - "cumulus-primitives-core", - "frame-support", - "frame-system", - "hex-literal", - "ismp", - "log", - "pallet-ismp", - "parity-scale-codec", - "primitive-types", - "scale-info", - "serde", - "sp-consensus-aura", - "sp-inherents", - "sp-io", - "sp-runtime", - "sp-trie", - "substrate-state-machine", + "hermit-abi", + "libc", + "windows-sys 0.48.0", ] [[package]] -name = "ismp-parachain-runtime-api" -version = "1.15.0" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" -dependencies = [ - "cumulus-pallet-parachain-system", - "sp-api", -] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -3098,7 +3255,13 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" @@ -3118,6 +3281,15 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + [[package]] name = "macro_magic" version = "0.5.1" @@ -3137,7 +3309,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" dependencies = [ "const-random", - "derive-syn-parse", + "derive-syn-parse 0.2.0", "macro_magic_core_macros", "proc-macro2", "quote", @@ -3191,6 +3363,24 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memfd" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +dependencies = [ + "rustix 0.38.37", +] + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + [[package]] name = "memory-db" version = "0.32.0" @@ -3208,7 +3398,7 @@ checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" dependencies = [ "byteorder", "keccak", - "rand_core", + "rand_core 0.6.4", "zeroize", ] @@ -3251,24 +3441,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "mmr-primitives" -version = "1.15.0" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" -dependencies = [ - "ckb-merkle-mountain-range", - "frame-system", - "ismp", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core", - "sp-io", - "sp-mmr-primitives", - "sp-runtime", - "sp-std", -] - [[package]] name = "multi-stash" version = "0.2.0" @@ -3426,10 +3598,13 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.30.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" dependencies = [ + "crc32fast", + "hashbrown 0.13.2", + "indexmap 1.9.3", "memchr", ] @@ -3468,70 +3643,85 @@ dependencies = [ name = "pallet-api" version = "0.1.0" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "pallet-assets", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", + "pallet-assets 30.0.0", + "pallet-nfts", "parity-scale-codec", - "pop-chain-extension", "scale-info", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "pallet-asset-conversion" -version = "18.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f726ebb59401c1844a4a8703047bdafcd99a1827cd5d8b2c82abeb8948a7f25b" +checksum = "4079f12db3cf98daa717337ab5b7e5ef15aa3bec3b497f501dc715d129b500da" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "log", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "parity-scale-codec", "scale-info", - "sp-api", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", + "sp-api 27.0.1", + "sp-arithmetic 24.0.0", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "pallet-asset-rate" -version = "15.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e806842bec955190ec64f8b2179f74f5355137c4cadf04f3269e6196cd19caf9" +checksum = "571ce57fd846911041749832b46a8c2b01f0b79ffebcd7585e3973865607036d" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "parity-scale-codec", "scale-info", - "sp-core", - "sp-runtime", + "sp-core 29.0.0", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "pallet-asset-tx-payment" -version = "36.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "100a180dfbf30a1c872100ec2dae8a61c0f5e8b3f2d3a5cbb34093826293e2ab" +checksum = "9ed783679921ad8b96807d683d320c314e305753b230d5c04dc713bab7aca64c" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", - "pallet-transaction-payment", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", + "pallet-transaction-payment 29.0.2", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", + "sp-std", +] + +[[package]] +name = "pallet-assets" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46728a98a910af13f6a77033dd053456650773bb7adc71e0ba845bff7e31b33e" +dependencies = [ + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", + "log", + "parity-scale-codec", + "scale-info", + "sp-core 29.0.0", + "sp-runtime 32.0.0", "sp-std", ] @@ -3541,90 +3731,107 @@ version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f79ef6a7763fc08177f014052469ee12aefcdad0d99a747372360c2f648d2cc4" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 36.0.0", + "frame-support 36.0.0", + "frame-system 36.1.0", "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", - "sp-core", - "sp-runtime", + "sp-core 34.0.0", + "sp-runtime 38.0.0", "sp-std", ] [[package]] name = "pallet-aura" -version = "35.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0861b2a1ad6526948567bb59a3fdc4c7f02ee79b07be8b931a544350ec35ab0c" +checksum = "a611bef3c8cf281e41a43f32a4153260bdc8b7b61b901e65c7a4442529224e11" dependencies = [ - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", - "pallet-timestamp", + "pallet-timestamp 28.0.0", "parity-scale-codec", "scale-info", - "sp-application-crypto", + "sp-application-crypto 31.0.0", "sp-consensus-aura", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "pallet-authority-discovery" -version = "36.0.0" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2c3666a476132f5846fe4d5e1961a923a58a0f54d873d84566f24ffaa3684f" +checksum = "7cd9a381c613e6538638391fb51f353fd13b16f849d0d1ac66a388326bd456f1" dependencies = [ - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "pallet-session", "parity-scale-codec", "scale-info", - "sp-application-crypto", + "sp-application-crypto 31.0.0", "sp-authority-discovery", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "pallet-authorship" -version = "36.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38885846dbcf03b025fdbd7edb3649046dbc68fa0b419ffe8837ef853a10d31f" +checksum = "3d83773e731a1760f99684b09961ed7b92acafe335f36f08ebb8313d3b9c72e2" dependencies = [ - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "pallet-babe" -version = "36.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b23d2d814e3cb793659fcf84533f66fdf0ed9cccb66cb2225851f482843ed096" +checksum = "d3f2020c52667a650d64e84a4bbb63388e25bc1c9bc872a8243d03bfcb285049" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", "pallet-authorship", "pallet-session", - "pallet-timestamp", + "pallet-timestamp 28.0.0", "parity-scale-codec", "scale-info", - "sp-application-crypto", + "sp-application-crypto 31.0.0", "sp-consensus-babe", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-session", - "sp-staking", + "sp-staking 27.0.0", + "sp-std", +] + +[[package]] +name = "pallet-balances" +version = "29.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a54b5d0c7c4c3731883d6b1ac18aff44db20c3d0a3470c8861001a17afdc85" +dependencies = [ + "docify", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime 32.0.0", "sp-std", ] @@ -3635,55 +3842,86 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6878e240962d3887f0e0654ac343a18845adb95ad493c9d4d5e803c015d4a4c3" dependencies = [ "docify", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 36.0.0", + "frame-support 36.0.0", + "frame-system 36.1.0", "log", "parity-scale-codec", "scale-info", - "sp-runtime", + "sp-runtime 38.0.0", "sp-std", ] [[package]] name = "pallet-broker" -version = "0.15.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0d652c399b6ed776ee3322e60f40e323f86b413719d7696eddb8f64c368ac0" +checksum = "574c52fd629191c374c24a18036acac008ea92142309e5dd05e7f03149a667c3" dependencies = [ "bitvec", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", "parity-scale-codec", "scale-info", - "sp-api", - "sp-arithmetic", - "sp-core", - "sp-runtime", + "sp-arithmetic 24.0.0", + "sp-core 29.0.0", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "pallet-collator-selection" -version = "17.0.0" +version = "10.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f660cc09f2f277a3976da2eef856b5c725ab7ad1192902ef7f4e4bafd992f04f" +checksum = "a36858c4275b7d19671b321e95f545e07c9643f97dffed1b333774cb391a4456" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", "pallet-authorship", - "pallet-balances", + "pallet-balances 29.0.2", "pallet-session", "parity-scale-codec", "rand", "scale-info", - "sp-runtime", - "sp-staking", + "sp-runtime 32.0.0", + "sp-staking 27.0.0", + "sp-std", +] + +[[package]] +name = "pallet-contracts" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b56fe53df97911ed3ecd90d631f8093cedd795c756d4e42d386110e9fe6614f" +dependencies = [ + "bitflags 1.3.2", + "environmental", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", + "impl-trait-for-tuples", + "log", + "pallet-balances 29.0.2", + "pallet-contracts-proc-macro 19.0.0", + "pallet-contracts-uapi 6.0.0", + "parity-scale-codec", + "rand", + "scale-info", + "serde", + "smallvec", + "sp-api 27.0.1", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", + "staging-xcm 8.0.1", + "staging-xcm-builder 8.0.3", + "wasm-instrument", + "wasmi 0.31.2", ] [[package]] @@ -3694,29 +3932,40 @@ checksum = "3e6989ac82690f981959b0d38ac6d6d52fc06bf00a035548d62b9a2e9c220376" dependencies = [ "bitflags 1.3.2", "environmental", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 36.0.0", + "frame-support 36.0.0", + "frame-system 36.1.0", "impl-trait-for-tuples", "log", - "pallet-balances", - "pallet-contracts-proc-macro", - "pallet-contracts-uapi", + "pallet-balances 37.0.0", + "pallet-contracts-proc-macro 23.0.1", + "pallet-contracts-uapi 11.0.0", "parity-scale-codec", "paste", "rand", "scale-info", "serde", "smallvec", - "sp-api", - "sp-core", - "sp-io", - "sp-runtime", + "sp-api 33.0.0", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.0", "sp-std", - "staging-xcm", - "staging-xcm-builder", + "staging-xcm 14.1.0", + "staging-xcm-builder 15.0.0", "wasm-instrument", - "wasmi", + "wasmi 0.32.3", +] + +[[package]] +name = "pallet-contracts-proc-macro" +version = "19.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3163c6bc21b55a0ccb74c546ba784d9c9e69beb9240c059d28a3052f4cbce509" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] @@ -3730,6 +3979,19 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "pallet-contracts-uapi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61eeda58538dc888c59ae6de2146f0e2f43e9ad0eb1d56c228e5cc7af90d4e52" +dependencies = [ + "bitflags 1.3.2", + "parity-scale-codec", + "paste", + "polkavm-derive 0.5.0", + "scale-info", +] + [[package]] name = "pallet-contracts-uapi" version = "11.0.0" @@ -3756,329 +4018,313 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" -version = "35.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd1090fdc6ccdd8ff08c60000c970428baaaf0b33e7a6b01a91ec8b697a650a3" +checksum = "b54d1d3fe9ae61a144d581147e699b7c3009169de0019a0f87cca0bed82681e7" dependencies = [ - "frame-benchmarking", + "frame-benchmarking 29.0.0", "frame-election-provider-support", - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", "pallet-election-provider-support-benchmarking", "parity-scale-codec", "rand", "scale-info", - "sp-arithmetic", - "sp-core", - "sp-io", + "sp-arithmetic 24.0.0", + "sp-core 29.0.0", + "sp-io 31.0.0", "sp-npos-elections", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", - "strum 0.26.3", + "strum 0.24.1", ] [[package]] name = "pallet-election-provider-support-benchmarking" -version = "35.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93475989d2f6900caf8f1c847a55d909295c156525a7510c5f1dde176ec7c714" +checksum = "46ec87816a1e32a1ab6deececa99e21e6684b111efe87b11b8298328dbbefd01" dependencies = [ - "frame-benchmarking", + "frame-benchmarking 29.0.0", "frame-election-provider-support", - "frame-system", + "frame-system 29.0.0", "parity-scale-codec", "sp-npos-elections", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "pallet-fast-unstake" -version = "35.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9155f4f762513e0287320411415c76a647152799ad33db1785c9b71c36a14575" +checksum = "2222607a0dba10a9d57cab5360a6549b5fda925181c3c7af481246c0964998df" dependencies = [ "docify", - "frame-benchmarking", + "frame-benchmarking 29.0.0", "frame-election-provider-support", - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", "parity-scale-codec", "scale-info", - "sp-io", - "sp-runtime", - "sp-staking", + "sp-io 31.0.0", + "sp-runtime 32.0.0", + "sp-staking 27.0.0", "sp-std", ] [[package]] name = "pallet-identity" -version = "36.0.0" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4555795a3e0e3aa49ea432b7afecb9c71a7db8793a99c68bd8dd3a52a12571f3" +checksum = "452bba25325b7f0148eeecbde13e7c26dfb677ad46b3f160b359d7643b44c94b" dependencies = [ "enumflags2", - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-io", - "sp-runtime", - "sp-std", -] - -[[package]] -name = "pallet-ismp" -version = "1.15.0" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" -dependencies = [ - "fortuples", - "frame-benchmarking", - "frame-support", - "frame-system", - "ismp", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", - "mmr-primitives", "parity-scale-codec", "scale-info", - "serde", - "sp-api", - "sp-core", - "sp-io", - "sp-mmr-primitives", - "sp-runtime", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", ] -[[package]] -name = "pallet-ismp-runtime-api" -version = "1.15.0" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" -dependencies = [ - "ismp", - "pallet-ismp", - "parity-scale-codec", - "primitive-types", - "serde", - "sp-api", - "sp-mmr-primitives", -] - [[package]] name = "pallet-message-queue" -version = "39.0.0" +version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20e65a37881d1998546254a5e50a1f768b3f82deabe774e750f4ea95aba8030c" +checksum = "9ccb23dee70b184a214d729db550117a0965a69107d466d35181d60a6feede38" dependencies = [ "environmental", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", "parity-scale-codec", "scale-info", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", + "sp-arithmetic 24.0.0", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", - "sp-weights", + "sp-weights 28.0.0", ] [[package]] name = "pallet-multisig" -version = "36.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be58483d827602eb8353ecf36aed65c857f0974db5d27981831e5ebf853040bd" +checksum = "176f6a5c170185f892a047c0ae189bc52eb390f2c0b94d4261ed0ebc7f82a548" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", "parity-scale-codec", "scale-info", - "sp-io", - "sp-runtime", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "pallet-nft-fractionalization" -version = "18.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dcaa330221f60feaf3b23d495cccc3bf2a3d6254c596b3c032273c2b46d4078" +checksum = "e4225c31beb3a10235dd165c78f340c344ee78f6ebccd7c99d62a71fb76d2e39" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", - "pallet-assets", + "pallet-assets 30.0.0", "pallet-nfts", "parity-scale-codec", "scale-info", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "pallet-nfts" -version = "30.0.0" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e1cd476809de3840e19091a083d5a79178af1f108ad489706e1f9e04c8836a4" +checksum = "d3a8978bd9c43ac5ebaa7a26e5bd0c130b037d7cde97189e1a62fa64e5ee1ef1" dependencies = [ "enumflags2", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "pallet-nfts-runtime-api" -version = "22.0.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0ca7a0446d2d3c27f726a016c6366218df2e0bfef9ed35886b252cfa9757f6c" +checksum = "c412ca82207d43e651ef80a3be837220b82ad0d6c3174922c369ef301ea0e5af" dependencies = [ "pallet-nfts", "parity-scale-codec", - "sp-api", + "sp-api 27.0.1", "sp-std", ] [[package]] name = "pallet-preimage" -version = "36.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ac726abc5b1bcd6c8f783514b8e1a48be32c7d15e0b263e4bc28cc1e4e7763" +checksum = "7344a30c304771beb90aec34604100185e47cdc0366e268ad18922de602a0c7e" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "pallet-proxy" -version = "36.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4e12680e176607815a78a0cd10a52af50790292cb950404f30a885e2a7229e9" +checksum = "f7aa31a0b91e8060b808c3e3407e4578a5e94503b174b9e99769147b24fb2c56" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "parity-scale-codec", "scale-info", - "sp-io", - "sp-runtime", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "pallet-scheduler" -version = "37.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b170d6aa191197d3f50b1193925546972ffc394376ead4d2739eb40909b73c85" +checksum = "45e2a4ebe6a5f98b14a26deed8d7a1ea28bb2c2d3ad4d6dc129a725523a2042d" dependencies = [ "docify", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", "parity-scale-codec", "scale-info", - "sp-io", - "sp-runtime", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", - "sp-weights", + "sp-weights 28.0.0", ] [[package]] name = "pallet-session" -version = "36.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c92b24c911c2cfa5351616edc7f2f93427ea6f4f95efdb13f0f5d51997939c3" +checksum = "7412ac59247b300feee53709f7009a23d1c6f8c70528599f48f44e102d896d03" dependencies = [ - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "impl-trait-for-tuples", "log", - "pallet-timestamp", + "pallet-timestamp 28.0.0", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-session", - "sp-staking", - "sp-state-machine", + "sp-staking 27.0.0", + "sp-state-machine 0.36.0", "sp-std", - "sp-trie", + "sp-trie 30.0.0", ] [[package]] name = "pallet-staking" -version = "36.0.0" +version = "29.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbebdb060417654f215fc6f03675e5f44cfc83837d9e523e1b8fd9a4a2e1bdc2" +checksum = "061b00814eb794a40df4eca7972a7c67b26473cd85cc7c54f5816ae49ad6e11b" dependencies = [ - "frame-benchmarking", + "frame-benchmarking 29.0.0", "frame-election-provider-support", - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", "pallet-authorship", "pallet-session", "parity-scale-codec", "scale-info", "serde", - "sp-application-crypto", - "sp-io", - "sp-runtime", - "sp-staking", + "sp-application-crypto 31.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", + "sp-staking 27.0.0", "sp-std", ] [[package]] name = "pallet-staking-reward-fn" -version = "22.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "988a7ebeacc84d4bdb0b12409681e956ffe35438447d8f8bc78db547cffb6ebc" +checksum = "505d45e08bad052f55fb51f00a6b6244d23ee46ffdc8091f6cddf4e3a880319d" dependencies = [ "log", - "sp-arithmetic", + "sp-arithmetic 24.0.0", ] [[package]] name = "pallet-sudo" -version = "36.0.0" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d02f7855d411913e77e57126f4a8b8a32d90d9bf47d0b747e367a1301729c3" +dependencies = [ + "docify", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", + "parity-scale-codec", + "scale-info", + "sp-io 31.0.0", + "sp-runtime 32.0.0", + "sp-std", +] + +[[package]] +name = "pallet-timestamp" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bd2a8797c1bb3d3897b4f87a7716111da5eeb8561345277b6e6d70349ec8b35" +checksum = "c1b8810ddfb254c7fb8cd7698229cce513d309a43ff117b38798dae6120f477b" dependencies = [ "docify", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", + "log", "parity-scale-codec", "scale-info", - "sp-io", - "sp-runtime", + "sp-inherents 27.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", + "sp-storage 20.0.0", + "sp-timestamp 27.0.0", ] [[package]] @@ -4088,18 +4334,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae789d344be857679b0b98b28a67c747119724847f81d704d3fd03ee13fb6841" dependencies = [ "docify", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 36.0.0", + "frame-support 36.0.0", + "frame-system 36.1.0", "log", "parity-scale-codec", "scale-info", - "sp-inherents", - "sp-io", - "sp-runtime", + "sp-inherents 33.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.0", + "sp-std", + "sp-storage 21.0.0", + "sp-timestamp 33.0.0", +] + +[[package]] +name = "pallet-transaction-payment" +version = "29.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5ba71f06f09e955b80dc313c333be3f8d9e8505b051558e0b7af4806b13310" +dependencies = [ + "frame-support 29.0.2", + "frame-system 29.0.0", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", - "sp-storage", - "sp-timestamp", ] [[package]] @@ -4108,123 +4371,122 @@ version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74fb6114223c8d967c3c2f21cbc845e8ea604ff7e21a8e59d119d5a9257ba886" dependencies = [ - "frame-support", - "frame-system", + "frame-support 36.0.0", + "frame-system 36.1.0", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.0", "sp-std", ] [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "36.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4bad1700ad7eb5ab254189e1df894d1d16b3626a3c4b9c45259ec4d9efc262c" +checksum = "c78bcba80c7c61712b98a6b5640975ebd25ceb688c18e975af78a0fac81785b0" dependencies = [ - "pallet-transaction-payment", + "pallet-transaction-payment 29.0.2", "parity-scale-codec", - "sp-api", - "sp-runtime", - "sp-weights", + "sp-api 27.0.1", + "sp-runtime 32.0.0", + "sp-weights 28.0.0", ] [[package]] name = "pallet-treasury" -version = "35.0.0" +version = "28.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c502615bb4fdd02856a131cb2a612ad40c26435ec938f65f11cae4ff230812b" +checksum = "3eca44990d0d759213744f2d1f6fe1fadec1079a3e4e4da40556d6b4e42abbcd" dependencies = [ "docify", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "impl-trait-for-tuples", - "pallet-balances", + "pallet-balances 29.0.2", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-runtime", + "sp-core 29.0.0", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "pallet-utility" -version = "36.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3238fe6ad00da6a137be115904c39cab97eb5c7f03da0bb1a20de1bef03f0c71" +checksum = "954f15b98c3fdebb763bb5cea4ec6803fd180d540ec5b07a9fcb2c118251d52c" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "parity-scale-codec", "scale-info", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "pallet-vesting" -version = "36.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f7f0f4fe5e1d851e85d81e5e73b6f929f0c35af786ce8be9c9e3363717c136" +checksum = "4525f3038cdf078fea39d913c563ca626f09a615e7724f0c9eac97743c75ff44" dependencies = [ - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", "parity-scale-codec", "scale-info", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", ] [[package]] name = "pallet-xcm" -version = "15.0.0" +version = "8.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7409458b7fedc5c7d46459da154ccc2dc22a843ce08e8ab6c1743ef5cf972c" +checksum = "ba9138b04168b07b1aff4a2079f5514753c31dddba40e5fb471b9cda7da27ad6" dependencies = [ "bounded-collections", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", - "pallet-balances", + "pallet-balances 29.0.2", "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", - "xcm-runtime-apis", + "staging-xcm 8.0.1", + "staging-xcm-builder 8.0.3", + "staging-xcm-executor 8.0.2", ] [[package]] name = "parachains-common" -version = "15.0.0" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9319e656eebdf161666e54a4d8e24f73137f702f01600247f7be650bc4d46167" +checksum = "711a4c073e7c83aac7e414ba16c7c641d6d9e22e6d32f9775ff35b2464ffd7ff" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-utility", - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", "pallet-asset-tx-payment", - "pallet-assets", + "pallet-assets 30.0.0", "pallet-authorship", - "pallet-balances", + "pallet-balances 29.0.2", "pallet-collator-selection", "pallet-message-queue", "pallet-xcm", @@ -4232,13 +4494,13 @@ dependencies = [ "polkadot-primitives", "scale-info", "sp-consensus-aura", - "sp-core", - "sp-io", - "sp-runtime", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", "staging-parachain-info", - "staging-xcm", - "staging-xcm-executor", + "staging-xcm 8.0.1", + "staging-xcm-executor 8.0.2", "substrate-wasm-builder", ] @@ -4250,7 +4512,7 @@ checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" dependencies = [ "bitcoin_hashes", "rand", - "rand_core", + "rand_core 0.6.4", "serde", "unicode-normalization", ] @@ -4318,7 +4580,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" dependencies = [ "base64ct", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -4328,6 +4590,15 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pbkdf2" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +dependencies = [ + "crypto-mac 0.11.1", +] + [[package]] name = "pbkdf2" version = "0.12.2" @@ -4373,13 +4644,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] -name = "polkadot-ckb-merkle-mountain-range" -version = "0.7.0" +name = "polkadot-core-primitives" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b44320e5f7ce2c18227537a3032ae5b2c476a7e8eddba45333e1011fc31b92" +checksum = "b6a08e4e014c853b252ecbbe3ccd67b2d33d78e46988d309b8cccf4ac06e25ef" dependencies = [ - "cfg-if", - "itertools 0.10.5", + "parity-scale-codec", + "scale-info", + "sp-core 29.0.0", + "sp-runtime 32.0.0", + "sp-std", ] [[package]] @@ -4390,11 +4664,29 @@ checksum = "17c72ee63bcf920f963cd7ac066759b0b649350c8ab3781a85a6aac87b1488f2" dependencies = [ "parity-scale-codec", "scale-info", - "sp-core", - "sp-runtime", + "sp-core 34.0.0", + "sp-runtime 38.0.0", "sp-std", ] +[[package]] +name = "polkadot-parachain-primitives" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248ab090959a92e61493277e33b7e85104280a4beb4cb0815137d3c8c50a07f4" +dependencies = [ + "bounded-collections", + "derive_more", + "parity-scale-codec", + "polkadot-core-primitives 8.0.0", + "scale-info", + "serde", + "sp-core 29.0.0", + "sp-runtime 32.0.0", + "sp-std", + "sp-weights 28.0.0", +] + [[package]] name = "polkadot-parachain-primitives" version = "13.0.0" @@ -4404,60 +4696,60 @@ dependencies = [ "bounded-collections", "derive_more", "parity-scale-codec", - "polkadot-core-primitives", + "polkadot-core-primitives 14.0.0", "scale-info", "serde", - "sp-core", - "sp-runtime", + "sp-core 34.0.0", + "sp-runtime 38.0.0", "sp-std", - "sp-weights", + "sp-weights 31.0.0", ] [[package]] name = "polkadot-primitives" -version = "14.0.0" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a4879609f4340138930c3c7313256941104a3ff6f7ecb2569d15223da9b35b2" +checksum = "e0d5f9930210cab0233d81204415c9ef4a8889cdf3e60de1435250481a2773ca" dependencies = [ "bitvec", "hex-literal", "log", "parity-scale-codec", - "polkadot-core-primitives", - "polkadot-parachain-primitives", + "polkadot-core-primitives 8.0.0", + "polkadot-parachain-primitives 7.0.0", "scale-info", "serde", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", + "sp-api 27.0.1", + "sp-application-crypto 31.0.0", + "sp-arithmetic 24.0.0", "sp-authority-discovery", "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", - "sp-staking", + "sp-core 29.0.0", + "sp-inherents 27.0.0", + "sp-io 31.0.0", + "sp-keystore 0.35.0", + "sp-runtime 32.0.0", + "sp-staking 27.0.0", "sp-std", ] [[package]] name = "polkadot-runtime-common" -version = "15.0.0" +version = "8.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28fdcb41bb21c7b14d0341a9a17364ccc04ad34de05d41e7938cb03acbc11066" +checksum = "12a70422ca43d30457e2d9502a5e4af35e20fa2ff3f7cd46e0d2997c784f2665" dependencies = [ "bitvec", - "frame-benchmarking", + "frame-benchmarking 29.0.0", "frame-election-provider-support", - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "impl-trait-for-tuples", "libsecp256k1", "log", "pallet-asset-rate", "pallet-authorship", - "pallet-balances", + "pallet-balances 29.0.2", "pallet-broker", "pallet-election-provider-multi-phase", "pallet-fast-unstake", @@ -4465,8 +4757,8 @@ dependencies = [ "pallet-session", "pallet-staking", "pallet-staking-reward-fn", - "pallet-timestamp", - "pallet-transaction-payment", + "pallet-timestamp 28.0.0", + "pallet-transaction-payment 29.0.2", "pallet-treasury", "pallet-vesting", "parity-scale-codec", @@ -4477,81 +4769,82 @@ dependencies = [ "serde", "serde_derive", "slot-range-helper", - "sp-api", - "sp-core", - "sp-inherents", - "sp-io", + "sp-api 27.0.1", + "sp-core 29.0.0", + "sp-inherents 27.0.0", + "sp-io 31.0.0", "sp-npos-elections", - "sp-runtime", + "sp-runtime 32.0.0", "sp-session", - "sp-staking", + "sp-staking 27.0.0", "sp-std", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", + "staging-xcm 8.0.1", + "staging-xcm-builder 8.0.3", + "staging-xcm-executor 8.0.2", "static_assertions", ] [[package]] name = "polkadot-runtime-metrics" -version = "15.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac75b3fea8464e5681b44733ed11cf09e22ff1e956f6703b918b637bd40e7427" +checksum = "e3566c6fd0c21b5dd555309427c984cf506f875ee90f710acea295b478fecbe0" dependencies = [ "bs58", - "frame-benchmarking", + "frame-benchmarking 29.0.0", "parity-scale-codec", "polkadot-primitives", "sp-std", - "sp-tracing", + "sp-tracing 16.0.0", ] [[package]] name = "polkadot-runtime-parachains" -version = "15.0.3" +version = "8.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7e68cb26f9025daaad694d8192fd0e63e92c8761c45a339dd7a5b7925a3cb6" +checksum = "b8d37cd3e014b06daf396d1483b5327782a0ebadc816423419665166b75b3e3e" dependencies = [ "bitflags 1.3.2", "bitvec", "derive_more", - "frame-benchmarking", - "frame-support", - "frame-system", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", + "frame-system 29.0.0", "impl-trait-for-tuples", "log", "pallet-authority-discovery", "pallet-authorship", "pallet-babe", - "pallet-balances", + "pallet-balances 29.0.2", "pallet-broker", "pallet-message-queue", "pallet-session", "pallet-staking", - "pallet-timestamp", + "pallet-timestamp 28.0.0", "pallet-vesting", "parity-scale-codec", - "polkadot-core-primitives", - "polkadot-parachain-primitives", + "polkadot-core-primitives 8.0.0", + "polkadot-parachain-primitives 7.0.0", "polkadot-primitives", "polkadot-runtime-metrics", "rand", "rand_chacha", + "rustc-hex", "scale-info", "serde", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-runtime", + "sp-api 27.0.1", + "sp-application-crypto 31.0.0", + "sp-arithmetic 24.0.0", + "sp-core 29.0.0", + "sp-inherents 27.0.0", + "sp-io 31.0.0", + "sp-keystore 0.35.0", + "sp-runtime 32.0.0", "sp-session", - "sp-staking", + "sp-staking 27.0.0", "sp-std", - "staging-xcm", - "staging-xcm-executor", + "staging-xcm 8.0.1", + "staging-xcm-executor 8.0.2", ] [[package]] @@ -4619,42 +4912,27 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "polkavm-linker" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7be503e60cf56c0eb785f90aaba4b583b36bff00e93997d93fef97f9553c39" -dependencies = [ - "gimli 0.28.1", - "hashbrown 0.14.5", - "log", - "object 0.32.2", - "polkavm-common 0.9.0", - "regalloc2", - "rustc-demangle", -] - [[package]] name = "pop-api" version = "0.0.0" dependencies = [ "ink", "pop-primitives", - "sp-io", + "sp-io 31.0.0", ] [[package]] name = "pop-chain-extension" version = "0.1.0" dependencies = [ - "frame-support", - "frame-system", - "impl-trait-for-tuples", + "frame-support 29.0.2", + "frame-system 29.0.0", "log", - "pallet-contracts", + "pallet-contracts 28.0.0", "parity-scale-codec", - "sp-core", - "sp-runtime", + "pop-primitives", + "sp-core 29.0.0", + "sp-runtime 32.0.0", "sp-std", ] @@ -4663,19 +4941,19 @@ name = "pop-drink" version = "0.1.0" dependencies = [ "drink", - "frame-support", - "frame-system", + "frame-support 36.0.0", + "frame-system 36.1.0", "ink_sandbox", "pallet-api", - "pallet-assets", - "pallet-balances", - "pallet-contracts", - "pallet-timestamp", + "pallet-assets 37.0.0", + "pallet-balances 37.0.0", + "pallet-contracts 35.0.0", + "pallet-timestamp 35.0.0", "parity-scale-codec", "pop-api", "pop-runtime-devnet", "scale-info", - "sp-io", + "sp-io 37.0.0", ] [[package]] @@ -4690,12 +4968,12 @@ dependencies = [ name = "pop-runtime-common" version = "0.0.0" dependencies = [ - "frame-support", + "frame-support 29.0.2", "parachains-common", "parity-scale-codec", "polkadot-primitives", "scale-info", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", ] @@ -4710,30 +4988,23 @@ dependencies = [ "cumulus-pallet-xcmp-queue", "cumulus-primitives-aura", "cumulus-primitives-core", - "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-utility", - "frame-benchmarking", + "frame-benchmarking 29.0.0", "frame-executive", - "frame-metadata-hash-extension", - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", "hex-literal", - "ismp", - "ismp-parachain", - "ismp-parachain-runtime-api", "log", "pallet-api", - "pallet-assets", + "pallet-assets 30.0.0", "pallet-aura", "pallet-authorship", - "pallet-balances", + "pallet-balances 29.0.2", "pallet-collator-selection", - "pallet-contracts", - "pallet-ismp", - "pallet-ismp-runtime-api", + "pallet-contracts 28.0.0", "pallet-message-queue", "pallet-multisig", "pallet-nft-fractionalization", @@ -4744,38 +5015,37 @@ dependencies = [ "pallet-scheduler", "pallet-session", "pallet-sudo", - "pallet-timestamp", - "pallet-transaction-payment", + "pallet-timestamp 28.0.0", + "pallet-transaction-payment 29.0.2", "pallet-transaction-payment-rpc-runtime-api", "pallet-utility", "pallet-xcm", "parachains-common", "parity-scale-codec", - "polkadot-parachain-primitives", + "polkadot-parachain-primitives 7.0.0", "polkadot-runtime-common", "pop-chain-extension", "pop-primitives", "pop-runtime-common", "scale-info", "smallvec", - "sp-api", + "sp-api 27.0.1", "sp-block-builder", "sp-consensus-aura", - "sp-core", - "sp-genesis-builder", - "sp-inherents", - "sp-io", - "sp-mmr-primitives", + "sp-core 29.0.0", + "sp-genesis-builder 0.8.0", + "sp-inherents 27.0.0", + "sp-io 31.0.0", "sp-offchain", - "sp-runtime", + "sp-runtime 32.0.0", "sp-session", "sp-std", "sp-transaction-pool", - "sp-version", + "sp-version 30.0.0", "staging-parachain-info", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", + "staging-xcm 8.0.1", + "staging-xcm-builder 8.0.3", + "staging-xcm-executor 8.0.2", "substrate-wasm-builder", ] @@ -4880,6 +5150,15 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "psm" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" +dependencies = [ + "cc", +] + [[package]] name = "quote" version = "1.0.37" @@ -4903,7 +5182,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -4913,9 +5192,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", ] +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" + [[package]] name = "rand_core" version = "0.6.4" @@ -4974,19 +5259,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "regalloc2" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" -dependencies = [ - "hashbrown 0.13.2", - "log", - "rustc-hash", - "slice-group-by", - "smallvec", -] - [[package]] name = "regex" version = "1.10.6" @@ -5053,12 +5325,6 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-hex" version = "2.1.0" @@ -5074,6 +5340,20 @@ dependencies = [ "semver 1.0.23", ] +[[package]] +name = "rustix" +version = "0.36.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.1.4", + "windows-sys 0.45.0", +] + [[package]] name = "rustix" version = "0.38.37" @@ -5083,7 +5363,7 @@ dependencies = [ "bitflags 2.6.0", "errno", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.14", "windows-sys 0.52.0", ] @@ -5237,7 +5517,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" dependencies = [ - "ahash", + "ahash 0.8.11", "cfg-if", "hashbrown 0.13.2", ] @@ -5251,10 +5531,10 @@ dependencies = [ "aead", "arrayref", "arrayvec", - "curve25519-dalek", + "curve25519-dalek 4.1.3", "getrandom_or_panic", "merlin", - "rand_core", + "rand_core 0.6.4", "serde_bytes", "sha2 0.10.8", "subtle", @@ -5348,16 +5628,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-utils" -version = "0.1.0" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" -dependencies = [ - "anyhow", - "hex", - "serde", -] - [[package]] name = "serde_bytes" version = "0.11.15" @@ -5556,7 +5826,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -5587,22 +5857,16 @@ dependencies = [ "autocfg", ] -[[package]] -name = "slice-group-by" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" - [[package]] name = "slot-range-helper" -version = "14.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4d67aa9b1ccfd746c8529754c4ce06445b1d48e189567402ef856340a3a6b14" +checksum = "d40fa5e14772407fd2ccffdd5971bf055bbf46a40727c0ea96d2bb6563d17e1c" dependencies = [ "enumn", "parity-scale-codec", "paste", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", ] @@ -5622,6 +5886,28 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "sp-api" +version = "27.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e4f8702afd77f14a32733e2b589c02694bf79d0b3a641963c508016208724d0" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "scale-info", + "sp-api-proc-macro 15.0.1", + "sp-core 29.0.0", + "sp-externalities 0.26.0", + "sp-metadata-ir 0.6.0", + "sp-runtime 32.0.0", + "sp-state-machine 0.36.0", + "sp-std", + "sp-trie 30.0.0", + "sp-version 30.0.0", + "thiserror", +] + [[package]] name = "sp-api" version = "33.0.0" @@ -5632,19 +5918,34 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-api-proc-macro", - "sp-core", - "sp-externalities", - "sp-metadata-ir", - "sp-runtime", - "sp-runtime-interface", - "sp-state-machine", + "sp-api-proc-macro 20.0.0", + "sp-core 34.0.0", + "sp-externalities 0.29.0", + "sp-metadata-ir 0.7.0", + "sp-runtime 38.0.0", + "sp-runtime-interface 28.0.0", + "sp-state-machine 0.42.0", "sp-std", - "sp-trie", - "sp-version", + "sp-trie 36.0.0", + "sp-version 36.0.0", "thiserror", ] +[[package]] +name = "sp-api-proc-macro" +version = "15.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0301e2f77afb450fbf2b093f8b324c7ad88cc82e5e69bd5dc8658a1f068b2a96" +dependencies = [ + "Inflector", + "blake2", + "expander", + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "sp-api-proc-macro" version = "20.0.0" @@ -5660,6 +5961,20 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "sp-application-crypto" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "547cad7a6eabb52c639ec117b3db9c6b43cf1b29a9393b18feb19e101a91833f" +dependencies = [ + "parity-scale-codec", + "scale-info", + "serde", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-std", +] + [[package]] name = "sp-application-crypto" version = "37.0.0" @@ -5669,9 +5984,24 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-io", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-std", +] + +[[package]] +name = "sp-arithmetic" +version = "24.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afa823ca5adc490d47dccb41d69ad482bc57a317bd341de275868378f48f131c" +dependencies = [ + "integer-sqrt", + "num-traits", + "parity-scale-codec", + "scale-info", + "serde", "sp-std", + "static_assertions", ] [[package]] @@ -5692,74 +6022,125 @@ dependencies = [ [[package]] name = "sp-authority-discovery" -version = "33.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a4a1e45abc3277f18484ee0b0f9808e4206eb696ad38500c892c72f33480d69" +checksum = "c92b177c72b5d2973c36d60f6ef942d791d9fd91eae8b08c71882e4118d4fbfc" dependencies = [ "parity-scale-codec", "scale-info", - "sp-api", - "sp-application-crypto", - "sp-runtime", + "sp-api 27.0.1", + "sp-application-crypto 31.0.0", + "sp-runtime 32.0.0", + "sp-std", ] [[package]] name = "sp-block-builder" -version = "33.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cf199dc4f9f77abd3fd91c409759118159ce6ffcd8bc90b229b684ccc8c981f" +checksum = "1b36ce171caa7eb2bbe682c089f755fdefa71d3702e4fb1ba30d10146aef99d5" dependencies = [ - "sp-api", - "sp-inherents", - "sp-runtime", + "sp-api 27.0.1", + "sp-inherents 27.0.0", + "sp-runtime 32.0.0", + "sp-std", ] [[package]] name = "sp-consensus-aura" -version = "0.39.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ebb90bf00f331b898eb729a1f707251846c1d5582d7467f083884799a69b89" +checksum = "4bf13c293685319751f72fa5216c7fb5f25f3e8e8fe29b4503296ed5f5466b3d" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", - "sp-api", - "sp-application-crypto", + "sp-api 27.0.1", + "sp-application-crypto 31.0.0", "sp-consensus-slots", - "sp-inherents", - "sp-runtime", - "sp-timestamp", + "sp-inherents 27.0.0", + "sp-runtime 32.0.0", + "sp-std", + "sp-timestamp 27.0.0", ] [[package]] name = "sp-consensus-babe" -version = "0.39.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3aa2de4c7100a3279658d8dd4affd8f92487528deae5cb4b40322717b9175ed5" +checksum = "b9be2f86a2f0ce2a78b455feb547aa27604fd76a7f7a691995cbad44e0b1b9dd" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", "serde", - "sp-api", - "sp-application-crypto", + "sp-api 27.0.1", + "sp-application-crypto 31.0.0", "sp-consensus-slots", - "sp-core", - "sp-inherents", - "sp-runtime", - "sp-timestamp", + "sp-core 29.0.0", + "sp-inherents 27.0.0", + "sp-runtime 32.0.0", + "sp-std", + "sp-timestamp 27.0.0", ] [[package]] name = "sp-consensus-slots" -version = "0.39.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ca60d713f8ddb03bbebcc755d5e6463fdc0b6259fabfc4221b20a5f1e428fd" +checksum = "73a5bd1fcd84bbdc7255528c7cdb92f9357fd555f06ee553af7e340cbdab517c" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-timestamp", + "sp-std", + "sp-timestamp 27.0.0", +] + +[[package]] +name = "sp-core" +version = "29.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c33c7a1568175250628567d50c4e1c54a6ac5bc1190413b9be29a9e810cbe73" +dependencies = [ + "array-bytes", + "bip39", + "bitflags 1.3.2", + "blake2", + "bounded-collections", + "bs58", + "dyn-clonable", + "ed25519-zebra 3.1.0", + "futures", + "hash-db", + "hash256-std-hasher", + "impl-serde", + "itertools 0.10.5", + "libsecp256k1", + "log", + "merlin", + "parity-scale-codec", + "parking_lot", + "paste", + "primitive-types", + "rand", + "scale-info", + "schnorrkel", + "secp256k1", + "secrecy", + "serde", + "sp-crypto-hashing", + "sp-debug-derive", + "sp-externalities 0.26.0", + "sp-runtime-interface 25.0.0", + "sp-std", + "sp-storage 20.0.0", + "ss58-registry", + "substrate-bip39 0.4.6", + "thiserror", + "tracing", + "w3f-bls", + "zeroize", ] [[package]] @@ -5774,7 +6155,7 @@ dependencies = [ "bounded-collections", "bs58", "dyn-clonable", - "ed25519-zebra", + "ed25519-zebra 4.0.3", "futures", "hash-db", "hash256-std-hasher", @@ -5797,12 +6178,12 @@ dependencies = [ "serde", "sp-crypto-hashing", "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", + "sp-externalities 0.29.0", + "sp-runtime-interface 28.0.0", "sp-std", - "sp-storage", + "sp-storage 21.0.0", "ss58-registry", - "substrate-bip39", + "substrate-bip39 0.6.0", "thiserror", "tracing", "w3f-bls", @@ -5845,6 +6226,18 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "sp-externalities" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7096ed024cec397804864898b093b51e14c7299f1d00c67dd5800330e02bb82" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std", + "sp-storage 20.0.0", +] + [[package]] name = "sp-externalities" version = "0.29.0" @@ -5853,7 +6246,19 @@ checksum = "a904407d61cb94228c71b55a9d3708e9d6558991f9e83bd42bd91df37a159d30" dependencies = [ "environmental", "parity-scale-codec", - "sp-storage", + "sp-storage 21.0.0", +] + +[[package]] +name = "sp-genesis-builder" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd865540ec19479c7349b584ccd78cc34c3f3a628a2a69dbb6365ceec36295ee" +dependencies = [ + "serde_json", + "sp-api 27.0.1", + "sp-runtime 32.0.0", + "sp-std", ] [[package]] @@ -5865,8 +6270,23 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde_json", - "sp-api", - "sp-runtime", + "sp-api 33.0.0", + "sp-runtime 38.0.0", +] + +[[package]] +name = "sp-inherents" +version = "27.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "607c9e35e96966645ff180a9e9f976433b96e905d0a91d8d5315e605a21f4bc0" +dependencies = [ + "async-trait", + "impl-trait-for-tuples", + "parity-scale-codec", + "scale-info", + "sp-runtime 32.0.0", + "sp-std", + "thiserror", ] [[package]] @@ -5879,10 +6299,36 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime", + "sp-runtime 38.0.0", "thiserror", ] +[[package]] +name = "sp-io" +version = "31.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec43aa073eab35fcb920d7592474d5427ea3be2bf938706a3ad955d7ba54fd8d" +dependencies = [ + "bytes", + "ed25519-dalek", + "libsecp256k1", + "log", + "parity-scale-codec", + "rustversion", + "secp256k1", + "sp-core 29.0.0", + "sp-crypto-hashing", + "sp-externalities 0.26.0", + "sp-keystore 0.35.0", + "sp-runtime-interface 25.0.0", + "sp-state-machine 0.36.0", + "sp-std", + "sp-tracing 16.0.0", + "sp-trie 30.0.0", + "tracing", + "tracing-core", +] + [[package]] name = "sp-io" version = "37.0.0" @@ -5897,19 +6343,32 @@ dependencies = [ "polkavm-derive 0.9.1", "rustversion", "secp256k1", - "sp-core", + "sp-core 34.0.0", "sp-crypto-hashing", - "sp-externalities", - "sp-keystore", - "sp-runtime-interface", - "sp-state-machine", + "sp-externalities 0.29.0", + "sp-keystore 0.40.0", + "sp-runtime-interface 28.0.0", + "sp-state-machine 0.42.0", "sp-std", - "sp-tracing", - "sp-trie", + "sp-tracing 17.0.0", + "sp-trie 36.0.0", "tracing", "tracing-core", ] +[[package]] +name = "sp-keystore" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "444f2d53968b1ce5e908882710ff1f3873fcf3e95f59d57432daf685bbacb959" +dependencies = [ + "parity-scale-codec", + "parking_lot", + "sp-core 29.0.0", + "sp-externalities 0.26.0", + "thiserror", +] + [[package]] name = "sp-keystore" version = "0.40.0" @@ -5918,8 +6377,8 @@ checksum = "0248b4d784cb4a01472276928977121fa39d977a5bb24793b6b15e64b046df42" dependencies = [ "parity-scale-codec", "parking_lot", - "sp-core", - "sp-externalities", + "sp-core 34.0.0", + "sp-externalities 0.29.0", ] [[package]] @@ -5934,56 +6393,51 @@ dependencies = [ [[package]] name = "sp-metadata-ir" -version = "0.7.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a616fa51350b35326682a472ee8e6ba742fdacb18babac38ecd46b3e05ead869" +checksum = "fa0b5e87e56c1bb26d9524d48dd127121d630f895bd5914a34f0b017489f7c1d" dependencies = [ "frame-metadata", "parity-scale-codec", "scale-info", + "sp-std", ] [[package]] -name = "sp-mmr-primitives" -version = "33.0.0" +name = "sp-metadata-ir" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47412a2d2e988430d5f59d7fec1473f229e1ef5ce24c1ea4f601b4b3679cac52" +checksum = "a616fa51350b35326682a472ee8e6ba742fdacb18babac38ecd46b3e05ead869" dependencies = [ - "log", + "frame-metadata", "parity-scale-codec", - "polkadot-ckb-merkle-mountain-range", "scale-info", - "serde", - "sp-api", - "sp-core", - "sp-debug-derive", - "sp-runtime", - "thiserror", ] [[package]] name = "sp-npos-elections" -version = "33.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b0c51a7b60cd663f2661e6949069eb316b092f22c239691d5272a4d0cfca0fb" +checksum = "195d7e1154c91cce5c3abc8c778689c3e5799da6411328dd32ac7a974c68e526" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic", - "sp-core", - "sp-runtime", + "sp-arithmetic 24.0.0", + "sp-core 29.0.0", + "sp-runtime 32.0.0", + "sp-std", ] [[package]] name = "sp-offchain" -version = "33.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbe721c367760bddf10fcfa24fb48edd64c442f71db971f043c8ac73f51aa6e9" +checksum = "4d83b955dce0b6d143bec3f60571311168f362b1c16cf044da7037a407b66c19" dependencies = [ - "sp-api", - "sp-core", - "sp-runtime", + "sp-api 27.0.1", + "sp-core 29.0.0", + "sp-runtime 32.0.0", ] [[package]] @@ -5997,6 +6451,31 @@ dependencies = [ "regex", ] +[[package]] +name = "sp-runtime" +version = "32.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a95e71603a6281e91b0f1fd3d68057644be16d75a4602013187b8137db8abee" +dependencies = [ + "docify", + "either", + "hash256-std-hasher", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "paste", + "rand", + "scale-info", + "serde", + "simple-mermaid", + "sp-application-crypto 31.0.0", + "sp-arithmetic 24.0.0", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-std", + "sp-weights 28.0.0", +] + [[package]] name = "sp-runtime" version = "38.0.0" @@ -6015,12 +6494,31 @@ dependencies = [ "scale-info", "serde", "simple-mermaid", - "sp-application-crypto", - "sp-arithmetic", - "sp-core", - "sp-io", + "sp-application-crypto 37.0.0", + "sp-arithmetic 26.0.0", + "sp-core 34.0.0", + "sp-io 37.0.0", "sp-std", - "sp-weights", + "sp-weights 31.0.0", +] + +[[package]] +name = "sp-runtime-interface" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e2321ab29d4bcc31f1ba1b4f076a81fb2a666465231e5c981c72320d74dbe63" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types", + "sp-externalities 0.26.0", + "sp-runtime-interface-proc-macro 17.0.0", + "sp-std", + "sp-storage 20.0.0", + "sp-tracing 16.0.0", + "sp-wasm-interface 20.0.0", + "static_assertions", ] [[package]] @@ -6034,15 +6532,29 @@ dependencies = [ "parity-scale-codec", "polkavm-derive 0.9.1", "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", + "sp-externalities 0.29.0", + "sp-runtime-interface-proc-macro 18.0.0", "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", + "sp-storage 21.0.0", + "sp-tracing 17.0.0", + "sp-wasm-interface 21.0.0", "static_assertions", ] +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "17.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfaf6e85b2ec12a4b99cd6d8d57d083e30c94b7f1b0d8f93547121495aae6f0c" +dependencies = [ + "Inflector", + "expander", + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "sp-runtime-interface-proc-macro" version = "18.0.0" @@ -6059,17 +6571,33 @@ dependencies = [ [[package]] name = "sp-session" -version = "34.0.0" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b86531090cc04d2ab3535df07146258e2fb3ab6257b0a77ef14aa08282c3d4a" +dependencies = [ + "parity-scale-codec", + "scale-info", + "sp-api 27.0.1", + "sp-core 29.0.0", + "sp-keystore 0.35.0", + "sp-runtime 32.0.0", + "sp-staking 27.0.0", + "sp-std", +] + +[[package]] +name = "sp-staking" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4daf2e40ffc7e7e8de08efb860eb9534faf614a49c53dc282f430faedb4aed13" +checksum = "1e14d003ecf0b610bf1305a92bdab875289b39d514c073f30e75e78c2763a788" dependencies = [ + "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-api", - "sp-core", - "sp-keystore", - "sp-runtime", - "sp-staking", + "serde", + "sp-core 29.0.0", + "sp-runtime 32.0.0", + "sp-std", ] [[package]] @@ -6082,8 +6610,30 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core", - "sp-runtime", + "sp-core 34.0.0", + "sp-runtime 38.0.0", +] + +[[package]] +name = "sp-state-machine" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a67297e702aa32027d7766803f362a420d6d3ec9e2f84961f3c64e2e52b5aaf9" +dependencies = [ + "hash-db", + "log", + "parity-scale-codec", + "parking_lot", + "rand", + "smallvec", + "sp-core 29.0.0", + "sp-externalities 0.26.0", + "sp-panic-handler", + "sp-std", + "sp-trie 30.0.0", + "thiserror", + "tracing", + "trie-db 0.28.0", ] [[package]] @@ -6098,13 +6648,13 @@ dependencies = [ "parking_lot", "rand", "smallvec", - "sp-core", - "sp-externalities", + "sp-core 34.0.0", + "sp-externalities 0.29.0", "sp-panic-handler", - "sp-trie", + "sp-trie 36.0.0", "thiserror", "tracing", - "trie-db", + "trie-db 0.29.1", ] [[package]] @@ -6113,6 +6663,20 @@ version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" +[[package]] +name = "sp-storage" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dba5791cb3978e95daf99dad919ecb3ec35565604e88cd38d805d9d4981e8bd" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive", + "sp-std", +] + [[package]] name = "sp-storage" version = "21.0.0" @@ -6126,6 +6690,20 @@ dependencies = [ "sp-debug-derive", ] +[[package]] +name = "sp-timestamp" +version = "27.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "249cd06624f2edb53b25af528ab216a508dc9d0870e158b43caac3a97e86699f" +dependencies = [ + "async-trait", + "parity-scale-codec", + "sp-inherents 27.0.0", + "sp-runtime 32.0.0", + "sp-std", + "thiserror", +] + [[package]] name = "sp-timestamp" version = "33.0.0" @@ -6134,11 +6712,24 @@ checksum = "78becf144a76f6fd108dfe94a90e20a185b38c0b310dc5482328196143c8266b" dependencies = [ "async-trait", "parity-scale-codec", - "sp-inherents", - "sp-runtime", + "sp-inherents 33.0.0", + "sp-runtime 38.0.0", "thiserror", ] +[[package]] +name = "sp-tracing" +version = "16.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0351810b9d074df71c4514c5228ed05c250607cba131c1c9d1526760ab69c05c" +dependencies = [ + "parity-scale-codec", + "sp-std", + "tracing", + "tracing-core", + "tracing-subscriber", +] + [[package]] name = "sp-tracing" version = "17.0.0" @@ -6153,12 +6744,37 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "33.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3c9d1604aadc15b70e95f4388d0b1aa380215520b7ddfd372531a6d8262269c" +checksum = "9742861c5330bdcb42856a6eed3d3745b58ee1c92ca4c9260032ff4e6c387165" dependencies = [ - "sp-api", - "sp-runtime", + "sp-api 27.0.1", + "sp-runtime 32.0.0", +] + +[[package]] +name = "sp-trie" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed48dfd05081e8b36741b10ce4eb686c135a2952227a11fe71caec89890ddbb" +dependencies = [ + "ahash 0.8.11", + "hash-db", + "lazy_static", + "memory-db", + "nohash-hasher", + "parity-scale-codec", + "parking_lot", + "rand", + "scale-info", + "schnellru", + "sp-core 29.0.0", + "sp-externalities 0.26.0", + "sp-std", + "thiserror", + "tracing", + "trie-db 0.28.0", + "trie-root", ] [[package]] @@ -6167,7 +6783,7 @@ version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d717c0f465f5371569e6fdc25b6f32d47c15d6e4c92b3b779e1c9b18b951d" dependencies = [ - "ahash", + "ahash 0.8.11", "hash-db", "lazy_static", "memory-db", @@ -6177,14 +6793,32 @@ dependencies = [ "rand", "scale-info", "schnellru", - "sp-core", - "sp-externalities", + "sp-core 34.0.0", + "sp-externalities 0.29.0", "thiserror", "tracing", - "trie-db", + "trie-db 0.29.1", "trie-root", ] +[[package]] +name = "sp-version" +version = "30.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff4a660c68995663d6778df324f4e2b4efc48d55a8e9c92c22a5fb7dae7899cd" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "parity-wasm", + "scale-info", + "serde", + "sp-crypto-hashing-proc-macro", + "sp-runtime 32.0.0", + "sp-std", + "sp-version-proc-macro 13.0.0", + "thiserror", +] + [[package]] name = "sp-version" version = "36.0.0" @@ -6197,12 +6831,24 @@ dependencies = [ "scale-info", "serde", "sp-crypto-hashing-proc-macro", - "sp-runtime", + "sp-runtime 38.0.0", "sp-std", - "sp-version-proc-macro", + "sp-version-proc-macro 14.0.0", "thiserror", ] +[[package]] +name = "sp-version-proc-macro" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9bc3fed32d6dacbbbfb28dd1fe0224affbb737cb6cbfca1d9149351c2b69a7d" +dependencies = [ + "parity-scale-codec", + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "sp-version-proc-macro" version = "14.0.0" @@ -6210,9 +6856,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aee8f6730641a65fcf0c8f9b1e448af4b3bb083d08058b47528188bccc7b7a7" dependencies = [ "parity-scale-codec", - "proc-macro2", - "quote", - "syn 2.0.77", + "proc-macro2", + "quote", + "syn 2.0.77", +] + +[[package]] +name = "sp-wasm-interface" +version = "20.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ef97172c42eb4c6c26506f325f48463e9bc29b2034a587f1b9e48c751229bee" +dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-std", + "wasmtime", ] [[package]] @@ -6226,6 +6886,22 @@ dependencies = [ "parity-scale-codec", ] +[[package]] +name = "sp-weights" +version = "28.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3be30aec904994451dcacf841a9168cfbbaf817de6b24b6a1c1418cbf1af2fe" +dependencies = [ + "bounded-collections", + "parity-scale-codec", + "scale-info", + "serde", + "smallvec", + "sp-arithmetic 24.0.0", + "sp-debug-derive", + "sp-std", +] + [[package]] name = "sp-weights" version = "31.0.0" @@ -6237,7 +6913,7 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-arithmetic", + "sp-arithmetic 26.0.0", "sp-debug-derive", ] @@ -6280,19 +6956,38 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-parachain-info" -version = "0.15.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd00d586b0dac4f42736bdd0ad52213a891b240e011ea82b38938263dd821c25" +checksum = "da7dc139d104f676a18c13380a09c3f72d59450a7471116387cbf8cb5f845a0e" dependencies = [ "cumulus-primitives-core", - "frame-support", - "frame-system", + "frame-support 29.0.2", + "frame-system 29.0.0", "parity-scale-codec", "scale-info", - "sp-runtime", + "sp-runtime 32.0.0", "sp-std", ] +[[package]] +name = "staging-xcm" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fa328b87de3466bc38cc9a07244c42c647b7755b81115e1dfeb47cc13fc6e6" +dependencies = [ + "array-bytes", + "bounded-collections", + "derivative", + "environmental", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-weights 28.0.0", + "xcm-procedural 8.0.0", +] + [[package]] name = "staging-xcm" version = "14.1.0" @@ -6308,8 +7003,31 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-weights", - "xcm-procedural", + "sp-weights 31.0.0", + "xcm-procedural 10.1.0", +] + +[[package]] +name = "staging-xcm-builder" +version = "8.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b7447c38be3ca9fb21c7434de2243aa6ac74acde8944cda7bb6e2a4f765801" +dependencies = [ + "frame-support 29.0.2", + "frame-system 29.0.0", + "impl-trait-for-tuples", + "log", + "pallet-transaction-payment 29.0.2", + "parity-scale-codec", + "polkadot-parachain-primitives 7.0.0", + "scale-info", + "sp-arithmetic 24.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", + "sp-std", + "sp-weights 28.0.0", + "staging-xcm 8.0.1", + "staging-xcm-executor 8.0.2", ] [[package]] @@ -6318,21 +7036,43 @@ version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "847fa2afe1bed2751eaabf7b91fa4043037947f17653d7cc59ea202cc44c6bb8" dependencies = [ - "frame-support", - "frame-system", + "frame-support 36.0.0", + "frame-system 36.1.0", + "impl-trait-for-tuples", + "log", + "pallet-transaction-payment 36.0.0", + "parity-scale-codec", + "polkadot-parachain-primitives 13.0.0", + "scale-info", + "sp-arithmetic 26.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.0", + "sp-std", + "sp-weights 31.0.0", + "staging-xcm 14.1.0", + "staging-xcm-executor 15.0.0", +] + +[[package]] +name = "staging-xcm-executor" +version = "8.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74b5c5f2a1d610c5e20e5fae2680c9a28380f305afafeed62f341bfbce57b79a" +dependencies = [ + "environmental", + "frame-benchmarking 29.0.0", + "frame-support 29.0.2", "impl-trait-for-tuples", "log", - "pallet-transaction-payment", "parity-scale-codec", - "polkadot-parachain-primitives", "scale-info", - "sp-arithmetic", - "sp-io", - "sp-runtime", + "sp-arithmetic 24.0.0", + "sp-core 29.0.0", + "sp-io 31.0.0", + "sp-runtime 32.0.0", "sp-std", - "sp-weights", - "staging-xcm", - "staging-xcm-executor", + "sp-weights 28.0.0", + "staging-xcm 8.0.1", ] [[package]] @@ -6342,19 +7082,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26b98d8219449eaf02e71a7edf1a14b14d4c713dd01d9df66fde1ce30dba4d6d" dependencies = [ "environmental", - "frame-benchmarking", - "frame-support", + "frame-benchmarking 36.0.0", + "frame-support 36.0.0", "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", - "sp-arithmetic", - "sp-core", - "sp-io", - "sp-runtime", + "sp-arithmetic 26.0.0", + "sp-core 34.0.0", + "sp-io 37.0.0", + "sp-runtime 38.0.0", "sp-std", - "sp-weights", - "staging-xcm", + "sp-weights 31.0.0", + "staging-xcm 14.1.0", ] [[package]] @@ -6391,6 +7131,9 @@ name = "strum" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros 0.24.3", +] [[package]] name = "strum" @@ -6429,49 +7172,43 @@ dependencies = [ [[package]] name = "substrate-bip39" -version = "0.6.0" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" +checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" dependencies = [ - "hmac 0.12.1", - "pbkdf2", + "hmac 0.11.0", + "pbkdf2 0.8.0", "schnorrkel", - "sha2 0.10.8", + "sha2 0.9.9", "zeroize", ] [[package]] -name = "substrate-state-machine" -version = "1.15.0" -source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" +name = "substrate-bip39" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" dependencies = [ - "frame-support", - "hash-db", - "ismp", - "pallet-ismp", - "parity-scale-codec", - "primitive-types", - "scale-info", - "serde", - "sp-consensus-aura", - "sp-runtime", - "sp-trie", + "hmac 0.12.1", + "pbkdf2 0.12.2", + "schnorrkel", + "sha2 0.10.8", + "zeroize", ] [[package]] name = "substrate-wasm-builder" -version = "23.0.0" +version = "18.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dc993ad871b63fbba60362f3ea86583f5e7e1256e8fdcb3b5b249c9ead354bf" +checksum = "4a39a20e17c24ede36b5bd5e7543a4cef8d8a0daf6e1a046dc31832b837a54a0" dependencies = [ "build-helper", "cargo_metadata 0.15.4", "console", "filetime", "parity-wasm", - "polkavm-linker", "sp-maybe-compressed-blob", - "strum 0.26.3", + "strum 0.24.1", "tempfile", "toml", "walkdir", @@ -6523,6 +7260,12 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "target-lexicon" +version = "0.12.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" + [[package]] name = "tempfile" version = "3.12.0" @@ -6532,7 +7275,7 @@ dependencies = [ "cfg-if", "fastrand", "once_cell", - "rustix", + "rustix 0.38.37", "windows-sys 0.59.0", ] @@ -6819,6 +7562,19 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "trie-db" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff28e0f815c2fea41ebddf148e008b077d2faddb026c9555b29696114d602642" +dependencies = [ + "hash-db", + "hashbrown 0.13.2", + "log", + "rustc-hex", + "smallvec", +] + [[package]] name = "trie-db" version = "0.29.1" @@ -6978,7 +7734,7 @@ dependencies = [ "digest 0.10.7", "rand", "rand_chacha", - "rand_core", + "rand_core 0.6.4", "sha2 0.10.8", "sha3", "thiserror", @@ -7123,6 +7879,19 @@ dependencies = [ "cxx-build", ] +[[package]] +name = "wasmi" +version = "0.31.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8281d1d660cdf54c76a3efa9ddd0c270cada1383a995db3ccb43d166456c7" +dependencies = [ + "smallvec", + "spin", + "wasmi_arena", + "wasmi_core 0.13.0", + "wasmparser-nostd", +] + [[package]] name = "wasmi" version = "0.32.3" @@ -7136,21 +7905,39 @@ dependencies = [ "smallvec", "spin", "wasmi_collections", - "wasmi_core", + "wasmi_core 0.32.3", "wasmparser-nostd", ] +[[package]] +name = "wasmi_arena" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" + [[package]] name = "wasmi_collections" version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c128c039340ffd50d4195c3f8ce31aac357f06804cfc494c8b9508d4b30dca4" dependencies = [ - "ahash", + "ahash 0.8.11", "hashbrown 0.14.5", "string-interner", ] +[[package]] +name = "wasmi_core" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" +dependencies = [ + "downcast-rs", + "libm", + "num-traits", + "paste", +] + [[package]] name = "wasmi_core" version = "0.32.3" @@ -7163,6 +7950,16 @@ dependencies = [ "paste", ] +[[package]] +name = "wasmparser" +version = "0.102.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" +dependencies = [ + "indexmap 1.9.3", + "url", +] + [[package]] name = "wasmparser-nostd" version = "0.100.2" @@ -7172,6 +7969,138 @@ dependencies = [ "indexmap-nostd", ] +[[package]] +name = "wasmtime" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" +dependencies = [ + "anyhow", + "bincode", + "cfg-if", + "indexmap 1.9.3", + "libc", + "log", + "object 0.30.4", + "once_cell", + "paste", + "psm", + "serde", + "target-lexicon", + "wasmparser", + "wasmtime-environ", + "wasmtime-jit", + "wasmtime-runtime", + "windows-sys 0.45.0", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "wasmtime-environ" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" +dependencies = [ + "anyhow", + "cranelift-entity", + "gimli 0.27.3", + "indexmap 1.9.3", + "log", + "object 0.30.4", + "serde", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-types", +] + +[[package]] +name = "wasmtime-jit" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" +dependencies = [ + "addr2line 0.19.0", + "anyhow", + "bincode", + "cfg-if", + "cpp_demangle", + "gimli 0.27.3", + "log", + "object 0.30.4", + "rustc-demangle", + "serde", + "target-lexicon", + "wasmtime-environ", + "wasmtime-jit-icache-coherence", + "wasmtime-runtime", + "windows-sys 0.45.0", +] + +[[package]] +name = "wasmtime-jit-debug" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" +dependencies = [ + "once_cell", +] + +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" +dependencies = [ + "cfg-if", + "libc", + "windows-sys 0.45.0", +] + +[[package]] +name = "wasmtime-runtime" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" +dependencies = [ + "anyhow", + "cc", + "cfg-if", + "indexmap 1.9.3", + "libc", + "log", + "mach", + "memfd", + "memoffset", + "paste", + "rand", + "rustix 0.36.17", + "wasmtime-asm-macros", + "wasmtime-environ", + "wasmtime-jit-debug", + "windows-sys 0.45.0", +] + +[[package]] +name = "wasmtime-types" +version = "8.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" +dependencies = [ + "cranelift-entity", + "serde", + "thiserror", + "wasmparser", +] + [[package]] name = "wast" version = "217.0.0" @@ -7202,7 +8131,7 @@ checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f" dependencies = [ "either", "home", - "rustix", + "rustix 0.38.37", "winsafe", ] @@ -7256,6 +8185,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -7283,6 +8221,21 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -7314,6 +8267,12 @@ dependencies = [ "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -7326,6 +8285,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -7338,6 +8303,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -7356,6 +8327,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -7368,6 +8345,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -7380,6 +8363,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -7392,6 +8381,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -7439,9 +8434,9 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "10.1.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fb4f14094d65c500a59bcf540cf42b99ee82c706edd6226a92e769ad60563e" +checksum = "f4717a97970a9cda70d7db53cf50d2615c2f6f6b7c857445325b4a39ea7aa2cd" dependencies = [ "Inflector", "proc-macro2", @@ -7450,19 +8445,15 @@ dependencies = [ ] [[package]] -name = "xcm-runtime-apis" -version = "0.2.0" +name = "xcm-procedural" +version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30fffcd9128a46abd836c37dd001c2cbe122aeb8904cd7b9bac8358564fb7b56" +checksum = "87fb4f14094d65c500a59bcf540cf42b99ee82c706edd6226a92e769ad60563e" dependencies = [ - "frame-support", - "parity-scale-codec", - "scale-info", - "sp-api", - "sp-std", - "sp-weights", - "staging-xcm", - "staging-xcm-executor", + "Inflector", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] From 5ea730b4d05f0fe2e9409f726c9bdb34913dc760 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Fri, 11 Oct 2024 18:14:13 +0700 Subject: [PATCH 29/43] fix: doc --- crates/pop-drink/src/error.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/crates/pop-drink/src/error.rs b/crates/pop-drink/src/error.rs index 35b49de..d7cad05 100644 --- a/crates/pop-drink/src/error.rs +++ b/crates/pop-drink/src/error.rs @@ -134,6 +134,14 @@ where /// Asserts that a `Result` with an error type convertible to `u32` matches the expected `Error` /// from pop-drink. /// +/// The macro is used to test a custom error which is returned by the API if the error doesn't conform to the provided API error (e.g., [`PSP22Error`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/v0/fungibles/errors.rs#L73C1-L73C22)). The custom error is represented by a [`StatusCode`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/lib.rs#L33), which encapsulates a `u32` value indicating the success or failure of a runtime call via the Pop API. +/// +/// Pop DRink! provides an error type and a [macro](https://doc.rust-lang.org/book/ch19-06-macros.html) to simplify testing both runtime module errors and API errors. +/// +/// - `Error`: Runtime error for efficiently testing both runtime module errors and API errors. +/// - `assert_err`: Asserts that a `Result` with an error type convertible to `u32` matches the +/// expected `Error` from pop-drink. +/// /// # Parameters /// /// - `result` - The `Result` from a smart contract method, where `E` must be convertible to @@ -143,17 +151,7 @@ where /// /// # Examples /// -/// The below example interacts with a [PSP22](https://github.com/w3f/PSPs/blob/master/PSPs/psp-22.md) contract that uses [Pop API](https://github.com/r0gue-io/pop-node/tree/main/pop-api). The contract method returns [`PSP22Error`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/v0/fungibles/errors.rs#L73C1-L73C22) which is provided by Pop API library. -/// Learn more in the [PSP22 example contract](https://github.com/r0gue-io/pop-node/blob/main/pop-api/examples/fungibles/lib.rs). -/// -/// The macro is used to test a customer error which is returned by the API if the error doesn't conform to the [`PSP22Error`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/v0/fungibles/errors.rs#L73C1-L73C22) standard. -/// The custom error is represented by a [`StatusCode`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/lib.rs#L33), which encapsulates a `u32` value indicating the success or failure of a runtime call via the Pop API. -/// -/// Pop DRink! provides an error type and a [macro](https://doc.rust-lang.org/book/ch19-06-macros.html) to simplify testing both runtime module errors and API errors. -/// -/// - `Error`: Runtime error for efficiently testing both runtime module errors and API errors. -/// - `assert_err`: Asserts that a `Result` with an error type convertible to `u32` matches the -/// expected `Error` from pop-drink. +/// The below example interacts with a [PSP22](https://github.com/w3f/PSPs/blob/master/PSPs/psp-22.md) contract that uses [Pop API](https://github.com/r0gue-io/pop-node/tree/main/pop-api). The contract method returns the API error [`PSP22Error`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/v0/fungibles/errors.rs#L73C1-L73C22) which is provided by Pop API library. Learn more in the [PSP22 example contract](https://github.com/r0gue-io/pop-node/blob/main/pop-api/examples/fungibles/lib.rs). /// /// Note: `PSP22Error` is used here only as an example. The test suite utility library provided by /// Pop DRink! is not limited to a single specific error type. From 30405b4adab24c8e3dd273640b46abe12cba74de Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Tue, 15 Oct 2024 16:49:28 +0700 Subject: [PATCH 30/43] fix: doc --- Cargo.lock | 2959 +++++++++++---------------------- crates/pop-drink/src/error.rs | 187 +-- crates/pop-drink/src/lib.rs | 9 +- 3 files changed, 1068 insertions(+), 2087 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 67c09c6..ee655c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,15 +12,6 @@ dependencies = [ "regex", ] -[[package]] -name = "addr2line" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" -dependencies = [ - "gimli 0.27.3", -] - [[package]] name = "addr2line" version = "0.24.1" @@ -46,17 +37,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.11" @@ -363,7 +343,7 @@ version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "addr2line 0.24.1", + "addr2line", "cfg-if", "libc", "miniz_oxide", @@ -402,28 +382,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bip39" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33415e24172c1b7d6066f6d999545375ab8e1d95421d6784bdfff9496f292387" -dependencies = [ - "bitcoin_hashes", - "rand", - "rand_core 0.6.4", - "serde", - "unicode-normalization", -] - [[package]] name = "bitcoin-internals" version = "0.2.0" @@ -561,14 +519,14 @@ dependencies = [ [[package]] name = "bp-xcm-bridge-hub-router" -version = "0.7.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ff4abe93be7bc1663adc41817b1aa3476fbec953ce361537419924310d5dd4" +checksum = "b7dae4d1ec894ee920195dd39070b279ef3c1d4d078c3fcf7336c93a1d502a9d" dependencies = [ "parity-scale-codec", "scale-info", - "sp-core 29.0.0", - "sp-runtime 32.0.0", + "sp-core", + "sp-runtime", ] [[package]] @@ -719,6 +677,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "ckb-merkle-mountain-range" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ccb671c5921be8a84686e6212ca184cb1d7c51cadcdbfcbd1cc3f042f5dfb8" +dependencies = [ + "cfg-if", +] + [[package]] name = "clap" version = "4.5.18" @@ -965,15 +932,6 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" -[[package]] -name = "cpp_demangle" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" -dependencies = [ - "cfg-if", -] - [[package]] name = "cpufeatures" version = "0.2.14" @@ -983,15 +941,6 @@ dependencies = [ "libc", ] -[[package]] -name = "cranelift-entity" -version = "0.95.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40099d38061b37e505e63f89bab52199037a72b931ad4868d9089ff7268660b0" -dependencies = [ - "serde", -] - [[package]] name = "crc32fast" version = "1.4.2" @@ -1061,7 +1010,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "subtle", "zeroize", ] @@ -1073,7 +1022,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "typenum", ] @@ -1087,40 +1036,30 @@ dependencies = [ "subtle", ] -[[package]] -name = "crypto-mac" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" -dependencies = [ - "generic-array", - "subtle", -] - [[package]] name = "cumulus-pallet-aura-ext" -version = "0.8.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8e78b18548ae3454bc8a46e2bc2e3f521ea547844cbaecc9344d4741f4b1ef" +checksum = "c5e8af48090936c45483d489ee681acb54277763586b53fa3dbd17173aa474fc" dependencies = [ "cumulus-pallet-parachain-system", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-support", + "frame-system", "pallet-aura", - "pallet-timestamp 28.0.0", + "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-application-crypto 31.0.0", + "sp-application-crypto", "sp-consensus-aura", - "sp-runtime 32.0.0", + "sp-runtime", "sp-std", ] [[package]] name = "cumulus-pallet-parachain-system" -version = "0.8.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a215fe4d66d23e8f3956bd21b9d80d2b33239f3b150b36d56fa238cfc9421a5" +checksum = "300d5509bd8ac95bafe158fa475278315175a4eb0422c2cd82e08e8b9dde035c" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -1128,28 +1067,29 @@ dependencies = [ "cumulus-primitives-parachain-inherent", "cumulus-primitives-proof-size-hostfunction", "environmental", - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", "pallet-message-queue", "parity-scale-codec", - "polkadot-parachain-primitives 7.0.0", + "polkadot-parachain-primitives", "polkadot-runtime-common", "polkadot-runtime-parachains", "scale-info", - "sp-core 29.0.0", - "sp-externalities 0.26.0", - "sp-inherents 27.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", - "sp-state-machine 0.36.0", + "sp-core", + "sp-externalities", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-state-machine", "sp-std", - "sp-trie 30.0.0", - "sp-version 30.0.0", - "staging-xcm 8.0.1", - "trie-db 0.28.0", + "sp-trie", + "sp-version", + "staging-xcm", + "staging-xcm-builder", + "trie-db", ] [[package]] @@ -1166,154 +1106,162 @@ dependencies = [ [[package]] name = "cumulus-pallet-session-benchmarking" -version = "10.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f3259f743f70f39baa3abf2d9d8de864e18120465f8731b99bef039a3bf9329" +checksum = "506daacefa861aa2909b64f26e76495ce029227fd8355b97e074cc1d5dc54ab2" dependencies = [ - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "pallet-session", "parity-scale-codec", - "sp-runtime 32.0.0", + "sp-runtime", "sp-std", ] [[package]] name = "cumulus-pallet-xcm" -version = "0.8.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e802291060763f8d1176bf808da97aafe5afe7351f62bb093c317c1d35c5cee" +checksum = "8d5224285f60e5159bab549f458079d606a7f95ef779def8b89f1a244dc7cf81" dependencies = [ "cumulus-primitives-core", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-io", + "sp-runtime", "sp-std", - "staging-xcm 8.0.1", + "staging-xcm", ] [[package]] name = "cumulus-pallet-xcmp-queue" -version = "0.8.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa22d6e479a4d3a2790bab291269ba0917a1ac384255a54a2ebc3f7c37e505e" +checksum = "0adf5409618b21e754fef0ac70f257878d22d61c48fdeefcab666835dcb8e0f0" dependencies = [ "bounded-collections", "bp-xcm-bridge-hub-router", "cumulus-primitives-core", - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "pallet-message-queue", "parity-scale-codec", "polkadot-runtime-common", "polkadot-runtime-parachains", "scale-info", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-std", - "staging-xcm 8.0.1", - "staging-xcm-executor 8.0.2", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] name = "cumulus-primitives-aura" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f07d6177692154043d7ddcc0b87ca5365ae8e4d94b90d9931f6b2f76e162f09" +checksum = "3e7977947ad43a4cbc532ca33abcde136ae3deffdc7168b2ae253d73ccd371e4" dependencies = [ "parity-scale-codec", - "polkadot-core-primitives 8.0.0", + "polkadot-core-primitives", "polkadot-primitives", - "sp-api 27.0.1", + "sp-api", "sp-consensus-aura", - "sp-runtime 32.0.0", + "sp-runtime", "sp-std", ] [[package]] name = "cumulus-primitives-core" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9df07f6825fd50ea30aae335e43dc1a615a05de7465f5f329b9e414f2c886a12" +checksum = "751e64b89a839d5cfabebc1c797936e5eee791d0fa2322d91e86f8440a743ddb" dependencies = [ "parity-scale-codec", - "polkadot-core-primitives 8.0.0", - "polkadot-parachain-primitives 7.0.0", + "polkadot-core-primitives", + "polkadot-parachain-primitives", "polkadot-primitives", "scale-info", - "sp-api 27.0.1", - "sp-runtime 32.0.0", + "sp-api", + "sp-runtime", "sp-std", - "sp-trie 30.0.0", - "staging-xcm 8.0.1", + "sp-trie", + "staging-xcm", ] [[package]] name = "cumulus-primitives-parachain-inherent" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ad140a065a6b8001fb26ec42b91391e90fde120f5b4e57986698249a9b98c8" +checksum = "df521e13b48278b86d02c61d6e44036d6d263deb5aaec4838b1751da8988d3d2" dependencies = [ "async-trait", "cumulus-primitives-core", "parity-scale-codec", "scale-info", - "sp-core 29.0.0", - "sp-inherents 27.0.0", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-state-machine", "sp-std", - "sp-trie 30.0.0", + "sp-trie", ] [[package]] name = "cumulus-primitives-proof-size-hostfunction" -version = "0.3.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b74f9141190b9f4bf96a947ade46da64097b77f1ebfa8d611c81724250e119" +checksum = "9f973d2a7262c90e48dcd42062bcb1e0fbf48bbcdac4ea6df3d85212d8d8be5d" dependencies = [ - "sp-externalities 0.26.0", - "sp-runtime-interface 25.0.0", - "sp-trie 30.0.0", + "sp-externalities", + "sp-runtime-interface", + "sp-trie", ] [[package]] -name = "cumulus-primitives-utility" -version = "0.8.1" +name = "cumulus-primitives-storage-weight-reclaim" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e65466e56d642f979b556d098a03755ae51972fff5fa0f9b1cdcfdb3df062ea3" +checksum = "29a7e13063f593f21534a7b64c96f311c40cd4d3c72649e0bd063a34506fdd70" dependencies = [ "cumulus-primitives-core", - "frame-support 29.0.2", + "cumulus-primitives-proof-size-hostfunction", + "docify", + "frame-support", + "frame-system", "log", - "pallet-asset-conversion", "parity-scale-codec", - "polkadot-runtime-common", - "polkadot-runtime-parachains", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "scale-info", + "sp-runtime", "sp-std", - "staging-xcm 8.0.1", - "staging-xcm-builder 8.0.3", - "staging-xcm-executor 8.0.2", ] [[package]] -name = "curve25519-dalek" -version = "3.2.0" +name = "cumulus-primitives-utility" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +checksum = "05742c520065e3870d419683113ed7f6d35de66f0c80af6828e7878d1bb0ea94" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle", - "zeroize", + "cumulus-primitives-core", + "frame-support", + "log", + "pallet-asset-conversion", + "parity-scale-codec", + "polkadot-runtime-common", + "polkadot-runtime-parachains", + "sp-io", + "sp-runtime", + "sp-std", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] @@ -1488,17 +1436,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive-syn-parse" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "derive-syn-parse" version = "0.2.0" @@ -1560,7 +1497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a081e51fb188742f5a7a1164ad752121abcb22874b21e2c3b0dd040c515fdad" dependencies = [ "common-path", - "derive-syn-parse 0.2.0", + "derive-syn-parse", "once_cell", "proc-macro2", "quote", @@ -1584,15 +1521,15 @@ dependencies = [ "contract-metadata", "contract-transcode", "drink-test-macro", - "frame-support 36.0.0", - "frame-system 36.1.0", + "frame-support", + "frame-system", "ink_sandbox", "log", "parity-scale-codec", "parity-scale-codec-derive", "scale-info", "serde_json", - "sp-runtime-interface 28.0.0", + "sp-runtime-interface", "thiserror", "wat", ] @@ -1696,7 +1633,7 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ - "curve25519-dalek 4.1.3", + "curve25519-dalek", "ed25519", "serde", "sha2 0.10.8", @@ -1704,31 +1641,17 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ed25519-zebra" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" -dependencies = [ - "curve25519-dalek 3.2.0", - "hashbrown 0.12.3", - "hex", - "rand_core 0.6.4", - "sha2 0.9.9", - "zeroize", -] - [[package]] name = "ed25519-zebra" version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ - "curve25519-dalek 4.1.3", + "curve25519-dalek", "ed25519", "hashbrown 0.14.5", "hex", - "rand_core 0.6.4", + "rand_core", "sha2 0.10.8", "zeroize", ] @@ -1752,7 +1675,7 @@ dependencies = [ "generic-array", "group", "pkcs8", - "rand_core 0.6.4", + "rand_core", "sec1", "serdect", "subtle", @@ -1841,9 +1764,9 @@ dependencies = [ [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fastrand" @@ -1857,7 +1780,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -1917,29 +1840,14 @@ dependencies = [ ] [[package]] -name = "frame-benchmarking" -version = "29.0.0" +name = "fortuples" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4090659c6aaa3c4d5b6c6ec909b4b0a25dec10ad92aad5f729efa8d5bd4d806a" +checksum = "87630a8087e9cac4b7edfb6ee5e250ddca9112b57b6b17d8f5107375a3a8eace" dependencies = [ - "frame-support 29.0.2", - "frame-support-procedural 24.0.0", - "frame-system 29.0.0", - "linregress", - "log", - "parity-scale-codec", - "paste", - "scale-info", - "serde", - "sp-api 27.0.1", - "sp-application-crypto 31.0.0", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", - "sp-runtime-interface 25.0.0", - "sp-std", - "sp-storage 20.0.0", - "static_assertions", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -1948,31 +1856,31 @@ version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "709b26657ebbba53dc7bb616577375ca462b20fef1b00e8d9b20d2435e87f7bc" dependencies = [ - "frame-support 36.0.0", - "frame-support-procedural 30.0.1", - "frame-system 36.1.0", + "frame-support", + "frame-support-procedural", + "frame-system", "linregress", "log", "parity-scale-codec", "paste", "scale-info", "serde", - "sp-api 33.0.0", - "sp-application-crypto 37.0.0", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.0", - "sp-runtime-interface 28.0.0", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-io", + "sp-runtime", + "sp-runtime-interface", "sp-std", - "sp-storage 21.0.0", + "sp-storage", "static_assertions", ] [[package]] name = "frame-election-provider-solution-type" -version = "13.0.0" +version = "14.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5c3bff645e46577c69c272733c53fa3a77d1ee6e40dfb66157bc94b0740b8fc" +checksum = "8156f209055d352994ecd49e19658c6b469d7c6de923bd79868957d0dcfb6f71" dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", @@ -1982,39 +1890,40 @@ dependencies = [ [[package]] name = "frame-election-provider-support" -version = "29.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87da19ee99e6473cd057ead84337d20011fe5e299c6750e88e43b8b7963b8852" +checksum = "b1ec289ebad5e601bb165cf7eb6ec2179ae34280ee310d0710a3111d4f8f8f94" dependencies = [ "frame-election-provider-solution-type", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", - "sp-arithmetic 24.0.0", - "sp-core 29.0.0", + "sp-arithmetic", + "sp-core", "sp-npos-elections", - "sp-runtime 32.0.0", + "sp-runtime", "sp-std", ] [[package]] name = "frame-executive" -version = "29.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09bff9574ee2dcc349f646e1d2faadf76afd688c2ea1bbac5e4a0e19a0c19c59" +checksum = "4d878830330eaa9e8b886279c338556b05702d0059989cb51cfb226b70bf3fa4" dependencies = [ - "frame-support 29.0.2", - "frame-system 29.0.0", + "aquamarine", + "frame-support", + "frame-system", "frame-try-runtime", "log", "parity-scale-codec", "scale-info", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-std", - "sp-tracing 16.0.0", + "sp-tracing", ] [[package]] @@ -2030,45 +1939,19 @@ dependencies = [ ] [[package]] -name = "frame-support" -version = "29.0.2" +name = "frame-metadata-hash-extension" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e52c84b611d2049d9253f83a62ab0f093e4be5c42a7ef42ea5bb16d6611e32" +checksum = "cf37fc730bf4b51e82a34c6357eebe32c04dbacf6525e0a7b9726f6a17ec9427" dependencies = [ - "aquamarine", "array-bytes", - "bitflags 1.3.2", "docify", - "environmental", - "frame-metadata", - "frame-support-procedural 24.0.0", - "impl-trait-for-tuples", - "k256", + "frame-support", + "frame-system", "log", - "macro_magic", "parity-scale-codec", - "paste", "scale-info", - "serde", - "serde_json", - "smallvec", - "sp-api 27.0.1", - "sp-arithmetic 24.0.0", - "sp-core 29.0.0", - "sp-crypto-hashing-proc-macro", - "sp-debug-derive", - "sp-genesis-builder 0.8.0", - "sp-inherents 27.0.0", - "sp-io 31.0.0", - "sp-metadata-ir 0.6.0", - "sp-runtime 32.0.0", - "sp-staking 27.0.0", - "sp-state-machine 0.36.0", - "sp-std", - "sp-tracing 16.0.0", - "sp-weights 28.0.0", - "static_assertions", - "tt-call", + "sp-runtime", ] [[package]] @@ -2083,7 +1966,7 @@ dependencies = [ "docify", "environmental", "frame-metadata", - "frame-support-procedural 30.0.1", + "frame-support-procedural", "impl-trait-for-tuples", "k256", "log", @@ -2094,45 +1977,25 @@ dependencies = [ "serde", "serde_json", "smallvec", - "sp-api 33.0.0", - "sp-arithmetic 26.0.0", - "sp-core 34.0.0", + "sp-api", + "sp-arithmetic", + "sp-core", "sp-crypto-hashing-proc-macro", "sp-debug-derive", - "sp-genesis-builder 0.14.0", - "sp-inherents 33.0.0", - "sp-io 37.0.0", - "sp-metadata-ir 0.7.0", - "sp-runtime 38.0.0", - "sp-staking 33.0.0", - "sp-state-machine 0.42.0", + "sp-genesis-builder", + "sp-inherents", + "sp-io", + "sp-metadata-ir", + "sp-runtime", + "sp-staking", + "sp-state-machine", "sp-std", - "sp-tracing 17.0.0", - "sp-weights 31.0.0", + "sp-tracing", + "sp-weights", "static_assertions", "tt-call", ] -[[package]] -name = "frame-support-procedural" -version = "24.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bf1d648c4007d421b9677b3c893256913498fff159dc2d85022cdd9cc432f3c" -dependencies = [ - "Inflector", - "cfg-expr", - "derive-syn-parse 0.1.5", - "expander", - "frame-support-procedural-tools 10.0.0", - "itertools 0.10.5", - "macro_magic", - "proc-macro-warning", - "proc-macro2", - "quote", - "sp-crypto-hashing", - "syn 2.0.77", -] - [[package]] name = "frame-support-procedural" version = "30.0.1" @@ -2141,9 +2004,9 @@ checksum = "fd94af68373e179c32c360b3c280497a9cf0f45a4f47f0ee6539a6c6c9cf2343" dependencies = [ "Inflector", "cfg-expr", - "derive-syn-parse 0.2.0", + "derive-syn-parse", "expander", - "frame-support-procedural-tools 13.0.0", + "frame-support-procedural-tools", "itertools 0.11.0", "macro_magic", "proc-macro-warning", @@ -2153,43 +2016,19 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "frame-support-procedural-tools" -version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3363df38464c47a73eb521a4f648bfcc7537a82d70347ef8af3f73b6d019e910" -dependencies = [ - "frame-support-procedural-tools-derive 11.0.0", - "proc-macro-crate 3.2.0", - "proc-macro2", - "quote", - "syn 2.0.77", -] - [[package]] name = "frame-support-procedural-tools" version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bead15a320be1764cdd50458c4cfacb23e0cee65f64f500f8e34136a94c7eeca" dependencies = [ - "frame-support-procedural-tools-derive 12.0.0", + "frame-support-procedural-tools-derive", "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.77", ] -[[package]] -name = "frame-support-procedural-tools-derive" -version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68672b9ec6fe72d259d3879dc212c5e42e977588cdac830c76f54d9f492aeb58" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.77", -] - [[package]] name = "frame-support-procedural-tools-derive" version = "12.0.0" @@ -2201,27 +2040,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "frame-system" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc20a793c3cec0b11165c1075fe11a255b2491f3eef8230bb3073cb296e7383" -dependencies = [ - "cfg-if", - "docify", - "frame-support 29.0.2", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", - "sp-std", - "sp-version 30.0.0", - "sp-weights 28.0.0", -] - [[package]] name = "frame-system" version = "36.1.0" @@ -2230,55 +2048,55 @@ checksum = "64d6a0e7bb6503facdcc6f8e19c83cd0bfc8bbbd268522b1a50e107dfc6b972d" dependencies = [ "cfg-if", "docify", - "frame-support 36.0.0", + "frame-support", "log", "parity-scale-codec", "scale-info", "serde", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-std", - "sp-version 36.0.0", - "sp-weights 31.0.0", + "sp-version", + "sp-weights", ] [[package]] name = "frame-system-benchmarking" -version = "29.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac47ee48fee3a0b49c9ab9ee68997dee3733776a355f780cf2858449cf495d69" +checksum = "15afc91c7780e18274dcea58ed1edb700c48d10e086a9785e3f6708099cd3250" dependencies = [ - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", - "sp-core 29.0.0", - "sp-runtime 32.0.0", + "sp-core", + "sp-runtime", "sp-std", ] [[package]] name = "frame-system-rpc-runtime-api" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c1b20433c3c76b56ce905ed971631ec8c34fa64cf6c20e590afe46455fc0cc8" +checksum = "c9e9e2b7b85e451e367f4fb85ff3295bd039e17f64de1906154d3976e2638ee8" dependencies = [ "parity-scale-codec", - "sp-api 27.0.1", + "sp-api", ] [[package]] name = "frame-try-runtime" -version = "0.35.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eab87d07bc2f9a2160b818d1b7506c303b3b28b6a8a5f01dc5e2641390450b5" +checksum = "ae6ba8b36a52775ad39ccfb45ff4ad814c3cb45ec74d0a4271889e00bd791c6c" dependencies = [ - "frame-support 29.0.2", + "frame-support", "parity-scale-codec", - "sp-api 27.0.1", - "sp-runtime 32.0.0", + "sp-api", + "sp-runtime", "sp-std", ] @@ -2416,17 +2234,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ "rand", - "rand_core 0.6.4", + "rand_core", ] [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ "fallible-iterator", - "indexmap 1.9.3", "stable_deref_trait", ] @@ -2443,7 +2260,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -2467,9 +2284,6 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.8", -] [[package]] name = "hashbrown" @@ -2477,7 +2291,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.11", + "ahash", ] [[package]] @@ -2486,7 +2300,7 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.11", + "ahash", "allocator-api2", ] @@ -2532,17 +2346,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" dependencies = [ - "crypto-mac 0.8.0", - "digest 0.9.0", -] - -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac", "digest 0.9.0", ] @@ -2977,20 +2781,20 @@ name = "ink_sandbox" version = "5.0.0" dependencies = [ "frame-metadata", - "frame-support 36.0.0", - "frame-system 36.1.0", + "frame-support", + "frame-system", "log", - "pallet-assets 37.0.0", - "pallet-balances 37.0.0", - "pallet-contracts 35.0.0", - "pallet-timestamp 35.0.0", + "pallet-assets", + "pallet-balances", + "pallet-contracts", + "pallet-timestamp", "parity-scale-codec", "paste", "scale-info", - "sp-core 34.0.0", - "sp-externalities 0.29.0", - "sp-io 37.0.0", - "sp-runtime-interface 28.0.0", + "sp-core", + "sp-externalities", + "sp-io", + "sp-runtime-interface", "wat", ] @@ -3036,21 +2840,60 @@ dependencies = [ ] [[package]] -name = "io-lifetimes" -version = "1.0.11" +name = "is_terminal_polyfill" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "ismp" +version = "0.2.0" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.48.0", + "anyhow", + "derive_more", + "hex", + "parity-scale-codec", + "primitive-types", + "scale-info", + "serde", + "serde-utils", + "serde_json", ] [[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +name = "ismp-parachain" +version = "1.15.0" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" +dependencies = [ + "cumulus-pallet-parachain-system", + "cumulus-primitives-core", + "frame-support", + "frame-system", + "hex-literal", + "ismp", + "log", + "pallet-ismp", + "parity-scale-codec", + "primitive-types", + "scale-info", + "serde", + "sp-consensus-aura", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-trie", + "substrate-state-machine", +] + +[[package]] +name = "ismp-parachain-runtime-api" +version = "1.15.0" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" +dependencies = [ + "cumulus-pallet-parachain-system", + "sp-api", +] [[package]] name = "itertools" @@ -3255,13 +3098,7 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - -[[package]] -name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" @@ -3281,15 +3118,6 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - [[package]] name = "macro_magic" version = "0.5.1" @@ -3309,7 +3137,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" dependencies = [ "const-random", - "derive-syn-parse 0.2.0", + "derive-syn-parse", "macro_magic_core_macros", "proc-macro2", "quote", @@ -3363,24 +3191,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "memfd" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" -dependencies = [ - "rustix 0.38.37", -] - -[[package]] -name = "memoffset" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" -dependencies = [ - "autocfg", -] - [[package]] name = "memory-db" version = "0.32.0" @@ -3398,7 +3208,7 @@ checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" dependencies = [ "byteorder", "keccak", - "rand_core 0.6.4", + "rand_core", "zeroize", ] @@ -3441,6 +3251,24 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "mmr-primitives" +version = "1.15.0" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" +dependencies = [ + "ckb-merkle-mountain-range", + "frame-system", + "ismp", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", + "sp-std", +] + [[package]] name = "multi-stash" version = "0.2.0" @@ -3598,13 +3426,10 @@ dependencies = [ [[package]] name = "object" -version = "0.30.4" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ - "crc32fast", - "hashbrown 0.13.2", - "indexmap 1.9.3", "memchr", ] @@ -3643,85 +3468,70 @@ dependencies = [ name = "pallet-api" version = "0.1.0" dependencies = [ - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", - "pallet-assets 30.0.0", - "pallet-nfts", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-assets", "parity-scale-codec", + "pop-chain-extension", "scale-info", - "sp-runtime 32.0.0", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-asset-conversion" -version = "11.0.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4079f12db3cf98daa717337ab5b7e5ef15aa3bec3b497f501dc715d129b500da" +checksum = "f726ebb59401c1844a4a8703047bdafcd99a1827cd5d8b2c82abeb8948a7f25b" dependencies = [ - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", "parity-scale-codec", "scale-info", - "sp-api 27.0.1", - "sp-arithmetic 24.0.0", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-asset-rate" -version = "8.0.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571ce57fd846911041749832b46a8c2b01f0b79ffebcd7585e3973865607036d" +checksum = "e806842bec955190ec64f8b2179f74f5355137c4cadf04f3269e6196cd19caf9" dependencies = [ - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", - "sp-core 29.0.0", - "sp-runtime 32.0.0", + "sp-core", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-asset-tx-payment" -version = "29.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed783679921ad8b96807d683d320c314e305753b230d5c04dc713bab7aca64c" +checksum = "100a180dfbf30a1c872100ec2dae8a61c0f5e8b3f2d3a5cbb34093826293e2ab" dependencies = [ - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", - "pallet-transaction-payment 29.0.2", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-transaction-payment", "parity-scale-codec", "scale-info", "serde", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", - "sp-std", -] - -[[package]] -name = "pallet-assets" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46728a98a910af13f6a77033dd053456650773bb7adc71e0ba845bff7e31b33e" -dependencies = [ - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-core 29.0.0", - "sp-runtime 32.0.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-std", ] @@ -3731,107 +3541,90 @@ version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f79ef6a7763fc08177f014052469ee12aefcdad0d99a747372360c2f648d2cc4" dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.0", - "frame-system 36.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", - "sp-core 34.0.0", - "sp-runtime 38.0.0", + "sp-core", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-aura" -version = "28.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a611bef3c8cf281e41a43f32a4153260bdc8b7b61b901e65c7a4442529224e11" +checksum = "0861b2a1ad6526948567bb59a3fdc4c7f02ee79b07be8b931a544350ec35ab0c" dependencies = [ - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-support", + "frame-system", "log", - "pallet-timestamp 28.0.0", + "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-application-crypto 31.0.0", + "sp-application-crypto", "sp-consensus-aura", - "sp-runtime 32.0.0", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-authority-discovery" -version = "29.0.1" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd9a381c613e6538638391fb51f353fd13b16f849d0d1ac66a388326bd456f1" +checksum = "ed2c3666a476132f5846fe4d5e1961a923a58a0f54d873d84566f24ffaa3684f" dependencies = [ - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-support", + "frame-system", "pallet-session", "parity-scale-codec", "scale-info", - "sp-application-crypto 31.0.0", + "sp-application-crypto", "sp-authority-discovery", - "sp-runtime 32.0.0", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-authorship" -version = "29.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d83773e731a1760f99684b09961ed7b92acafe335f36f08ebb8313d3b9c72e2" +checksum = "38885846dbcf03b025fdbd7edb3649046dbc68fa0b419ffe8837ef853a10d31f" dependencies = [ - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-support", + "frame-system", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime 32.0.0", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-babe" -version = "29.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3f2020c52667a650d64e84a4bbb63388e25bc1c9bc872a8243d03bfcb285049" +checksum = "b23d2d814e3cb793659fcf84533f66fdf0ed9cccb66cb2225851f482843ed096" dependencies = [ - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "pallet-authorship", "pallet-session", - "pallet-timestamp 28.0.0", + "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-application-crypto 31.0.0", + "sp-application-crypto", "sp-consensus-babe", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-session", - "sp-staking 27.0.0", - "sp-std", -] - -[[package]] -name = "pallet-balances" -version = "29.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a54b5d0c7c4c3731883d6b1ac18aff44db20c3d0a3470c8861001a17afdc85" -dependencies = [ - "docify", - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 32.0.0", + "sp-staking", "sp-std", ] @@ -3842,86 +3635,55 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6878e240962d3887f0e0654ac343a18845adb95ad493c9d4d5e803c015d4a4c3" dependencies = [ "docify", - "frame-benchmarking 36.0.0", - "frame-support 36.0.0", - "frame-system 36.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-runtime 38.0.0", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-broker" -version = "0.7.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "574c52fd629191c374c24a18036acac008ea92142309e5dd05e7f03149a667c3" +checksum = "cd0d652c399b6ed776ee3322e60f40e323f86b413719d7696eddb8f64c368ac0" dependencies = [ "bitvec", - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-arithmetic 24.0.0", - "sp-core 29.0.0", - "sp-runtime 32.0.0", + "sp-api", + "sp-arithmetic", + "sp-core", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-collator-selection" -version = "10.0.3" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a36858c4275b7d19671b321e95f545e07c9643f97dffed1b333774cb391a4456" +checksum = "f660cc09f2f277a3976da2eef856b5c725ab7ad1192902ef7f4e4bafd992f04f" dependencies = [ - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "pallet-authorship", - "pallet-balances 29.0.2", + "pallet-balances", "pallet-session", "parity-scale-codec", "rand", "scale-info", - "sp-runtime 32.0.0", - "sp-staking 27.0.0", - "sp-std", -] - -[[package]] -name = "pallet-contracts" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b56fe53df97911ed3ecd90d631f8093cedd795c756d4e42d386110e9fe6614f" -dependencies = [ - "bitflags 1.3.2", - "environmental", - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", - "impl-trait-for-tuples", - "log", - "pallet-balances 29.0.2", - "pallet-contracts-proc-macro 19.0.0", - "pallet-contracts-uapi 6.0.0", - "parity-scale-codec", - "rand", - "scale-info", - "serde", - "smallvec", - "sp-api 27.0.1", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-runtime", + "sp-staking", "sp-std", - "staging-xcm 8.0.1", - "staging-xcm-builder 8.0.3", - "wasm-instrument", - "wasmi 0.31.2", ] [[package]] @@ -3932,40 +3694,29 @@ checksum = "3e6989ac82690f981959b0d38ac6d6d52fc06bf00a035548d62b9a2e9c220376" dependencies = [ "bitflags 1.3.2", "environmental", - "frame-benchmarking 36.0.0", - "frame-support 36.0.0", - "frame-system 36.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", - "pallet-balances 37.0.0", - "pallet-contracts-proc-macro 23.0.1", - "pallet-contracts-uapi 11.0.0", + "pallet-balances", + "pallet-contracts-proc-macro", + "pallet-contracts-uapi", "parity-scale-codec", "paste", "rand", "scale-info", "serde", "smallvec", - "sp-api 33.0.0", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.0", + "sp-api", + "sp-core", + "sp-io", + "sp-runtime", "sp-std", - "staging-xcm 14.1.0", - "staging-xcm-builder 15.0.0", + "staging-xcm", + "staging-xcm-builder", "wasm-instrument", - "wasmi 0.32.3", -] - -[[package]] -name = "pallet-contracts-proc-macro" -version = "19.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3163c6bc21b55a0ccb74c546ba784d9c9e69beb9240c059d28a3052f4cbce509" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.77", + "wasmi", ] [[package]] @@ -3979,19 +3730,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "pallet-contracts-uapi" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61eeda58538dc888c59ae6de2146f0e2f43e9ad0eb1d56c228e5cc7af90d4e52" -dependencies = [ - "bitflags 1.3.2", - "parity-scale-codec", - "paste", - "polkavm-derive 0.5.0", - "scale-info", -] - [[package]] name = "pallet-contracts-uapi" version = "11.0.0" @@ -4018,313 +3756,345 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" -version = "28.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b54d1d3fe9ae61a144d581147e699b7c3009169de0019a0f87cca0bed82681e7" +checksum = "bd1090fdc6ccdd8ff08c60000c970428baaaf0b33e7a6b01a91ec8b697a650a3" dependencies = [ - "frame-benchmarking 29.0.0", + "frame-benchmarking", "frame-election-provider-support", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-support", + "frame-system", "log", "pallet-election-provider-support-benchmarking", "parity-scale-codec", "rand", "scale-info", - "sp-arithmetic 24.0.0", - "sp-core 29.0.0", - "sp-io 31.0.0", + "sp-arithmetic", + "sp-core", + "sp-io", "sp-npos-elections", - "sp-runtime 32.0.0", + "sp-runtime", "sp-std", - "strum 0.24.1", + "strum 0.26.3", ] [[package]] name = "pallet-election-provider-support-benchmarking" -version = "28.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46ec87816a1e32a1ab6deececa99e21e6684b111efe87b11b8298328dbbefd01" +checksum = "93475989d2f6900caf8f1c847a55d909295c156525a7510c5f1dde176ec7c714" dependencies = [ - "frame-benchmarking 29.0.0", + "frame-benchmarking", "frame-election-provider-support", - "frame-system 29.0.0", + "frame-system", "parity-scale-codec", "sp-npos-elections", - "sp-runtime 32.0.0", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-fast-unstake" -version = "28.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2222607a0dba10a9d57cab5360a6549b5fda925181c3c7af481246c0964998df" +checksum = "9155f4f762513e0287320411415c76a647152799ad33db1785c9b71c36a14575" dependencies = [ "docify", - "frame-benchmarking 29.0.0", + "frame-benchmarking", "frame-election-provider-support", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-io 31.0.0", - "sp-runtime 32.0.0", - "sp-staking 27.0.0", + "sp-io", + "sp-runtime", + "sp-staking", "sp-std", ] [[package]] name = "pallet-identity" -version = "29.0.1" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452bba25325b7f0148eeecbde13e7c26dfb677ad46b3f160b359d7643b44c94b" +checksum = "4555795a3e0e3aa49ea432b7afecb9c71a7db8793a99c68bd8dd3a52a12571f3" dependencies = [ "enumflags2", - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std", +] + +[[package]] +name = "pallet-ismp" +version = "1.15.0" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" +dependencies = [ + "fortuples", + "frame-benchmarking", + "frame-support", + "frame-system", + "ismp", "log", + "mmr-primitives", "parity-scale-codec", "scale-info", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "serde", + "sp-api", + "sp-core", + "sp-io", + "sp-mmr-primitives", + "sp-runtime", "sp-std", ] +[[package]] +name = "pallet-ismp-runtime-api" +version = "1.15.0" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" +dependencies = [ + "ismp", + "pallet-ismp", + "parity-scale-codec", + "primitive-types", + "serde", + "sp-api", + "sp-mmr-primitives", +] + [[package]] name = "pallet-message-queue" -version = "32.0.0" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccb23dee70b184a214d729db550117a0965a69107d466d35181d60a6feede38" +checksum = "20e65a37881d1998546254a5e50a1f768b3f82deabe774e750f4ea95aba8030c" dependencies = [ "environmental", - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-arithmetic 24.0.0", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", "sp-std", - "sp-weights 28.0.0", + "sp-weights", ] [[package]] name = "pallet-multisig" -version = "29.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176f6a5c170185f892a047c0ae189bc52eb390f2c0b94d4261ed0ebc7f82a548" +checksum = "be58483d827602eb8353ecf36aed65c857f0974db5d27981831e5ebf853040bd" dependencies = [ - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-io", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-nft-fractionalization" -version = "11.0.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4225c31beb3a10235dd165c78f340c344ee78f6ebccd7c99d62a71fb76d2e39" +checksum = "7dcaa330221f60feaf3b23d495cccc3bf2a3d6254c596b3c032273c2b46d4078" dependencies = [ - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", - "pallet-assets 30.0.0", - "pallet-nfts", + "pallet-assets", + "pallet-nfts 30.0.0", "parity-scale-codec", "scale-info", - "sp-runtime 32.0.0", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-nfts" -version = "23.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a8978bd9c43ac5ebaa7a26e5bd0c130b037d7cde97189e1a62fa64e5ee1ef1" +checksum = "3e1cd476809de3840e19091a083d5a79178af1f108ad489706e1f9e04c8836a4" dependencies = [ "enumflags2", - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-std", ] +[[package]] +name = "pallet-nfts" +version = "31.0.0" +dependencies = [ + "enumflags2", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", +] + [[package]] name = "pallet-nfts-runtime-api" -version = "15.0.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c412ca82207d43e651ef80a3be837220b82ad0d6c3174922c369ef301ea0e5af" +checksum = "b0ca7a0446d2d3c27f726a016c6366218df2e0bfef9ed35886b252cfa9757f6c" dependencies = [ - "pallet-nfts", + "pallet-nfts 30.0.0", "parity-scale-codec", - "sp-api 27.0.1", + "sp-api", "sp-std", ] [[package]] name = "pallet-preimage" -version = "29.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7344a30c304771beb90aec34604100185e47cdc0366e268ad18922de602a0c7e" +checksum = "68ac726abc5b1bcd6c8f783514b8e1a48be32c7d15e0b263e4bc28cc1e4e7763" dependencies = [ - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-proxy" -version = "29.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7aa31a0b91e8060b808c3e3407e4578a5e94503b174b9e99769147b24fb2c56" +checksum = "b4e12680e176607815a78a0cd10a52af50790292cb950404f30a885e2a7229e9" dependencies = [ - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-io", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-scheduler" -version = "30.0.0" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45e2a4ebe6a5f98b14a26deed8d7a1ea28bb2c2d3ad4d6dc129a725523a2042d" +checksum = "b170d6aa191197d3f50b1193925546972ffc394376ead4d2739eb40909b73c85" dependencies = [ "docify", - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-io", + "sp-runtime", "sp-std", - "sp-weights 28.0.0", + "sp-weights", ] [[package]] name = "pallet-session" -version = "29.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7412ac59247b300feee53709f7009a23d1c6f8c70528599f48f44e102d896d03" +checksum = "7c92b24c911c2cfa5351616edc7f2f93427ea6f4f95efdb13f0f5d51997939c3" dependencies = [ - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", - "pallet-timestamp 28.0.0", + "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-session", - "sp-staking 27.0.0", - "sp-state-machine 0.36.0", + "sp-staking", + "sp-state-machine", "sp-std", - "sp-trie 30.0.0", + "sp-trie", ] [[package]] name = "pallet-staking" -version = "29.0.3" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061b00814eb794a40df4eca7972a7c67b26473cd85cc7c54f5816ae49ad6e11b" +checksum = "fbebdb060417654f215fc6f03675e5f44cfc83837d9e523e1b8fd9a4a2e1bdc2" dependencies = [ - "frame-benchmarking 29.0.0", + "frame-benchmarking", "frame-election-provider-support", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-support", + "frame-system", "log", "pallet-authorship", "pallet-session", "parity-scale-codec", "scale-info", "serde", - "sp-application-crypto 31.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", - "sp-staking 27.0.0", + "sp-application-crypto", + "sp-io", + "sp-runtime", + "sp-staking", "sp-std", ] [[package]] name = "pallet-staking-reward-fn" -version = "20.0.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "505d45e08bad052f55fb51f00a6b6244d23ee46ffdc8091f6cddf4e3a880319d" +checksum = "988a7ebeacc84d4bdb0b12409681e956ffe35438447d8f8bc78db547cffb6ebc" dependencies = [ "log", - "sp-arithmetic 24.0.0", + "sp-arithmetic", ] [[package]] name = "pallet-sudo" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d02f7855d411913e77e57126f4a8b8a32d90d9bf47d0b747e367a1301729c3" -dependencies = [ - "docify", - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", - "parity-scale-codec", - "scale-info", - "sp-io 31.0.0", - "sp-runtime 32.0.0", - "sp-std", -] - -[[package]] -name = "pallet-timestamp" -version = "28.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b8810ddfb254c7fb8cd7698229cce513d309a43ff117b38798dae6120f477b" +checksum = "1bd2a8797c1bb3d3897b4f87a7716111da5eeb8561345277b6e6d70349ec8b35" dependencies = [ "docify", - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", - "log", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", - "sp-inherents 27.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-io", + "sp-runtime", "sp-std", - "sp-storage 20.0.0", - "sp-timestamp 27.0.0", ] [[package]] @@ -4334,35 +4104,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae789d344be857679b0b98b28a67c747119724847f81d704d3fd03ee13fb6841" dependencies = [ "docify", - "frame-benchmarking 36.0.0", - "frame-support 36.0.0", - "frame-system 36.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-inherents 33.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.0", - "sp-std", - "sp-storage 21.0.0", - "sp-timestamp 33.0.0", -] - -[[package]] -name = "pallet-transaction-payment" -version = "29.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5ba71f06f09e955b80dc313c333be3f8d9e8505b051558e0b7af4806b13310" -dependencies = [ - "frame-support 29.0.2", - "frame-system 29.0.0", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-inherents", + "sp-io", + "sp-runtime", "sp-std", + "sp-storage", + "sp-timestamp", ] [[package]] @@ -4371,122 +4124,123 @@ version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74fb6114223c8d967c3c2f21cbc845e8ea604ff7e21a8e59d119d5a9257ba886" dependencies = [ - "frame-support 36.0.0", - "frame-system 36.1.0", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", "serde", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "29.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c78bcba80c7c61712b98a6b5640975ebd25ceb688c18e975af78a0fac81785b0" +checksum = "f4bad1700ad7eb5ab254189e1df894d1d16b3626a3c4b9c45259ec4d9efc262c" dependencies = [ - "pallet-transaction-payment 29.0.2", + "pallet-transaction-payment", "parity-scale-codec", - "sp-api 27.0.1", - "sp-runtime 32.0.0", - "sp-weights 28.0.0", + "sp-api", + "sp-runtime", + "sp-weights", ] [[package]] name = "pallet-treasury" -version = "28.0.1" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eca44990d0d759213744f2d1f6fe1fadec1079a3e4e4da40556d6b4e42abbcd" +checksum = "9c502615bb4fdd02856a131cb2a612ad40c26435ec938f65f11cae4ff230812b" dependencies = [ "docify", - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "impl-trait-for-tuples", - "pallet-balances 29.0.2", + "pallet-balances", "parity-scale-codec", "scale-info", "serde", - "sp-core 29.0.0", - "sp-runtime 32.0.0", + "sp-core", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-utility" -version = "29.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "954f15b98c3fdebb763bb5cea4ec6803fd180d540ec5b07a9fcb2c118251d52c" +checksum = "3238fe6ad00da6a137be115904c39cab97eb5c7f03da0bb1a20de1bef03f0c71" dependencies = [ - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-vesting" -version = "29.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4525f3038cdf078fea39d913c563ca626f09a615e7724f0c9eac97743c75ff44" +checksum = "78f7f0f4fe5e1d851e85d81e5e73b6f929f0c35af786ce8be9c9e3363717c136" dependencies = [ - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-runtime 32.0.0", + "sp-runtime", "sp-std", ] [[package]] name = "pallet-xcm" -version = "8.0.5" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba9138b04168b07b1aff4a2079f5514753c31dddba40e5fb471b9cda7da27ad6" +checksum = "fe7409458b7fedc5c7d46459da154ccc2dc22a843ce08e8ab6c1743ef5cf972c" dependencies = [ "bounded-collections", - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", - "pallet-balances 29.0.2", + "pallet-balances", "parity-scale-codec", "scale-info", "serde", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-std", - "staging-xcm 8.0.1", - "staging-xcm-builder 8.0.3", - "staging-xcm-executor 8.0.2", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "xcm-runtime-apis", ] [[package]] name = "parachains-common" -version = "8.0.1" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711a4c073e7c83aac7e414ba16c7c641d6d9e22e6d32f9775ff35b2464ffd7ff" +checksum = "9319e656eebdf161666e54a4d8e24f73137f702f01600247f7be650bc4d46167" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-utility", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-support", + "frame-system", "log", "pallet-asset-tx-payment", - "pallet-assets 30.0.0", + "pallet-assets", "pallet-authorship", - "pallet-balances 29.0.2", + "pallet-balances", "pallet-collator-selection", "pallet-message-queue", "pallet-xcm", @@ -4494,13 +4248,13 @@ dependencies = [ "polkadot-primitives", "scale-info", "sp-consensus-aura", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-core", + "sp-io", + "sp-runtime", "sp-std", "staging-parachain-info", - "staging-xcm 8.0.1", - "staging-xcm-executor 8.0.2", + "staging-xcm", + "staging-xcm-executor", "substrate-wasm-builder", ] @@ -4512,7 +4266,7 @@ checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" dependencies = [ "bitcoin_hashes", "rand", - "rand_core 0.6.4", + "rand_core", "serde", "unicode-normalization", ] @@ -4580,7 +4334,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" dependencies = [ "base64ct", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -4590,15 +4344,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "pbkdf2" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" -dependencies = [ - "crypto-mac 0.11.1", -] - [[package]] name = "pbkdf2" version = "0.12.2" @@ -4644,16 +4389,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] -name = "polkadot-core-primitives" -version = "8.0.0" +name = "polkadot-ckb-merkle-mountain-range" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a08e4e014c853b252ecbbe3ccd67b2d33d78e46988d309b8cccf4ac06e25ef" +checksum = "a4b44320e5f7ce2c18227537a3032ae5b2c476a7e8eddba45333e1011fc31b92" dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-core 29.0.0", - "sp-runtime 32.0.0", - "sp-std", + "cfg-if", + "itertools 0.10.5", ] [[package]] @@ -4664,27 +4406,9 @@ checksum = "17c72ee63bcf920f963cd7ac066759b0b649350c8ab3781a85a6aac87b1488f2" dependencies = [ "parity-scale-codec", "scale-info", - "sp-core 34.0.0", - "sp-runtime 38.0.0", - "sp-std", -] - -[[package]] -name = "polkadot-parachain-primitives" -version = "7.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248ab090959a92e61493277e33b7e85104280a4beb4cb0815137d3c8c50a07f4" -dependencies = [ - "bounded-collections", - "derive_more", - "parity-scale-codec", - "polkadot-core-primitives 8.0.0", - "scale-info", - "serde", - "sp-core 29.0.0", - "sp-runtime 32.0.0", + "sp-core", + "sp-runtime", "sp-std", - "sp-weights 28.0.0", ] [[package]] @@ -4696,60 +4420,60 @@ dependencies = [ "bounded-collections", "derive_more", "parity-scale-codec", - "polkadot-core-primitives 14.0.0", + "polkadot-core-primitives", "scale-info", "serde", - "sp-core 34.0.0", - "sp-runtime 38.0.0", + "sp-core", + "sp-runtime", "sp-std", - "sp-weights 31.0.0", + "sp-weights", ] [[package]] name = "polkadot-primitives" -version = "8.0.1" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0d5f9930210cab0233d81204415c9ef4a8889cdf3e60de1435250481a2773ca" +checksum = "5a4879609f4340138930c3c7313256941104a3ff6f7ecb2569d15223da9b35b2" dependencies = [ "bitvec", "hex-literal", "log", "parity-scale-codec", - "polkadot-core-primitives 8.0.0", - "polkadot-parachain-primitives 7.0.0", + "polkadot-core-primitives", + "polkadot-parachain-primitives", "scale-info", "serde", - "sp-api 27.0.1", - "sp-application-crypto 31.0.0", - "sp-arithmetic 24.0.0", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", "sp-authority-discovery", "sp-consensus-slots", - "sp-core 29.0.0", - "sp-inherents 27.0.0", - "sp-io 31.0.0", - "sp-keystore 0.35.0", - "sp-runtime 32.0.0", - "sp-staking 27.0.0", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", + "sp-staking", "sp-std", ] [[package]] name = "polkadot-runtime-common" -version = "8.0.3" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12a70422ca43d30457e2d9502a5e4af35e20fa2ff3f7cd46e0d2997c784f2665" +checksum = "28fdcb41bb21c7b14d0341a9a17364ccc04ad34de05d41e7938cb03acbc11066" dependencies = [ "bitvec", - "frame-benchmarking 29.0.0", + "frame-benchmarking", "frame-election-provider-support", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-support", + "frame-system", "impl-trait-for-tuples", "libsecp256k1", "log", "pallet-asset-rate", "pallet-authorship", - "pallet-balances 29.0.2", + "pallet-balances", "pallet-broker", "pallet-election-provider-multi-phase", "pallet-fast-unstake", @@ -4757,8 +4481,8 @@ dependencies = [ "pallet-session", "pallet-staking", "pallet-staking-reward-fn", - "pallet-timestamp 28.0.0", - "pallet-transaction-payment 29.0.2", + "pallet-timestamp", + "pallet-transaction-payment", "pallet-treasury", "pallet-vesting", "parity-scale-codec", @@ -4769,82 +4493,81 @@ dependencies = [ "serde", "serde_derive", "slot-range-helper", - "sp-api 27.0.1", - "sp-core 29.0.0", - "sp-inherents 27.0.0", - "sp-io 31.0.0", + "sp-api", + "sp-core", + "sp-inherents", + "sp-io", "sp-npos-elections", - "sp-runtime 32.0.0", + "sp-runtime", "sp-session", - "sp-staking 27.0.0", + "sp-staking", "sp-std", - "staging-xcm 8.0.1", - "staging-xcm-builder 8.0.3", - "staging-xcm-executor 8.0.2", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "static_assertions", ] [[package]] name = "polkadot-runtime-metrics" -version = "8.0.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3566c6fd0c21b5dd555309427c984cf506f875ee90f710acea295b478fecbe0" +checksum = "ac75b3fea8464e5681b44733ed11cf09e22ff1e956f6703b918b637bd40e7427" dependencies = [ "bs58", - "frame-benchmarking 29.0.0", + "frame-benchmarking", "parity-scale-codec", "polkadot-primitives", "sp-std", - "sp-tracing 16.0.0", + "sp-tracing", ] [[package]] name = "polkadot-runtime-parachains" -version = "8.0.3" +version = "15.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8d37cd3e014b06daf396d1483b5327782a0ebadc816423419665166b75b3e3e" +checksum = "cb7e68cb26f9025daaad694d8192fd0e63e92c8761c45a339dd7a5b7925a3cb6" dependencies = [ "bitflags 1.3.2", "bitvec", "derive_more", - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", "pallet-authority-discovery", "pallet-authorship", "pallet-babe", - "pallet-balances 29.0.2", + "pallet-balances", "pallet-broker", "pallet-message-queue", "pallet-session", "pallet-staking", - "pallet-timestamp 28.0.0", + "pallet-timestamp", "pallet-vesting", "parity-scale-codec", - "polkadot-core-primitives 8.0.0", - "polkadot-parachain-primitives 7.0.0", + "polkadot-core-primitives", + "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-metrics", "rand", "rand_chacha", - "rustc-hex", "scale-info", "serde", - "sp-api 27.0.1", - "sp-application-crypto 31.0.0", - "sp-arithmetic 24.0.0", - "sp-core 29.0.0", - "sp-inherents 27.0.0", - "sp-io 31.0.0", - "sp-keystore 0.35.0", - "sp-runtime 32.0.0", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-inherents", + "sp-io", + "sp-keystore", + "sp-runtime", "sp-session", - "sp-staking 27.0.0", + "sp-staking", "sp-std", - "staging-xcm 8.0.1", - "staging-xcm-executor 8.0.2", + "staging-xcm", + "staging-xcm-executor", ] [[package]] @@ -4912,27 +4635,42 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "polkavm-linker" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7be503e60cf56c0eb785f90aaba4b583b36bff00e93997d93fef97f9553c39" +dependencies = [ + "gimli 0.28.1", + "hashbrown 0.14.5", + "log", + "object 0.32.2", + "polkavm-common 0.9.0", + "regalloc2", + "rustc-demangle", +] + [[package]] name = "pop-api" version = "0.0.0" dependencies = [ "ink", "pop-primitives", - "sp-io 31.0.0", + "sp-io", ] [[package]] name = "pop-chain-extension" version = "0.1.0" dependencies = [ - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-support", + "frame-system", + "impl-trait-for-tuples", "log", - "pallet-contracts 28.0.0", + "pallet-contracts", "parity-scale-codec", - "pop-primitives", - "sp-core 29.0.0", - "sp-runtime 32.0.0", + "sp-core", + "sp-runtime", "sp-std", ] @@ -4941,19 +4679,19 @@ name = "pop-drink" version = "0.1.0" dependencies = [ "drink", - "frame-support 36.0.0", - "frame-system 36.1.0", + "frame-support", + "frame-system", "ink_sandbox", "pallet-api", - "pallet-assets 37.0.0", - "pallet-balances 37.0.0", - "pallet-contracts 35.0.0", - "pallet-timestamp 35.0.0", + "pallet-assets", + "pallet-balances", + "pallet-contracts", + "pallet-timestamp", "parity-scale-codec", "pop-api", "pop-runtime-devnet", "scale-info", - "sp-io 37.0.0", + "sp-io", ] [[package]] @@ -4968,12 +4706,12 @@ dependencies = [ name = "pop-runtime-common" version = "0.0.0" dependencies = [ - "frame-support 29.0.2", + "frame-support", "parachains-common", "parity-scale-codec", "polkadot-primitives", "scale-info", - "sp-runtime 32.0.0", + "sp-runtime", "sp-std", ] @@ -4988,64 +4726,72 @@ dependencies = [ "cumulus-pallet-xcmp-queue", "cumulus-primitives-aura", "cumulus-primitives-core", + "cumulus-primitives-storage-weight-reclaim", "cumulus-primitives-utility", - "frame-benchmarking 29.0.0", + "frame-benchmarking", "frame-executive", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-metadata-hash-extension", + "frame-support", + "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", "hex-literal", + "ismp", + "ismp-parachain", + "ismp-parachain-runtime-api", "log", "pallet-api", - "pallet-assets 30.0.0", + "pallet-assets", "pallet-aura", "pallet-authorship", - "pallet-balances 29.0.2", + "pallet-balances", "pallet-collator-selection", - "pallet-contracts 28.0.0", + "pallet-contracts", + "pallet-ismp", + "pallet-ismp-runtime-api", "pallet-message-queue", "pallet-multisig", "pallet-nft-fractionalization", - "pallet-nfts", + "pallet-nfts 31.0.0", "pallet-nfts-runtime-api", "pallet-preimage", "pallet-proxy", "pallet-scheduler", "pallet-session", "pallet-sudo", - "pallet-timestamp 28.0.0", - "pallet-transaction-payment 29.0.2", + "pallet-timestamp", + "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-utility", "pallet-xcm", "parachains-common", "parity-scale-codec", - "polkadot-parachain-primitives 7.0.0", + "polkadot-parachain-primitives", "polkadot-runtime-common", "pop-chain-extension", "pop-primitives", "pop-runtime-common", "scale-info", "smallvec", - "sp-api 27.0.1", + "sp-api", "sp-block-builder", "sp-consensus-aura", - "sp-core 29.0.0", - "sp-genesis-builder 0.8.0", - "sp-inherents 27.0.0", - "sp-io 31.0.0", + "sp-core", + "sp-genesis-builder", + "sp-inherents", + "sp-io", + "sp-mmr-primitives", "sp-offchain", - "sp-runtime 32.0.0", + "sp-runtime", "sp-session", "sp-std", "sp-transaction-pool", - "sp-version 30.0.0", + "sp-version", "staging-parachain-info", - "staging-xcm 8.0.1", - "staging-xcm-builder 8.0.3", - "staging-xcm-executor 8.0.2", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", "substrate-wasm-builder", ] @@ -5150,15 +4896,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "psm" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" -dependencies = [ - "cc", -] - [[package]] name = "quote" version = "1.0.37" @@ -5182,7 +4919,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -5192,15 +4929,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", + "rand_core", ] -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" - [[package]] name = "rand_core" version = "0.6.4" @@ -5259,6 +4990,19 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "regalloc2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash", + "slice-group-by", + "smallvec", +] + [[package]] name = "regex" version = "1.10.6" @@ -5325,6 +5069,12 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -5342,28 +5092,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.17" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "errno", - "io-lifetimes", "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - -[[package]] -name = "rustix" -version = "0.38.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys 0.4.14", + "linux-raw-sys", "windows-sys 0.52.0", ] @@ -5517,7 +5253,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" dependencies = [ - "ahash 0.8.11", + "ahash", "cfg-if", "hashbrown 0.13.2", ] @@ -5531,10 +5267,10 @@ dependencies = [ "aead", "arrayref", "arrayvec", - "curve25519-dalek 4.1.3", + "curve25519-dalek", "getrandom_or_panic", "merlin", - "rand_core 0.6.4", + "rand_core", "serde_bytes", "sha2 0.10.8", "subtle", @@ -5628,6 +5364,16 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-utils" +version = "0.1.0" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" +dependencies = [ + "anyhow", + "hex", + "serde", +] + [[package]] name = "serde_bytes" version = "0.11.15" @@ -5826,7 +5572,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -5857,16 +5603,22 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + [[package]] name = "slot-range-helper" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40fa5e14772407fd2ccffdd5971bf055bbf46a40727c0ea96d2bb6563d17e1c" +checksum = "a4d67aa9b1ccfd746c8529754c4ce06445b1d48e189567402ef856340a3a6b14" dependencies = [ "enumn", "parity-scale-codec", "paste", - "sp-runtime 32.0.0", + "sp-runtime", "sp-std", ] @@ -5886,28 +5638,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "sp-api" -version = "27.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e4f8702afd77f14a32733e2b589c02694bf79d0b3a641963c508016208724d0" -dependencies = [ - "hash-db", - "log", - "parity-scale-codec", - "scale-info", - "sp-api-proc-macro 15.0.1", - "sp-core 29.0.0", - "sp-externalities 0.26.0", - "sp-metadata-ir 0.6.0", - "sp-runtime 32.0.0", - "sp-state-machine 0.36.0", - "sp-std", - "sp-trie 30.0.0", - "sp-version 30.0.0", - "thiserror", -] - [[package]] name = "sp-api" version = "33.0.0" @@ -5918,34 +5648,19 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-api-proc-macro 20.0.0", - "sp-core 34.0.0", - "sp-externalities 0.29.0", - "sp-metadata-ir 0.7.0", - "sp-runtime 38.0.0", - "sp-runtime-interface 28.0.0", - "sp-state-machine 0.42.0", + "sp-api-proc-macro", + "sp-core", + "sp-externalities", + "sp-metadata-ir", + "sp-runtime", + "sp-runtime-interface", + "sp-state-machine", "sp-std", - "sp-trie 36.0.0", - "sp-version 36.0.0", + "sp-trie", + "sp-version", "thiserror", ] -[[package]] -name = "sp-api-proc-macro" -version = "15.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0301e2f77afb450fbf2b093f8b324c7ad88cc82e5e69bd5dc8658a1f068b2a96" -dependencies = [ - "Inflector", - "blake2", - "expander", - "proc-macro-crate 3.2.0", - "proc-macro2", - "quote", - "syn 2.0.77", -] - [[package]] name = "sp-api-proc-macro" version = "20.0.0" @@ -5961,20 +5676,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "sp-application-crypto" -version = "31.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "547cad7a6eabb52c639ec117b3db9c6b43cf1b29a9393b18feb19e101a91833f" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-std", -] - [[package]] name = "sp-application-crypto" version = "37.0.0" @@ -5984,26 +5685,11 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 34.0.0", - "sp-io 37.0.0", + "sp-core", + "sp-io", "sp-std", ] -[[package]] -name = "sp-arithmetic" -version = "24.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afa823ca5adc490d47dccb41d69ad482bc57a317bd341de275868378f48f131c" -dependencies = [ - "integer-sqrt", - "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-std", - "static_assertions", -] - [[package]] name = "sp-arithmetic" version = "26.0.0" @@ -6022,125 +5708,74 @@ dependencies = [ [[package]] name = "sp-authority-discovery" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92b177c72b5d2973c36d60f6ef942d791d9fd91eae8b08c71882e4118d4fbfc" +checksum = "6a4a1e45abc3277f18484ee0b0f9808e4206eb696ad38500c892c72f33480d69" dependencies = [ "parity-scale-codec", "scale-info", - "sp-api 27.0.1", - "sp-application-crypto 31.0.0", - "sp-runtime 32.0.0", - "sp-std", + "sp-api", + "sp-application-crypto", + "sp-runtime", ] [[package]] name = "sp-block-builder" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b36ce171caa7eb2bbe682c089f755fdefa71d3702e4fb1ba30d10146aef99d5" +checksum = "2cf199dc4f9f77abd3fd91c409759118159ce6ffcd8bc90b229b684ccc8c981f" dependencies = [ - "sp-api 27.0.1", - "sp-inherents 27.0.0", - "sp-runtime 32.0.0", - "sp-std", + "sp-api", + "sp-inherents", + "sp-runtime", ] [[package]] name = "sp-consensus-aura" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf13c293685319751f72fa5216c7fb5f25f3e8e8fe29b4503296ed5f5466b3d" +checksum = "05ebb90bf00f331b898eb729a1f707251846c1d5582d7467f083884799a69b89" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", - "sp-api 27.0.1", - "sp-application-crypto 31.0.0", + "sp-api", + "sp-application-crypto", "sp-consensus-slots", - "sp-inherents 27.0.0", - "sp-runtime 32.0.0", - "sp-std", - "sp-timestamp 27.0.0", + "sp-inherents", + "sp-runtime", + "sp-timestamp", ] [[package]] name = "sp-consensus-babe" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9be2f86a2f0ce2a78b455feb547aa27604fd76a7f7a691995cbad44e0b1b9dd" +checksum = "3aa2de4c7100a3279658d8dd4affd8f92487528deae5cb4b40322717b9175ed5" dependencies = [ "async-trait", "parity-scale-codec", "scale-info", "serde", - "sp-api 27.0.1", - "sp-application-crypto 31.0.0", + "sp-api", + "sp-application-crypto", "sp-consensus-slots", - "sp-core 29.0.0", - "sp-inherents 27.0.0", - "sp-runtime 32.0.0", - "sp-std", - "sp-timestamp 27.0.0", + "sp-core", + "sp-inherents", + "sp-runtime", + "sp-timestamp", ] [[package]] name = "sp-consensus-slots" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73a5bd1fcd84bbdc7255528c7cdb92f9357fd555f06ee553af7e340cbdab517c" +checksum = "c8ca60d713f8ddb03bbebcc755d5e6463fdc0b6259fabfc4221b20a5f1e428fd" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std", - "sp-timestamp 27.0.0", -] - -[[package]] -name = "sp-core" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c33c7a1568175250628567d50c4e1c54a6ac5bc1190413b9be29a9e810cbe73" -dependencies = [ - "array-bytes", - "bip39", - "bitflags 1.3.2", - "blake2", - "bounded-collections", - "bs58", - "dyn-clonable", - "ed25519-zebra 3.1.0", - "futures", - "hash-db", - "hash256-std-hasher", - "impl-serde", - "itertools 0.10.5", - "libsecp256k1", - "log", - "merlin", - "parity-scale-codec", - "parking_lot", - "paste", - "primitive-types", - "rand", - "scale-info", - "schnorrkel", - "secp256k1", - "secrecy", - "serde", - "sp-crypto-hashing", - "sp-debug-derive", - "sp-externalities 0.26.0", - "sp-runtime-interface 25.0.0", - "sp-std", - "sp-storage 20.0.0", - "ss58-registry", - "substrate-bip39 0.4.6", - "thiserror", - "tracing", - "w3f-bls", - "zeroize", + "sp-timestamp", ] [[package]] @@ -6155,7 +5790,7 @@ dependencies = [ "bounded-collections", "bs58", "dyn-clonable", - "ed25519-zebra 4.0.3", + "ed25519-zebra", "futures", "hash-db", "hash256-std-hasher", @@ -6178,12 +5813,12 @@ dependencies = [ "serde", "sp-crypto-hashing", "sp-debug-derive", - "sp-externalities 0.29.0", - "sp-runtime-interface 28.0.0", + "sp-externalities", + "sp-runtime-interface", "sp-std", - "sp-storage 21.0.0", + "sp-storage", "ss58-registry", - "substrate-bip39 0.6.0", + "substrate-bip39", "thiserror", "tracing", "w3f-bls", @@ -6226,18 +5861,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "sp-externalities" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7096ed024cec397804864898b093b51e14c7299f1d00c67dd5800330e02bb82" -dependencies = [ - "environmental", - "parity-scale-codec", - "sp-std", - "sp-storage 20.0.0", -] - [[package]] name = "sp-externalities" version = "0.29.0" @@ -6246,19 +5869,7 @@ checksum = "a904407d61cb94228c71b55a9d3708e9d6558991f9e83bd42bd91df37a159d30" dependencies = [ "environmental", "parity-scale-codec", - "sp-storage 21.0.0", -] - -[[package]] -name = "sp-genesis-builder" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd865540ec19479c7349b584ccd78cc34c3f3a628a2a69dbb6365ceec36295ee" -dependencies = [ - "serde_json", - "sp-api 27.0.1", - "sp-runtime 32.0.0", - "sp-std", + "sp-storage", ] [[package]] @@ -6270,23 +5881,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde_json", - "sp-api 33.0.0", - "sp-runtime 38.0.0", -] - -[[package]] -name = "sp-inherents" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "607c9e35e96966645ff180a9e9f976433b96e905d0a91d8d5315e605a21f4bc0" -dependencies = [ - "async-trait", - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "sp-runtime 32.0.0", - "sp-std", - "thiserror", + "sp-api", + "sp-runtime", ] [[package]] @@ -6299,36 +5895,10 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime 38.0.0", + "sp-runtime", "thiserror", ] -[[package]] -name = "sp-io" -version = "31.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec43aa073eab35fcb920d7592474d5427ea3be2bf938706a3ad955d7ba54fd8d" -dependencies = [ - "bytes", - "ed25519-dalek", - "libsecp256k1", - "log", - "parity-scale-codec", - "rustversion", - "secp256k1", - "sp-core 29.0.0", - "sp-crypto-hashing", - "sp-externalities 0.26.0", - "sp-keystore 0.35.0", - "sp-runtime-interface 25.0.0", - "sp-state-machine 0.36.0", - "sp-std", - "sp-tracing 16.0.0", - "sp-trie 30.0.0", - "tracing", - "tracing-core", -] - [[package]] name = "sp-io" version = "37.0.0" @@ -6343,32 +5913,19 @@ dependencies = [ "polkavm-derive 0.9.1", "rustversion", "secp256k1", - "sp-core 34.0.0", + "sp-core", "sp-crypto-hashing", - "sp-externalities 0.29.0", - "sp-keystore 0.40.0", - "sp-runtime-interface 28.0.0", - "sp-state-machine 0.42.0", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", "sp-std", - "sp-tracing 17.0.0", - "sp-trie 36.0.0", + "sp-tracing", + "sp-trie", "tracing", "tracing-core", ] -[[package]] -name = "sp-keystore" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444f2d53968b1ce5e908882710ff1f3873fcf3e95f59d57432daf685bbacb959" -dependencies = [ - "parity-scale-codec", - "parking_lot", - "sp-core 29.0.0", - "sp-externalities 0.26.0", - "thiserror", -] - [[package]] name = "sp-keystore" version = "0.40.0" @@ -6377,8 +5934,8 @@ checksum = "0248b4d784cb4a01472276928977121fa39d977a5bb24793b6b15e64b046df42" dependencies = [ "parity-scale-codec", "parking_lot", - "sp-core 34.0.0", - "sp-externalities 0.29.0", + "sp-core", + "sp-externalities", ] [[package]] @@ -6393,51 +5950,56 @@ dependencies = [ [[package]] name = "sp-metadata-ir" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0b5e87e56c1bb26d9524d48dd127121d630f895bd5914a34f0b017489f7c1d" +checksum = "a616fa51350b35326682a472ee8e6ba742fdacb18babac38ecd46b3e05ead869" dependencies = [ "frame-metadata", "parity-scale-codec", "scale-info", - "sp-std", ] [[package]] -name = "sp-metadata-ir" -version = "0.7.0" +name = "sp-mmr-primitives" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a616fa51350b35326682a472ee8e6ba742fdacb18babac38ecd46b3e05ead869" +checksum = "47412a2d2e988430d5f59d7fec1473f229e1ef5ce24c1ea4f601b4b3679cac52" dependencies = [ - "frame-metadata", + "log", "parity-scale-codec", + "polkadot-ckb-merkle-mountain-range", "scale-info", + "serde", + "sp-api", + "sp-core", + "sp-debug-derive", + "sp-runtime", + "thiserror", ] [[package]] name = "sp-npos-elections" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "195d7e1154c91cce5c3abc8c778689c3e5799da6411328dd32ac7a974c68e526" +checksum = "0b0c51a7b60cd663f2661e6949069eb316b092f22c239691d5272a4d0cfca0fb" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic 24.0.0", - "sp-core 29.0.0", - "sp-runtime 32.0.0", - "sp-std", + "sp-arithmetic", + "sp-core", + "sp-runtime", ] [[package]] name = "sp-offchain" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d83b955dce0b6d143bec3f60571311168f362b1c16cf044da7037a407b66c19" +checksum = "cbe721c367760bddf10fcfa24fb48edd64c442f71db971f043c8ac73f51aa6e9" dependencies = [ - "sp-api 27.0.1", - "sp-core 29.0.0", - "sp-runtime 32.0.0", + "sp-api", + "sp-core", + "sp-runtime", ] [[package]] @@ -6451,31 +6013,6 @@ dependencies = [ "regex", ] -[[package]] -name = "sp-runtime" -version = "32.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a95e71603a6281e91b0f1fd3d68057644be16d75a4602013187b8137db8abee" -dependencies = [ - "docify", - "either", - "hash256-std-hasher", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "paste", - "rand", - "scale-info", - "serde", - "simple-mermaid", - "sp-application-crypto 31.0.0", - "sp-arithmetic 24.0.0", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-std", - "sp-weights 28.0.0", -] - [[package]] name = "sp-runtime" version = "38.0.0" @@ -6494,31 +6031,12 @@ dependencies = [ "scale-info", "serde", "simple-mermaid", - "sp-application-crypto 37.0.0", - "sp-arithmetic 26.0.0", - "sp-core 34.0.0", - "sp-io 37.0.0", + "sp-application-crypto", + "sp-arithmetic", + "sp-core", + "sp-io", "sp-std", - "sp-weights 31.0.0", -] - -[[package]] -name = "sp-runtime-interface" -version = "25.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2321ab29d4bcc31f1ba1b4f076a81fb2a666465231e5c981c72320d74dbe63" -dependencies = [ - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec", - "primitive-types", - "sp-externalities 0.26.0", - "sp-runtime-interface-proc-macro 17.0.0", - "sp-std", - "sp-storage 20.0.0", - "sp-tracing 16.0.0", - "sp-wasm-interface 20.0.0", - "static_assertions", + "sp-weights", ] [[package]] @@ -6532,29 +6050,15 @@ dependencies = [ "parity-scale-codec", "polkavm-derive 0.9.1", "primitive-types", - "sp-externalities 0.29.0", - "sp-runtime-interface-proc-macro 18.0.0", + "sp-externalities", + "sp-runtime-interface-proc-macro", "sp-std", - "sp-storage 21.0.0", - "sp-tracing 17.0.0", - "sp-wasm-interface 21.0.0", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", "static_assertions", ] -[[package]] -name = "sp-runtime-interface-proc-macro" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfaf6e85b2ec12a4b99cd6d8d57d083e30c94b7f1b0d8f93547121495aae6f0c" -dependencies = [ - "Inflector", - "expander", - "proc-macro-crate 3.2.0", - "proc-macro2", - "quote", - "syn 2.0.77", -] - [[package]] name = "sp-runtime-interface-proc-macro" version = "18.0.0" @@ -6571,33 +6075,17 @@ dependencies = [ [[package]] name = "sp-session" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b86531090cc04d2ab3535df07146258e2fb3ab6257b0a77ef14aa08282c3d4a" -dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-api 27.0.1", - "sp-core 29.0.0", - "sp-keystore 0.35.0", - "sp-runtime 32.0.0", - "sp-staking 27.0.0", - "sp-std", -] - -[[package]] -name = "sp-staking" -version = "27.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e14d003ecf0b610bf1305a92bdab875289b39d514c073f30e75e78c2763a788" +checksum = "4daf2e40ffc7e7e8de08efb860eb9534faf614a49c53dc282f430faedb4aed13" dependencies = [ - "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "serde", - "sp-core 29.0.0", - "sp-runtime 32.0.0", - "sp-std", + "sp-api", + "sp-core", + "sp-keystore", + "sp-runtime", + "sp-staking", ] [[package]] @@ -6610,30 +6098,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 34.0.0", - "sp-runtime 38.0.0", -] - -[[package]] -name = "sp-state-machine" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a67297e702aa32027d7766803f362a420d6d3ec9e2f84961f3c64e2e52b5aaf9" -dependencies = [ - "hash-db", - "log", - "parity-scale-codec", - "parking_lot", - "rand", - "smallvec", - "sp-core 29.0.0", - "sp-externalities 0.26.0", - "sp-panic-handler", - "sp-std", - "sp-trie 30.0.0", - "thiserror", - "tracing", - "trie-db 0.28.0", + "sp-core", + "sp-runtime", ] [[package]] @@ -6648,13 +6114,13 @@ dependencies = [ "parking_lot", "rand", "smallvec", - "sp-core 34.0.0", - "sp-externalities 0.29.0", + "sp-core", + "sp-externalities", "sp-panic-handler", - "sp-trie 36.0.0", + "sp-trie", "thiserror", "tracing", - "trie-db 0.29.1", + "trie-db", ] [[package]] @@ -6663,20 +6129,6 @@ version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" -[[package]] -name = "sp-storage" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dba5791cb3978e95daf99dad919ecb3ec35565604e88cd38d805d9d4981e8bd" -dependencies = [ - "impl-serde", - "parity-scale-codec", - "ref-cast", - "serde", - "sp-debug-derive", - "sp-std", -] - [[package]] name = "sp-storage" version = "21.0.0" @@ -6690,20 +6142,6 @@ dependencies = [ "sp-debug-derive", ] -[[package]] -name = "sp-timestamp" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "249cd06624f2edb53b25af528ab216a508dc9d0870e158b43caac3a97e86699f" -dependencies = [ - "async-trait", - "parity-scale-codec", - "sp-inherents 27.0.0", - "sp-runtime 32.0.0", - "sp-std", - "thiserror", -] - [[package]] name = "sp-timestamp" version = "33.0.0" @@ -6712,24 +6150,11 @@ checksum = "78becf144a76f6fd108dfe94a90e20a185b38c0b310dc5482328196143c8266b" dependencies = [ "async-trait", "parity-scale-codec", - "sp-inherents 33.0.0", - "sp-runtime 38.0.0", + "sp-inherents", + "sp-runtime", "thiserror", ] -[[package]] -name = "sp-tracing" -version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0351810b9d074df71c4514c5228ed05c250607cba131c1c9d1526760ab69c05c" -dependencies = [ - "parity-scale-codec", - "sp-std", - "tracing", - "tracing-core", - "tracing-subscriber", -] - [[package]] name = "sp-tracing" version = "17.0.0" @@ -6744,37 +6169,12 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "27.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9742861c5330bdcb42856a6eed3d3745b58ee1c92ca4c9260032ff4e6c387165" -dependencies = [ - "sp-api 27.0.1", - "sp-runtime 32.0.0", -] - -[[package]] -name = "sp-trie" -version = "30.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed48dfd05081e8b36741b10ce4eb686c135a2952227a11fe71caec89890ddbb" +checksum = "a3c9d1604aadc15b70e95f4388d0b1aa380215520b7ddfd372531a6d8262269c" dependencies = [ - "ahash 0.8.11", - "hash-db", - "lazy_static", - "memory-db", - "nohash-hasher", - "parity-scale-codec", - "parking_lot", - "rand", - "scale-info", - "schnellru", - "sp-core 29.0.0", - "sp-externalities 0.26.0", - "sp-std", - "thiserror", - "tracing", - "trie-db 0.28.0", - "trie-root", + "sp-api", + "sp-runtime", ] [[package]] @@ -6783,7 +6183,7 @@ version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d717c0f465f5371569e6fdc25b6f32d47c15d6e4c92b3b779e1c9b18b951d" dependencies = [ - "ahash 0.8.11", + "ahash", "hash-db", "lazy_static", "memory-db", @@ -6793,32 +6193,14 @@ dependencies = [ "rand", "scale-info", "schnellru", - "sp-core 34.0.0", - "sp-externalities 0.29.0", + "sp-core", + "sp-externalities", "thiserror", "tracing", - "trie-db 0.29.1", + "trie-db", "trie-root", ] -[[package]] -name = "sp-version" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4a660c68995663d6778df324f4e2b4efc48d55a8e9c92c22a5fb7dae7899cd" -dependencies = [ - "impl-serde", - "parity-scale-codec", - "parity-wasm", - "scale-info", - "serde", - "sp-crypto-hashing-proc-macro", - "sp-runtime 32.0.0", - "sp-std", - "sp-version-proc-macro 13.0.0", - "thiserror", -] - [[package]] name = "sp-version" version = "36.0.0" @@ -6831,48 +6213,22 @@ dependencies = [ "scale-info", "serde", "sp-crypto-hashing-proc-macro", - "sp-runtime 38.0.0", + "sp-runtime", "sp-std", - "sp-version-proc-macro 14.0.0", + "sp-version-proc-macro", "thiserror", ] -[[package]] -name = "sp-version-proc-macro" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9bc3fed32d6dacbbbfb28dd1fe0224affbb737cb6cbfca1d9149351c2b69a7d" -dependencies = [ - "parity-scale-codec", - "proc-macro2", - "quote", - "syn 2.0.77", -] - [[package]] name = "sp-version-proc-macro" version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aee8f6730641a65fcf0c8f9b1e448af4b3bb083d08058b47528188bccc7b7a7" -dependencies = [ - "parity-scale-codec", - "proc-macro2", - "quote", - "syn 2.0.77", -] - -[[package]] -name = "sp-wasm-interface" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef97172c42eb4c6c26506f325f48463e9bc29b2034a587f1b9e48c751229bee" -dependencies = [ - "anyhow", - "impl-trait-for-tuples", - "log", +checksum = "5aee8f6730641a65fcf0c8f9b1e448af4b3bb083d08058b47528188bccc7b7a7" +dependencies = [ "parity-scale-codec", - "sp-std", - "wasmtime", + "proc-macro2", + "quote", + "syn 2.0.77", ] [[package]] @@ -6886,22 +6242,6 @@ dependencies = [ "parity-scale-codec", ] -[[package]] -name = "sp-weights" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3be30aec904994451dcacf841a9168cfbbaf817de6b24b6a1c1418cbf1af2fe" -dependencies = [ - "bounded-collections", - "parity-scale-codec", - "scale-info", - "serde", - "smallvec", - "sp-arithmetic 24.0.0", - "sp-debug-derive", - "sp-std", -] - [[package]] name = "sp-weights" version = "31.0.0" @@ -6913,7 +6253,7 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-arithmetic 26.0.0", + "sp-arithmetic", "sp-debug-derive", ] @@ -6956,38 +6296,19 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-parachain-info" -version = "0.8.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da7dc139d104f676a18c13380a09c3f72d59450a7471116387cbf8cb5f845a0e" +checksum = "cd00d586b0dac4f42736bdd0ad52213a891b240e011ea82b38938263dd821c25" dependencies = [ "cumulus-primitives-core", - "frame-support 29.0.2", - "frame-system 29.0.0", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", - "sp-runtime 32.0.0", + "sp-runtime", "sp-std", ] -[[package]] -name = "staging-xcm" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fa328b87de3466bc38cc9a07244c42c647b7755b81115e1dfeb47cc13fc6e6" -dependencies = [ - "array-bytes", - "bounded-collections", - "derivative", - "environmental", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-weights 28.0.0", - "xcm-procedural 8.0.0", -] - [[package]] name = "staging-xcm" version = "14.1.0" @@ -7003,31 +6324,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-weights 31.0.0", - "xcm-procedural 10.1.0", -] - -[[package]] -name = "staging-xcm-builder" -version = "8.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b7447c38be3ca9fb21c7434de2243aa6ac74acde8944cda7bb6e2a4f765801" -dependencies = [ - "frame-support 29.0.2", - "frame-system 29.0.0", - "impl-trait-for-tuples", - "log", - "pallet-transaction-payment 29.0.2", - "parity-scale-codec", - "polkadot-parachain-primitives 7.0.0", - "scale-info", - "sp-arithmetic 24.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", - "sp-std", - "sp-weights 28.0.0", - "staging-xcm 8.0.1", - "staging-xcm-executor 8.0.2", + "sp-weights", + "xcm-procedural", ] [[package]] @@ -7036,43 +6334,21 @@ version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "847fa2afe1bed2751eaabf7b91fa4043037947f17653d7cc59ea202cc44c6bb8" dependencies = [ - "frame-support 36.0.0", - "frame-system 36.1.0", - "impl-trait-for-tuples", - "log", - "pallet-transaction-payment 36.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 13.0.0", - "scale-info", - "sp-arithmetic 26.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.0", - "sp-std", - "sp-weights 31.0.0", - "staging-xcm 14.1.0", - "staging-xcm-executor 15.0.0", -] - -[[package]] -name = "staging-xcm-executor" -version = "8.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b5c5f2a1d610c5e20e5fae2680c9a28380f305afafeed62f341bfbce57b79a" -dependencies = [ - "environmental", - "frame-benchmarking 29.0.0", - "frame-support 29.0.2", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", + "pallet-transaction-payment", "parity-scale-codec", + "polkadot-parachain-primitives", "scale-info", - "sp-arithmetic 24.0.0", - "sp-core 29.0.0", - "sp-io 31.0.0", - "sp-runtime 32.0.0", + "sp-arithmetic", + "sp-io", + "sp-runtime", "sp-std", - "sp-weights 28.0.0", - "staging-xcm 8.0.1", + "sp-weights", + "staging-xcm", + "staging-xcm-executor", ] [[package]] @@ -7082,19 +6358,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26b98d8219449eaf02e71a7edf1a14b14d4c713dd01d9df66fde1ce30dba4d6d" dependencies = [ "environmental", - "frame-benchmarking 36.0.0", - "frame-support 36.0.0", + "frame-benchmarking", + "frame-support", "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.0", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-runtime", "sp-std", - "sp-weights 31.0.0", - "staging-xcm 14.1.0", + "sp-weights", + "staging-xcm", ] [[package]] @@ -7131,9 +6407,6 @@ name = "strum" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros 0.24.3", -] [[package]] name = "strum" @@ -7170,19 +6443,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "substrate-bip39" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" -dependencies = [ - "hmac 0.11.0", - "pbkdf2 0.8.0", - "schnorrkel", - "sha2 0.9.9", - "zeroize", -] - [[package]] name = "substrate-bip39" version = "0.6.0" @@ -7190,25 +6450,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" dependencies = [ "hmac 0.12.1", - "pbkdf2 0.12.2", + "pbkdf2", "schnorrkel", "sha2 0.10.8", "zeroize", ] +[[package]] +name = "substrate-state-machine" +version = "1.15.0" +source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-v1.14.0#f95ee188c3b73ca3c4d6319ab85cff12fe757c4c" +dependencies = [ + "frame-support", + "hash-db", + "ismp", + "pallet-ismp", + "parity-scale-codec", + "primitive-types", + "scale-info", + "serde", + "sp-consensus-aura", + "sp-runtime", + "sp-trie", +] + [[package]] name = "substrate-wasm-builder" -version = "18.0.1" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a39a20e17c24ede36b5bd5e7543a4cef8d8a0daf6e1a046dc31832b837a54a0" +checksum = "7dc993ad871b63fbba60362f3ea86583f5e7e1256e8fdcb3b5b249c9ead354bf" dependencies = [ "build-helper", "cargo_metadata 0.15.4", "console", "filetime", "parity-wasm", + "polkavm-linker", "sp-maybe-compressed-blob", - "strum 0.24.1", + "strum 0.26.3", "tempfile", "toml", "walkdir", @@ -7260,12 +6539,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" -[[package]] -name = "target-lexicon" -version = "0.12.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" - [[package]] name = "tempfile" version = "3.12.0" @@ -7275,7 +6548,7 @@ dependencies = [ "cfg-if", "fastrand", "once_cell", - "rustix 0.38.37", + "rustix", "windows-sys 0.59.0", ] @@ -7562,19 +6835,6 @@ dependencies = [ "tracing-serde", ] -[[package]] -name = "trie-db" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff28e0f815c2fea41ebddf148e008b077d2faddb026c9555b29696114d602642" -dependencies = [ - "hash-db", - "hashbrown 0.13.2", - "log", - "rustc-hex", - "smallvec", -] - [[package]] name = "trie-db" version = "0.29.1" @@ -7734,7 +6994,7 @@ dependencies = [ "digest 0.10.7", "rand", "rand_chacha", - "rand_core 0.6.4", + "rand_core", "sha2 0.10.8", "sha3", "thiserror", @@ -7879,19 +7139,6 @@ dependencies = [ "cxx-build", ] -[[package]] -name = "wasmi" -version = "0.31.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8281d1d660cdf54c76a3efa9ddd0c270cada1383a995db3ccb43d166456c7" -dependencies = [ - "smallvec", - "spin", - "wasmi_arena", - "wasmi_core 0.13.0", - "wasmparser-nostd", -] - [[package]] name = "wasmi" version = "0.32.3" @@ -7905,39 +7152,21 @@ dependencies = [ "smallvec", "spin", "wasmi_collections", - "wasmi_core 0.32.3", + "wasmi_core", "wasmparser-nostd", ] -[[package]] -name = "wasmi_arena" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" - [[package]] name = "wasmi_collections" version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c128c039340ffd50d4195c3f8ce31aac357f06804cfc494c8b9508d4b30dca4" dependencies = [ - "ahash 0.8.11", + "ahash", "hashbrown 0.14.5", "string-interner", ] -[[package]] -name = "wasmi_core" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" -dependencies = [ - "downcast-rs", - "libm", - "num-traits", - "paste", -] - [[package]] name = "wasmi_core" version = "0.32.3" @@ -7950,16 +7179,6 @@ dependencies = [ "paste", ] -[[package]] -name = "wasmparser" -version = "0.102.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" -dependencies = [ - "indexmap 1.9.3", - "url", -] - [[package]] name = "wasmparser-nostd" version = "0.100.2" @@ -7969,138 +7188,6 @@ dependencies = [ "indexmap-nostd", ] -[[package]] -name = "wasmtime" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f907fdead3153cb9bfb7a93bbd5b62629472dc06dee83605358c64c52ed3dda9" -dependencies = [ - "anyhow", - "bincode", - "cfg-if", - "indexmap 1.9.3", - "libc", - "log", - "object 0.30.4", - "once_cell", - "paste", - "psm", - "serde", - "target-lexicon", - "wasmparser", - "wasmtime-environ", - "wasmtime-jit", - "wasmtime-runtime", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-asm-macros" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3b9daa7c14cd4fa3edbf69de994408d5f4b7b0959ac13fa69d465f6597f810d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "wasmtime-environ" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a990198cee4197423045235bf89d3359e69bd2ea031005f4c2d901125955c949" -dependencies = [ - "anyhow", - "cranelift-entity", - "gimli 0.27.3", - "indexmap 1.9.3", - "log", - "object 0.30.4", - "serde", - "target-lexicon", - "thiserror", - "wasmparser", - "wasmtime-types", -] - -[[package]] -name = "wasmtime-jit" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de48df552cfca1c9b750002d3e07b45772dd033b0b206d5c0968496abf31244" -dependencies = [ - "addr2line 0.19.0", - "anyhow", - "bincode", - "cfg-if", - "cpp_demangle", - "gimli 0.27.3", - "log", - "object 0.30.4", - "rustc-demangle", - "serde", - "target-lexicon", - "wasmtime-environ", - "wasmtime-jit-icache-coherence", - "wasmtime-runtime", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-jit-debug" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0554b84c15a27d76281d06838aed94e13a77d7bf604bbbaf548aa20eb93846" -dependencies = [ - "once_cell", -] - -[[package]] -name = "wasmtime-jit-icache-coherence" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aecae978b13f7f67efb23bd827373ace4578f2137ec110bbf6a4a7cde4121bbd" -dependencies = [ - "cfg-if", - "libc", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-runtime" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658cf6f325232b6760e202e5255d823da5e348fdea827eff0a2a22319000b441" -dependencies = [ - "anyhow", - "cc", - "cfg-if", - "indexmap 1.9.3", - "libc", - "log", - "mach", - "memfd", - "memoffset", - "paste", - "rand", - "rustix 0.36.17", - "wasmtime-asm-macros", - "wasmtime-environ", - "wasmtime-jit-debug", - "windows-sys 0.45.0", -] - -[[package]] -name = "wasmtime-types" -version = "8.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4f6fffd2a1011887d57f07654dd112791e872e3ff4a2e626aee8059ee17f06f" -dependencies = [ - "cranelift-entity", - "serde", - "thiserror", - "wasmparser", -] - [[package]] name = "wast" version = "217.0.0" @@ -8131,7 +7218,7 @@ checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f" dependencies = [ "either", "home", - "rustix 0.38.37", + "rustix", "winsafe", ] @@ -8185,15 +7272,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -8221,21 +7299,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.48.5" @@ -8267,12 +7330,6 @@ dependencies = [ "windows_x86_64_msvc 0.52.6", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -8285,12 +7342,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -8303,12 +7354,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -8327,12 +7372,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -8345,12 +7384,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -8363,12 +7396,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -8381,12 +7408,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -8434,9 +7455,9 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "8.0.0" +version = "10.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4717a97970a9cda70d7db53cf50d2615c2f6f6b7c857445325b4a39ea7aa2cd" +checksum = "87fb4f14094d65c500a59bcf540cf42b99ee82c706edd6226a92e769ad60563e" dependencies = [ "Inflector", "proc-macro2", @@ -8445,15 +7466,19 @@ dependencies = [ ] [[package]] -name = "xcm-procedural" -version = "10.1.0" +name = "xcm-runtime-apis" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fb4f14094d65c500a59bcf540cf42b99ee82c706edd6226a92e769ad60563e" +checksum = "30fffcd9128a46abd836c37dd001c2cbe122aeb8904cd7b9bac8358564fb7b56" dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "syn 2.0.77", + "frame-support", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-std", + "sp-weights", + "staging-xcm", + "staging-xcm-executor", ] [[package]] diff --git a/crates/pop-drink/src/error.rs b/crates/pop-drink/src/error.rs index d7cad05..ba9aca7 100644 --- a/crates/pop-drink/src/error.rs +++ b/crates/pop-drink/src/error.rs @@ -12,6 +12,79 @@ fn decode(data: &[u8]) -> T { T::decode(&mut &data[..]).expect("Decoding failed") } +/// Asserts a custom error type against the `Error`. This is useful when you want to check if a contract's custom error (e.g., [`PSP22Error`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/v0/fungibles/errors.rs#L73C1-L73C22)) matches the error code returned by the runtime, which is represented by a [`StatusCode`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/lib.rs#L33). The error type must be convertible to a `u32`. +/// +/// # Parameters +/// +/// - `result` - Contract method's result returns the custom error type which is convertible to +/// `u32`. +/// - `error` - `Error` to assert against the custom error type. +/// +/// # Examples +/// +/// To assert the `StatusCode` returned by a contract method that uses Pop API, you simply use the provided `assert_err!` macro. +/// +/// ```rs +/// // Required imports to test the custom error. +/// use drink::{ assert_err, devnet::error::{ v0::Error, Arithmetic, ArithmeticError::Overflow }}; +/// +/// // Call a contract method named "hello_world" that returns `StatusCode`. +/// let result = call::(session, "hello_world", vec![], None); +/// +/// // Using macro to test the returned error. +/// assert_err!(result, Error::Api(Arithmetic(Overflow))); +/// ``` +#[macro_export] +macro_rules! assert_err { + ($result:expr, $error:expr $(,)?) => { + $crate::error::assert_err_inner::<_, _, _>($result, $error); + }; +} + +/// Asserts an error type to Error. This can be used for custom error types used by a contract which +/// uses the [`StatusCode`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/lib.rs#L33) returned by the pop runtime. The error type must be convertible to a `u32`. +/// +/// # Generic parameters +/// +/// - `R` - Type returned if `result` is `Ok()`. +/// - `E` - Type returend if `result` is `Err()`. Must be convertible to `u32`. +/// - `Error` - Runtime error type. +/// +/// # Parameters +/// +/// - `result` - The `Result` from a smart contract method, where `E` must be convertible to +/// `u32`. +/// - `expected_error` - The expected runtime specific `Error` to assert against the `E` error type +/// from `result`. +#[track_caller] +pub fn assert_err_inner(result: Result, expected_error: Error) +where + E: Into, + Error: From + Into + Debug, +{ + let expected_code: u32 = expected_error.into(); + let expected_error = Error::from(expected_code); + if let Err(error) = result { + let error_code: u32 = error.into(); + if error_code != expected_code { + panic!( + r#"assertion `left == right` failed + left: {:?} + right: {:?}"#, + Error::from(error_code), + expected_error + ); + } + } else { + panic!( + r#"assertion `left == right` failed + left: Ok() + right: {:?}"#, + expected_error + ); + } +} + /// Runtime error for efficiently testing both runtime module errors and API errors. /// It is designed for use with the `assert_err!` macro. /// @@ -131,120 +204,6 @@ where } } -/// Asserts that a `Result` with an error type convertible to `u32` matches the expected `Error` -/// from pop-drink. -/// -/// The macro is used to test a custom error which is returned by the API if the error doesn't conform to the provided API error (e.g., [`PSP22Error`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/v0/fungibles/errors.rs#L73C1-L73C22)). The custom error is represented by a [`StatusCode`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/lib.rs#L33), which encapsulates a `u32` value indicating the success or failure of a runtime call via the Pop API. -/// -/// Pop DRink! provides an error type and a [macro](https://doc.rust-lang.org/book/ch19-06-macros.html) to simplify testing both runtime module errors and API errors. -/// -/// - `Error`: Runtime error for efficiently testing both runtime module errors and API errors. -/// - `assert_err`: Asserts that a `Result` with an error type convertible to `u32` matches the -/// expected `Error` from pop-drink. -/// -/// # Parameters -/// -/// - `result` - The `Result` from a smart contract method, where `E` must be convertible to -/// `u32`. -/// - `error` - The expected runtime specific `Error` to assert against the `E` error type from -/// `result`. -/// -/// # Examples -/// -/// The below example interacts with a [PSP22](https://github.com/w3f/PSPs/blob/master/PSPs/psp-22.md) contract that uses [Pop API](https://github.com/r0gue-io/pop-node/tree/main/pop-api). The contract method returns the API error [`PSP22Error`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/v0/fungibles/errors.rs#L73C1-L73C22) which is provided by Pop API library. Learn more in the [PSP22 example contract](https://github.com/r0gue-io/pop-node/blob/main/pop-api/examples/fungibles/lib.rs). -/// -/// Note: `PSP22Error` is used here only as an example. The test suite utility library provided by -/// Pop DRink! is not limited to a single specific error type. -/// -/// ```rs -/// // Required imports to test the custom error. -/// use drink::{ -/// assert_err, -/// devnet::{ -/// error::{ -/// v0::Error, -/// Assets, -/// AssetsError::AssetNotLive, -/// }, -/// }, -/// }; -/// -/// // `PSP22Error` is provided by the API library. -/// use pop_api::v0::fungibles::PSP22Error; -/// ``` -/// -/// - Example `pop-drink` testing method to interact with PSP22 contract. -/// -/// ```rs -/// fn transfer(session: &mut Session, to: AccountId, amount: Balance) -> Result<(), PSP22Error> { -/// call::( -/// session, -/// "Psp22::transfer", -/// vec![to.to_string(), amount.to_string(), serde_json::to_string::<[u8; 0]>(&[]).unwrap()], -/// None, -/// ) -/// } -/// ``` -/// -/// - Using macro to test the returned error. -/// -/// ```rs -/// assert_err!( -/// transfer(&mut session, ALICE, AMOUNT), -/// Error::Module(Assets(AssetNotLive)) -/// ); -/// ``` -#[macro_export] -macro_rules! assert_err { - ($result:expr, $error:expr $(,)?) => { - $crate::error::assert_err_inner::<_, _, _>($result, $error); - }; -} - -/// Asserts that a `Result` with an error type convertible to `u32` matches the expected `Error` -/// from pop-drink. -/// -/// # Generic parameters -/// -/// - `R` - Type returned if `result` is `Ok()`. -/// - `E` - Type returend if `result` is `Err()`. Must be convertible to `u32`. -/// - `Error` - Runtime error type. -/// -/// # Parameters -/// -/// - `result` - The `Result` from a smart contract method, where `E` must be convertible to -/// `u32`. -/// - `expected_error` - The expected runtime specific `Error` to assert against the `E` error type -/// from `result`. -#[track_caller] -pub fn assert_err_inner(result: Result, expected_error: Error) -where - E: Into, - Error: From + Into + Debug, -{ - let expected_code: u32 = expected_error.into(); - let expected_error = Error::from(expected_code); - if let Err(error) = result { - let error_code: u32 = error.into(); - if error_code != expected_code { - panic!( - r#"assertion `left == right` failed - left: {:?} - right: {:?}"#, - Error::from(error_code), - expected_error - ); - } - } else { - panic!( - r#"assertion `left == right` failed - left: Ok() - right: {:?}"#, - expected_error - ); - } -} - #[cfg(test)] mod test { use pop_api::primitives::v0::Error as ApiError; diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index 6406fac..2e27654 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -54,8 +54,7 @@ pub mod devnet { /// /// # Parameters /// -/// - `session` - Wrapper around [`Sandbox`](https://github.com/r0gue-io/pop-drink/blob/main/crates/ink-sandbox/src/lib.rs) -/// that provides methods to interact with multiple contracts. [Reference](https://github.com/r0gue-io/pop-drink/blob/main/crates/drink/drink/src/session.rs). +/// - `session` - Wrapper around Sandbox that provides methods to interact with multiple contracts. [Reference](https://github.com/r0gue-io/pop-drink/blob/main/crates/drink/drink/src/session.rs). /// - `bundle` - A struct representing the result of parsing a `.contract` bundle file. [Reference](https://github.com/r0gue-io/pop-drink/blob/main/crates/drink/drink/src/session/bundle.rs). /// - `method` - The name of the contract constructor method. For trait methods, use /// `trait_name::method_name` (e.g., `Psp22::transfer`). @@ -126,8 +125,7 @@ where /// /// # Parameters /// -/// - `session` - Wrapper around [`Sandbox`](https://github.com/r0gue-io/pop-drink/blob/main/crates/ink-sandbox/src/lib.rs) -/// that provides methods to interact with multiple contracts. [Reference](https://github.com/r0gue-io/pop-drink/blob/main/crates/drink/drink/src/session.rs). +/// - `session` - Wrapper around Sandbox that provides methods to interact with multiple contracts. [Reference](https://github.com/r0gue-io/pop-drink/blob/main/crates/drink/drink/src/session.rs). /// - `func_name`: The name of the contract method. For trait methods, use `trait_name::method_name` /// (e.g., `Psp22::transfer`). /// - `input` - Arguments passed to the contract method. @@ -201,8 +199,7 @@ fn account_id_from_slice(s: &[u8; 32]) -> pop_api::primitives::AccountId { /// /// # Parameters /// -/// - `session` - Wrapper around [`Sandbox`](https://github.com/r0gue-io/pop-drink/blob/main/crates/ink-sandbox/src/lib.rs) -/// that provides methods to interact with multiple contracts. [Reference](https://github.com/r0gue-io/pop-drink/blob/main/crates/drink/drink/src/session.rs). +/// - `session` - Wrapper around Sandbox that provides methods to interact with multiple contracts. [Reference](https://github.com/r0gue-io/pop-drink/blob/main/crates/drink/drink/src/session.rs). /// /// # Examples /// From 364766f674bc2e9ed2663f219a61a7dc41655e56 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Tue, 15 Oct 2024 16:51:32 +0700 Subject: [PATCH 31/43] fix: doc --- crates/pop-drink/src/error.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/pop-drink/src/error.rs b/crates/pop-drink/src/error.rs index ba9aca7..319e3c8 100644 --- a/crates/pop-drink/src/error.rs +++ b/crates/pop-drink/src/error.rs @@ -47,15 +47,14 @@ macro_rules! assert_err { /// # Generic parameters /// /// - `R` - Type returned if `result` is `Ok()`. -/// - `E` - Type returend if `result` is `Err()`. Must be convertible to `u32`. -/// - `Error` - Runtime error type. +/// - `E` - Type returned if `result` is `Err()`. Must be convertible to `u32`. +/// - `Error` - `Error` to assert against the custom error type. /// /// # Parameters /// -/// - `result` - The `Result` from a smart contract method, where `E` must be convertible to +/// - `result` - Contract method's result returns the custom error type which is convertible to /// `u32`. -/// - `expected_error` - The expected runtime specific `Error` to assert against the `E` error type -/// from `result`. +/// - `expected_error` - `Error` to assert against the custom error type. #[track_caller] pub fn assert_err_inner(result: Result, expected_error: Error) where From 98244cd1507f637958dbd86c70b5c7381b7906a8 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Tue, 15 Oct 2024 23:10:05 +0700 Subject: [PATCH 32/43] fix: docs --- Cargo.lock | 1 + crates/pop-drink/src/error.rs | 137 ++++++++++++++++++++-------------- crates/pop-drink/src/lib.rs | 5 +- 3 files changed, 84 insertions(+), 59 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ee655c5..bfc9981 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3473,6 +3473,7 @@ dependencies = [ "frame-system", "log", "pallet-assets", + "pallet-nfts 31.0.0", "parity-scale-codec", "pop-chain-extension", "scale-info", diff --git a/crates/pop-drink/src/error.rs b/crates/pop-drink/src/error.rs index 319e3c8..dd43094 100644 --- a/crates/pop-drink/src/error.rs +++ b/crates/pop-drink/src/error.rs @@ -22,17 +22,18 @@ fn decode(data: &[u8]) -> T { /// /// # Examples /// -/// To assert the `StatusCode` returned by a contract method that uses Pop API, you simply use the provided `assert_err!` macro. +/// To assert the `StatusCode` returned by a contract method that uses Pop API, you simply use the +/// provided `assert_err!` macro. /// /// ```rs /// // Required imports to test the custom error. /// use drink::{ assert_err, devnet::error::{ v0::Error, Arithmetic, ArithmeticError::Overflow }}; /// -/// // Call a contract method named "hello_world" that returns `StatusCode`. +/// // Call a contract method named "hello_world" that throws `StatusCode`. /// let result = call::(session, "hello_world", vec![], None); /// -/// // Using macro to test the returned error. -/// assert_err!(result, Error::Api(Arithmetic(Overflow))); +/// // Asserts that the call fails because of an arithmetic operation error. +/// assert_err!(result, Error::Raw(Arithmetic(Overflow))); /// ``` #[macro_export] macro_rules! assert_err { @@ -84,155 +85,177 @@ where } } -/// Runtime error for efficiently testing both runtime module errors and API errors. -/// It is designed for use with the `assert_err!` macro. +/// Error type for testing why a runtime call fails. /// /// # Generic Parameters /// -/// - `ModuleError` - Error type of the runtime modules. [Reference](https://paritytech.github.io/polkadot-sdk/master/solochain_template_runtime/enum.Error.html). -/// - `ApiError` - Error type of the API, which depends on version. [Reference](https://github.com/r0gue-io/pop-node/tree/main/pop-api). -/// - `MODULE_INDEX` - Index of the variant `Error::Module`. This is based on the index of [`ApiError::Module`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L38). +/// - [`RuntimeCallError`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L30) +/// - Reason why a runtime call fails. (.e.g, arithmetic operation errors) +/// - [`ModuleError`](https://paritytech.github.io/polkadot-sdk/master/solochain_template_runtime/enum.Error.html) +/// - Refers to specific reasons a runtime call fails, originating from the runtime modules. +/// - [`MODULE_INDEX`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L38) +/// - Index of the variant `Error::Module`. /// /// # Examples /// -/// ### Runtime module errors +/// ### Runtime call errors /// -/// - Import types to construct runtime module errors: +/// - Import types to construct runtime call errors: /// /// ```rs -/// use drink::devnet::{ -/// Assets, -/// AssetsError::AssetNotLive, -/// Balances::BelowMinimum, -/// BalancesError::BelowMinimum +/// use drink::devnet::v0::{ +/// Arithmetic, +/// ArithmeticError::Overflow, +/// BadOrigin /// }; /// ``` /// -/// - Construct a runtime module error [`Assets(AssetNotLive)`](https://paritytech.github.io/polkadot-sdk/master/pallet_assets/pallet/enum.Error.html#variant.AssetNotLive): +/// - Runtime call error [`Arithmetic(Overflow)`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L55): /// /// ```rs -/// Error::Module(Assets(AssetNotLive)) +/// Error::Raw(Arithmetic(Overflow)) /// ``` /// -/// - Construct a runtime module error [`Balances(InsufficientBalance)`](https://docs.rs/pallet-balances/latest/pallet_balances/pallet/enum.Error.html#variant.InsufficientBalance): +/// - Runtime call error [`BadOrigin`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L36C4-L36C18): /// /// ```rs -/// Error::Module(Balances(InsufficientBalance)) +/// Error::Raw(BadOrigin) /// ``` /// -/// ### API errors +/// ### Runtime module errors /// -/// - Import types to construct API errors: +/// - Import types to construct runtime module errors: /// /// ```rs -/// use drink::devnet::v0::{ -/// Arithmetic, -/// ArithmeticError::Overflow, -/// BadOrigin +/// use drink::devnet::{ +/// Assets, +/// AssetsError::AssetNotLive, +/// Balances::BelowMinimum, +/// BalancesError::BelowMinimum /// }; /// ``` /// -/// - API error [`Arithmetic(Overflow)`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L55): +/// - Construct a runtime module error [`Assets(AssetNotLive)`](https://paritytech.github.io/polkadot-sdk/master/pallet_assets/pallet/enum.Error.html#variant.AssetNotLive): /// /// ```rs -/// Error::Api(Arithmetic(Overflow)) +/// Error::Module(Assets(AssetNotLive)) /// ``` /// -/// - API error [`BadOrigin`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L36C4-L36C18): +/// - Construct a runtime module error [`Balances(InsufficientBalance)`](https://docs.rs/pallet-balances/latest/pallet_balances/pallet/enum.Error.html#variant.InsufficientBalance): /// /// ```rs -/// Error::Api(BadOrigin) +/// Error::Module(Balances(InsufficientBalance)) /// ``` + #[derive(Encode, Decode, Debug)] -pub enum Error +pub enum Error where + RuntimeCallError: Decode + Encode + Debug + From + Into, ModuleError: Decode + Encode + Debug, - ApiError: Decode + Encode + Debug + From + Into, { - /// Error type of the runtime modules. [Reference](https://paritytech.github.io/polkadot-sdk/master/solochain_template_runtime/enum.Error.html). + /// Reason why a runtime call fails. [Reference](https://github.com/r0gue-io/pop-node/blob/52fb7f06a89955d462900e33d2b9c9170c4534a0/primitives/src/lib.rs#L30). + Raw(RuntimeCallError), + /// [Module error](https://paritytech.github.io/polkadot-sdk/master/solochain_template_runtime/enum.Error.html) refers to specific reasons a runtime call fails, originating from the runtime modules. Module(ModuleError), - /// Every [`ApiError`](https://github.com/r0gue-io/pop-node/blob/52fb7f06a89955d462900e33d2b9c9170c4534a0/primitives/src/lib.rs#L30). - Api(ApiError), } -impl From> - for u32 +impl + From> for u32 where + RuntimeCallError: Decode + Encode + Debug + From + Into, ModuleError: Decode + Encode + Debug, - ApiError: Decode + Encode + Debug + From + Into, { - /// Converts an `Error` into a numerical value of `ApiError`. + /// Converts an `Error` to a `u32` number. /// /// This conversion is necessary for comparing `Error` instances with other types. // Compared types must implement `Into`, as `Error` does not implement `Eq`. // Use this function to obtain a numerical representation of the error for comparison or // further processing. - fn from(error: Error) -> Self { + fn from(error: Error) -> Self { match error { + Error::Raw(error) => decode::(&error.encode()), Error::Module(error) => { let mut encoded = error.encode(); encoded.insert(0, MODULE_INDEX); encoded.resize(4, 0); - decode::(&encoded) + decode::(&encoded) }, - Error::Api(error) => decode::(&error.encode()), } .into() } } -impl From - for Error +impl From + for Error where + RuntimeCallError: Decode + Encode + Debug + From + Into, ModuleError: Decode + Encode + Debug, - ApiError: Decode + Encode + Debug + From + Into, { - /// Converts a numerical value of `ApiError` into an `Error`. + /// Converts a numerical value `u32` into an `Error`. /// /// This is used to reconstruct and display an `Error` from its numerical representation /// when an error is thrown. fn from(value: u32) -> Self { - let error = ApiError::from(value); + let error = RuntimeCallError::from(value); let encoded = error.encode(); if encoded[0] == MODULE_INDEX { let (index, module_error) = (encoded[1], &encoded[2..]); let data = vec![vec![index], module_error.to_vec()].concat(); return Error::Module(decode(&data)); } - Error::Api(error) + Error::Raw(error) } } #[cfg(test)] mod test { - use pop_api::primitives::v0::Error as ApiError; + use pop_api::primitives::v0::Error as RuntimeCallError; use crate::error::{AssetsError::*, BalancesError::*, *}; - fn test_cases() -> Vec<(Error, ApiError)> { + fn test_cases() -> Vec<(Error, RuntimeCallError)> + { use frame_support::traits::PalletInfoAccess; use pop_api::primitives::{ArithmeticError::*, TokenError::*}; use crate::mock::RuntimeError::*; vec![ - (Error::Api(ApiError::BadOrigin), ApiError::BadOrigin), - (Error::Api(ApiError::Token(BelowMinimum)), ApiError::Token(BelowMinimum)), - (Error::Api(ApiError::Arithmetic(Overflow)), ApiError::Arithmetic(Overflow)), + (Error::Raw(RuntimeCallError::BadOrigin), RuntimeCallError::BadOrigin), + ( + Error::Raw(RuntimeCallError::Token(BelowMinimum)), + RuntimeCallError::Token(BelowMinimum), + ), + ( + Error::Raw(RuntimeCallError::Arithmetic(Overflow)), + RuntimeCallError::Arithmetic(Overflow), + ), ( Error::Module(Assets(BalanceLow)), - ApiError::Module { index: crate::mock::Assets::index() as u8, error: [0, 0] }, + RuntimeCallError::Module { + index: crate::mock::Assets::index() as u8, + error: [0, 0], + }, ), ( Error::Module(Assets(NoAccount)), - ApiError::Module { index: crate::mock::Assets::index() as u8, error: [1, 0] }, + RuntimeCallError::Module { + index: crate::mock::Assets::index() as u8, + error: [1, 0], + }, ), ( Error::Module(Balances(VestingBalance)), - ApiError::Module { index: crate::mock::Balances::index() as u8, error: [0, 0] }, + RuntimeCallError::Module { + index: crate::mock::Balances::index() as u8, + error: [0, 0], + }, ), ( Error::Module(Balances(LiquidityRestrictions)), - ApiError::Module { index: crate::mock::Balances::index() as u8, error: [1, 0] }, + RuntimeCallError::Module { + index: crate::mock::Balances::index() as u8, + error: [1, 0], + }, ), ] } diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index 2e27654..ab24098 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -24,10 +24,11 @@ pub mod devnet { /// A collection of error types from the `v0` module used for smart contract testing in the /// `devnet` environment. pub mod v0 { - pub use pop_api::primitives::v0::{Error as ApiError, *}; + pub use pop_api::primitives::v0::{Error as RuntimeCallError, *}; /// Error type for testing contracts using the API V0. - pub type Error = crate::error::Error; + pub type Error = + crate::error::Error; } } From 4ac3fab80b34b6cd7936b200b2715288189cfcdc Mon Sep 17 00:00:00 2001 From: Daanvdplas Date: Wed, 16 Oct 2024 23:11:30 +0200 Subject: [PATCH 33/43] docs: drink --- Cargo.lock | 361 ++++++++++++++++++++++++++-------- README.md | 99 ++++++---- crates/pop-drink/src/error.rs | 334 +++++++++++++++---------------- crates/pop-drink/src/lib.rs | 186 +++++++----------- 4 files changed, 575 insertions(+), 405 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bfc9981..d07b344 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -896,8 +896,8 @@ dependencies = [ "escape8259", "hex", "indexmap 2.5.0", - "ink_env", - "ink_metadata", + "ink_env 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_metadata 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.12.1", "nom", "nom-supreme", @@ -1087,7 +1087,7 @@ dependencies = [ "sp-std", "sp-trie", "sp-version", - "staging-xcm", + "staging-xcm 14.1.0", "staging-xcm-builder", "trie-db", ] @@ -1133,7 +1133,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "staging-xcm", + "staging-xcm 14.1.0", ] [[package]] @@ -1158,7 +1158,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "staging-xcm", + "staging-xcm 14.1.0", "staging-xcm-builder", "staging-xcm-executor", ] @@ -1193,7 +1193,7 @@ dependencies = [ "sp-runtime", "sp-std", "sp-trie", - "staging-xcm", + "staging-xcm 14.1.0", ] [[package]] @@ -1259,7 +1259,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "staging-xcm", + "staging-xcm 14.1.0", "staging-xcm-builder", "staging-xcm-executor", ] @@ -2611,19 +2611,19 @@ checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" [[package]] name = "ink" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d4a862aedbfda93175ddf75c9aaa2ae4c4b39ee5cee06c16d50bccce05bf5c7" +source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" dependencies = [ "derive_more", - "ink_env", + "ink_env 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", "ink_macro", - "ink_metadata", - "ink_prelude", - "ink_primitives", + "ink_metadata 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_prelude 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_primitives 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", "ink_storage", - "pallet-contracts-uapi-next", + "pallet-contracts-uapi 9.0.0", "parity-scale-codec", "scale-info", + "staging-xcm 11.0.0", ] [[package]] @@ -2635,19 +2635,26 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "ink_allocator" +version = "5.0.0" +source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" +dependencies = [ + "cfg-if", +] + [[package]] name = "ink_codegen" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a1f8473fa09e0f9b6f3cb3f8d18c07c14ebf9ea1f7cdfee270f009d45ee8e9" +source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" dependencies = [ "blake2", "derive_more", "either", - "heck 0.4.1", + "heck 0.5.0", "impl-serde", "ink_ir", - "ink_primitives", + "ink_primitives 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", "itertools 0.12.1", "parity-scale-codec", "proc-macro2", @@ -2665,7 +2672,7 @@ checksum = "4f357e2e867f4e222ffc4015a6e61d1073548de89f70a4e36a8b0385562777fa" dependencies = [ "blake2", "derive_more", - "ink_primitives", + "ink_primitives 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-contracts-uapi-next", "parity-scale-codec", "secp256k1", @@ -2673,6 +2680,21 @@ dependencies = [ "sha3", ] +[[package]] +name = "ink_engine" +version = "5.0.0" +source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" +dependencies = [ + "blake2", + "derive_more", + "ink_primitives 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "pallet-contracts-uapi 9.0.0", + "parity-scale-codec", + "secp256k1", + "sha2 0.10.8", + "sha3", +] + [[package]] name = "ink_env" version = "5.0.0" @@ -2683,36 +2705,65 @@ dependencies = [ "cfg-if", "const_env", "derive_more", - "ink_allocator", - "ink_engine", - "ink_prelude", - "ink_primitives", - "ink_storage_traits", + "ink_allocator 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_engine 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_prelude 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_primitives 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_storage_traits 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits", "pallet-contracts-uapi-next", "parity-scale-codec", "paste", "rlibc", - "scale-decode", - "scale-encode", + "scale-decode 0.10.0", + "scale-encode 0.5.0", + "scale-info", + "schnorrkel", + "secp256k1", + "sha2 0.10.8", + "sha3", + "static_assertions", +] + +[[package]] +name = "ink_env" +version = "5.0.0" +source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" +dependencies = [ + "blake2", + "cfg-if", + "const_env", + "derive_more", + "ink_allocator 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_engine 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_prelude 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_primitives 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_storage_traits 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "num-traits", + "pallet-contracts-uapi 9.0.0", + "parity-scale-codec", + "paste", + "rlibc", + "scale-decode 0.11.1", + "scale-encode 0.6.0", "scale-info", "schnorrkel", "secp256k1", "sha2 0.10.8", "sha3", + "staging-xcm 11.0.0", "static_assertions", ] [[package]] name = "ink_ir" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b1ad2975551c4ed800af971289ed6d2c68ac41ffc03a42010b3e01d7360dfb2" +source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" dependencies = [ "blake2", "either", "impl-serde", - "ink_prelude", + "ink_prelude 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", "itertools 0.12.1", "proc-macro2", "quote", @@ -2722,12 +2773,11 @@ dependencies = [ [[package]] name = "ink_macro" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aee1a546f37eae3b3cd223832d31702033c5369dcfa3405899587c110a7908d3" +source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" dependencies = [ "ink_codegen", "ink_ir", - "ink_primitives", + "ink_primitives 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", "parity-scale-codec", "proc-macro2", "quote", @@ -2743,8 +2793,24 @@ checksum = "a98fcc0ff9292ff68c7ee7b84c93533c9ff13859ec3b148faa822e2da9954fe6" dependencies = [ "derive_more", "impl-serde", - "ink_prelude", - "ink_primitives", + "ink_prelude 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_primitives 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "linkme", + "parity-scale-codec", + "scale-info", + "schemars", + "serde", +] + +[[package]] +name = "ink_metadata" +version = "5.0.0" +source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" +dependencies = [ + "derive_more", + "impl-serde", + "ink_prelude 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_primitives 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", "linkme", "parity-scale-codec", "scale-info", @@ -2761,6 +2827,14 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "ink_prelude" +version = "5.0.0" +source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" +dependencies = [ + "cfg-if", +] + [[package]] name = "ink_primitives" version = "5.0.0" @@ -2768,10 +2842,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11ec35ef7f45e67a53b6142d7e7f18e6d9292d76c3a2a1da14cf8423e481813d" dependencies = [ "derive_more", - "ink_prelude", + "ink_prelude 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec", - "scale-decode", - "scale-encode", + "scale-decode 0.10.0", + "scale-encode 0.5.0", + "scale-info", + "xxhash-rust", +] + +[[package]] +name = "ink_primitives" +version = "5.0.0" +source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" +dependencies = [ + "derive_more", + "ink_prelude 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "parity-scale-codec", + "scale-decode 0.11.1", + "scale-encode 0.6.0", "scale-info", "xxhash-rust", ] @@ -2801,18 +2889,17 @@ dependencies = [ [[package]] name = "ink_storage" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbdb04cad74df858c05bc9cb6f30bbf12da33c3e2cb7ca211749c001fa761aa9" +source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" dependencies = [ "array-init", "cfg-if", "derive_more", - "ink_env", - "ink_metadata", - "ink_prelude", - "ink_primitives", - "ink_storage_traits", - "pallet-contracts-uapi-next", + "ink_env 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_metadata 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_prelude 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_primitives 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_storage_traits 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "pallet-contracts-uapi 9.0.0", "parity-scale-codec", "scale-info", ] @@ -2823,9 +2910,21 @@ version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83ce49e3d2935fc1ec3e73117119712b187d3123339f6a31624e92f75fa2293d" dependencies = [ - "ink_metadata", - "ink_prelude", - "ink_primitives", + "ink_metadata 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_prelude 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_primitives 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "ink_storage_traits" +version = "5.0.0" +source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" +dependencies = [ + "ink_metadata 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_prelude 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_primitives 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", "parity-scale-codec", "scale-info", ] @@ -3473,12 +3572,13 @@ dependencies = [ "frame-system", "log", "pallet-assets", - "pallet-nfts 31.0.0", + "pallet-xcm", "parity-scale-codec", "pop-chain-extension", "scale-info", "sp-runtime", "sp-std", + "staging-xcm 14.1.0", ] [[package]] @@ -3702,7 +3802,7 @@ dependencies = [ "log", "pallet-balances", "pallet-contracts-proc-macro", - "pallet-contracts-uapi", + "pallet-contracts-uapi 11.0.0", "parity-scale-codec", "paste", "rand", @@ -3714,7 +3814,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "staging-xcm", + "staging-xcm 14.1.0", "staging-xcm-builder", "wasm-instrument", "wasmi", @@ -3731,6 +3831,17 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "pallet-contracts-uapi" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d7a51646d9ff1d91abd0186d2c074f0dfd3b1a2d55f08a229a2f2e4bc6d1e49" +dependencies = [ + "bitflags 1.3.2", + "paste", + "polkavm-derive 0.9.1", +] + [[package]] name = "pallet-contracts-uapi" version = "11.0.0" @@ -3918,7 +4029,7 @@ dependencies = [ "frame-system", "log", "pallet-assets", - "pallet-nfts 30.0.0", + "pallet-nfts", "parity-scale-codec", "scale-info", "sp-runtime", @@ -3944,29 +4055,13 @@ dependencies = [ "sp-std", ] -[[package]] -name = "pallet-nfts" -version = "31.0.0" -dependencies = [ - "enumflags2", - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "sp-core", - "sp-io", - "sp-runtime", -] - [[package]] name = "pallet-nfts-runtime-api" version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0ca7a0446d2d3c27f726a016c6366218df2e0bfef9ed35886b252cfa9757f6c" dependencies = [ - "pallet-nfts 30.0.0", + "pallet-nfts", "parity-scale-codec", "sp-api", "sp-std", @@ -4221,7 +4316,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "staging-xcm", + "staging-xcm 14.1.0", "staging-xcm-builder", "staging-xcm-executor", "xcm-runtime-apis", @@ -4254,7 +4349,7 @@ dependencies = [ "sp-runtime", "sp-std", "staging-parachain-info", - "staging-xcm", + "staging-xcm 14.1.0", "staging-xcm-executor", "substrate-wasm-builder", ] @@ -4503,7 +4598,7 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", - "staging-xcm", + "staging-xcm 14.1.0", "staging-xcm-builder", "staging-xcm-executor", "static_assertions", @@ -4567,7 +4662,7 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", - "staging-xcm", + "staging-xcm 14.1.0", "staging-xcm-executor", ] @@ -4754,7 +4849,7 @@ dependencies = [ "pallet-message-queue", "pallet-multisig", "pallet-nft-fractionalization", - "pallet-nfts 31.0.0", + "pallet-nfts", "pallet-nfts-runtime-api", "pallet-preimage", "pallet-proxy", @@ -4790,7 +4885,7 @@ dependencies = [ "sp-transaction-pool", "sp-version", "staging-parachain-info", - "staging-xcm", + "staging-xcm 14.1.0", "staging-xcm-builder", "staging-xcm-executor", "substrate-wasm-builder", @@ -5144,6 +5239,16 @@ dependencies = [ "scale-info", ] +[[package]] +name = "scale-bits" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "662d10dcd57b1c2a3c41c9cf68f71fb09747ada1ea932ad961aca7e2ca28315f" +dependencies = [ + "parity-scale-codec", + "scale-type-resolver", +] + [[package]] name = "scale-decode" version = "0.10.0" @@ -5152,12 +5257,26 @@ checksum = "7caaf753f8ed1ab4752c6afb20174f03598c664724e0e32628e161c21000ff76" dependencies = [ "derive_more", "parity-scale-codec", - "scale-bits", - "scale-decode-derive", + "scale-bits 0.4.0", + "scale-decode-derive 0.10.0", "scale-info", "smallvec", ] +[[package]] +name = "scale-decode" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afc79ba56a1c742f5aeeed1f1801f3edf51f7e818f0a54582cac6f131364ea7b" +dependencies = [ + "derive_more", + "parity-scale-codec", + "scale-bits 0.5.0", + "scale-decode-derive 0.11.1", + "scale-type-resolver", + "smallvec", +] + [[package]] name = "scale-decode-derive" version = "0.10.0" @@ -5171,6 +5290,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "scale-decode-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5398fdb3c7bea3cb419bac4983aadacae93fe1a7b5f693f4ebd98c3821aad7a5" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "scale-encode" version = "0.5.0" @@ -5179,11 +5310,24 @@ checksum = "6d70cb4b29360105483fac1ed567ff95d65224a14dd275b6303ed0a654c78de5" dependencies = [ "derive_more", "parity-scale-codec", - "scale-encode-derive", + "scale-encode-derive 0.5.0", "scale-info", "smallvec", ] +[[package]] +name = "scale-encode" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628800925a33794fb5387781b883b5e14d130fece9af5a63613867b8de07c5c7" +dependencies = [ + "derive_more", + "parity-scale-codec", + "scale-encode-derive 0.6.0", + "scale-type-resolver", + "smallvec", +] + [[package]] name = "scale-encode-derive" version = "0.5.0" @@ -5197,6 +5341,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "scale-encode-derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a304e1af7cdfbe7a24e08b012721456cc8cecdedadc14b3d10513eada63233c" +dependencies = [ + "darling 0.14.4", + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "scale-info" version = "2.11.3" @@ -5224,6 +5381,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "scale-type-resolver" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10b800069bfd43374e0f96f653e0d46882a2cb16d6d961ac43bea80f26c76843" +dependencies = [ + "smallvec", +] + [[package]] name = "schemars" version = "0.8.21" @@ -6310,6 +6476,25 @@ dependencies = [ "sp-std", ] +[[package]] +name = "staging-xcm" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aded0292274ad473250c22ed3deaf2d9ed47d15786d700e9e83ab7c1cad2ad44" +dependencies = [ + "array-bytes", + "bounded-collections", + "derivative", + "environmental", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-weights", + "xcm-procedural 8.0.0", +] + [[package]] name = "staging-xcm" version = "14.1.0" @@ -6326,7 +6511,7 @@ dependencies = [ "scale-info", "serde", "sp-weights", - "xcm-procedural", + "xcm-procedural 10.1.0", ] [[package]] @@ -6348,7 +6533,7 @@ dependencies = [ "sp-runtime", "sp-std", "sp-weights", - "staging-xcm", + "staging-xcm 14.1.0", "staging-xcm-executor", ] @@ -6371,7 +6556,7 @@ dependencies = [ "sp-runtime", "sp-std", "sp-weights", - "staging-xcm", + "staging-xcm 14.1.0", ] [[package]] @@ -7454,6 +7639,18 @@ dependencies = [ "tap", ] +[[package]] +name = "xcm-procedural" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4717a97970a9cda70d7db53cf50d2615c2f6f6b7c857445325b4a39ea7aa2cd" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "xcm-procedural" version = "10.1.0" @@ -7478,7 +7675,7 @@ dependencies = [ "sp-api", "sp-std", "sp-weights", - "staging-xcm", + "staging-xcm 14.1.0", "staging-xcm-executor", ] diff --git a/README.md b/README.md index 2e17b48..4116a1a 100644 --- a/README.md +++ b/README.md @@ -1,68 +1,85 @@ -

Pop DRink! (forked from DRink!)

-

Dechained Ready-to-play ink! playground

+
+

Pop DRink!

-> [!IMPORTANT] -> This repository is customized and maintained for Pop API contract end-to-end testing. -> -> Quasi tests must be run with `cargo test --release`. +R0GUE Logo -# Pop Sandbox +[![Twitter URL](https://img.shields.io/twitter/follow/Pop?style=social)](https://x.com/onpopio/) +[![Twitter URL](https://img.shields.io/twitter/follow/R0GUE?style=social)](https://twitter.com/gor0gue) +[![Telegram](https://img.shields.io/badge/Telegram-gray?logo=telegram)](https://t.me/onpopio) -Implementation of the [`pop_drink::Sandbox`](https://github.com/r0gue-io/pop-drink) struct for the Pop Network runtimes (located in `pop-node/runtime`) required for the quasi testing with `drink`. +Forked version of [inkdevhub/drink](https://github.com/inkdevhub/drink) for E2E testing of smart contract using the [Pop API](https://github.com/r0gue-io/pop-node/tree/main/pop-api) on Pop Network. -In the context of quasi-testing with pop-drink, a sandbox refers to an isolated runtime environment that simulates the behavior of a full node, without requiring an actual node. It can emulate key processes (where runtime `pallets` are involved) such as block initialization, execution, and block finalization. +
+ +## Overview + +About the repository folder structure: + +- [pop-drink](/crates/pop-drink): Library for testing contracts deployed on Pop Network using drink. +- [drink](/crates/drink/drink): drink is a toolbox for ink! developers to test contracts in a sandbox environment. +- [ink-sandbox](/crates/ink-sandbox): Creates a sandbox environment for a given runtime, without having to run a node. +- [examples](/crates/drink/examples): A collection of example contracts tested with drink. +- [drink-cli](/crates/drink/drink-cli): Simple command line tool to help you play with your local contracts in a convenient way. ## Getting Started -### Installation +Add `pop-drink` crate to your contract `Cargo.toml`: ```toml -pop_drink = { version = "1.0.0", package = "pop-drink" } +drink = { version = "1.0.0", package = "pop-drink" } ``` -### Import Sandbox for the specific runtime - -- For `devnet` runtime - -Implementation of the sandbox runtime environment for `devnet` runtime located in `pop-node/runtime/devnet` +Set up your pop-drink test environment and write your first test. ```rs -use pop_sandbox::DevnetSandbox; -``` +use drink::{ + devnet::{AccountId, Balance, Runtime}, + TestExternalities, + deploy, call, +}; -- For `testnet` runtime -Implementation of the sandbox runtime environment for `testnet` runtime located in `pop-node/runtime/testnet` +// Builds your contract(s). +#[drink::contract_bundle_provider] +enum BundleProvider {} -```rs -use pop_sandbox::TestnetSandbox; -``` +/// Sandbox environment for Pop Devnet Runtime. +pub struct Pop { + ext: TestExternalities, +} -- For `mainnet` runtime +// Initialising genesis state. +impl Default for Pop { + fn default() -> Self { + let balances: Vec<(AccountId, Balance)> = vec![(ALICE, 100u128)]; + let ext = BlockBuilder::::new_ext(balances); + Self { ext } + } +} -Implementation of the sandbox runtime environment for `mainnet` runtime located in `pop-node/runtime/mainnet` +// Implement core functionalities for the `Pop` sandbox. +drink::impl_sandbox!(Pop, Runtime, ALICE); -```rs -use pop_sandbox::MainnetSandbox; +// Write your first pop-drink test! +#[drink::test(sandbox = Pop)] +fn test(mut session: Session) { ... } ``` -### Setup test environment for your contract +Important: run your tests with `--release` +``` +cargo test --release +``` -Below is an example for the contract testing with `pop_drink` and `pop_sandbox` for `devnet` environment using `DevnetSandbox`. +## Learn more -```rs -use pop_drink::session::Session; -use pop_sandbox::DevnetSandbox as Sandbox; +Dive into the ["quick start with drink!"](/crates/drink/examples/quick-start-with-drink/README.md) to learn more about drink. Also check out the other examples provided by drink. -#[drink::contract_bundle_provider] -enum BundleProvider {} +If you are interested in learning more about testing contracts using the Pop API, check out the [example contracts](https://github.com/r0gue-io/pop-node/tree/main/pop-api/examples) tested with pop-drink! -#[drink::test(sandbox = Sandbox)] -fn test(mut session: Session) { - // Your test case -} -``` +## Support + +Be part of our passionate community of Web3 builders. [Join our Telegram](https://t.me/onpopio)! -## Examples +Feel free to contribute to `drink` or `pop-drink` to help improve testing ink! smart contracts! -Please find more examples of `pop_drink` tests in the [`pop_drink/examples`](https://github.com/r0gue-io/pop-drink/tree/main/examples). +For any questions related to ink! you can also go to [Polkadot Stack Exchange](https://polkadot.stackexchange.com/) or ask the [ink! community](https://t.me/inkathon/1). \ No newline at end of file diff --git a/crates/pop-drink/src/error.rs b/crates/pop-drink/src/error.rs index dd43094..5a1f5db 100644 --- a/crates/pop-drink/src/error.rs +++ b/crates/pop-drink/src/error.rs @@ -1,63 +1,181 @@ -//! A set of errors used for testing smart contracts. +//! The error type and utilities for testing smart contracts using the Pop API. use std::fmt::Debug; +use scale::{Decode, Encode}; pub use drink::{ pallet_assets::Error as AssetsError, pallet_balances::Error as BalancesError, pallet_contracts::Error as ContractsError, }; -use scale::{Decode, Encode}; -fn decode(data: &[u8]) -> T { - T::decode(&mut &data[..]).expect("Decoding failed") +/// A simplified error type representing errors from the runtime and its modules. +/// +/// This type can be used to assert to an error that holds a [status code](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/lib.rs#L33). +/// The status code is returned by the Pop API and represents a runtime error. +/// +/// # Generic Parameters: +/// - `ApiError`: The pop api error type. +/// - `ModuleError`: The error type for specific runtime modules. +/// - `MODULE_INDEX`: Index of the variant `Error::Module`. +#[derive(Encode, Decode, Debug)] +pub enum Error + where + ApiError: Decode + Encode + Debug + From + Into, + ModuleError: Decode + Encode + Debug, +{ + /// An error not related to any specific module. + Raw(ApiError), + /// An error originating from a runtime module. + Module(ModuleError), +} + +impl +From> for u32 + where + ApiError: Decode + Encode + Debug + From + Into, + ModuleError: Decode + Encode + Debug, +{ + /// Converts an `Error` to a `u32` status code. + fn from(error: Error) -> Self { + match error { + Error::Raw(error) => decode::(&error.encode()), + Error::Module(error) => { + let mut encoded = error.encode(); + encoded.insert(0, MODULE_INDEX); + encoded.resize(4, 0); + decode::(&encoded) + }, + } + .into() + } +} + +impl From +for Error + where + ApiError: Decode + Encode + Debug + From + Into, + ModuleError: Decode + Encode + Debug, +{ + /// Converts a `u32` into an `Error`. + /// + /// If the status code represents a module error it converts it into `Error::Module` in stead + /// of `Error::Raw`. + fn from(value: u32) -> Self { + let error = ApiError::from(value); + let encoded = error.encode(); + if encoded[0] == MODULE_INDEX { + let (index, module_error) = (encoded[1], &encoded[2..]); + let data = vec![vec![index], module_error.to_vec()].concat(); + return Error::Module(decode(&data)); + } + Error::Raw(error) + } } -/// Asserts a custom error type against the `Error`. This is useful when you want to check if a contract's custom error (e.g., [`PSP22Error`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/v0/fungibles/errors.rs#L73C1-L73C22)) matches the error code returned by the runtime, which is represented by a [`StatusCode`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/lib.rs#L33). The error type must be convertible to a `u32`. +/// Asserts that a result matches an expected `Error`. /// -/// # Parameters +/// This can be used to assert that a contract execution resulted in a specific runtime error `Error`. +/// The contract error must be convertible to a `u32` (i.e. the status code received from the api). /// -/// - `result` - Contract method's result returns the custom error type which is convertible to -/// `u32`. -/// - `error` - `Error` to assert against the custom error type. +/// # Example /// -/// # Examples +/// ## Errors /// -/// To assert the `StatusCode` returned by a contract method that uses Pop API, you simply use the -/// provided `assert_err!` macro. +/// ```rs +/// use drink::devnet::{ +/// Assets, +/// AssetsError::BalanceLow, +/// v0::{ +/// Arithmetic, +/// ArithmeticError::Overflow, +/// BadOrigin +/// }, +/// }; +/// ``` /// +/// [`BadOrigin`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L36C4-L36C18): /// ```rs -/// // Required imports to test the custom error. -/// use drink::{ assert_err, devnet::error::{ v0::Error, Arithmetic, ArithmeticError::Overflow }}; +/// Error::Raw(BadOrigin) +/// ``` /// -/// // Call a contract method named "hello_world" that throws `StatusCode`. -/// let result = call::(session, "hello_world", vec![], None); +/// [`Arithmetic(Overflow)`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L55): +/// ```rs +/// Error::Raw(Arithmetic(Overflow)) +/// ``` /// -/// // Asserts that the call fails because of an arithmetic operation error. -/// assert_err!(result, Error::Raw(Arithmetic(Overflow))); +/// [`Assets(BalanceLow)`](https://paritytech.github.io/polkadot-sdk/master/pallet_assets/pallet/enum.Error.html#variant.BalanceLow): +/// ```rs +/// Error::Module(Assets(BalanceLow)) /// ``` -#[macro_export] -macro_rules! assert_err { - ($result:expr, $error:expr $(,)?) => { - $crate::error::assert_err_inner::<_, _, _>($result, $error); - }; -} - -/// Asserts an error type to Error. This can be used for custom error types used by a contract which -/// uses the [`StatusCode`](https://github.com/r0gue-io/pop-node/blob/main/pop-api/src/lib.rs#L33) returned by the pop runtime. The error type must be convertible to a `u32`. /// -/// # Generic parameters +/// ## How to use `assert_err` macro. /// -/// - `R` - Type returned if `result` is `Ok()`. -/// - `E` - Type returned if `result` is `Err()`. Must be convertible to `u32`. -/// - `Error` - `Error` to assert against the custom error type. +/// - Create a custom error type that holds the status code. +/// +/// ```rs +/// use pop_api::StatusCode; /// -/// # Parameters +/// /// Custom error in contract. +/// pub enum CustomError { +/// ..., +/// /// Error with status code. +/// StatusCode(u32), +/// } /// -/// - `result` - Contract method's result returns the custom error type which is convertible to -/// `u32`. -/// - `expected_error` - `Error` to assert against the custom error type. +/// impl From for CustomError { +/// /// Converts a `StatusCode` (returned by the api) to a `CustomError`. +/// fn from(value: StatusCode) -> Self { +/// match value { +/// ..., +/// _ => CustomError::StatusCode(value.0), +/// } +/// } +/// } +/// +/// impl From for u32 { +/// /// Converts a `CustomError to a `u32`. +/// // +/// // Required for the `assert_err` macro to assert to `Error`. +/// fn from(value: CustomError) -> Self { +/// match value { +/// ..., +/// CustomError::StatusCode(status_code) => status_code, +/// } +/// } +/// } +/// +/// - Use `assert_err` in a test. +/// +/// #[drink::test(sandbox = Pop)] +/// fn test_custom_error(mut session: Session) { +/// ... +/// +/// // Call a contract method that returns a `Result<(), CustomError>`. +/// let result = call::(session, "hello_world", vec![], None); +/// +/// // Assert the result to the expected error. +/// assert_err!(result, Error::Raw(BadOrigin))); +/// +/// // Other assertions: +/// ... +/// assert_err!(result, Error::Raw(Arithmetic(Overflow))); +/// ... +/// assert_err!(result, Error::Module(Assets(BalanceLow))); +/// } +/// ``` +/// +/// # Parameters: +/// - `result`: The result which contains the custom error type. +/// - `error`: The expected error. +#[macro_export] +macro_rules! assert_err { + ($result:expr, $error:expr $(,)?) => { + $crate::error::assert_err_inner::<_, _, _>($result, $error); + }; +} + #[track_caller] -pub fn assert_err_inner(result: Result, expected_error: Error) +fn assert_err_inner(result: Result, expected_error: Error) where E: Into, Error: From + Into + Debug, @@ -85,174 +203,56 @@ where } } -/// Error type for testing why a runtime call fails. -/// -/// # Generic Parameters -/// -/// - [`RuntimeCallError`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L30) -/// - Reason why a runtime call fails. (.e.g, arithmetic operation errors) -/// - [`ModuleError`](https://paritytech.github.io/polkadot-sdk/master/solochain_template_runtime/enum.Error.html) -/// - Refers to specific reasons a runtime call fails, originating from the runtime modules. -/// - [`MODULE_INDEX`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L38) -/// - Index of the variant `Error::Module`. -/// -/// # Examples -/// -/// ### Runtime call errors -/// -/// - Import types to construct runtime call errors: -/// -/// ```rs -/// use drink::devnet::v0::{ -/// Arithmetic, -/// ArithmeticError::Overflow, -/// BadOrigin -/// }; -/// ``` -/// -/// - Runtime call error [`Arithmetic(Overflow)`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L55): -/// -/// ```rs -/// Error::Raw(Arithmetic(Overflow)) -/// ``` -/// -/// - Runtime call error [`BadOrigin`](https://github.com/r0gue-io/pop-node/blob/main/primitives/src/lib.rs#L36C4-L36C18): -/// -/// ```rs -/// Error::Raw(BadOrigin) -/// ``` -/// -/// ### Runtime module errors -/// -/// - Import types to construct runtime module errors: -/// -/// ```rs -/// use drink::devnet::{ -/// Assets, -/// AssetsError::AssetNotLive, -/// Balances::BelowMinimum, -/// BalancesError::BelowMinimum -/// }; -/// ``` -/// -/// - Construct a runtime module error [`Assets(AssetNotLive)`](https://paritytech.github.io/polkadot-sdk/master/pallet_assets/pallet/enum.Error.html#variant.AssetNotLive): -/// -/// ```rs -/// Error::Module(Assets(AssetNotLive)) -/// ``` -/// -/// - Construct a runtime module error [`Balances(InsufficientBalance)`](https://docs.rs/pallet-balances/latest/pallet_balances/pallet/enum.Error.html#variant.InsufficientBalance): -/// -/// ```rs -/// Error::Module(Balances(InsufficientBalance)) -/// ``` - -#[derive(Encode, Decode, Debug)] -pub enum Error -where - RuntimeCallError: Decode + Encode + Debug + From + Into, - ModuleError: Decode + Encode + Debug, -{ - /// Reason why a runtime call fails. [Reference](https://github.com/r0gue-io/pop-node/blob/52fb7f06a89955d462900e33d2b9c9170c4534a0/primitives/src/lib.rs#L30). - Raw(RuntimeCallError), - /// [Module error](https://paritytech.github.io/polkadot-sdk/master/solochain_template_runtime/enum.Error.html) refers to specific reasons a runtime call fails, originating from the runtime modules. - Module(ModuleError), -} - -impl - From> for u32 -where - RuntimeCallError: Decode + Encode + Debug + From + Into, - ModuleError: Decode + Encode + Debug, -{ - /// Converts an `Error` to a `u32` number. - /// - /// This conversion is necessary for comparing `Error` instances with other types. - // Compared types must implement `Into`, as `Error` does not implement `Eq`. - // Use this function to obtain a numerical representation of the error for comparison or - // further processing. - fn from(error: Error) -> Self { - match error { - Error::Raw(error) => decode::(&error.encode()), - Error::Module(error) => { - let mut encoded = error.encode(); - encoded.insert(0, MODULE_INDEX); - encoded.resize(4, 0); - decode::(&encoded) - }, - } - .into() - } -} - -impl From - for Error -where - RuntimeCallError: Decode + Encode + Debug + From + Into, - ModuleError: Decode + Encode + Debug, -{ - /// Converts a numerical value `u32` into an `Error`. - /// - /// This is used to reconstruct and display an `Error` from its numerical representation - /// when an error is thrown. - fn from(value: u32) -> Self { - let error = RuntimeCallError::from(value); - let encoded = error.encode(); - if encoded[0] == MODULE_INDEX { - let (index, module_error) = (encoded[1], &encoded[2..]); - let data = vec![vec![index], module_error.to_vec()].concat(); - return Error::Module(decode(&data)); - } - Error::Raw(error) - } +fn decode(data: &[u8]) -> T { + T::decode(&mut &data[..]).expect("Decoding failed") } #[cfg(test)] mod test { - use pop_api::primitives::v0::Error as RuntimeCallError; + use pop_api::primitives::v0::Error as ApiError; use crate::error::{AssetsError::*, BalancesError::*, *}; - fn test_cases() -> Vec<(Error, RuntimeCallError)> + fn test_cases() -> Vec<(Error, ApiError)> { use frame_support::traits::PalletInfoAccess; use pop_api::primitives::{ArithmeticError::*, TokenError::*}; use crate::mock::RuntimeError::*; vec![ - (Error::Raw(RuntimeCallError::BadOrigin), RuntimeCallError::BadOrigin), + (Error::Raw(ApiError::BadOrigin), ApiError::BadOrigin), ( - Error::Raw(RuntimeCallError::Token(BelowMinimum)), - RuntimeCallError::Token(BelowMinimum), + Error::Raw(ApiError::Token(BelowMinimum)), + ApiError::Token(BelowMinimum), ), ( - Error::Raw(RuntimeCallError::Arithmetic(Overflow)), - RuntimeCallError::Arithmetic(Overflow), + Error::Raw(ApiError::Arithmetic(Overflow)), + ApiError::Arithmetic(Overflow), ), ( Error::Module(Assets(BalanceLow)), - RuntimeCallError::Module { + ApiError::Module { index: crate::mock::Assets::index() as u8, error: [0, 0], }, ), ( Error::Module(Assets(NoAccount)), - RuntimeCallError::Module { + ApiError::Module { index: crate::mock::Assets::index() as u8, error: [1, 0], }, ), ( Error::Module(Balances(VestingBalance)), - RuntimeCallError::Module { + ApiError::Module { index: crate::mock::Balances::index() as u8, error: [0, 0], }, ), ( Error::Module(Balances(LiquidityRestrictions)), - RuntimeCallError::Module { + ApiError::Module { index: crate::mock::Balances::index() as u8, error: [1, 0], }, diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index ab24098..4ac137d 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -1,3 +1,5 @@ +//! A library for testing smart contracts on Pop Network. + pub use drink::*; pub use frame_support::{self, assert_ok}; pub use ink_sandbox::api::assets_api::AssetsAPI; @@ -6,91 +8,64 @@ use scale::Decode; pub use session::{error::SessionError, ContractBundle, Session, NO_SALT}; pub use sp_io::TestExternalities; +/// Error type and utilities for testing contracts using the Pop API. pub mod error; #[cfg(test)] mod mock; +/// Types and utilities for testing smart contracts interacting with Pop Network Devnet via the pop api. pub mod devnet { - pub use pop_runtime_devnet::Runtime; + pub use pop_runtime_devnet::{RuntimeError::*, Runtime}; + pub use crate::error::*; use super::*; - /// A set of primitive runtime errors and versioned runtime errors used for testing. - pub mod error { - pub use pop_runtime_devnet::RuntimeError::*; - - pub use crate::error::*; + /// Utilities for smart contracts using pop api V0. + pub mod v0 { + pub use pop_api::primitives::v0::{self, *}; - /// A collection of error types from the `v0` module used for smart contract testing in the - /// `devnet` environment. - pub mod v0 { - pub use pop_api::primitives::v0::{Error as RuntimeCallError, *}; - - /// Error type for testing contracts using the API V0. - pub type Error = - crate::error::Error; - } + /// Error type for writing tests (see `error` module). + pub type Error = + crate::error::Error; } // Types used in the pop runtime. pub type Balance = BalanceFor; pub type AccountId = AccountIdFor; - /// This is used to resolve type mismatches between the `AccountId` in the quasi testing - /// environment and the contract environment. + /// Converts an AccountId from Pop's runtime to the account ID used in the contract environment. pub fn account_id_from_slice(s: &AccountId) -> pop_api::primitives::AccountId { let account: [u8; 32] = s.clone().into(); super::account_id_from_slice(&account) } } -/// Deploys a contract with a given constructor method, arguments, salt and an initial value. In +/// Deploy a contract with a given constructor, arguments, salt and an initial value. In /// case of success, returns the address of the deployed contract. /// -/// # Generic Parameters -/// -/// - `S` - [`Sandbox`](https://github.com/r0gue-io/pop-drink/blob/main/crates/ink-sandbox/src/lib.rs) -/// environment for the Pop Network runtime. -/// - `E` - Decodable error type returned if the contract deployment fails. -/// -/// # Parameters -/// -/// - `session` - Wrapper around Sandbox that provides methods to interact with multiple contracts. [Reference](https://github.com/r0gue-io/pop-drink/blob/main/crates/drink/drink/src/session.rs). -/// - `bundle` - A struct representing the result of parsing a `.contract` bundle file. [Reference](https://github.com/r0gue-io/pop-drink/blob/main/crates/drink/drink/src/session/bundle.rs). -/// - `method` - The name of the contract constructor method. For trait methods, use -/// `trait_name::method_name` (e.g., `Psp22::transfer`). -/// - `input` - Arguments passed to the constructor method. -/// - `salt` - Additional data used to influence the contract deployment address. -/// - `init_value` - Initial funds allocated for the contract. Requires the contract method to be +/// # Generic Parameters: +/// - `S` - Sandbox environment. +/// - `E` - `Err()` type returned by the contract. +/// +/// # Parameters: +/// - `session` - The session for interacting with contracts. +/// - `bundle` - The contract bundle. +/// - `method` - The name of the constructor method. +/// - `input` - The input arguments. +/// - `salt` - Optional deployment salt. +/// - `init_value` - Initial balance to transfer during the contract creation. Requires the contract method to be /// `payable`. /// -/// # Examples -/// +/// # Example: /// ```rs -/// /// The contract bundle provider. -/// #[drink::contract_bundle_provider] -/// enum BundleProvider {} -/// -/// /// Sandbox environment for Pop Devnet Runtime. -/// pub struct Pop { -/// ext: TestExternalities, -/// } -/// -/// // Implement core functionalities for the `Pop` sandbox. -/// drink::impl_sandbox!(Pop, Runtime, ALICE); -/// /// #[drink::test(sandbox = Pop)] -/// fn test_constructor_works() { -/// let local_contract = BundleProvider::local().unwrap(); -/// // Contract address is returned if a deployment succeeds. -/// let contract = deploy( -/// &mut session, -/// local_contract, -/// "new", -/// vec![TOKEN.to_string(), MIN_BALANCE.to_string()], -/// vec![], -/// None -/// ).unwrap(); +/// fn test_constructor_works(mut session: Session) { +/// let bundle = BundleProvider::local().unwrap(); +/// +/// // Deploy contract. +/// // +/// // `ContractError` is the error type used by the contract. +/// assert_ok!(deploy(&mut session, bundle, "new", input, salt, init_value)); /// } /// ``` pub fn deploy( @@ -115,48 +90,35 @@ where Ok(result.unwrap()) } -/// Call a contract method and decode the returned data. +/// Call a method and decode the returned data. /// -/// # Generic Parameters -/// -/// - `S` - [`Sandbox`](https://github.com/r0gue-io/pop-drink/blob/main/crates/ink-sandbox/src/lib.rs) -/// environment for the Pop Network runtime. -/// - `O` - Decodable output type returned if the contract execution succeeds. -/// - `E` - Decodable error type returned if the contract execution fails. -/// -/// # Parameters -/// -/// - `session` - Wrapper around Sandbox that provides methods to interact with multiple contracts. [Reference](https://github.com/r0gue-io/pop-drink/blob/main/crates/drink/drink/src/session.rs). -/// - `func_name`: The name of the contract method. For trait methods, use `trait_name::method_name` -/// (e.g., `Psp22::transfer`). -/// - `input` - Arguments passed to the contract method. -/// - `endowment` - Funds allocated for the contract execution. Requires the contract method to be -/// `payable`. +/// # Generic Parameters: +/// - `S` - Sandbox environment. +/// - `O` - `Ok()` type returned by the contract. +/// - `E` - `Err()` type returned by the contract. /// -/// # Examples +/// # Parameters: +/// - `session` - The session for interacting with contracts. +/// - `func_name`: The name of the contract method. +/// - `input` - The input arguments. +/// - `init_value` - Balance to transfer during the call. Requires the contract method to be `payable`. /// +/// # Example: /// ```rs -/// /// The contract bundle provider. -/// #[drink::contract_bundle_provider] -/// enum BundleProvider {} -/// -/// /// Sandbox environment for Pop Devnet Runtime. -/// pub struct Pop { -/// ext: TestExternalities, -/// } -/// -/// // Implement core functionalities for the `Pop` sandbox. -/// drink::impl_sandbox!(Pop, Runtime, ALICE); -/// -/// /// Call to a contract method `Psp22::transfer` and return error `PSP22Error` if fails. -/// fn transfer(session: &mut Session, to: AccountId, amount: Balance) -> Result<(), PSP22Error> { -/// // Convert empty array into string. -/// let empty_array = serde_json::to_string::<[u8; 0]>(&[]).unwrap(); -/// call::( +/// #[drink::test(sandbox = Pop)] +/// fn call_works(mut session: Session) { +/// let bundle = BundleProvider::local().unwrap(); +/// assert_ok!(deploy(&mut session, bundle, "new", input, salt, init_value)); +/// +/// // Call contract. +/// // +/// // `()` is the successful result type used by the contract. +/// // `ContractError` is the error type used by the contract. +/// call::( /// session, -/// "Psp22::transfer", -/// vec![to.to_string(), amount.to_string(), empty_array], -/// None, +/// "transfer", +/// input, +/// init_value, /// ) /// } /// ``` @@ -187,32 +149,22 @@ where } } -fn account_id_from_slice(s: &[u8; 32]) -> pop_api::primitives::AccountId { - pop_api::primitives::AccountId::decode(&mut &s[..]).expect("Should be decoded to AccountId") -} - -/// Get the last event from pallet contracts. -/// -/// # Generic Parameters -/// -/// - `S` - [`Sandbox`](https://github.com/r0gue-io/pop-drink/blob/main/crates/ink-sandbox/src/lib.rs) -/// environment for the Pop Network runtime. -/// -/// # Parameters +/// Get the last contract event. /// -/// - `session` - Wrapper around Sandbox that provides methods to interact with multiple contracts. [Reference](https://github.com/r0gue-io/pop-drink/blob/main/crates/drink/drink/src/session.rs). +/// # Generic Parameters: +/// - `S` - Sandbox environment. /// -/// # Examples +/// # Parameters: +/// - `session` - The session for interacting with contracts. /// +/// # Example: /// ```rs -/// use drink::{assert_ok, devnet::account_id_from_slice, last_contract_event}; +/// use drink::last_contract_event; /// /// assert_eq!( -/// last_contract_event(&session).unwrap(), -/// Transfer { -/// from: Some(account_id_from_slice(&ALICE)), -/// to: Some(account_id_from_slice(&BOB)), -/// value, +/// last_contract_event::(&session).unwrap(), +/// ContractEvent { +/// value: 42, /// } /// .encode() /// .as_slice() @@ -227,3 +179,7 @@ where { session.record().last_event_batch().contract_events().last().cloned() } + +fn account_id_from_slice(s: &[u8; 32]) -> pop_api::primitives::AccountId { + pop_api::primitives::AccountId::decode(&mut &s[..]).expect("Should be decoded to AccountId") +} From 1a585d57e3957cb88a31a2ec96cbcda222a1b8d7 Mon Sep 17 00:00:00 2001 From: Daanvdplas Date: Thu, 17 Oct 2024 18:08:36 +0200 Subject: [PATCH 34/43] fix: comments --- crates/pop-drink/Cargo.toml | 5 +-- crates/pop-drink/src/error.rs | 77 ++++++++++++++--------------------- crates/pop-drink/src/lib.rs | 25 ++++++------ 3 files changed, 44 insertions(+), 63 deletions(-) diff --git a/crates/pop-drink/Cargo.toml b/crates/pop-drink/Cargo.toml index cd95815..e82fa10 100644 --- a/crates/pop-drink/Cargo.toml +++ b/crates/pop-drink/Cargo.toml @@ -4,10 +4,6 @@ version = "0.1.0" edition = "2021" [dependencies] -scale-info = { workspace = true, default-features = false, features = [ - "derive", -] } - drink.workspace = true ink_sandbox.workspace = true pallet-contracts.workspace = true @@ -19,6 +15,7 @@ scale.workspace = true pop-api.workspace = true [dev-dependencies] +scale-info = { workspace = true, features = ["derive"] } pallet-api.workspace = true pallet-assets.workspace = true pallet-balances.workspace = true diff --git a/crates/pop-drink/src/error.rs b/crates/pop-drink/src/error.rs index 5a1f5db..8d2c528 100644 --- a/crates/pop-drink/src/error.rs +++ b/crates/pop-drink/src/error.rs @@ -1,12 +1,12 @@ //! The error type and utilities for testing smart contracts using the Pop API. use std::fmt::Debug; -use scale::{Decode, Encode}; pub use drink::{ pallet_assets::Error as AssetsError, pallet_balances::Error as BalancesError, pallet_contracts::Error as ContractsError, }; +use scale::{Decode, Encode}; /// A simplified error type representing errors from the runtime and its modules. /// @@ -19,9 +19,9 @@ pub use drink::{ /// - `MODULE_INDEX`: Index of the variant `Error::Module`. #[derive(Encode, Decode, Debug)] pub enum Error - where - ApiError: Decode + Encode + Debug + From + Into, - ModuleError: Decode + Encode + Debug, +where + ApiError: Decode + Encode + Debug + From + Into, + ModuleError: Decode + Encode + Debug, { /// An error not related to any specific module. Raw(ApiError), @@ -29,11 +29,11 @@ pub enum Error Module(ModuleError), } -impl -From> for u32 - where - ApiError: Decode + Encode + Debug + From + Into, - ModuleError: Decode + Encode + Debug, +impl From> + for u32 +where + ApiError: Decode + Encode + Debug + From + Into, + ModuleError: Decode + Encode + Debug, { /// Converts an `Error` to a `u32` status code. fn from(error: Error) -> Self { @@ -46,15 +46,15 @@ From> for u32 decode::(&encoded) }, } - .into() + .into() } } impl From -for Error - where - ApiError: Decode + Encode + Debug + From + Into, - ModuleError: Decode + Encode + Debug, + for Error +where + ApiError: Decode + Encode + Debug + From + Into, + ModuleError: Decode + Encode + Debug, { /// Converts a `u32` into an `Error`. /// @@ -74,8 +74,9 @@ for Error /// Asserts that a result matches an expected `Error`. /// -/// This can be used to assert that a contract execution resulted in a specific runtime error `Error`. -/// The contract error must be convertible to a `u32` (i.e. the status code received from the api). +/// This can be used to assert that a contract execution resulted in a specific runtime error +/// `Error`. The contract error must be convertible to a `u32` (i.e. the status code received from +/// the api). /// /// # Example /// @@ -117,7 +118,7 @@ for Error /// /// /// Custom error in contract. /// pub enum CustomError { -/// ..., +/// ..., /// /// Error with status code. /// StatusCode(u32), /// } @@ -151,7 +152,7 @@ for Error /// ... /// /// // Call a contract method that returns a `Result<(), CustomError>`. -/// let result = call::(session, "hello_world", vec![], None); +/// let result = call::(session, "hello_world", vec![], None); /// /// // Assert the result to the expected error. /// assert_err!(result, Error::Raw(BadOrigin))); @@ -169,12 +170,13 @@ for Error /// - `error`: The expected error. #[macro_export] macro_rules! assert_err { - ($result:expr, $error:expr $(,)?) => { - $crate::error::assert_err_inner::<_, _, _>($result, $error); - }; + ($result:expr, $error:expr $(,)?) => { + $crate::error::assert_err_inner::<_, _, _>($result, $error); + }; } #[track_caller] +#[allow(unused)] fn assert_err_inner(result: Result, expected_error: Error) where E: Into, @@ -213,49 +215,30 @@ mod test { use crate::error::{AssetsError::*, BalancesError::*, *}; - fn test_cases() -> Vec<(Error, ApiError)> - { + fn test_cases() -> Vec<(Error, ApiError)> { use frame_support::traits::PalletInfoAccess; use pop_api::primitives::{ArithmeticError::*, TokenError::*}; use crate::mock::RuntimeError::*; vec![ (Error::Raw(ApiError::BadOrigin), ApiError::BadOrigin), - ( - Error::Raw(ApiError::Token(BelowMinimum)), - ApiError::Token(BelowMinimum), - ), - ( - Error::Raw(ApiError::Arithmetic(Overflow)), - ApiError::Arithmetic(Overflow), - ), + (Error::Raw(ApiError::Token(BelowMinimum)), ApiError::Token(BelowMinimum)), + (Error::Raw(ApiError::Arithmetic(Overflow)), ApiError::Arithmetic(Overflow)), ( Error::Module(Assets(BalanceLow)), - ApiError::Module { - index: crate::mock::Assets::index() as u8, - error: [0, 0], - }, + ApiError::Module { index: crate::mock::Assets::index() as u8, error: [0, 0] }, ), ( Error::Module(Assets(NoAccount)), - ApiError::Module { - index: crate::mock::Assets::index() as u8, - error: [1, 0], - }, + ApiError::Module { index: crate::mock::Assets::index() as u8, error: [1, 0] }, ), ( Error::Module(Balances(VestingBalance)), - ApiError::Module { - index: crate::mock::Balances::index() as u8, - error: [0, 0], - }, + ApiError::Module { index: crate::mock::Balances::index() as u8, error: [0, 0] }, ), ( Error::Module(Balances(LiquidityRestrictions)), - ApiError::Module { - index: crate::mock::Balances::index() as u8, - error: [1, 0], - }, + ApiError::Module { index: crate::mock::Balances::index() as u8, error: [1, 0] }, ), ] } diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index 4ac137d..ac72a9c 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -13,20 +13,20 @@ pub mod error; #[cfg(test)] mod mock; -/// Types and utilities for testing smart contracts interacting with Pop Network Devnet via the pop api. +/// Types and utilities for testing smart contracts interacting with Pop Network Devnet via the pop +/// api. pub mod devnet { - pub use pop_runtime_devnet::{RuntimeError::*, Runtime}; - pub use crate::error::*; + pub use pop_runtime_devnet::{Runtime, RuntimeError::*}; use super::*; + pub use crate::error::*; /// Utilities for smart contracts using pop api V0. pub mod v0 { pub use pop_api::primitives::v0::{self, *}; /// Error type for writing tests (see `error` module). - pub type Error = - crate::error::Error; + pub type Error = crate::error::Error; } // Types used in the pop runtime. @@ -53,8 +53,8 @@ pub mod devnet { /// - `method` - The name of the constructor method. /// - `input` - The input arguments. /// - `salt` - Optional deployment salt. -/// - `init_value` - Initial balance to transfer during the contract creation. Requires the contract method to be -/// `payable`. +/// - `init_value` - Initial balance to transfer during the contract creation. Requires the contract +/// method to be `payable`. /// /// # Example: /// ```rs @@ -64,7 +64,7 @@ pub mod devnet { /// /// // Deploy contract. /// // -/// // `ContractError` is the error type used by the contract. +/// // `ContractError` is the error type used by the contract. /// assert_ok!(deploy(&mut session, bundle, "new", input, salt, init_value)); /// } /// ``` @@ -101,7 +101,8 @@ where /// - `session` - The session for interacting with contracts. /// - `func_name`: The name of the contract method. /// - `input` - The input arguments. -/// - `init_value` - Balance to transfer during the call. Requires the contract method to be `payable`. +/// - `init_value` - Balance to transfer during the call. Requires the contract method to be +/// `payable`. /// /// # Example: /// ```rs @@ -111,9 +112,9 @@ where /// assert_ok!(deploy(&mut session, bundle, "new", input, salt, init_value)); /// /// // Call contract. -/// // -/// // `()` is the successful result type used by the contract. -/// // `ContractError` is the error type used by the contract. +/// // +/// // `()` is the successful result type used by the contract. +/// // `ContractError` is the error type used by the contract. /// call::( /// session, /// "transfer", From aaf322cf94f0466015fa11fa342e90fa7b6a8e1c Mon Sep 17 00:00:00 2001 From: Daanvdplas Date: Thu, 17 Oct 2024 18:10:12 +0200 Subject: [PATCH 35/43] fix: Cargo.lock --- Cargo.lock | 338 ++++++++++------------------------------------------- 1 file changed, 62 insertions(+), 276 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d07b344..4b5fb1e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -896,8 +896,8 @@ dependencies = [ "escape8259", "hex", "indexmap 2.5.0", - "ink_env 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ink_metadata 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_env", + "ink_metadata", "itertools 0.12.1", "nom", "nom-supreme", @@ -1087,7 +1087,7 @@ dependencies = [ "sp-std", "sp-trie", "sp-version", - "staging-xcm 14.1.0", + "staging-xcm", "staging-xcm-builder", "trie-db", ] @@ -1133,7 +1133,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "staging-xcm 14.1.0", + "staging-xcm", ] [[package]] @@ -1158,7 +1158,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "staging-xcm 14.1.0", + "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", ] @@ -1193,7 +1193,7 @@ dependencies = [ "sp-runtime", "sp-std", "sp-trie", - "staging-xcm 14.1.0", + "staging-xcm", ] [[package]] @@ -1259,7 +1259,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "staging-xcm 14.1.0", + "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", ] @@ -2611,19 +2611,19 @@ checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" [[package]] name = "ink" version = "5.0.0" -source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d4a862aedbfda93175ddf75c9aaa2ae4c4b39ee5cee06c16d50bccce05bf5c7" dependencies = [ "derive_more", - "ink_env 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_env", "ink_macro", - "ink_metadata 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "ink_prelude 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "ink_primitives 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_metadata", + "ink_prelude", + "ink_primitives", "ink_storage", - "pallet-contracts-uapi 9.0.0", + "pallet-contracts-uapi-next", "parity-scale-codec", "scale-info", - "staging-xcm 11.0.0", ] [[package]] @@ -2635,26 +2635,19 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "ink_allocator" -version = "5.0.0" -source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" -dependencies = [ - "cfg-if", -] - [[package]] name = "ink_codegen" version = "5.0.0" -source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a1f8473fa09e0f9b6f3cb3f8d18c07c14ebf9ea1f7cdfee270f009d45ee8e9" dependencies = [ "blake2", "derive_more", "either", - "heck 0.5.0", + "heck 0.4.1", "impl-serde", "ink_ir", - "ink_primitives 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_primitives", "itertools 0.12.1", "parity-scale-codec", "proc-macro2", @@ -2672,7 +2665,7 @@ checksum = "4f357e2e867f4e222ffc4015a6e61d1073548de89f70a4e36a8b0385562777fa" dependencies = [ "blake2", "derive_more", - "ink_primitives 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_primitives", "pallet-contracts-uapi-next", "parity-scale-codec", "secp256k1", @@ -2680,21 +2673,6 @@ dependencies = [ "sha3", ] -[[package]] -name = "ink_engine" -version = "5.0.0" -source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" -dependencies = [ - "blake2", - "derive_more", - "ink_primitives 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "pallet-contracts-uapi 9.0.0", - "parity-scale-codec", - "secp256k1", - "sha2 0.10.8", - "sha3", -] - [[package]] name = "ink_env" version = "5.0.0" @@ -2705,18 +2683,18 @@ dependencies = [ "cfg-if", "const_env", "derive_more", - "ink_allocator 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ink_engine 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ink_prelude 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ink_primitives 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ink_storage_traits 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_allocator", + "ink_engine", + "ink_prelude", + "ink_primitives", + "ink_storage_traits", "num-traits", "pallet-contracts-uapi-next", "parity-scale-codec", "paste", "rlibc", - "scale-decode 0.10.0", - "scale-encode 0.5.0", + "scale-decode", + "scale-encode", "scale-info", "schnorrkel", "secp256k1", @@ -2725,45 +2703,16 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "ink_env" -version = "5.0.0" -source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" -dependencies = [ - "blake2", - "cfg-if", - "const_env", - "derive_more", - "ink_allocator 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "ink_engine 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "ink_prelude 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "ink_primitives 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "ink_storage_traits 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "num-traits", - "pallet-contracts-uapi 9.0.0", - "parity-scale-codec", - "paste", - "rlibc", - "scale-decode 0.11.1", - "scale-encode 0.6.0", - "scale-info", - "schnorrkel", - "secp256k1", - "sha2 0.10.8", - "sha3", - "staging-xcm 11.0.0", - "static_assertions", -] - [[package]] name = "ink_ir" version = "5.0.0" -source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b1ad2975551c4ed800af971289ed6d2c68ac41ffc03a42010b3e01d7360dfb2" dependencies = [ "blake2", "either", "impl-serde", - "ink_prelude 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_prelude", "itertools 0.12.1", "proc-macro2", "quote", @@ -2773,11 +2722,12 @@ dependencies = [ [[package]] name = "ink_macro" version = "5.0.0" -source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aee1a546f37eae3b3cd223832d31702033c5369dcfa3405899587c110a7908d3" dependencies = [ "ink_codegen", "ink_ir", - "ink_primitives 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_primitives", "parity-scale-codec", "proc-macro2", "quote", @@ -2793,24 +2743,8 @@ checksum = "a98fcc0ff9292ff68c7ee7b84c93533c9ff13859ec3b148faa822e2da9954fe6" dependencies = [ "derive_more", "impl-serde", - "ink_prelude 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ink_primitives 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "linkme", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", -] - -[[package]] -name = "ink_metadata" -version = "5.0.0" -source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" -dependencies = [ - "derive_more", - "impl-serde", - "ink_prelude 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "ink_primitives 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_prelude", + "ink_primitives", "linkme", "parity-scale-codec", "scale-info", @@ -2827,14 +2761,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "ink_prelude" -version = "5.0.0" -source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" -dependencies = [ - "cfg-if", -] - [[package]] name = "ink_primitives" version = "5.0.0" @@ -2842,24 +2768,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11ec35ef7f45e67a53b6142d7e7f18e6d9292d76c3a2a1da14cf8423e481813d" dependencies = [ "derive_more", - "ink_prelude 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ink_prelude", "parity-scale-codec", - "scale-decode 0.10.0", - "scale-encode 0.5.0", - "scale-info", - "xxhash-rust", -] - -[[package]] -name = "ink_primitives" -version = "5.0.0" -source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" -dependencies = [ - "derive_more", - "ink_prelude 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "parity-scale-codec", - "scale-decode 0.11.1", - "scale-encode 0.6.0", + "scale-decode", + "scale-encode", "scale-info", "xxhash-rust", ] @@ -2889,17 +2801,18 @@ dependencies = [ [[package]] name = "ink_storage" version = "5.0.0" -source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbdb04cad74df858c05bc9cb6f30bbf12da33c3e2cb7ca211749c001fa761aa9" dependencies = [ "array-init", "cfg-if", "derive_more", - "ink_env 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "ink_metadata 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "ink_prelude 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "ink_primitives 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "ink_storage_traits 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "pallet-contracts-uapi 9.0.0", + "ink_env", + "ink_metadata", + "ink_prelude", + "ink_primitives", + "ink_storage_traits", + "pallet-contracts-uapi-next", "parity-scale-codec", "scale-info", ] @@ -2910,21 +2823,9 @@ version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83ce49e3d2935fc1ec3e73117119712b187d3123339f6a31624e92f75fa2293d" dependencies = [ - "ink_metadata 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ink_prelude 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ink_primitives 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec", - "scale-info", -] - -[[package]] -name = "ink_storage_traits" -version = "5.0.0" -source = "git+https://github.com/use-ink/ink?branch=xcm#5af1d75472c16bc7175788fa9050edcde2369599" -dependencies = [ - "ink_metadata 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "ink_prelude 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", - "ink_primitives 5.0.0 (git+https://github.com/use-ink/ink?branch=xcm)", + "ink_metadata", + "ink_prelude", + "ink_primitives", "parity-scale-codec", "scale-info", ] @@ -3572,13 +3473,11 @@ dependencies = [ "frame-system", "log", "pallet-assets", - "pallet-xcm", "parity-scale-codec", "pop-chain-extension", "scale-info", "sp-runtime", "sp-std", - "staging-xcm 14.1.0", ] [[package]] @@ -3802,7 +3701,7 @@ dependencies = [ "log", "pallet-balances", "pallet-contracts-proc-macro", - "pallet-contracts-uapi 11.0.0", + "pallet-contracts-uapi", "parity-scale-codec", "paste", "rand", @@ -3814,7 +3713,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "staging-xcm 14.1.0", + "staging-xcm", "staging-xcm-builder", "wasm-instrument", "wasmi", @@ -3831,17 +3730,6 @@ dependencies = [ "syn 2.0.77", ] -[[package]] -name = "pallet-contracts-uapi" -version = "9.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d7a51646d9ff1d91abd0186d2c074f0dfd3b1a2d55f08a229a2f2e4bc6d1e49" -dependencies = [ - "bitflags 1.3.2", - "paste", - "polkavm-derive 0.9.1", -] - [[package]] name = "pallet-contracts-uapi" version = "11.0.0" @@ -4316,7 +4204,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", - "staging-xcm 14.1.0", + "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", "xcm-runtime-apis", @@ -4349,7 +4237,7 @@ dependencies = [ "sp-runtime", "sp-std", "staging-parachain-info", - "staging-xcm 14.1.0", + "staging-xcm", "staging-xcm-executor", "substrate-wasm-builder", ] @@ -4598,7 +4486,7 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", - "staging-xcm 14.1.0", + "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", "static_assertions", @@ -4662,7 +4550,7 @@ dependencies = [ "sp-session", "sp-staking", "sp-std", - "staging-xcm 14.1.0", + "staging-xcm", "staging-xcm-executor", ] @@ -4885,7 +4773,7 @@ dependencies = [ "sp-transaction-pool", "sp-version", "staging-parachain-info", - "staging-xcm 14.1.0", + "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", "substrate-wasm-builder", @@ -5239,16 +5127,6 @@ dependencies = [ "scale-info", ] -[[package]] -name = "scale-bits" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662d10dcd57b1c2a3c41c9cf68f71fb09747ada1ea932ad961aca7e2ca28315f" -dependencies = [ - "parity-scale-codec", - "scale-type-resolver", -] - [[package]] name = "scale-decode" version = "0.10.0" @@ -5257,26 +5135,12 @@ checksum = "7caaf753f8ed1ab4752c6afb20174f03598c664724e0e32628e161c21000ff76" dependencies = [ "derive_more", "parity-scale-codec", - "scale-bits 0.4.0", - "scale-decode-derive 0.10.0", + "scale-bits", + "scale-decode-derive", "scale-info", "smallvec", ] -[[package]] -name = "scale-decode" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc79ba56a1c742f5aeeed1f1801f3edf51f7e818f0a54582cac6f131364ea7b" -dependencies = [ - "derive_more", - "parity-scale-codec", - "scale-bits 0.5.0", - "scale-decode-derive 0.11.1", - "scale-type-resolver", - "smallvec", -] - [[package]] name = "scale-decode-derive" version = "0.10.0" @@ -5290,18 +5154,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "scale-decode-derive" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5398fdb3c7bea3cb419bac4983aadacae93fe1a7b5f693f4ebd98c3821aad7a5" -dependencies = [ - "darling 0.14.4", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "scale-encode" version = "0.5.0" @@ -5310,24 +5162,11 @@ checksum = "6d70cb4b29360105483fac1ed567ff95d65224a14dd275b6303ed0a654c78de5" dependencies = [ "derive_more", "parity-scale-codec", - "scale-encode-derive 0.5.0", + "scale-encode-derive", "scale-info", "smallvec", ] -[[package]] -name = "scale-encode" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628800925a33794fb5387781b883b5e14d130fece9af5a63613867b8de07c5c7" -dependencies = [ - "derive_more", - "parity-scale-codec", - "scale-encode-derive 0.6.0", - "scale-type-resolver", - "smallvec", -] - [[package]] name = "scale-encode-derive" version = "0.5.0" @@ -5341,19 +5180,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "scale-encode-derive" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a304e1af7cdfbe7a24e08b012721456cc8cecdedadc14b3d10513eada63233c" -dependencies = [ - "darling 0.14.4", - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "scale-info" version = "2.11.3" @@ -5381,15 +5207,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "scale-type-resolver" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10b800069bfd43374e0f96f653e0d46882a2cb16d6d961ac43bea80f26c76843" -dependencies = [ - "smallvec", -] - [[package]] name = "schemars" version = "0.8.21" @@ -6476,25 +6293,6 @@ dependencies = [ "sp-std", ] -[[package]] -name = "staging-xcm" -version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aded0292274ad473250c22ed3deaf2d9ed47d15786d700e9e83ab7c1cad2ad44" -dependencies = [ - "array-bytes", - "bounded-collections", - "derivative", - "environmental", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-weights", - "xcm-procedural 8.0.0", -] - [[package]] name = "staging-xcm" version = "14.1.0" @@ -6511,7 +6309,7 @@ dependencies = [ "scale-info", "serde", "sp-weights", - "xcm-procedural 10.1.0", + "xcm-procedural", ] [[package]] @@ -6533,7 +6331,7 @@ dependencies = [ "sp-runtime", "sp-std", "sp-weights", - "staging-xcm 14.1.0", + "staging-xcm", "staging-xcm-executor", ] @@ -6556,7 +6354,7 @@ dependencies = [ "sp-runtime", "sp-std", "sp-weights", - "staging-xcm 14.1.0", + "staging-xcm", ] [[package]] @@ -7639,18 +7437,6 @@ dependencies = [ "tap", ] -[[package]] -name = "xcm-procedural" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4717a97970a9cda70d7db53cf50d2615c2f6f6b7c857445325b4a39ea7aa2cd" -dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "syn 2.0.77", -] - [[package]] name = "xcm-procedural" version = "10.1.0" @@ -7675,7 +7461,7 @@ dependencies = [ "sp-api", "sp-std", "sp-weights", - "staging-xcm 14.1.0", + "staging-xcm", "staging-xcm-executor", ] From dc38f73038210b960c1d286fa81e53addda97cdd Mon Sep 17 00:00:00 2001 From: Daanvdplas Date: Thu, 17 Oct 2024 18:15:53 +0200 Subject: [PATCH 36/43] refactor --- crates/pop-drink/src/lib.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index ac72a9c..5c20ee4 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -16,17 +16,23 @@ mod mock; /// Types and utilities for testing smart contracts interacting with Pop Network Devnet via the pop /// api. pub mod devnet { - pub use pop_runtime_devnet::{Runtime, RuntimeError::*}; + pub use pop_runtime_devnet::Runtime; use super::*; pub use crate::error::*; - /// Utilities for smart contracts using pop api V0. - pub mod v0 { - pub use pop_api::primitives::v0::{self, *}; + /// Error related utilities for smart contracts using pop api. + pub mod error { + pub use pop_runtime_devnet::RuntimeError::*; - /// Error type for writing tests (see `error` module). - pub type Error = crate::error::Error; + pub use crate::error::*; + + pub mod v0 { + pub use pop_api::primitives::v0::{self, *}; + + /// Error type for writing tests (see `error` module). + pub type Error = crate::error::Error; + } } // Types used in the pop runtime. From 59ae0eb7a64f96e6b963858743c38926e4002e72 Mon Sep 17 00:00:00 2001 From: Daanvdplas Date: Fri, 18 Oct 2024 10:53:20 +0200 Subject: [PATCH 37/43] remove: pallet-api --- Cargo.lock | 1 - Cargo.toml | 1 - crates/pop-drink/Cargo.toml | 1 - crates/pop-drink/src/mock.rs | 7 ------- 4 files changed, 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4b5fb1e..a346fcd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4666,7 +4666,6 @@ dependencies = [ "frame-support", "frame-system", "ink_sandbox", - "pallet-api", "pallet-assets", "pallet-balances", "pallet-contracts", diff --git a/Cargo.toml b/Cargo.toml index 9b65db7..b2f579c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,6 @@ sp-runtime-interface = { version = "28.0.0", features = ["std"] } # Local drink = { path = "crates/drink/drink" } ink_sandbox = { path = "crates/ink-sandbox" } -pallet-api = { path = "../pop-node/pallets/api" } pop-api = { path = "../pop-node/pop-api" } pop-drink = { path = "crates/pop-drink" } pop-runtime-devnet = { path = "../pop-node/runtime/devnet" } diff --git a/crates/pop-drink/Cargo.toml b/crates/pop-drink/Cargo.toml index e82fa10..5c7f26c 100644 --- a/crates/pop-drink/Cargo.toml +++ b/crates/pop-drink/Cargo.toml @@ -16,7 +16,6 @@ pop-api.workspace = true [dev-dependencies] scale-info = { workspace = true, features = ["derive"] } -pallet-api.workspace = true pallet-assets.workspace = true pallet-balances.workspace = true pallet-timestamp.workspace = true diff --git a/crates/pop-drink/src/mock.rs b/crates/pop-drink/src/mock.rs index 5dcfd68..08d0746 100644 --- a/crates/pop-drink/src/mock.rs +++ b/crates/pop-drink/src/mock.rs @@ -20,7 +20,6 @@ frame_support::construct_runtime!( Balances: pallet_balances, Timestamp: pallet_timestamp, Contracts: pallet_contracts, - Fungibles: pallet_api::fungibles, } ); @@ -87,12 +86,6 @@ impl pallet_assets::Config for Test { type RuntimeEvent = RuntimeEvent; } -impl pallet_api::fungibles::Config for Test { - type AssetsInstance = AssetsInstance; - type RuntimeEvent = RuntimeEvent; - type WeightInfo = (); -} - parameter_types! { pub MySchedule: Schedule = { let schedule = >::default(); From f1c0faf5cd852dc8a0ba1cab46c5c56730b822fe Mon Sep 17 00:00:00 2001 From: Daanvdplas Date: Fri, 18 Oct 2024 12:04:40 +0200 Subject: [PATCH 38/43] chore: pop dependencies to git --- Cargo.lock | 6 ++++++ Cargo.toml | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a346fcd..10c43d2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3467,6 +3467,7 @@ dependencies = [ [[package]] name = "pallet-api" version = "0.1.0" +source = "git+https://github.com/r0gue-io/pop-node.git?branch=main#52fb7f06a89955d462900e33d2b9c9170c4534a0" dependencies = [ "frame-benchmarking", "frame-support", @@ -4637,6 +4638,7 @@ dependencies = [ [[package]] name = "pop-api" version = "0.0.0" +source = "git+https://github.com/r0gue-io/pop-node.git?branch=main#52fb7f06a89955d462900e33d2b9c9170c4534a0" dependencies = [ "ink", "pop-primitives", @@ -4646,6 +4648,7 @@ dependencies = [ [[package]] name = "pop-chain-extension" version = "0.1.0" +source = "git+https://github.com/r0gue-io/pop-node.git?branch=main#52fb7f06a89955d462900e33d2b9c9170c4534a0" dependencies = [ "frame-support", "frame-system", @@ -4680,6 +4683,7 @@ dependencies = [ [[package]] name = "pop-primitives" version = "0.0.0" +source = "git+https://github.com/r0gue-io/pop-node.git?branch=main#52fb7f06a89955d462900e33d2b9c9170c4534a0" dependencies = [ "parity-scale-codec", "scale-info", @@ -4688,6 +4692,7 @@ dependencies = [ [[package]] name = "pop-runtime-common" version = "0.0.0" +source = "git+https://github.com/r0gue-io/pop-node.git?branch=main#52fb7f06a89955d462900e33d2b9c9170c4534a0" dependencies = [ "frame-support", "parachains-common", @@ -4701,6 +4706,7 @@ dependencies = [ [[package]] name = "pop-runtime-devnet" version = "0.1.0" +source = "git+https://github.com/r0gue-io/pop-node.git?branch=main#52fb7f06a89955d462900e33d2b9c9170c4534a0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", diff --git a/Cargo.toml b/Cargo.toml index b2f579c..4a196d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,6 +54,6 @@ sp-runtime-interface = { version = "28.0.0", features = ["std"] } # Local drink = { path = "crates/drink/drink" } ink_sandbox = { path = "crates/ink-sandbox" } -pop-api = { path = "../pop-node/pop-api" } +pop-api = { git = "https://github.com/r0gue-io/pop-node.git", branch = "main" } pop-drink = { path = "crates/pop-drink" } -pop-runtime-devnet = { path = "../pop-node/runtime/devnet" } +pop-runtime-devnet = { git = "https://github.com/r0gue-io/pop-node.git", branch = "main" } From ed5140ae3cb2b542882406a1189ffa52df4bced1 Mon Sep 17 00:00:00 2001 From: Daanvdplas Date: Fri, 18 Oct 2024 12:18:25 +0200 Subject: [PATCH 39/43] chore: remove old ci files --- .github/workflows/publish.yml | 27 --------------- .github/workflows/rust-checks.yml | 55 ------------------------------- 2 files changed, 82 deletions(-) delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/rust-checks.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index bf00698..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: Publish to crates.io - -on: - push: - branches: - - main - - release-* - pull_request: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: true - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - uses: katyo/publish-crates@v2 - with: - dry-run: ${{ github.event_name != 'push' }} - registry-token: ${{ secrets.CRATES_IO_TOKEN }} - ignore-unpublished-changes: true diff --git a/.github/workflows/rust-checks.yml b/.github/workflows/rust-checks.yml deleted file mode 100644 index 53303e1..0000000 --- a/.github/workflows/rust-checks.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -name: Rust checks - -on: - push: - branches: - - main - - release-* - pull_request: - workflow_dispatch: - -concurrency: - group: ${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: true - -jobs: - main: - name: Run check, test and lints - runs-on: drink-runner - env: - CARGO_INCREMENTAL: 0 - steps: - - name: Checkout source code - uses: actions/checkout@v3 - - - name: Install Rust toolchain - uses: Cardinal-Cryptography/github-actions/install-rust-toolchain@v1 - with: - targets: wasm32-unknown-unknown - components: clippy rustfmt - - - name: Add rust-src - shell: bash - run: rustup component add rust-src - - - name: Run format checks - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all - - - name: Run linter - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all-targets -- --no-deps -D warnings - - - name: Run unit test suite - uses: actions-rs/cargo@v1 - with: - command: test - - - name: Run tests for examples - shell: bash - run: make test_examples From b735c02986a0a5c12c7fd8b6b5f3c7fe0c92debd Mon Sep 17 00:00:00 2001 From: Daanvdplas Date: Fri, 18 Oct 2024 12:26:41 +0200 Subject: [PATCH 40/43] chore: ci --- .githooks/README.md | 23 + .githooks/pre-push | 21 + crates/drink/drink-cli/src/executor/mod.rs | 5 +- crates/drink/drink/src/errors.rs | 10 +- crates/drink/drink/src/session.rs | 31 +- crates/ink-sandbox/src/api.rs | 10 +- crates/ink-sandbox/src/api/balances_api.rs | 85 ++- crates/ink-sandbox/src/api/contracts_api.rs | 657 ++++++++++---------- crates/ink-sandbox/src/api/system_api.rs | 329 +++++----- crates/ink-sandbox/src/api/timestamp_api.rs | 68 +- crates/ink-sandbox/src/lib.rs | 108 ++-- crates/ink-sandbox/src/macros.rs | 102 ++- 12 files changed, 747 insertions(+), 702 deletions(-) create mode 100644 .githooks/README.md create mode 100755 .githooks/pre-push diff --git a/.githooks/README.md b/.githooks/README.md new file mode 100644 index 0000000..55d3d98 --- /dev/null +++ b/.githooks/README.md @@ -0,0 +1,23 @@ +# Git Hooks + +A pre-push hook which checks formatting of Rust files. Additional checks may be added in the future. + +# Prerequisites + +The following prerequisites are required: + +## Rust Nightly + +The nightly version of Rust provides additional formatting benefits over the stable version. + +```shell +rustup toolchain install nightly --profile minimal --component rustfmt +``` + +# Installation + +Use the following command in the root directory of the local repository to configure Git to use the hooks: + +```shell +git config core.hooksPath .githooks +``` diff --git a/.githooks/pre-push b/.githooks/pre-push new file mode 100755 index 0000000..3bd009c --- /dev/null +++ b/.githooks/pre-push @@ -0,0 +1,21 @@ +#!/bin/sh + +set -eu + +# Are deps installed +if ! command -v cargo > /dev/null 2>&1 +then + echo "cargo couldn't be found, please confirm your set up is properly configured." + exit 1 +else + # Check Rust formatting + if ! cargo +nightly fmt --all -- --check + then + echo "There are some code style issues." + # shellcheck disable=SC2006 + echo "Run 'cargo +nightly fmt --all' first." + exit 1 + fi +fi + +exit 0 diff --git a/crates/drink/drink-cli/src/executor/mod.rs b/crates/drink/drink-cli/src/executor/mod.rs index ed93750..5b087f6 100644 --- a/crates/drink/drink-cli/src/executor/mod.rs +++ b/crates/drink/drink-cli/src/executor/mod.rs @@ -5,7 +5,10 @@ use std::env; use anyhow::Result; use clap::Parser; -use drink::{sandbox_api::prelude::{SystemAPI, BalanceAPI}, AccountId32, Weight}; +use drink::{ + sandbox_api::prelude::{BalanceAPI, SystemAPI}, + AccountId32, Weight, +}; use crate::{app_state::AppState, cli::CliCommand}; diff --git a/crates/drink/drink/src/errors.rs b/crates/drink/drink/src/errors.rs index 9bc6250..7db322b 100644 --- a/crates/drink/drink/src/errors.rs +++ b/crates/drink/drink/src/errors.rs @@ -20,15 +20,7 @@ pub enum Error { #[non_exhaustive] #[repr(u32)] #[derive( - Debug, - Copy, - Clone, - PartialEq, - Eq, - scale::Encode, - scale::Decode, - scale_info::TypeInfo, - Error, + Debug, Copy, Clone, PartialEq, Eq, scale::Encode, scale::Decode, scale_info::TypeInfo, Error, )] pub enum LangError { /// Failed to read execution input for the dispatchable. diff --git a/crates/drink/drink/src/session.rs b/crates/drink/drink/src/session.rs index bd634d8..ec89238 100644 --- a/crates/drink/drink/src/session.rs +++ b/crates/drink/drink/src/session.rs @@ -13,8 +13,8 @@ use frame_support::{traits::fungible::Inspect, weights::Weight}; use ink_sandbox::{ api::prelude::*, AccountIdFor, ContractExecResultFor, ContractInstantiateResultFor, Sandbox, }; -use scale::Decode; pub use record::{EventBatch, Record}; +use scale::Decode; use crate::{ minimal::MinimalSandboxRuntime, @@ -106,8 +106,14 @@ pub const NO_ENDOWMENT: Option> = None; /// # fn main() -> Result<(), Box> { /// /// let mut session = Session::::default(); -/// let _address = -/// session.deploy(contract_bytes(), "new", NO_ARGS, NO_SALT, NO_ENDOWMENT, &get_transcoder())?; +/// let _address = session.deploy( +/// contract_bytes(), +/// "new", +/// NO_ARGS, +/// NO_SALT, +/// NO_ENDOWMENT, +/// &get_transcoder(), +/// )?; /// let _result: u32 = session.call("foo", NO_ARGS, NO_ENDOWMENT)??; /// session.set_actor(bob()); /// session.call::<_, ()>("bar", NO_ARGS, NO_ENDOWMENT)??; @@ -135,8 +141,13 @@ pub const NO_ENDOWMENT: Option> = None; /// /// // Or choosing the file explicitly: /// let contract = ContractBundle::load("path/to/your.contract")?; -/// Session::::default() -/// .deploy_bundle_and(contract, "new", NO_ARGS, NO_SALT, NO_ENDOWMENT)?; // ... +/// Session::::default().deploy_bundle_and( +/// contract, +/// "new", +/// NO_ARGS, +/// NO_SALT, +/// NO_ENDOWMENT, +/// )?; // ... /// # Ok(()) } /// ``` pub struct Session @@ -309,9 +320,8 @@ where }); let ret = match &result.result { - Ok(exec_result) if exec_result.result.did_revert() => { - Err(SessionError::DeploymentReverted) - }, + Ok(exec_result) if exec_result.result.did_revert() => + Err(SessionError::DeploymentReverted), Ok(exec_result) => { let address = exec_result.account_id.clone(); self.record.push_deploy_return(address.clone()); @@ -582,9 +592,8 @@ where }); let ret = match &result.result { - Ok(exec_result) if exec_result.did_revert() => { - Err(SessionError::CallReverted(exec_result.data.clone())) - }, + Ok(exec_result) if exec_result.did_revert() => + Err(SessionError::CallReverted(exec_result.data.clone())), Ok(exec_result) => { self.record.push_call_return(exec_result.data.clone()); self.record.last_call_return_decoded::() diff --git a/crates/ink-sandbox/src/api.rs b/crates/ink-sandbox/src/api.rs index 62edd5d..f52e7b4 100644 --- a/crates/ink-sandbox/src/api.rs +++ b/crates/ink-sandbox/src/api.rs @@ -1,12 +1,12 @@ +pub mod assets_api; pub mod balances_api; pub mod contracts_api; pub mod system_api; pub mod timestamp_api; -pub mod assets_api; pub mod prelude { - pub use super::{ - assets_api::AssetsAPI, balances_api::BalanceAPI, contracts_api::ContractAPI, system_api::SystemAPI, - timestamp_api::TimestampAPI, - }; + pub use super::{ + assets_api::AssetsAPI, balances_api::BalanceAPI, contracts_api::ContractAPI, + system_api::SystemAPI, timestamp_api::TimestampAPI, + }; } diff --git a/crates/ink-sandbox/src/api/balances_api.rs b/crates/ink-sandbox/src/api/balances_api.rs index 984b785..3a733d9 100644 --- a/crates/ink-sandbox/src/api/balances_api.rs +++ b/crates/ink-sandbox/src/api/balances_api.rs @@ -7,63 +7,58 @@ type BalanceOf = ::Balance; /// Balances API for the sandbox. pub trait BalanceAPI where - T: Sandbox, - T::Runtime: pallet_balances::Config, + T: Sandbox, + T::Runtime: pallet_balances::Config, { - /// Mint tokens to an account. - /// - /// # Arguments - /// - /// * `address` - The address of the account to add tokens to. - /// * `amount` - The number of tokens to add. - fn mint_into( - &mut self, - address: &AccountIdFor, - amount: BalanceOf, - ) -> Result, DispatchError>; + /// Mint tokens to an account. + /// + /// # Arguments + /// + /// * `address` - The address of the account to add tokens to. + /// * `amount` - The number of tokens to add. + fn mint_into( + &mut self, + address: &AccountIdFor, + amount: BalanceOf, + ) -> Result, DispatchError>; - /// Return the free balance of an account. - /// - /// # Arguments - /// - /// * `address` - The address of the account to query. - fn free_balance(&mut self, address: &AccountIdFor) -> BalanceOf; + /// Return the free balance of an account. + /// + /// # Arguments + /// + /// * `address` - The address of the account to query. + fn free_balance(&mut self, address: &AccountIdFor) -> BalanceOf; } impl BalanceAPI for T where - T: Sandbox, - T::Runtime: pallet_balances::Config, + T: Sandbox, + T::Runtime: pallet_balances::Config, { - fn mint_into( - &mut self, - address: &AccountIdFor, - amount: BalanceOf, - ) -> Result, DispatchError> { - self.execute_with(|| pallet_balances::Pallet::::mint_into(address, amount)) - } + fn mint_into( + &mut self, + address: &AccountIdFor, + amount: BalanceOf, + ) -> Result, DispatchError> { + self.execute_with(|| pallet_balances::Pallet::::mint_into(address, amount)) + } - fn free_balance(&mut self, address: &AccountIdFor) -> BalanceOf { - self.execute_with(|| pallet_balances::Pallet::::free_balance(address)) - } + fn free_balance(&mut self, address: &AccountIdFor) -> BalanceOf { + self.execute_with(|| pallet_balances::Pallet::::free_balance(address)) + } } #[cfg(test)] mod test { - use super::*; - use crate::DefaultSandbox; - #[test] - fn mint_works() { - let mut sandbox = DefaultSandbox::default(); - let balance = sandbox.free_balance(&DefaultSandbox::default_actor()); + use super::*; + use crate::DefaultSandbox; + #[test] + fn mint_works() { + let mut sandbox = DefaultSandbox::default(); + let balance = sandbox.free_balance(&DefaultSandbox::default_actor()); - sandbox - .mint_into(&DefaultSandbox::default_actor(), 100) - .unwrap(); + sandbox.mint_into(&DefaultSandbox::default_actor(), 100).unwrap(); - assert_eq!( - sandbox.free_balance(&DefaultSandbox::default_actor()), - balance + 100 - ); - } + assert_eq!(sandbox.free_balance(&DefaultSandbox::default_actor()), balance + 100); + } } diff --git a/crates/ink-sandbox/src/api/contracts_api.rs b/crates/ink-sandbox/src/api/contracts_api.rs index e7404f6..96a8895 100644 --- a/crates/ink-sandbox/src/api/contracts_api.rs +++ b/crates/ink-sandbox/src/api/contracts_api.rs @@ -3,355 +3,356 @@ use std::ops::Not; use frame_support::{traits::fungible::Inspect, weights::Weight}; use frame_system::Config as SysConfig; use pallet_contracts::{ - Code, CodeUploadResult, CollectEvents, ContractInstantiateResult, DebugInfo, Determinism, + Code, CodeUploadResult, CollectEvents, ContractInstantiateResult, DebugInfo, Determinism, }; use scale::Decode as _; use crate::{ - AccountIdFor, ContractExecResultFor, ContractInstantiateResultFor, EventRecordOf, Sandbox, + AccountIdFor, ContractExecResultFor, ContractInstantiateResultFor, EventRecordOf, Sandbox, }; type BalanceOf = - <::Currency as Inspect>>::Balance; + <::Currency as Inspect>>::Balance; /// Contract API used to interact with the contracts pallet. pub trait ContractAPI { - /// The runtime contract config. - type T: pallet_contracts::Config; - - /// Interface for `bare_instantiate` contract call with a simultaneous upload. - /// - /// # Arguments - /// - /// * `contract_bytes` - The contract code. - /// * `value` - The number of tokens to be transferred to the contract. - /// * `data` - The input data to be passed to the contract (including constructor - /// name). - /// * `salt` - The salt to be used for contract address derivation. - /// * `origin` - The sender of the contract call. - /// * `gas_limit` - The gas limit for the contract call. - /// * `storage_deposit_limit` - The storage deposit limit for the contract call. - #[allow(clippy::type_complexity, clippy::too_many_arguments)] - fn deploy_contract( - &mut self, - contract_bytes: Vec, - value: BalanceOf, - data: Vec, - salt: Vec, - origin: AccountIdFor, - gas_limit: Weight, - storage_deposit_limit: Option>, - ) -> ContractInstantiateResult, BalanceOf, EventRecordOf>; - - /// Interface for `bare_instantiate` contract call for a previously uploaded contract. - /// - /// # Arguments - /// - /// * `code_hash` - The code hash of the contract to instantiate. - /// * `value` - The number of tokens to be transferred to the contract. - /// * `data` - The input data to be passed to the contract (including constructor - /// name). - /// * `salt` - The salt to be used for contract address derivation. - /// * `origin` - The sender of the contract call. - /// * `gas_limit` - The gas limit for the contract call. - /// * `storage_deposit_limit` - The storage deposit limit for the contract call. - #[allow(clippy::type_complexity, clippy::too_many_arguments)] - fn instantiate_contract( - &mut self, - code_hash: Vec, - value: BalanceOf, - data: Vec, - salt: Vec, - origin: AccountIdFor, - gas_limit: Weight, - storage_deposit_limit: Option>, - ) -> ContractInstantiateResult, BalanceOf, EventRecordOf>; - - /// Interface for `bare_upload_code` contract call. - /// - /// # Arguments - /// - /// * `contract_bytes` - The contract code. - /// * `origin` - The sender of the contract call. - /// * `storage_deposit_limit` - The storage deposit limit for the contract call. - fn upload_contract( - &mut self, - contract_bytes: Vec, - origin: AccountIdFor, - storage_deposit_limit: Option>, - determinism: Determinism, - ) -> CodeUploadResult<::Hash, BalanceOf>; - - /// Interface for `bare_call` contract call. - /// - /// # Arguments - /// - /// * `address` - The address of the contract to be called. - /// * `value` - The number of tokens to be transferred to the contract. - /// * `data` - The input data to be passed to the contract (including message name). - /// * `origin` - The sender of the contract call. - /// * `gas_limit` - The gas limit for the contract call. - /// * `storage_deposit_limit` - The storage deposit limit for the contract call. - #[allow(clippy::type_complexity, clippy::too_many_arguments)] - fn call_contract( - &mut self, - address: AccountIdFor, - value: BalanceOf, - data: Vec, - origin: AccountIdFor, - gas_limit: Weight, - storage_deposit_limit: Option>, - determinism: Determinism, - ) -> ContractExecResultFor; + /// The runtime contract config. + type T: pallet_contracts::Config; + + /// Interface for `bare_instantiate` contract call with a simultaneous upload. + /// + /// # Arguments + /// + /// * `contract_bytes` - The contract code. + /// * `value` - The number of tokens to be transferred to the contract. + /// * `data` - The input data to be passed to the contract (including constructor name). + /// * `salt` - The salt to be used for contract address derivation. + /// * `origin` - The sender of the contract call. + /// * `gas_limit` - The gas limit for the contract call. + /// * `storage_deposit_limit` - The storage deposit limit for the contract call. + #[allow(clippy::type_complexity, clippy::too_many_arguments)] + fn deploy_contract( + &mut self, + contract_bytes: Vec, + value: BalanceOf, + data: Vec, + salt: Vec, + origin: AccountIdFor, + gas_limit: Weight, + storage_deposit_limit: Option>, + ) -> ContractInstantiateResult, BalanceOf, EventRecordOf>; + + /// Interface for `bare_instantiate` contract call for a previously uploaded contract. + /// + /// # Arguments + /// + /// * `code_hash` - The code hash of the contract to instantiate. + /// * `value` - The number of tokens to be transferred to the contract. + /// * `data` - The input data to be passed to the contract (including constructor name). + /// * `salt` - The salt to be used for contract address derivation. + /// * `origin` - The sender of the contract call. + /// * `gas_limit` - The gas limit for the contract call. + /// * `storage_deposit_limit` - The storage deposit limit for the contract call. + #[allow(clippy::type_complexity, clippy::too_many_arguments)] + fn instantiate_contract( + &mut self, + code_hash: Vec, + value: BalanceOf, + data: Vec, + salt: Vec, + origin: AccountIdFor, + gas_limit: Weight, + storage_deposit_limit: Option>, + ) -> ContractInstantiateResult, BalanceOf, EventRecordOf>; + + /// Interface for `bare_upload_code` contract call. + /// + /// # Arguments + /// + /// * `contract_bytes` - The contract code. + /// * `origin` - The sender of the contract call. + /// * `storage_deposit_limit` - The storage deposit limit for the contract call. + fn upload_contract( + &mut self, + contract_bytes: Vec, + origin: AccountIdFor, + storage_deposit_limit: Option>, + determinism: Determinism, + ) -> CodeUploadResult<::Hash, BalanceOf>; + + /// Interface for `bare_call` contract call. + /// + /// # Arguments + /// + /// * `address` - The address of the contract to be called. + /// * `value` - The number of tokens to be transferred to the contract. + /// * `data` - The input data to be passed to the contract (including message name). + /// * `origin` - The sender of the contract call. + /// * `gas_limit` - The gas limit for the contract call. + /// * `storage_deposit_limit` - The storage deposit limit for the contract call. + #[allow(clippy::type_complexity, clippy::too_many_arguments)] + fn call_contract( + &mut self, + address: AccountIdFor, + value: BalanceOf, + data: Vec, + origin: AccountIdFor, + gas_limit: Weight, + storage_deposit_limit: Option>, + determinism: Determinism, + ) -> ContractExecResultFor; } impl ContractAPI for T where - T: Sandbox, - T::Runtime: pallet_contracts::Config, + T: Sandbox, + T::Runtime: pallet_contracts::Config, { - type T = T::Runtime; - - fn deploy_contract( - &mut self, - contract_bytes: Vec, - value: BalanceOf, - data: Vec, - salt: Vec, - origin: AccountIdFor, - gas_limit: Weight, - storage_deposit_limit: Option>, - ) -> ContractInstantiateResultFor { - log::debug!("deploy_contract: value={value:?}, origin={origin}, gas_limit={gas_limit:?}, storage_deposit_limit={storage_deposit_limit:?}"); - self.execute_with(|| { - pallet_contracts::Pallet::::bare_instantiate( - origin, - value, - gas_limit, - storage_deposit_limit, - Code::Upload(contract_bytes), - data, - salt, - DebugInfo::UnsafeDebug, - CollectEvents::UnsafeCollect, - ) - }) - } - - fn instantiate_contract( - &mut self, - code_hash: Vec, - value: BalanceOf, - data: Vec, - salt: Vec, - origin: AccountIdFor, - gas_limit: Weight, - storage_deposit_limit: Option>, - ) -> ContractInstantiateResult, BalanceOf, EventRecordOf> - { - log::debug!("instantiate_contract: code_hash={code_hash:?}, value={value:?}, origin={origin}, gas_limit={gas_limit:?}"); - let mut code_hash = &code_hash[..]; - self.execute_with(|| { - pallet_contracts::Pallet::::bare_instantiate( - origin, - value, - gas_limit, - storage_deposit_limit, - Code::Existing( - ::Hash::decode(&mut code_hash) - .expect("Invalid code hash"), - ), - data, - salt, - DebugInfo::UnsafeDebug, - CollectEvents::UnsafeCollect, - ) - }) - } - - fn upload_contract( - &mut self, - contract_bytes: Vec, - origin: AccountIdFor, - storage_deposit_limit: Option>, - determinism: Determinism, - ) -> CodeUploadResult<::Hash, BalanceOf> { - self.execute_with(|| { - pallet_contracts::Pallet::::bare_upload_code( - origin, - contract_bytes, - storage_deposit_limit, - determinism, - ) - }) - } - - fn call_contract( - &mut self, - address: AccountIdFor, - value: BalanceOf, - data: Vec, - origin: AccountIdFor, - gas_limit: Weight, - storage_deposit_limit: Option>, - determinism: Determinism, - ) -> ContractExecResultFor { - self.execute_with(|| { - pallet_contracts::Pallet::::bare_call( - origin, - address, - value, - gas_limit, - storage_deposit_limit, - data, - DebugInfo::UnsafeDebug, - CollectEvents::UnsafeCollect, - determinism, - ) - }) - } + type T = T::Runtime; + + fn deploy_contract( + &mut self, + contract_bytes: Vec, + value: BalanceOf, + data: Vec, + salt: Vec, + origin: AccountIdFor, + gas_limit: Weight, + storage_deposit_limit: Option>, + ) -> ContractInstantiateResultFor { + log::debug!( + "deploy_contract: value={value:?}, origin={origin}, gas_limit={gas_limit:?}, \ + storage_deposit_limit={storage_deposit_limit:?}" + ); + self.execute_with(|| { + pallet_contracts::Pallet::::bare_instantiate( + origin, + value, + gas_limit, + storage_deposit_limit, + Code::Upload(contract_bytes), + data, + salt, + DebugInfo::UnsafeDebug, + CollectEvents::UnsafeCollect, + ) + }) + } + + fn instantiate_contract( + &mut self, + code_hash: Vec, + value: BalanceOf, + data: Vec, + salt: Vec, + origin: AccountIdFor, + gas_limit: Weight, + storage_deposit_limit: Option>, + ) -> ContractInstantiateResult, BalanceOf, EventRecordOf> + { + log::debug!( + "instantiate_contract: code_hash={code_hash:?}, value={value:?}, origin={origin}, \ + gas_limit={gas_limit:?}" + ); + let mut code_hash = &code_hash[..]; + self.execute_with(|| { + pallet_contracts::Pallet::::bare_instantiate( + origin, + value, + gas_limit, + storage_deposit_limit, + Code::Existing( + ::Hash::decode(&mut code_hash) + .expect("Invalid code hash"), + ), + data, + salt, + DebugInfo::UnsafeDebug, + CollectEvents::UnsafeCollect, + ) + }) + } + + fn upload_contract( + &mut self, + contract_bytes: Vec, + origin: AccountIdFor, + storage_deposit_limit: Option>, + determinism: Determinism, + ) -> CodeUploadResult<::Hash, BalanceOf> { + self.execute_with(|| { + pallet_contracts::Pallet::::bare_upload_code( + origin, + contract_bytes, + storage_deposit_limit, + determinism, + ) + }) + } + + fn call_contract( + &mut self, + address: AccountIdFor, + value: BalanceOf, + data: Vec, + origin: AccountIdFor, + gas_limit: Weight, + storage_deposit_limit: Option>, + determinism: Determinism, + ) -> ContractExecResultFor { + self.execute_with(|| { + pallet_contracts::Pallet::::bare_call( + origin, + address, + value, + gas_limit, + storage_deposit_limit, + data, + DebugInfo::UnsafeDebug, + CollectEvents::UnsafeCollect, + determinism, + ) + }) + } } /// Converts bytes to a '\n'-split string, ignoring empty lines. pub fn decode_debug_buffer(buffer: &[u8]) -> Vec { - let decoded = buffer.iter().map(|b| *b as char).collect::(); - decoded - .split('\n') - .filter_map(|s| s.is_empty().not().then_some(s.to_string())) - .collect() + let decoded = buffer.iter().map(|b| *b as char).collect::(); + decoded + .split('\n') + .filter_map(|s| s.is_empty().not().then_some(s.to_string())) + .collect() } #[cfg(test)] mod tests { - use frame_support::sp_runtime::traits::Hash; - use pallet_contracts::Origin; - - use super::*; - use crate::{api::prelude::*, DefaultSandbox, RuntimeEventOf, RuntimeOf}; - - fn compile_module(contract_name: &str) -> Vec { - let path = [ - std::env::var("CARGO_MANIFEST_DIR").as_deref().unwrap(), - "/test-resources/", - contract_name, - ".wat", - ] - .concat(); - wat::parse_file(path).expect("Failed to parse wat file") - } - - #[test] - fn can_upload_code() { - let mut sandbox = DefaultSandbox::default(); - let wasm_binary = compile_module("dummy"); - let hash = - < as frame_system::Config>::Hashing>::hash(&wasm_binary); - - let result = sandbox.upload_contract( - wasm_binary, - DefaultSandbox::default_actor(), - None, - Determinism::Enforced, - ); - - assert!(result.is_ok()); - assert_eq!(hash, result.unwrap().code_hash); - } - - #[test] - fn can_deploy_contract() { - let mut sandbox = DefaultSandbox::default(); - let wasm_binary = compile_module("dummy"); - - let events_before = sandbox.events(); - assert!(events_before.is_empty()); - - let result = sandbox.deploy_contract( - wasm_binary, - 0, - vec![], - vec![], - DefaultSandbox::default_actor(), - DefaultSandbox::default_gas_limit(), - None, - ); - assert!(result.result.is_ok()); - assert!(!result.result.unwrap().result.did_revert()); - - let events = result.events.expect("Sandbox should collect events"); - let event_count = events.len(); - let instantiation_event = events[event_count - 2].clone(); - assert!(matches!( - instantiation_event.event, - RuntimeEventOf::::Contracts(pallet_contracts::Event::< - RuntimeOf, - >::Instantiated { .. }) - )); - let deposit_event = events[event_count - 1].clone(); - assert!(matches!( - deposit_event.event, - RuntimeEventOf::::Contracts(pallet_contracts::Event::< - RuntimeOf, - >::StorageDepositTransferredAndHeld { .. }) - )); - } - - #[test] - fn can_call_contract() { - let mut sandbox = DefaultSandbox::default(); - let actor = DefaultSandbox::default_actor(); - let wasm_binary = compile_module("dummy"); - - let result = sandbox.deploy_contract( - wasm_binary, - 0, - vec![], - vec![], - actor.clone(), - DefaultSandbox::default_gas_limit(), - None, - ); - - let contract_address = result - .result - .expect("Contract should be deployed") - .account_id; - - sandbox.reset_events(); - - let result = sandbox.call_contract( - contract_address.clone(), - 0, - vec![], - actor.clone(), - DefaultSandbox::default_gas_limit(), - None, - Determinism::Enforced, - ); - assert!(result.result.is_ok()); - assert!(!result.result.unwrap().did_revert()); - - let events = result.events.expect("Sandbox should collect events"); - assert_eq!(events.len(), 2); - - assert_eq!( - events[0].event, - RuntimeEventOf::::Contracts(pallet_contracts::Event::< - RuntimeOf, - >::ContractEmitted { - contract: contract_address.clone(), - data: vec![0, 0, 0, 0], - }) - ); - - assert_eq!( - events[1].event, - RuntimeEventOf::::Contracts(pallet_contracts::Event::< - RuntimeOf, - >::Called { - contract: contract_address, - caller: Origin::Signed(actor), - }), - ); - } + use frame_support::sp_runtime::traits::Hash; + use pallet_contracts::Origin; + + use super::*; + use crate::{api::prelude::*, DefaultSandbox, RuntimeEventOf, RuntimeOf}; + + fn compile_module(contract_name: &str) -> Vec { + let path = [ + std::env::var("CARGO_MANIFEST_DIR").as_deref().unwrap(), + "/test-resources/", + contract_name, + ".wat", + ] + .concat(); + wat::parse_file(path).expect("Failed to parse wat file") + } + + #[test] + fn can_upload_code() { + let mut sandbox = DefaultSandbox::default(); + let wasm_binary = compile_module("dummy"); + let hash = + < as frame_system::Config>::Hashing>::hash(&wasm_binary); + + let result = sandbox.upload_contract( + wasm_binary, + DefaultSandbox::default_actor(), + None, + Determinism::Enforced, + ); + + assert!(result.is_ok()); + assert_eq!(hash, result.unwrap().code_hash); + } + + #[test] + fn can_deploy_contract() { + let mut sandbox = DefaultSandbox::default(); + let wasm_binary = compile_module("dummy"); + + let events_before = sandbox.events(); + assert!(events_before.is_empty()); + + let result = sandbox.deploy_contract( + wasm_binary, + 0, + vec![], + vec![], + DefaultSandbox::default_actor(), + DefaultSandbox::default_gas_limit(), + None, + ); + assert!(result.result.is_ok()); + assert!(!result.result.unwrap().result.did_revert()); + + let events = result.events.expect("Sandbox should collect events"); + let event_count = events.len(); + let instantiation_event = events[event_count - 2].clone(); + assert!(matches!( + instantiation_event.event, + RuntimeEventOf::::Contracts(pallet_contracts::Event::< + RuntimeOf, + >::Instantiated { .. }) + )); + let deposit_event = events[event_count - 1].clone(); + assert!(matches!( + deposit_event.event, + RuntimeEventOf::::Contracts(pallet_contracts::Event::< + RuntimeOf, + >::StorageDepositTransferredAndHeld { .. }) + )); + } + + #[test] + fn can_call_contract() { + let mut sandbox = DefaultSandbox::default(); + let actor = DefaultSandbox::default_actor(); + let wasm_binary = compile_module("dummy"); + + let result = sandbox.deploy_contract( + wasm_binary, + 0, + vec![], + vec![], + actor.clone(), + DefaultSandbox::default_gas_limit(), + None, + ); + + let contract_address = result.result.expect("Contract should be deployed").account_id; + + sandbox.reset_events(); + + let result = sandbox.call_contract( + contract_address.clone(), + 0, + vec![], + actor.clone(), + DefaultSandbox::default_gas_limit(), + None, + Determinism::Enforced, + ); + assert!(result.result.is_ok()); + assert!(!result.result.unwrap().did_revert()); + + let events = result.events.expect("Sandbox should collect events"); + assert_eq!(events.len(), 2); + + assert_eq!( + events[0].event, + RuntimeEventOf::::Contracts(pallet_contracts::Event::< + RuntimeOf, + >::ContractEmitted { + contract: contract_address.clone(), + data: vec![0, 0, 0, 0], + }) + ); + + assert_eq!( + events[1].event, + RuntimeEventOf::::Contracts(pallet_contracts::Event::< + RuntimeOf, + >::Called { + contract: contract_address, + caller: Origin::Signed(actor), + }), + ); + } } diff --git a/crates/ink-sandbox/src/api/system_api.rs b/crates/ink-sandbox/src/api/system_api.rs index f6d27dd..6946195 100644 --- a/crates/ink-sandbox/src/api/system_api.rs +++ b/crates/ink-sandbox/src/api/system_api.rs @@ -1,6 +1,6 @@ use frame_support::sp_runtime::{ - traits::{Dispatchable, Saturating}, - DispatchResultWithInfo, + traits::{Dispatchable, Saturating}, + DispatchResultWithInfo, }; use frame_system::pallet_prelude::BlockNumberFor; @@ -8,174 +8,177 @@ use crate::{EventRecordOf, RuntimeCall, Sandbox}; /// System API for the sandbox. pub trait SystemAPI { - /// The runtime system config. - type T: frame_system::Config; - - /// Build a new empty block and return the new height. - fn build_block(&mut self) -> BlockNumberFor; - - /// Build `n` empty blocks and return the new height. - /// - /// # Arguments - /// - /// * `n` - The number of blocks to build. - fn build_blocks(&mut self, n: u32) -> BlockNumberFor; - - /// Return the current height of the chain. - fn block_number(&mut self) -> BlockNumberFor; - - /// Return the events of the current block so far. - fn events(&mut self) -> Vec>; - - /// Reset the events of the current block. - fn reset_events(&mut self); - - /// Execute a runtime call (dispatchable). - /// - /// # Arguments - /// - /// * `call` - The runtime call to execute. - /// * `origin` - The origin of the call. - fn runtime_call as Dispatchable>::RuntimeOrigin>>( - &mut self, - call: RuntimeCall, - origin: Origin, - ) -> DispatchResultWithInfo< as Dispatchable>::PostInfo>; + /// The runtime system config. + type T: frame_system::Config; + + /// Build a new empty block and return the new height. + fn build_block(&mut self) -> BlockNumberFor; + + /// Build `n` empty blocks and return the new height. + /// + /// # Arguments + /// + /// * `n` - The number of blocks to build. + fn build_blocks(&mut self, n: u32) -> BlockNumberFor; + + /// Return the current height of the chain. + fn block_number(&mut self) -> BlockNumberFor; + + /// Return the events of the current block so far. + fn events(&mut self) -> Vec>; + + /// Reset the events of the current block. + fn reset_events(&mut self); + + /// Execute a runtime call (dispatchable). + /// + /// # Arguments + /// + /// * `call` - The runtime call to execute. + /// * `origin` - The origin of the call. + fn runtime_call as Dispatchable>::RuntimeOrigin>>( + &mut self, + call: RuntimeCall, + origin: Origin, + ) -> DispatchResultWithInfo< as Dispatchable>::PostInfo>; } impl SystemAPI for T where - T: Sandbox, - T::Runtime: frame_system::Config, + T: Sandbox, + T::Runtime: frame_system::Config, { - type T = T::Runtime; - - fn build_block(&mut self) -> BlockNumberFor { - self.execute_with(|| { - let mut current_block = frame_system::Pallet::::block_number(); - let block_hash = T::finalize_block(current_block); - current_block.saturating_inc(); - T::initialize_block(current_block, block_hash); - current_block - }) - } - - fn build_blocks(&mut self, n: u32) -> BlockNumberFor { - let mut last_block = None; - for _ in 0..n { - last_block = Some(self.build_block()); - } - last_block.unwrap_or_else(|| self.block_number()) - } - - fn block_number(&mut self) -> BlockNumberFor { - self.execute_with(frame_system::Pallet::::block_number) - } - - fn events(&mut self) -> Vec> { - self.execute_with(frame_system::Pallet::::events) - } - - fn reset_events(&mut self) { - self.execute_with(frame_system::Pallet::::reset_events) - } - - fn runtime_call as Dispatchable>::RuntimeOrigin>>( - &mut self, - call: RuntimeCall, - origin: Origin, - ) -> DispatchResultWithInfo< as Dispatchable>::PostInfo> { - self.execute_with(|| call.dispatch(origin.into())) - } + type T = T::Runtime; + + fn build_block(&mut self) -> BlockNumberFor { + self.execute_with(|| { + let mut current_block = frame_system::Pallet::::block_number(); + let block_hash = T::finalize_block(current_block); + current_block.saturating_inc(); + T::initialize_block(current_block, block_hash); + current_block + }) + } + + fn build_blocks(&mut self, n: u32) -> BlockNumberFor { + let mut last_block = None; + for _ in 0..n { + last_block = Some(self.build_block()); + } + last_block.unwrap_or_else(|| self.block_number()) + } + + fn block_number(&mut self) -> BlockNumberFor { + self.execute_with(frame_system::Pallet::::block_number) + } + + fn events(&mut self) -> Vec> { + self.execute_with(frame_system::Pallet::::events) + } + + fn reset_events(&mut self) { + self.execute_with(frame_system::Pallet::::reset_events) + } + + fn runtime_call as Dispatchable>::RuntimeOrigin>>( + &mut self, + call: RuntimeCall, + origin: Origin, + ) -> DispatchResultWithInfo< as Dispatchable>::PostInfo> { + self.execute_with(|| call.dispatch(origin.into())) + } } #[cfg(test)] mod tests { - use frame_support::sp_runtime::{traits::Dispatchable, AccountId32, DispatchResultWithInfo}; - - use crate::{api::prelude::{BalanceAPI, SystemAPI}, DefaultSandbox, RuntimeCall, RuntimeEventOf, RuntimeOf, Sandbox}; - - fn make_transfer( - sandbox: &mut DefaultSandbox, - dest: AccountId32, - value: u128, - ) -> DispatchResultWithInfo< - ::Runtime> as Dispatchable>::PostInfo, - > { - assert_ne!( - DefaultSandbox::default_actor(), - dest, - "make_transfer should send to account different than default_actor" - ); - sandbox.runtime_call( - RuntimeCall::>::Balances(pallet_balances::Call::< - RuntimeOf, - >::transfer_allow_death { - dest: dest.into(), - value, - }), - Some(DefaultSandbox::default_actor()), - ) - } - - #[test] - fn dry_run_works() { - let mut sandbox = DefaultSandbox::default(); - let actor = DefaultSandbox::default_actor(); - let initial_balance = sandbox.free_balance(&actor); - - sandbox.dry_run(|sandbox| { - sandbox.mint_into(&actor, 100).unwrap(); - assert_eq!(sandbox.free_balance(&actor), initial_balance + 100); - }); - - assert_eq!(sandbox.free_balance(&actor), initial_balance); - } - - #[test] - fn runtime_call_works() { - let mut sandbox = DefaultSandbox::default(); - - const RECIPIENT: AccountId32 = AccountId32::new([2u8; 32]); - let initial_balance = sandbox.free_balance(&RECIPIENT); - - let result = make_transfer(&mut sandbox, RECIPIENT, 100); - assert!(result.is_ok()); - - let expected_balance = initial_balance + 100; - assert_eq!(sandbox.free_balance(&RECIPIENT), expected_balance); - } - - #[test] - fn current_events() { - let mut sandbox = DefaultSandbox::default(); - const RECIPIENT: AccountId32 = AccountId32::new([2u8; 32]); - - let events_before = sandbox.events(); - assert!(events_before.is_empty()); - - make_transfer(&mut sandbox, RECIPIENT, 1).expect("Failed to make transfer"); - - let events_after = sandbox.events(); - assert!(!events_after.is_empty()); - assert!(matches!( - events_after.last().unwrap().event, - RuntimeEventOf::::Balances(_) - )); - } - - #[test] - fn resetting_events() { - let mut sandbox = DefaultSandbox::default(); - const RECIPIENT: AccountId32 = AccountId32::new([3u8; 32]); - - make_transfer(&mut sandbox, RECIPIENT.clone(), 1).expect("Failed to make transfer"); - - assert!(!sandbox.events().is_empty()); - sandbox.reset_events(); - assert!(sandbox.events().is_empty()); - - make_transfer(&mut sandbox, RECIPIENT, 1).expect("Failed to make transfer"); - assert!(!sandbox.events().is_empty()); - } + use frame_support::sp_runtime::{traits::Dispatchable, AccountId32, DispatchResultWithInfo}; + + use crate::{ + api::prelude::{BalanceAPI, SystemAPI}, + DefaultSandbox, RuntimeCall, RuntimeEventOf, RuntimeOf, Sandbox, + }; + + fn make_transfer( + sandbox: &mut DefaultSandbox, + dest: AccountId32, + value: u128, + ) -> DispatchResultWithInfo< + ::Runtime> as Dispatchable>::PostInfo, + > { + assert_ne!( + DefaultSandbox::default_actor(), + dest, + "make_transfer should send to account different than default_actor" + ); + sandbox.runtime_call( + RuntimeCall::>::Balances(pallet_balances::Call::< + RuntimeOf, + >::transfer_allow_death { + dest: dest.into(), + value, + }), + Some(DefaultSandbox::default_actor()), + ) + } + + #[test] + fn dry_run_works() { + let mut sandbox = DefaultSandbox::default(); + let actor = DefaultSandbox::default_actor(); + let initial_balance = sandbox.free_balance(&actor); + + sandbox.dry_run(|sandbox| { + sandbox.mint_into(&actor, 100).unwrap(); + assert_eq!(sandbox.free_balance(&actor), initial_balance + 100); + }); + + assert_eq!(sandbox.free_balance(&actor), initial_balance); + } + + #[test] + fn runtime_call_works() { + let mut sandbox = DefaultSandbox::default(); + + const RECIPIENT: AccountId32 = AccountId32::new([2u8; 32]); + let initial_balance = sandbox.free_balance(&RECIPIENT); + + let result = make_transfer(&mut sandbox, RECIPIENT, 100); + assert!(result.is_ok()); + + let expected_balance = initial_balance + 100; + assert_eq!(sandbox.free_balance(&RECIPIENT), expected_balance); + } + + #[test] + fn current_events() { + let mut sandbox = DefaultSandbox::default(); + const RECIPIENT: AccountId32 = AccountId32::new([2u8; 32]); + + let events_before = sandbox.events(); + assert!(events_before.is_empty()); + + make_transfer(&mut sandbox, RECIPIENT, 1).expect("Failed to make transfer"); + + let events_after = sandbox.events(); + assert!(!events_after.is_empty()); + assert!(matches!( + events_after.last().unwrap().event, + RuntimeEventOf::::Balances(_) + )); + } + + #[test] + fn resetting_events() { + let mut sandbox = DefaultSandbox::default(); + const RECIPIENT: AccountId32 = AccountId32::new([3u8; 32]); + + make_transfer(&mut sandbox, RECIPIENT.clone(), 1).expect("Failed to make transfer"); + + assert!(!sandbox.events().is_empty()); + sandbox.reset_events(); + assert!(sandbox.events().is_empty()); + + make_transfer(&mut sandbox, RECIPIENT, 1).expect("Failed to make transfer"); + assert!(!sandbox.events().is_empty()); + } } diff --git a/crates/ink-sandbox/src/api/timestamp_api.rs b/crates/ink-sandbox/src/api/timestamp_api.rs index 3877e40..dd9ed90 100644 --- a/crates/ink-sandbox/src/api/timestamp_api.rs +++ b/crates/ink-sandbox/src/api/timestamp_api.rs @@ -5,49 +5,49 @@ type MomentOf = ::Moment; /// Timestamp API used to interact with the timestamp pallet. pub trait TimestampAPI { - /// The runtime timestamp config. - type T: pallet_timestamp::Config; - - /// Return the timestamp of the current block. - fn get_timestamp(&mut self) -> MomentOf; - - /// Set the timestamp of the current block. - /// - /// # Arguments - /// - /// * `timestamp` - The new timestamp to be set. - fn set_timestamp(&mut self, timestamp: MomentOf); + /// The runtime timestamp config. + type T: pallet_timestamp::Config; + + /// Return the timestamp of the current block. + fn get_timestamp(&mut self) -> MomentOf; + + /// Set the timestamp of the current block. + /// + /// # Arguments + /// + /// * `timestamp` - The new timestamp to be set. + fn set_timestamp(&mut self, timestamp: MomentOf); } impl TimestampAPI for T where - T: Sandbox, - T::Runtime: pallet_timestamp::Config, + T: Sandbox, + T::Runtime: pallet_timestamp::Config, { - type T = T::Runtime; + type T = T::Runtime; - fn get_timestamp(&mut self) -> MomentOf { - self.execute_with(pallet_timestamp::Pallet::::get) - } + fn get_timestamp(&mut self) -> MomentOf { + self.execute_with(pallet_timestamp::Pallet::::get) + } - fn set_timestamp(&mut self, timestamp: MomentOf) { - self.execute_with(|| pallet_timestamp::Pallet::::set_timestamp(timestamp)) - } + fn set_timestamp(&mut self, timestamp: MomentOf) { + self.execute_with(|| pallet_timestamp::Pallet::::set_timestamp(timestamp)) + } } #[cfg(test)] mod tests { - use crate::{api::prelude::*, DefaultSandbox}; - - #[test] - fn getting_and_setting_timestamp_works() { - let mut sandbox = DefaultSandbox::default(); - for timestamp in 0..10 { - assert_ne!(sandbox.get_timestamp(), timestamp); - sandbox.set_timestamp(timestamp); - assert_eq!(sandbox.get_timestamp(), timestamp); - - sandbox.build_block(); - } - } + use crate::{api::prelude::*, DefaultSandbox}; + + #[test] + fn getting_and_setting_timestamp_works() { + let mut sandbox = DefaultSandbox::default(); + for timestamp in 0..10 { + assert_ne!(sandbox.get_timestamp(), timestamp); + sandbox.set_timestamp(timestamp); + assert_eq!(sandbox.get_timestamp(), timestamp); + + sandbox.build_block(); + } + } } diff --git a/crates/ink-sandbox/src/lib.rs b/crates/ink-sandbox/src/lib.rs index 66054ba..d94d3f2 100644 --- a/crates/ink-sandbox/src/lib.rs +++ b/crates/ink-sandbox/src/lib.rs @@ -11,20 +11,20 @@ pub use macros::{BlockBuilder, DefaultSandbox}; use pallet_contracts::{ContractExecResult, ContractInstantiateResult}; /// Export pallets that are used in [`crate::create_sandbox`] pub use { - frame_support::{ - self, - sp_runtime::{AccountId32, DispatchError}, - }, - frame_system, pallet_balances, pallet_assets, pallet_contracts, pallet_timestamp, paste, - sp_core::crypto::Ss58Codec, - sp_externalities::{self, Extension}, - sp_io::TestExternalities, - sp_runtime_interface::{self}, + frame_support::{ + self, + sp_runtime::{AccountId32, DispatchError}, + }, + frame_system, pallet_assets, pallet_balances, pallet_contracts, pallet_timestamp, paste, + sp_core::crypto::Ss58Codec, + sp_externalities::{self, Extension}, + sp_io::TestExternalities, + sp_runtime_interface::{self}, }; /// Alias for the balance type. pub type BalanceFor = - <::Currency as Inspect>>::Balance; + <::Currency as Inspect>>::Balance; /// Alias for the account ID type. pub type AccountIdFor = ::AccountId; @@ -34,17 +34,17 @@ pub type RuntimeCall = ::RuntimeCall; /// Alias for the event record type. pub type EventRecordOf = EventRecord< - ::RuntimeEvent, - ::Hash, + ::RuntimeEvent, + ::Hash, >; /// Alias for the contract instantiate result. pub type ContractInstantiateResultFor = - ContractInstantiateResult, BalanceFor, EventRecordOf>; + ContractInstantiateResult, BalanceFor, EventRecordOf>; /// Alias for the contract exec result. pub type ContractExecResultFor = - ContractExecResult, EventRecordOf>; + ContractExecResult, EventRecordOf>; /// Alias for the runtime of a sandbox. pub type RuntimeOf = ::Runtime; @@ -54,44 +54,44 @@ pub type RuntimeEventOf = as frame_system::Config>::RuntimeEven /// Sandbox defines the API of a sandboxed runtime. pub trait Sandbox { - /// The runtime associated with the sandbox. - type Runtime: frame_system::Config; - - /// Execute the given externalities. - fn execute_with(&mut self, execute: impl FnOnce() -> T) -> T; - - /// Dry run an action without modifying the storage. - fn dry_run(&mut self, action: impl FnOnce(&mut Self) -> T) -> T; - - /// Register an extension. - fn register_extension(&mut self, ext: E); - - /// Initialize a new block at particular height. - fn initialize_block( - _height: BlockNumberFor, - _parent_hash: ::Hash, - ) { - } - - /// Finalize a block at particular height. - fn finalize_block( - _height: BlockNumberFor, - ) -> ::Hash { - Default::default() - } - - /// Default actor for the sandbox. - fn default_actor() -> AccountIdFor; - - fn default_gas_limit() -> Weight { - Weight::from_parts(100_000_000_000, 3 * 1024 * 1024) - } - - /// Metadata of the runtime. - fn get_metadata() -> RuntimeMetadataPrefixed; - - /// Convert an account to an call origin. - fn convert_account_to_origin( - account: AccountIdFor, - ) -> <::RuntimeCall as Dispatchable>::RuntimeOrigin; + /// The runtime associated with the sandbox. + type Runtime: frame_system::Config; + + /// Execute the given externalities. + fn execute_with(&mut self, execute: impl FnOnce() -> T) -> T; + + /// Dry run an action without modifying the storage. + fn dry_run(&mut self, action: impl FnOnce(&mut Self) -> T) -> T; + + /// Register an extension. + fn register_extension(&mut self, ext: E); + + /// Initialize a new block at particular height. + fn initialize_block( + _height: BlockNumberFor, + _parent_hash: ::Hash, + ) { + } + + /// Finalize a block at particular height. + fn finalize_block( + _height: BlockNumberFor, + ) -> ::Hash { + Default::default() + } + + /// Default actor for the sandbox. + fn default_actor() -> AccountIdFor; + + fn default_gas_limit() -> Weight { + Weight::from_parts(100_000_000_000, 3 * 1024 * 1024) + } + + /// Metadata of the runtime. + fn get_metadata() -> RuntimeMetadataPrefixed; + + /// Convert an account to an call origin. + fn convert_account_to_origin( + account: AccountIdFor, + ) -> <::RuntimeCall as Dispatchable>::RuntimeOrigin; } diff --git a/crates/ink-sandbox/src/macros.rs b/crates/ink-sandbox/src/macros.rs index a181304..d4b9c9e 100644 --- a/crates/ink-sandbox/src/macros.rs +++ b/crates/ink-sandbox/src/macros.rs @@ -1,11 +1,11 @@ use std::time::SystemTime; use frame_support::{ - sp_runtime::{ - traits::{Header, One}, - BuildStorage, - }, - traits::Hooks, + sp_runtime::{ + traits::{Header, One}, + BuildStorage, + }, + traits::Hooks, }; use frame_system::pallet_prelude::BlockNumberFor; use sp_io::TestExternalities; @@ -14,53 +14,51 @@ use sp_io::TestExternalities; pub struct BlockBuilder(std::marker::PhantomData); impl< - T: pallet_balances::Config + pallet_timestamp::Config + pallet_contracts::Config, - > BlockBuilder + T: pallet_balances::Config + pallet_timestamp::Config + pallet_contracts::Config, + > BlockBuilder { - /// Create a new externalities with the given balances. - pub fn new_ext(balances: Vec<(T::AccountId, T::Balance)>) -> TestExternalities { - let mut storage = frame_system::GenesisConfig::::default() - .build_storage() - .unwrap(); - - pallet_balances::GenesisConfig:: { balances } - .assimilate_storage(&mut storage) - .unwrap(); - - let mut ext = TestExternalities::new(storage); - - ext.execute_with(|| Self::initialize_block(BlockNumberFor::::one(), Default::default())); - ext - } - - /// Initialize a new block at particular height. - pub fn initialize_block( - height: frame_system::pallet_prelude::BlockNumberFor, - parent_hash: ::Hash, - ) { - frame_system::Pallet::::reset_events(); - frame_system::Pallet::::initialize(&height, &parent_hash, &Default::default()); - pallet_balances::Pallet::::on_initialize(height); - pallet_timestamp::Pallet::::set_timestamp( - SystemTime::now() - .duration_since(SystemTime::UNIX_EPOCH) - .expect("Time went backwards") - .as_secs(), - ); - pallet_timestamp::Pallet::::on_initialize(height); - pallet_contracts::Pallet::::on_initialize(height); - frame_system::Pallet::::note_finished_initialize(); - } - - /// Finalize a block at particular height. - pub fn finalize_block( - height: frame_system::pallet_prelude::BlockNumberFor, - ) -> ::Hash { - pallet_contracts::Pallet::::on_finalize(height); - pallet_timestamp::Pallet::::on_finalize(height); - pallet_balances::Pallet::::on_finalize(height); - frame_system::Pallet::::finalize().hash() - } + /// Create a new externalities with the given balances. + pub fn new_ext(balances: Vec<(T::AccountId, T::Balance)>) -> TestExternalities { + let mut storage = frame_system::GenesisConfig::::default().build_storage().unwrap(); + + pallet_balances::GenesisConfig:: { balances } + .assimilate_storage(&mut storage) + .unwrap(); + + let mut ext = TestExternalities::new(storage); + + ext.execute_with(|| Self::initialize_block(BlockNumberFor::::one(), Default::default())); + ext + } + + /// Initialize a new block at particular height. + pub fn initialize_block( + height: frame_system::pallet_prelude::BlockNumberFor, + parent_hash: ::Hash, + ) { + frame_system::Pallet::::reset_events(); + frame_system::Pallet::::initialize(&height, &parent_hash, &Default::default()); + pallet_balances::Pallet::::on_initialize(height); + pallet_timestamp::Pallet::::set_timestamp( + SystemTime::now() + .duration_since(SystemTime::UNIX_EPOCH) + .expect("Time went backwards") + .as_secs(), + ); + pallet_timestamp::Pallet::::on_initialize(height); + pallet_contracts::Pallet::::on_initialize(height); + frame_system::Pallet::::note_finished_initialize(); + } + + /// Finalize a block at particular height. + pub fn finalize_block( + height: frame_system::pallet_prelude::BlockNumberFor, + ) -> ::Hash { + pallet_contracts::Pallet::::on_finalize(height); + pallet_timestamp::Pallet::::on_finalize(height); + pallet_balances::Pallet::::on_finalize(height); + frame_system::Pallet::::finalize().hash() + } } // Macro that implements the sandbox trait on the provided runtime. @@ -329,4 +327,4 @@ pub use construct_runtime::{ }; } -create_sandbox!(DefaultSandbox); \ No newline at end of file +create_sandbox!(DefaultSandbox); From d804b5de8919bee1db3b882d80e256cbc6b5f678 Mon Sep 17 00:00:00 2001 From: Daanvdplas Date: Fri, 18 Oct 2024 14:54:39 +0200 Subject: [PATCH 41/43] ci: skip wasm build --- .github/workflows/ci.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ecb3cf2..67cbbf8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,8 @@ jobs: check: needs: lint runs-on: ubuntu-latest + env: + SKIP_WASM_BUILD: 1 steps: - uses: actions/checkout@v4 @@ -30,10 +32,6 @@ jobs: - name: Check Build run: | cargo check --release --locked -# -# - name: Run tests for examples -# shell: bash -# run: make test_examples clippy: needs: lint From 844e9a51f2041386652edc9e577b6a8156cec201 Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Fri, 18 Oct 2024 19:56:50 +0700 Subject: [PATCH 42/43] fix: ApiError & public assert_err_inner --- crates/pop-drink/src/error.rs | 3 +-- crates/pop-drink/src/lib.rs | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/pop-drink/src/error.rs b/crates/pop-drink/src/error.rs index 8d2c528..2f57b2a 100644 --- a/crates/pop-drink/src/error.rs +++ b/crates/pop-drink/src/error.rs @@ -176,8 +176,7 @@ macro_rules! assert_err { } #[track_caller] -#[allow(unused)] -fn assert_err_inner(result: Result, expected_error: Error) +pub fn assert_err_inner(result: Result, expected_error: Error) where E: Into, Error: From + Into + Debug, diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index 5c20ee4..d28b134 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -28,7 +28,7 @@ pub mod devnet { pub use crate::error::*; pub mod v0 { - pub use pop_api::primitives::v0::{self, *}; + pub use pop_api::primitives::v0::{self, Error as ApiError, *}; /// Error type for writing tests (see `error` module). pub type Error = crate::error::Error; @@ -143,8 +143,9 @@ where { match session.call::(func_name, &input, endowment) { // If the call is reverted, decode the error into the specified error type. - Err(SessionError::CallReverted(error)) => - Err(E::decode(&mut &error[2..]).expect("Decoding failed")), + Err(SessionError::CallReverted(error)) => { + Err(E::decode(&mut &error[2..]).expect("Decoding failed")) + }, // If the call is successful, decode the last returned value. Ok(_) => Ok(session .record() From daf91627bf85e0d6c88135202576dfda87c307fe Mon Sep 17 00:00:00 2001 From: chungquantin <56880684+chungquantin@users.noreply.github.com> Date: Fri, 18 Oct 2024 19:57:09 +0700 Subject: [PATCH 43/43] fix: formatting --- crates/pop-drink/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/pop-drink/src/lib.rs b/crates/pop-drink/src/lib.rs index d28b134..95a81ef 100644 --- a/crates/pop-drink/src/lib.rs +++ b/crates/pop-drink/src/lib.rs @@ -143,9 +143,8 @@ where { match session.call::(func_name, &input, endowment) { // If the call is reverted, decode the error into the specified error type. - Err(SessionError::CallReverted(error)) => { - Err(E::decode(&mut &error[2..]).expect("Decoding failed")) - }, + Err(SessionError::CallReverted(error)) => + Err(E::decode(&mut &error[2..]).expect("Decoding failed")), // If the call is successful, decode the last returned value. Ok(_) => Ok(session .record()