Skip to content

Commit

Permalink
Merge pull request #102 from nation3/fix-execution-reverted
Browse files Browse the repository at this point in the history
fix: execution reverted
  • Loading branch information
aahna-ashina authored Oct 1, 2023
2 parents 938d0f4 + 12cefbd commit 41b120d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions data-sources/citizens/generate-citizen-count-csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,13 @@ async function loadPassportMintsByWeek() {
console.info('week:', `[${weekBeginDate.toISOString()}${weekEndDate.toISOString()}]`)

let newCitizensCount: number = 0
while (await getTimestamp(id) < (weekEndDate.getTime() / 1000)) {
while ((id < nextId) && (await getTimestamp(id) < (weekEndDate.getTime() / 1000))) {
console.info('id:', id)

newCitizensCount++
console.info('newCitizensCount:', newCitizensCount)

id++
if (id == nextId) {
console.info('Reached last passport ID:', (nextId - 1))
break
}
}

const totalExpiredPassports: number = getTotalExpiredPassports(weekEndDate, id)
Expand Down Expand Up @@ -85,7 +81,7 @@ async function getNextId(): Promise<number> {
}

async function getTimestamp(id: number): Promise<number> {
console.info('getTimestamp')
console.info('getTimestamp, id:', id)
return await PassportContract.methods.timestampOf(id).call()
}

Expand Down

0 comments on commit 41b120d

Please sign in to comment.