Skip to content

Commit

Permalink
fixes total pending cw transactions query
Browse files Browse the repository at this point in the history
  • Loading branch information
soaresa authored and minaxolone committed Jul 31, 2024
1 parent 83cc55b commit c52b8d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/src/ol/community-wallets/community-wallets.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ export class CommunityWalletsService implements ICommunityWalletsService {
let totalVetoed = 0;
let totalPending = 0;

const currentEpoch = await this.olService.aptosClient
const currentEpoch: number = await this.olService.aptosClient
.getLedgerInfo()
.then((info) => info.epoch);
.then((info) => Number(info.epoch));

await Promise.all(
wallets.map(async (wallet) => {
Expand All @@ -152,7 +152,7 @@ export class CommunityWalletsService implements ICommunityWalletsService {
});

resource.data['scheduled'].forEach((payment) => {
if (payment.deadline < currentEpoch) {
if (payment.deadline > currentEpoch) {
totalPending += Number(payment['tx']['value']);
}
});
Expand Down

0 comments on commit c52b8d3

Please sign in to comment.