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

eth_api: Implement new_pending_transaction_filter method #39

Closed
3 tasks
Tracked by #51
dutterbutter opened this issue Aug 10, 2023 · 0 comments · Fixed by #124
Closed
3 tasks
Tracked by #51

eth_api: Implement new_pending_transaction_filter method #39

dutterbutter opened this issue Aug 10, 2023 · 0 comments · Fixed by #124
Labels
eth_api ♢ Indicates eth namespace api tasks medium 🚩 Indicates moderately difficult item p3 🔵 Indicates low priority item

Comments

@dutterbutter
Copy link
Collaborator

Description:

We currently have a placeholder for the new_pending_transaction_filter method, which is designed to establish a filter that notifies when new pending transactions enter the transaction pool.

/// Creates a filter to notify when new pending transactions arise.
fn new_pending_transaction_filter(&self) -> jsonrpc_core::BoxFuture<jsonrpc_core::Result<U256>> {
    not_implemented("new_pending_transaction_filter")
}

Expected response

Command:

# Note: Using mainnet URL for demonstration purposes
curl -X POST https://mainnet.era.zksync.io \
     -H "Content-Type: application/json" \
     --data '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "eth_newPendingTransactionFilter",
       "params": []
     }'

Response:

{"jsonrpc":"2.0","result":"0xf86f90e83fd8a20ed75b6f7ed364c301a551abc98d5318d8d12e5ea4de7aa15a","id":1}

Requirements:

  1. Implement the Method:

    • The method doesn't require any arguments.
    • It should establish a new filter and return a U256 id for the created filter that's oriented towards pending transactions.
  2. Unit Tests:

    • Write unit tests to confirm the new_pending_transaction_filter method's functionality.
    • Consider and test for potential edge cases.
    • Ensure that potential errors and exceptions are managed appropriately.
  3. Inline Documentation:

    • Add inline Rust documentation (/// comments) to define the purpose and implementation of the new_pending_transaction_filter method.
    • Include any relevant information about the return values and potential errors/exceptions.

Task Checklist:

  • Implement the new_pending_transaction_filter method.
  • Write unit tests for the new_pending_transaction_filter method.
  • Include inline documentation for the new_pending_transaction_filter method.

Additional Notes:

If you're an external contributor looking to take on this issue, please comment below to let us know you're working on it. If you need further clarification on the requirements or need assistance with anything related to the implementation, feel free to ask!

@dutterbutter dutterbutter added p3 🔵 Indicates low priority item medium 🚩 Indicates moderately difficult item eth_api ♢ Indicates eth namespace api tasks labels Aug 10, 2023
@github-project-automation github-project-automation bot moved this from Todo 🔨 to Done 🏁 in Progress Board Sep 20, 2023
IAvecilla added a commit to lambdaclass/era-test-node that referenced this issue Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
eth_api ♢ Indicates eth namespace api tasks medium 🚩 Indicates moderately difficult item p3 🔵 Indicates low priority item
Projects
No open projects
Status: Done 🏁
Development

Successfully merging a pull request may close this issue.

1 participant