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

chore: make transaction type fields private #13915

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stevencartavia
Copy link
Contributor

towards #13913

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

good start, a few more things todo

Comment on lines +41 to +42
let transaction_signed = Self::new(transaction, signature, hash);
Ok(transaction_signed)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this didn't require a change

Comment on lines +676 to +678
TransactionSigned::new_unhashed(
tx.transaction().clone(),
*tx.signature(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

this looks odd, why does this require a conversion at all,

in any case we need decomposition fns like

/// Splits the block into its header and body.
fn split(self) -> (Self::Header, Self::Body);

@@ -913,7 +913,7 @@ impl TryFrom<Recovered<TransactionSigned>> for MockTransaction {
let size = transaction.size();

#[allow(unreachable_patterns)]
match transaction.transaction {
match transaction.transaction() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

we also want fn into_transaction then these changes aren't necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so should I change this one

    pub const fn transaction(&self) -> &Transaction {
        &self.transaction
    }

with this one?

    pub fn into_transaction(self) -> Transaction {
        self.transaction
    }

@emhane emhane added the A-sdk Related to reth's use as a library label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sdk Related to reth's use as a library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants