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

refactor: Remove standalone from_recovered functions and make part of TransactionCompat trait #13653

Merged

Conversation

tonypony220
Copy link
Contributor

Closes #13641

@@ -45,6 +36,9 @@ pub trait TransactionCompat<T = TransactionSigned>:
/// RPC transaction error type.
type Error: error::Error + Into<jsonrpsee_types::ErrorObject<'static>>;

/// Wrapper for `fill()` with default `TransactionInfo`
fn fill_pending(&self, tx: RecoveredTx<T>) -> Result<Self::Transaction, Self::Error>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

does implementing it here as default shared behavior is bad idea?

Copy link
Collaborator

Choose a reason for hiding this comment

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

we can impl this as default delegating to fill with default::default for the info type like before

&self,
tx: RecoveredTx<OpTransactionSigned>,
) -> Result<Self::Transaction, Self::Error> {
self.fill(tx, TransactionInfo::default())
Copy link
Collaborator

Choose a reason for hiding this comment

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

yep like this

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.

great!

we can do the same for from_recovered_with_block_context which is just fill(info)

@mattsse mattsse added A-rpc Related to the RPC implementation C-debt Refactor of code section that is hard to understand or maintain labels Jan 4, 2025
@tonypony220
Copy link
Contributor Author

tonypony220 commented Jan 5, 2025

How to run CI, because test with fees is failing, but they are not related to changes so i guess something wrong with my setup

---- eth::core::tests::test_fee_history_all_blocks stdout ----
thread 'eth::core::tests::test_fee_history_all_blocks' panicked at crates/rpc/rpc/src/eth/core.rs:733:9:
assertion `left == right` failed: all: base fee per gas is incorrect
  left: [4141242051, 0, 357564253, 0, 2045821200, 3431872800, 0, 0, 0, 0, 0]
 right: [4141242051, 0, 357564253, 0, 2045821200, 3431872800, 0, 0, 0, 0, 1]

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.

lgtm, the failing test looks like some feature related thing

@mattsse mattsse enabled auto-merge January 6, 2025 14:40
@mattsse mattsse added this pull request to the merge queue Jan 6, 2025
Merged via the queue into paradigmxyz:main with commit 873009f Jan 6, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation C-debt Refactor of code section that is hard to understand or maintain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove standalone from_recovered functions and make part of TransactionCompat trait
2 participants