Skip to content

Commit

Permalink
Hide tuplex dependency and re-export by macro (#4774)
Browse files Browse the repository at this point in the history
Addressing comment:
https://github.com/paritytech/polkadot-sdk/pull/4102/files#r1635502496

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
2 people authored and Ank4n committed Jun 14, 2024
1 parent 5ac2620 commit d136cc6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ use sp_runtime::{
transaction_validity::{TransactionPriority, TransactionValidity, ValidTransactionBuilder},
};

// Re-export to avoid include tuplex dependency everywhere.
#[doc(hidden)]
pub mod __private {
pub use tuplex;
}

/// A duplication of the `FilterCall` trait.
///
/// We need this trait in order to be able to implement it for the messages pallet,
Expand Down Expand Up @@ -313,7 +319,7 @@ macro_rules! generate_bridge_reject_obsolete_headers_and_messages {
info: &sp_runtime::traits::DispatchInfoOf<Self::Call>,
len: usize,
) -> Result<Self::Pre, sp_runtime::transaction_validity::TransactionValidityError> {
use tuplex::PushBack;
use $crate::extensions::check_obsolete_extension::__private::tuplex::PushBack;
let to_post_dispatch = ();
$(
let (from_validate, call_filter_validity) = <
Expand All @@ -336,7 +342,7 @@ macro_rules! generate_bridge_reject_obsolete_headers_and_messages {
len: usize,
result: &sp_runtime::DispatchResult,
) -> Result<(), sp_runtime::transaction_validity::TransactionValidityError> {
use tuplex::PopFront;
use $crate::extensions::check_obsolete_extension::__private::tuplex::PopFront;
let Some((relayer, to_post_dispatch)) = to_post_dispatch else { return Ok(()) };
let has_failed = result.is_err();
$(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ scale-info = { version = "2.11.1", default-features = false, features = [
"derive",
] }
serde = { optional = true, features = ["derive"], workspace = true, default-features = true }
tuplex = { version = "0.1", default-features = false }

# Substrate
frame-benchmarking = { path = "../../../../../substrate/frame/benchmarking", default-features = false, optional = true }
Expand Down Expand Up @@ -218,7 +217,6 @@ std = [
"sp-version/std",
"substrate-wasm-builder",
"testnet-parachains-constants/std",
"tuplex/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm-fee-payment-runtime-api/std",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ hex-literal = { version = "0.4.1" }
log = { workspace = true }
scale-info = { version = "2.11.1", default-features = false, features = ["derive"] }
serde = { optional = true, features = ["derive"], workspace = true, default-features = true }
tuplex = { version = "0.1", default-features = false }

# Substrate
frame-benchmarking = { path = "../../../../../substrate/frame/benchmarking", default-features = false, optional = true }
Expand Down Expand Up @@ -182,7 +181,6 @@ std = [
"sp-version/std",
"substrate-wasm-builder",
"testnet-parachains-constants/std",
"tuplex/std",
"westend-runtime-constants/std",
"xcm-builder/std",
"xcm-executor/std",
Expand Down

0 comments on commit d136cc6

Please sign in to comment.