Skip to content

Commit

Permalink
chore: eslint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Kammerlo committed Mar 4, 2024
1 parent 4fa44e0 commit 6e4739c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
17 changes: 8 additions & 9 deletions packages/api-cardano-db-hasura/src/CardanoNodeClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import {
ConnectionConfig,
createConnectionObject, createLedgerStateQueryClient, createTransactionSubmissionClient,
getServerHealth,
ServerHealth,
ServerHealth
} from '@cardano-ogmios/client'
import { dummyLogger, Logger } from 'ts-log'
// import { createInteractionContextWithLogger } from './util'
import {LedgerStateQueryClient} from "@cardano-ogmios/client/dist/LedgerStateQuery";
import {TransactionSubmissionClient} from "@cardano-ogmios/client/dist/TransactionSubmission";
import {createInteractionContextWithLogger} from "./util";
import { LedgerStateQueryClient } from '@cardano-ogmios/client/dist/LedgerStateQuery'
import { TransactionSubmissionClient } from '@cardano-ogmios/client/dist/TransactionSubmission'
import { createInteractionContextWithLogger } from './util'

const MODULE_NAME = 'CardanoNodeClient'

Expand Down Expand Up @@ -76,12 +75,12 @@ export class CardanoNodeClient {
await this.initialize(ogmiosConnectionConfig)
})
this.stateQueryClient = await createLedgerStateQueryClient(interactionContext)
let tip;
let tip
try {
tip = await this.stateQueryClient.ledgerTip();
tip = await this.stateQueryClient.ledgerTip()
} catch (e) {
this.logger.error({ module: MODULE_NAME }, "Querying ledger tip not yet available. Wait for later epoch. Ogmios Error Message: " + e.message);
throw e;
this.logger.error({ module: MODULE_NAME }, 'Querying ledger tip not yet available. Wait for later epoch. Ogmios Error Message: ' + e.message)
throw e
}

this.logger.info({ module: MODULE_NAME }, tip)
Expand Down
8 changes: 4 additions & 4 deletions packages/api-cardano-db-hasura/src/ChainFollower.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { createInteractionContextWithLogger } from './util'
import { PointOrOrigin, BlockPraos } from '@cardano-ogmios/schema'
import { HasuraBackgroundClient } from './HasuraBackgroundClient'
import { DbConfig } from './typeAliases'
import {ChainSynchronizationClient} from "@cardano-ogmios/client/dist/ChainSynchronization";
import { ChainSynchronizationClient } from '@cardano-ogmios/client/dist/ChainSynchronization'

const MODULE_NAME = 'ChainFollower'

Expand Down Expand Up @@ -60,10 +60,10 @@ export class ChainFollower {
requestNext()
},
rollForward: async ({ block }, requestNext) => {
let b = block as BlockPraos;
const b = block as BlockPraos
if (b !== undefined && b.transactions !== undefined) {
for (const tx of b.transactions) {
if(tx.mint !== undefined) {
if (tx.mint !== undefined) {
for (const entry of Object.entries(tx.mint.assets)) {
const [policyId, assetName] = entry[0].split('.')
const assetId = `${policyId}${assetName !== undefined ? assetName : ''}`
Expand All @@ -78,7 +78,7 @@ export class ChainFollower {
await this.hasuraClient.insertAssets([asset])
const SIX_HOURS = 21600
const THREE_MONTHS = 365
await this.queue.publish('asset-metadata-fetch-initial', {assetId}, {
await this.queue.publish('asset-metadata-fetch-initial', { assetId }, {
retryDelay: SIX_HOURS,
retryLimit: THREE_MONTHS
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export class HasuraBackgroundClient {
const { hash, slotNo } = result.assets[0].firstAppearedInBlock
point = {
slot: Number(slotNo),
id: hash.substring(2)
id: hash.substring(2)
}
} else {
point = null
Expand Down

0 comments on commit 6e4739c

Please sign in to comment.