Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[draft] Introduce TransactionExtensionPipeline to use instead of tuple for pipeline with more than 12 elements #6571

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gui1117
Copy link
Contributor

@gui1117 gui1117 commented Nov 21, 2024

Fix #6569

@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/11950875913
Failed job name: cargo-clippy

#[derive(Debug, Clone, PartialEq, Eq, Encode, Decode, TypeInfo)]
pub struct TransactionExtensionPipeline<
$( $generic = (), )*
>(
Copy link
Contributor Author

@gui1117 gui1117 Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another solution is to implement a wrapper of tuple, that manually implements Debug, PartialEq, Eq, and also implements TransactionExtension.

This way the type may look less like a hack.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would work, we just need to make sure we expose it properly in the metadata so that it's not transparent, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I understand, the metadata is anyway just a vec of TransactionExtensionMetadata.

What I am thinking is we can implement do either:

  • like this PR currently, a type with 32 generics being () by default.
  • or a type with only 1 generic, and do impl<A> Debug for Pipeline<(A,)> .., impl<A, B> Debug for Pipeline<(A, B)> .. etc...
    Both implementation would be transparent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants