Skip to content

Commit

Permalink
Added logs
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-zklink committed May 9, 2024
1 parent 749ac0b commit f6111aa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
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

0 comments on commit f6111aa

Please sign in to comment.