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

feat: support parity_pendingTransactions #451

Merged
merged 3 commits into from Jan 19, 2021

Conversation

mohoff
Copy link
Contributor

@mohoff mohoff commented Jan 19, 2021

Adding support for parity_pendingTransactions. Implements #440

Applying a pending transaction filter is blocked by openethereum/openethereum#159. However, omitting a filter gives a full list of pending transactions as expected. This has been tested with a synced openethereum node.

Would love to get some feedback!

Copy link
Owner

@tomusdrw tomusdrw left a comment

Choose a reason for hiding this comment

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

looks good! I've left couple of improvements suggestions, let me know wdyt.

src/types/parity_pending_transaction.rs Outdated Show resolved Hide resolved
src/types/parity_pending_transaction.rs Show resolved Hide resolved
src/types/parity_pending_transaction.rs Outdated Show resolved Hide resolved
src/types/parity_pending_transaction.rs Outdated Show resolved Hide resolved
src/types/parity_pending_transaction.rs Outdated Show resolved Hide resolved

/// Filter for pending transactions (only openethereum/Parity)
#[derive(Clone, Default, Serialize)]
pub struct ParityPendingTransactionFilter {
Copy link
Owner

Choose a reason for hiding this comment

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

Could you please add ::builder() function to make it easy to create builder struct without importing the type?

impl ParityPendingTransactionFilter {
  pub fn builder() -> ParityPendingTransactionFilterBuilder {
    Default::default()
  }  
}

src/api/parity.rs Outdated Show resolved Hide resolved
@mohoff
Copy link
Contributor Author

mohoff commented Jan 19, 2021

@tomusdrw Addressed all feedback and learnt a few things, thank you!

I also updated the test to use the example transaction from the parity docs

Copy link
Owner

@tomusdrw tomusdrw left a comment

Choose a reason for hiding this comment

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

looks awesome, thanks!

@tomusdrw tomusdrw merged commit 6e36afd into tomusdrw:master Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants