Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added logs #49

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
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
17 changes: 16 additions & 1 deletion src/renzo/renzo.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,19 @@ export class RenzoService extends Worker {
this.tokenAddress = tokens;

const realTokenTotalPoints = await this.getRealPointsData();
this.logger.log(
"renzoLog: realTokenTotalPoints:",
realTokenTotalPoints.size,
);
const pointsData = await this.getLocalPointsData();
this.logger.log("renzoLog: pointsData");
const localPoints = pointsData.localPoints;
const localTotalPoints = pointsData.localTotalPoints;
const tokensMapBridgeTokens = await this.getTokensMapBriageTokens();
this.logger.log(
"renzoLog: tokensMapBridgeTokens:",
tokensMapBridgeTokens.size,
);
if (
tokensMapBridgeTokens.size < 1 ||
localPoints.length < 1 ||
Expand All @@ -118,6 +127,10 @@ export class RenzoService extends Worker {
const transferFaildPoints = this.projectGraphService.getTransferFaildPoints(
this.tokenAddress,
);
this.logger.log(
"renzoLog: transferFaildPoints:",
transferFaildPoints.length,
);
const localPointsMap = new Map<string, LocalPointsItem>();
const totalPointsPerTokenMap = new Map<string, bigint>();
const now = (new Date().getTime() / 1000) | 0;
Expand All @@ -126,6 +139,7 @@ export class RenzoService extends Worker {
totalPointsPerTokenMap.set(item.token, item.totalPointsPerToken);
localPointsMap.set(key, item);
}
this.logger.log("renzoLog: localPointsMap:", localPointsMap.size);
// loop transferFaildData, and added transferFaildPoint to localPoints
for (const item of transferFaildPoints) {
const key = `${item.address}_${item.tokenAddress}`;
Expand All @@ -152,7 +166,7 @@ export class RenzoService extends Worker {
}
}
// end added transferFaildPoint

this.logger.log("renzoLog: end added transferFaildPoint");
for (const [, point] of localPointsMap) {
const tokenAddress = point.token.toLocaleLowerCase();
if (!tokenAddress) {
Expand Down Expand Up @@ -196,6 +210,7 @@ export class RenzoService extends Worker {
};
data.push(pointsItem);
}
this.logger.log("renzoLog: data", data.length);
if (data.length > 0) {
this.renzoData = {
localTotalPoints: localTotalPoints,
Expand Down
2 changes: 1 addition & 1 deletion src/renzo/renzoapi.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class RenzoApiService {
for (const bridgeAddress of this.l1Erc20Bridges) {
const renzoPoints = await this._fetchRenzoPoints(bridgeAddress);
allRenzoPoints.set(bridgeAddress.toLocaleLowerCase(), renzoPoints);
await new Promise((resolve) => setTimeout(resolve, 1000)); // wait 1s
//await new Promise((resolve) => setTimeout(resolve, 1000)); // wait 1s
}
return allRenzoPoints;
}
Expand Down