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 01/24] 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 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 02/24] 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 03/24] 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 04/24] 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 05/24] 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 06/24] 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 07/24] 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 08/24] 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 09/24] 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 10/24] 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 11/24] 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 12/24] 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 13/24] 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 14/24] 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 15/24] 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 16/24] 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 17/24] 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 18/24] 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 19/24] 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 20/24] 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 21/24] 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 22/24] 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 23/24] 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 24/24] 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();