-
Notifications
You must be signed in to change notification settings - Fork 1
Support unconfirmed transactions lookup #300
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
Support unconfirmed transactions lookup #300
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds support for looking up unconfirmed transactions from the transaction pool. When a transaction is queried by ID and not found in the database, the API now checks the unconfirmed transaction pool before returning a 404 error.
Key changes:
- Added
Unconfirmedboolean field toTransactionandV2Transactiontypes to distinguish between confirmed and unconfirmed transactions - Implemented
UnconfirmedTransactionandUnconfirmedV2Transactionmethods in the Explorer to search the transaction pool - Updated transaction API handlers to fall back to checking the unconfirmed pool when transactions are not found in the database
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| explorer/types.go | Added Unconfirmed field to Transaction and V2Transaction structs with omitempty JSON tag |
| explorer/explorer.go | Implemented UnconfirmedTransaction and UnconfirmedV2Transaction methods to search the transaction pool |
| explorer/events.go | Modified CoreToExplorerV1Transaction and CoreToExplorerV2Transaction to set Unconfirmed flag |
| api/server.go | Updated transaction handlers to check unconfirmed pool as fallback; added interface methods |
| api/api_test.go | Added tests for confirmed and unconfirmed V1 transaction lookup |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b9306be to
caab760
Compare
This solves the backend part of #291
I was mistaken in the dev sync about this already being partially complete, I was looking at unpushed code...