Skip to content

Commit

Permalink
fix: lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelcr committed Oct 13, 2023
1 parent a0dbeea commit bcc0273
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
12 changes: 4 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,18 @@ import { ApiMetrics } from './metrics/metrics';
import { PgStore } from './pg/pg-store';
import { buildOrdhookIndexer } from './ordhook';

function numberRange(start: number, end: number) {
return Array.from(Array(end - start + 1).keys()).map(x => x + start);
}

async function initBackgroundServices(db: PgStore) {
logger.info('Initializing background services...');
const ordhook = buildOrdhookIndexer(db);
registerShutdownConfig({
name: 'Ordhook Indexer',
forceKillable: false,
handler: async () => {
await ordhook.terminate();
handler: () => {
ordhook.terminate();
},
});
await ordhook.replayBlockRange(767430, 807750);
// await ordhook.replayBlocks(numberRange(767430, 809386));
ordhook.replayBlockRange(767430, 807750);
await Promise.resolve();
}

async function initApiService(db: PgStore) {
Expand Down
1 change: 0 additions & 1 deletion src/pg/pg-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
PgConnectionVars,
PgSqlClient,
connectPostgres,
isTestEnv,
logger,
runMigrations,
} from '@hirosystems/api-toolkit';
Expand Down
6 changes: 5 additions & 1 deletion tests/setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
// ts-unused-exports:disable-next-line
export default (): void => {
process.env.BITCOIN_RPC_USERNAME = 'test';
process.env.BITCOIN_RPC_PASSWORD = 'password';
process.env.ORDHOOK_WORKING_DIR = '/tmp';
process.env.PGDATABASE = 'postgres';
// TODO: Remove these obsolete values
process.env.CHAINHOOK_NODE_AUTH_TOKEN = 'test';
process.env.CHAINHOOK_NODE_RPC_HOST = 'test.chainhooks.com';
process.env.PGDATABASE = 'postgres';
};

0 comments on commit bcc0273

Please sign in to comment.