Skip to content
Merged
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
11 changes: 6 additions & 5 deletions observer/test/platform-stats.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ describe('platform-stats-generator', () => {
describe('updateDailyTransferStats', () => {
it('should correctly update daily Transfer stats with new transfer events', async () => {
await updateDailyTransferStats(pgPool, { to_address: 'address1', amount: 100 }, 1)
await updateDailyTransferStats(pgPool, { to_address: 'address1', amount: 200 }, 1)
await updateDailyTransferStats(pgPool, { to_address: 'address1', amount: 200 }, 2)

const { rows } = await pgPool.query(`
SELECT day::TEXT, to_address, amount FROM daily_reward_transfers
WHERE to_address = $1
`, ['address1'])
Comment on lines -43 to -45
Copy link
Contributor Author

@PatrickNercessian PatrickNercessian Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason to have this WHERE clause, must have been a mistaken addition from my previous PR #102

SELECT day::TEXT, to_address, amount, last_checked_block FROM daily_reward_transfers
`)
assert.strictEqual(rows.length, 1)
assert.deepStrictEqual(rows, [{ day: today, to_address: 'address1', amount: '300' }])
assert.deepStrictEqual(rows, [{
day: today, to_address: 'address1', amount: '300', last_checked_block: 2
}])
})

it('should handle multiple addresses in daily Transfer stats', async () => {
Expand Down