Skip to content

Commit 508a8b9

Browse files
review
Signed-off-by: Robert Zaremba <robert@zaremba.ch>
1 parent 87e2689 commit 508a8b9

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

packages/btcindexer/db/migrations/0001_initial_schema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ CREATE INDEX IF NOT EXISTS btc_blocks_is_scanned_height ON btc_blocks (is_scanne
1616
-- This table tracks the nBTC deposit txs (minting)
1717
CREATE TABLE IF NOT EXISTS nbtc_minting (
1818
tx_id TEXT NOT NULL PRIMARY KEY,
19-
address_id TEXT NOT NULL, -- nbtc pkg is linked through address_id
19+
address_id TEXT NOT NULL, -- nbtc pkg is linked through address_id -> nbtc_deposit_addresses.setup_id
2020
sender TEXT NOT NULL,
2121
vout INTEGER NOT NULL,
2222
block_hash TEXT,

packages/btcindexer/scripts/seed-config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,8 @@ async function main() {
6767
continue;
6868
}
6969

70-
const checkAddrQuery = `SELECT id FROM nbtc_deposit_addresses WHERE setup_id = ${setupId} AND deposit_address = '${entry.btc_address}'`;
70+
const checkAddrQuery = `SELECT 1 FROM nbtc_deposit_addresses WHERE setup_id = ${setupId} AND deposit_address = '${entry.btc_address}'`;
7171
const existingAddrId = await executeQuery<number>(checkAddrQuery, DB_NAME, local, "id");
72-
7372
if (existingAddrId) {
7473
continue;
7574
}

0 commit comments

Comments
 (0)