Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
}

async readSettings (): Promise<TableSettings> {
return this.validateEntity(verifyOne(await this.toDb(undefined)<TableSettings>('settings')))

Check warning on line 80 in packages/wallet/wallet-toolbox/src/storage/StorageKnex.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this redundant "undefined".

See more on https://sonarcloud.io/project/issues?id=bsv-blockchain_ts-stack&issues=AZ_cA-POfwJVWRptARWB&open=AZ_cA-POfwJVWRptARWB&pullRequest=439
}

override async getProvenOrRawTx (txid: string, trx?: TrxToken): Promise<ProvenOrRawTx> {
Expand All @@ -88,7 +88,7 @@
inputBEEF: undefined
}

r.proven = verifyOneOrNone(await this.findProvenTxs({ partial: { txid } }))
r.proven = verifyOneOrNone(await this.findProvenTxs({ partial: { txid }, trx }))
if (r.proven == null) {
const reqRawTx = verifyOneOrNone(
await k('proven_tx_reqs')
Expand Down Expand Up @@ -858,7 +858,7 @@
override async findMonitorEvents (args: FindMonitorEventsArgs): Promise<TableMonitorEvent[]> {
const q = this.findMonitorEventsQuery(args)
const r = await q
return this.validateEntities(r, ['when'], undefined)

Check warning on line 861 in packages/wallet/wallet-toolbox/src/storage/StorageKnex.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this redundant "undefined".

See more on https://sonarcloud.io/project/issues?id=bsv-blockchain_ts-stack&issues=AZ_cA-POfwJVWRptARWC&open=AZ_cA-POfwJVWRptARWC&pullRequest=439
}

async getCount<T extends object>(q: Knex.QueryBuilder<T, T[]>): Promise<number> {
Expand Down Expand Up @@ -1108,7 +1108,7 @@
if (v.created_at != null) v.created_at = this.validateEntityDate(v.created_at)
if (v.updated_at != null) v.updated_at = this.validateEntityDate(v.updated_at)
if (v.created_at == null) delete v.created_at
if (v.updated_at == null) v.updated_at = this.validateEntityDate(new Date())

Check warning on line 1111 in packages/wallet/wallet-toolbox/src/storage/StorageKnex.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer using nullish coalescing operator (`??=`) instead of an assignment expression, as it is simpler to read.

See more on https://sonarcloud.io/project/issues?id=bsv-blockchain_ts-stack&issues=AZ_cA-POfwJVWRptARWD&open=AZ_cA-POfwJVWRptARWD&pullRequest=439
this.coerceDateFields(v, dateFields)
this.coerceBooleanFields(update, booleanFields)
this.serialiseForKnex(v)
Expand Down Expand Up @@ -1242,7 +1242,7 @@
byName[basket.name] = basket
}
for (const name of uniqueNames) {
if (byName[name] == null) byName[name] = await this.findOrInsertOutputBasket(userId, name, trx)

Check warning on line 1245 in packages/wallet/wallet-toolbox/src/storage/StorageKnex.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer using nullish coalescing operator (`??=`) instead of an assignment expression, as it is simpler to read.

See more on https://sonarcloud.io/project/issues?id=bsv-blockchain_ts-stack&issues=AZ_cA-POfwJVWRptARWE&open=AZ_cA-POfwJVWRptARWE&pullRequest=439
}
return byName
}
Expand All @@ -1264,7 +1264,7 @@
byTag[outputTag.tag] = outputTag
}
for (const tag of uniqueTags) {
if (byTag[tag] == null) byTag[tag] = await this.findOrInsertOutputTag(userId, tag, trx)

Check warning on line 1267 in packages/wallet/wallet-toolbox/src/storage/StorageKnex.ts

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer using nullish coalescing operator (`??=`) instead of an assignment expression, as it is simpler to read.

See more on https://sonarcloud.io/project/issues?id=bsv-blockchain_ts-stack&issues=AZ_cA-POfwJVWRptARWF&open=AZ_cA-POfwJVWRptARWF&pullRequest=439
}
return byTag
}
Expand Down