Skip to content

Commit

Permalink
more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
shaharyakir committed Dec 5, 2024
1 parent 9325aaf commit ba5e782
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/latest-known-contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { sha256 } from "./utils";
import { getTonClient } from "./ton-reader-client";
import { toBigIntBE } from "bigint-buffer";
import { SourceItem } from "./wrappers/source-item";
import { getLogger } from "./logger";

dotenv.config({ path: ".env.local" });
dotenv.config({ path: ".env" });
Expand All @@ -18,6 +19,8 @@ const contracts: {
}[] = [];
let lastUpdateTime: null | Date = null;

const logger = getLogger("latest-known-contracts");

async function update(verifierIdSha256: Buffer, ipfsProvider: string) {
// TODO - this means that clients get empty responses quickly instead of waiting
// for the single-instance fetch. needsfix
Expand Down Expand Up @@ -94,7 +97,7 @@ async function update(verifierIdSha256: Buffer, ipfsProvider: string) {
compiler: ipfsData.data.compiler,
});
} catch (e) {
console.warn(e);
logger.error(e);
callback(null);
}
},
Expand All @@ -103,7 +106,7 @@ async function update(verifierIdSha256: Buffer, ipfsProvider: string) {
// @ts-ignore
contracts.unshift(...results.filter((o: any) => o));
} catch (e) {
console.warn(e);
logger.error(e);
lastUpdateTime = null;
}
}
Expand Down

0 comments on commit ba5e782

Please sign in to comment.