Conversation
Signed-off-by: sczembor <stanislaw.czembor@gmail.com>
Contributor
Reviewer's GuideImplements a new POST /nbtcTx endpoint that registers broadcasting nBTC transactions via a new registerBroadcastedNbtcTx method, updates the nbtc_minting schema to support composite keys and timestamps, replaces raw inserts with upserts, standardizes timestamp usage, integrates router handling with JSON validation and error responses, and adds corresponding tests and request model. Sequence diagram for POST /nbtcTx request handlingsequenceDiagram
actor User
participant Router
participant Indexer
participant DB
User->>Router: POST /nbtcTx { txHex }
Router->>Indexer: registerBroadcastedNbtcTx(txHex)
Indexer->>DB: INSERT OR IGNORE INTO nbtc_minting
DB-->>Indexer: Insert result
Indexer-->>Router: { tx_id, registered_deposits }
Router-->>User: Success response
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey there - I've reviewed your changes and found some issues that need to be addressed.
- The migration creates an index on
nbtc_txsbut the table was renamed tonbtc_minting, so please correct the index to referencenbtc_minting. - Remove the
console.loginregisterBroadcastedNbtcTxand use the existing structured logger to keep logging consistent. - Instead of inlining
updated_attimestamps directly into SQL strings, bind them as parameters to avoid injection risks and keep queries consistent.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The migration creates an index on `nbtc_txs` but the table was renamed to `nbtc_minting`, so please correct the index to reference `nbtc_minting`.
- Remove the `console.log` in `registerBroadcastedNbtcTx` and use the existing structured logger to keep logging consistent.
- Instead of inlining `updated_at` timestamps directly into SQL strings, bind them as parameters to avoid injection risks and keep queries consistent.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Signed-off-by: sczembor <stanislaw.czembor@gmail.com>
vuvoth
reviewed
Aug 28, 2025
vuvoth
approved these changes
Aug 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes: #13
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!to the type prefix if API or client breaking changeCHANGELOG.mdSummary by Sourcery
Introduce a new POST nbtc endpoint backed by registerBroadcastedNbtcTx, update the nbtc_minting schema to use composite keys with timestamp tracking and upsert logic, and add tests for the new registration flow.
New Features:
Enhancements:
Documentation:
Tests: