Skip to content

Commit 1a9f31d

Browse files
committed
chore: upgrade to prettier 3
1 parent 32f879f commit 1a9f31d

File tree

15 files changed

+117
-68
lines changed

15 files changed

+117
-68
lines changed

package-lock.json

Lines changed: 54 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
"docker-compose": "0.24.8",
187187
"dockerode": "4.0.6",
188188
"eslint": "8.29.0",
189-
"eslint-plugin-prettier": "4.2.1",
189+
"eslint-plugin-prettier": "5.5.4",
190190
"eslint-plugin-tsdoc": "0.2.17",
191191
"husky": "4.3.8",
192192
"is-ci": "3.0.1",
@@ -196,7 +196,7 @@
196196
"openapi-to-postmanv2": "4.23.1",
197197
"openapi-typescript": "7.3.0",
198198
"pg-connection-string": "2.5.0",
199-
"prettier": "2.8.8",
199+
"prettier": "3.6.2",
200200
"rimraf": "5.0.0",
201201
"rpc-websocket-client": "1.1.4",
202202
"socket.io-client": "4.5.4",

src/api/async-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function asyncHandler<
1818
ResBody = any,
1919
ReqBody = any,
2020
ReqQuery = core.Query,
21-
Locals extends Record<string, any> = Record<string, any>
21+
Locals extends Record<string, any> = Record<string, any>,
2222
>(
2323
handler: (
2424
...args: Parameters<express.RequestHandler<P, ResBody, ReqBody, ReqQuery, Locals>>

src/api/controllers/db-controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,8 +1131,8 @@ function parseDbAbstractTx(dbTx: DbTx, baseTx: BaseTransaction): AbstractTransac
11311131
block_time_iso: dbTx.block_time
11321132
? unixEpochToIso(dbTx.block_time)
11331133
: dbTx.burn_block_time > 0
1134-
? unixEpochToIso(dbTx.burn_block_time)
1135-
: '',
1134+
? unixEpochToIso(dbTx.burn_block_time)
1135+
: '',
11361136
burn_block_height: dbTx.burn_block_height,
11371137
burn_block_time: dbTx.burn_block_time,
11381138
burn_block_time_iso: dbTx.burn_block_time > 0 ? unixEpochToIso(dbTx.burn_block_time) : '',

src/api/routes/ws/web-socket-channel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ export type WebSocketPayload = {
4949
export type ListenerType<T> = [T] extends [(...args: infer U) => any]
5050
? U
5151
: [T] extends [void]
52-
? []
53-
: [T];
52+
? []
53+
: [T];
5454

5555
/**
5656
* A channel that accepts user subscriptions to real time updates and responds with relevant

src/datastore/common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -819,15 +819,15 @@ export interface DbTokenOfferingLocked {
819819

820820
export interface DbGetBlockWithMetadataOpts<
821821
TWithTxs extends boolean,
822-
TWithMicroblocks extends boolean
822+
TWithMicroblocks extends boolean,
823823
> {
824824
txs?: TWithTxs;
825825
microblocks?: TWithMicroblocks;
826826
}
827827

828828
export interface DbGetBlockWithMetadataResponse<
829829
TWithTxs extends boolean,
830-
TWithMicroblocks extends boolean
830+
TWithMicroblocks extends boolean,
831831
> {
832832
block: DbBlock;
833833
txs: TWithTxs extends true ? DbTx[] : null;

src/datastore/connection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function getPgConnectionEnvValue(
2121
): string | undefined {
2222
const defaultVal = process.env[`PG_${name}`] ?? process.env[`PG${name}`];
2323
return pgServer === PgServer.primary
24-
? process.env[`PG_PRIMARY_${name}`] ?? defaultVal
24+
? (process.env[`PG_PRIMARY_${name}`] ?? defaultVal)
2525
: defaultVal;
2626
}
2727

src/datastore/pg-store-v2.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ export class PgStoreV2 extends BasePgStoreModule {
173173
args.block.type === 'latest'
174174
? sql`burn_block_hash = (SELECT burn_block_hash FROM blocks WHERE canonical = TRUE ORDER BY block_height DESC LIMIT 1)`
175175
: args.block.type === 'hash'
176-
? sql`burn_block_hash = ${normalizeHashString(args.block.hash)}`
177-
: sql`burn_block_height = ${args.block.height}`;
176+
? sql`burn_block_hash = ${normalizeHashString(args.block.hash)}`
177+
: sql`burn_block_height = ${args.block.height}`;
178178
const blockCheck = await sql`SELECT burn_block_hash FROM blocks WHERE ${filter} LIMIT 1`;
179179
if (blockCheck.count === 0)
180180
throw new InvalidRequestError(
@@ -218,11 +218,11 @@ export class PgStoreV2 extends BasePgStoreModule {
218218
args.type === 'latest'
219219
? sql`index_block_hash = (SELECT index_block_hash FROM blocks WHERE canonical = TRUE ORDER BY block_height DESC LIMIT 1)`
220220
: args.type === 'hash'
221-
? sql`(
221+
? sql`(
222222
block_hash = ${normalizeHashString(args.hash)}
223223
OR index_block_hash = ${normalizeHashString(args.hash)}
224224
)`
225-
: sql`block_height = ${args.height}`;
225+
: sql`block_height = ${args.height}`;
226226
const blockQuery = await sql<BlockQueryResult[]>`
227227
SELECT ${sql(BLOCK_COLUMNS)}
228228
FROM blocks
@@ -246,11 +246,11 @@ export class PgStoreV2 extends BasePgStoreModule {
246246
blockId.type === 'latest'
247247
? sql`index_block_hash = (SELECT index_block_hash FROM blocks WHERE canonical = TRUE ORDER BY block_height DESC LIMIT 1)`
248248
: blockId.type === 'hash'
249-
? sql`(
249+
? sql`(
250250
block_hash = ${normalizeHashString(blockId.hash)}
251251
OR index_block_hash = ${normalizeHashString(blockId.hash)}
252252
)`
253-
: sql`block_height = ${blockId.height}`;
253+
: sql`block_height = ${blockId.height}`;
254254
const blockQuery = await sql<{ signer_signatures: string[]; total: number }[]>`
255255
SELECT
256256
signer_signatures[${offset + 1}:${offset + limit}] as signer_signatures,
@@ -344,11 +344,11 @@ export class PgStoreV2 extends BasePgStoreModule {
344344
args.block.type === 'latest'
345345
? sql`canonical = TRUE ORDER BY block_height DESC`
346346
: args.block.type === 'hash'
347-
? sql`(
347+
? sql`(
348348
block_hash = ${normalizeHashString(args.block.hash)}
349349
OR index_block_hash = ${normalizeHashString(args.block.hash)}
350350
) AND canonical = TRUE`
351-
: sql`block_height = ${args.block.height} AND canonical = TRUE`
351+
: sql`block_height = ${args.block.height} AND canonical = TRUE`
352352
}
353353
LIMIT 1
354354
),
@@ -448,8 +448,8 @@ export class PgStoreV2 extends BasePgStoreModule {
448448
args.type === 'latest'
449449
? sql`burn_block_hash = (SELECT burn_block_hash FROM blocks WHERE canonical = TRUE ORDER BY block_height DESC LIMIT 1)`
450450
: args.type === 'hash'
451-
? sql`burn_block_hash = ${args.hash}`
452-
: sql`burn_block_height = ${args.height}`;
451+
? sql`burn_block_hash = ${args.hash}`
452+
: sql`burn_block_height = ${args.height}`;
453453
const blockQuery = await sql<DbBurnBlock[]>`
454454
WITH BlocksWithPrevTime AS (
455455
SELECT

src/datastore/pg-store.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,10 @@ export class PgStore extends BasePgStore {
333333
'hash' in blockIdentifer
334334
? sql`block_hash = ${blockIdentifer.hash}`
335335
: 'height' in blockIdentifer
336-
? sql`block_height = ${blockIdentifer.height}`
337-
: 'burnBlockHash' in blockIdentifer
338-
? sql`burn_block_hash = ${blockIdentifer.burnBlockHash}`
339-
: sql`burn_block_height = ${blockIdentifer.burnBlockHeight}`
336+
? sql`block_height = ${blockIdentifer.height}`
337+
: 'burnBlockHash' in blockIdentifer
338+
? sql`burn_block_hash = ${blockIdentifer.burnBlockHash}`
339+
: sql`burn_block_height = ${blockIdentifer.burnBlockHeight}`
340340
}
341341
ORDER BY canonical DESC, block_height DESC
342342
LIMIT 1
@@ -1325,13 +1325,13 @@ export class PgStore extends BasePgStore {
13251325
OR smart_contract_contract_id = ${address}
13261326
OR contract_call_contract_id = ${address})`
13271327
: senderAddress && recipientAddress
1328-
? sql`(sender_address = ${senderAddress}
1328+
? sql`(sender_address = ${senderAddress}
13291329
AND token_transfer_recipient_address = ${recipientAddress})`
1330-
: senderAddress
1331-
? sql`sender_address = ${senderAddress}`
1332-
: recipientAddress
1333-
? sql`token_transfer_recipient_address = ${recipientAddress}`
1334-
: sql`TRUE`
1330+
: senderAddress
1331+
? sql`sender_address = ${senderAddress}`
1332+
: recipientAddress
1333+
? sql`token_transfer_recipient_address = ${recipientAddress}`
1334+
: sql`TRUE`
13351335
}
13361336
AND (pruned = false ${
13371337
!includeUnanchored && unanchoredTxs.length
@@ -4528,8 +4528,8 @@ export class PgStore extends BasePgStore {
45284528
param.type == 'latest'
45294529
? this.sql`index_block_hash = (SELECT index_block_hash FROM chain_tip)`
45304530
: param.type == 'hash'
4531-
? this.sql`index_block_hash = ${param.hash}`
4532-
: this.sql`block_height = ${param.height} AND canonical = true`
4531+
? this.sql`index_block_hash = ${param.hash}`
4532+
: this.sql`block_height = ${param.height} AND canonical = true`
45334533
}
45344534
LIMIT 1
45354535
`;

src/datastore/pg-write-store.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -872,8 +872,8 @@ export class PgWriteStore extends PgStore {
872872
table === 'names'
873873
? sql('registered_at')
874874
: table === 'namespaces'
875-
? sql('ready_block')
876-
: sql('block_height');
875+
? sql('ready_block')
876+
: sql('block_height');
877877
// The smart_contracts table does not have a tx_index column
878878
const txIndexBump = table === 'smart_contracts' ? sql`` : sql`tx_index = tx_index + 1,`;
879879
const metadataResult = await sql`
@@ -895,10 +895,10 @@ export class PgWriteStore extends PgStore {
895895
Entry extends { tx: DbTx } & ('pox2_events' extends T
896896
? { pox2Events: DbPoxSyntheticEvent[] }
897897
: 'pox3_events' extends T
898-
? { pox3Events: DbPoxSyntheticEvent[] }
899-
: 'pox4_events' extends T
900-
? { pox4Events: DbPoxSyntheticEvent[] }
901-
: never)
898+
? { pox3Events: DbPoxSyntheticEvent[] }
899+
: 'pox4_events' extends T
900+
? { pox4Events: DbPoxSyntheticEvent[] }
901+
: never),
902902
>(sql: PgSqlClient, poxTable: T, entries: Entry[]) {
903903
const values: PoxSyntheticEventInsertValues[] = [];
904904
for (const entry of entries) {
@@ -2419,7 +2419,7 @@ export class PgWriteStore extends PgStore {
24192419
block_height: smartContract.block_height,
24202420
index_block_hash: tx.index_block_hash,
24212421
source_code: smartContract.source_code,
2422-
abi: smartContract.abi ? JSON.parse(smartContract.abi) ?? 'null' : 'null',
2422+
abi: smartContract.abi ? (JSON.parse(smartContract.abi) ?? 'null') : 'null',
24232423
parent_index_block_hash: tx.parent_index_block_hash,
24242424
microblock_hash: tx.microblock_hash,
24252425
microblock_sequence: tx.microblock_sequence,

0 commit comments

Comments
 (0)