Skip to content

Commit 8897568

Browse files
committed
feat: add epoch 1 override configuration
1 parent 2aabfaa commit 8897568

14 files changed

+471
-26
lines changed

config.yaml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,13 +289,38 @@ networks:
289289
events:
290290
- event: LoanSelfRepaid(address indexed user, address indexed vault, address debtAsset, address collateralAsset, uint256 amount)
291291

292-
# PartnerNFT - registered from NFTPartnershipRegistry.PartnershipAdded
292+
# PartnerNFT - registered from NFTPartnershipRegistry.PartnershipAdded (for dynamic registration)
293293
- name: PartnerNFT
294294
abi_file_path: abis/helpers/ERC721.json
295295
handler: src/handlers/nft.ts
296296
events:
297297
- event: Transfer(address indexed from, address indexed to, uint256 indexed tokenId)
298298

299+
# Static NFT collections (bootstrapped - tracked from start)
300+
- name: The10kSquad
301+
abi_file_path: abis/helpers/ERC721.json
302+
address: 0x818030837e8350ba63e64d7dc01a547fa73c8279
303+
start_block: 0
304+
handler: src/handlers/nft.ts
305+
events:
306+
- event: Transfer(address indexed from, address indexed to, uint256 indexed tokenId)
307+
308+
- name: Overnads
309+
abi_file_path: abis/helpers/ERC721.json
310+
address: 0xfb5ba4061f5c50b1daa6c067bb2dfb0a8ebf6a8d
311+
start_block: 0
312+
handler: src/handlers/nft.ts
313+
events:
314+
- event: Transfer(address indexed from, address indexed to, uint256 indexed tokenId)
315+
316+
- name: SolveilPass
317+
abi_file_path: abis/helpers/ERC721.json
318+
address: 0x8255dacd8a45f4abe6dc821e6f7f3c92a8e22fbb
319+
start_block: 0
320+
handler: src/handlers/nft.ts
321+
events:
322+
- event: Transfer(address indexed from, address indexed to, uint256 indexed tokenId)
323+
299324
# NonfungiblePositionManager - registered from LeaderboardConfig.LPPoolConfigured
300325
- name: NonfungiblePositionManager
301326
abi_file_path: abis/uniswap/NonfungiblePositionManager.json

src/__tests__/config-events.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import fs from 'node:fs';
33
import path from 'node:path';
44
import { test } from 'node:test';
55

6+
// Disable bootstrap in tests
7+
process.env.ENVIO_DISABLE_BOOTSTRAP = 'true';
8+
69
import { POOL_CONFIGURATOR_ID, POOL_ID, ZERO_ADDRESS } from '../helpers/constants';
710
import {
811
VIEM_ATOKEN_ADDRESS,

src/__tests__/leaderboard-handlers.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { installViemMock } from './viem-mock';
77

88
process.env.ENVIO_DISABLE_EXTERNAL_CALLS = 'true';
99
process.env.ENVIO_DISABLE_ETH_CALLS = 'true';
10+
process.env.ENVIO_DISABLE_BOOTSTRAP = 'true';
1011

1112
const ADDRESSES = {
1213
epochManager: '0x000000000000000000000000000000000000c001',

src/__tests__/leaderboard-keeper.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import assert from 'node:assert/strict';
22
import fs from 'node:fs';
33
import path from 'node:path';
44
import { test } from 'node:test';
5+
import { LEADERBOARD_START_BLOCK } from '../helpers/constants';
56

67
process.env.ENVIO_DISABLE_EXTERNAL_CALLS = 'true';
78
process.env.ENVIO_DISABLE_ETH_CALLS = 'true';
@@ -71,7 +72,7 @@ test('keeper events update leaderboard state and ownership', async () => {
7172
mockDb = mockDb.entities.LeaderboardEpoch.set({
7273
id: '1',
7374
epochNumber: 1n,
74-
startBlock: 1n,
75+
startBlock: BigInt(LEADERBOARD_START_BLOCK),
7576
startTime: 0,
7677
endBlock: undefined,
7778
endTime: undefined,
@@ -167,7 +168,7 @@ test('keeper events update leaderboard state and ownership', async () => {
167168
user: ADDRESSES.user,
168169
votingPower: 1000n * 10n ** 18n,
169170
timestamp: 100n,
170-
...eventData(10, 100, ADDRESSES.keeper),
171+
...eventData(LEADERBOARD_START_BLOCK + 10, 100, ADDRESSES.keeper),
171172
});
172173
mockDb = await TestHelpers.LeaderboardKeeper.VotingPowerSynced.processEvent({
173174
event: vpSynced,
@@ -179,7 +180,7 @@ test('keeper events update leaderboard state and ownership', async () => {
179180
collection: ADDRESSES.collection,
180181
balance: 1n,
181182
timestamp: 101n,
182-
...eventData(10, 101, ADDRESSES.keeper),
183+
...eventData(LEADERBOARD_START_BLOCK + 10, 101, ADDRESSES.keeper),
183184
});
184185
mockDb = await TestHelpers.LeaderboardKeeper.NFTBalanceSynced.processEvent({
185186
event: nftSynced,
@@ -193,7 +194,7 @@ test('keeper events update leaderboard state and ownership', async () => {
193194
const settle = TestHelpers.LeaderboardKeeper.UserSettled.createMockEvent({
194195
user: ADDRESSES.user,
195196
timestamp: 86400n,
196-
...eventData(11, 86400, ADDRESSES.keeper),
197+
...eventData(LEADERBOARD_START_BLOCK + 11, 86400, ADDRESSES.keeper),
197198
});
198199
mockDb = await TestHelpers.LeaderboardKeeper.UserSettled.processEvent({
199200
event: settle,

src/__tests__/leaderboard.e2e.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const UNIT = 10n ** 6n;
1515

1616
process.env.ENVIO_DISABLE_EXTERNAL_CALLS = 'true';
1717
process.env.ENVIO_DISABLE_ETH_CALLS = 'true';
18+
process.env.ENVIO_DISABLE_BOOTSTRAP = 'true';
1819

1920
const ADDRESSES = {
2021
user: '0x0000000000000000000000000000000000000001',

src/__tests__/lp-coverage.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import assert from 'node:assert/strict';
22
import { test } from 'node:test';
33

4+
process.env.ENVIO_DISABLE_BOOTSTRAP = 'true';
5+
46
import { AUSD_ADDRESS } from '../helpers/constants';
57
import {
68
getOrCreateLPPoolState,

src/__tests__/lp-events.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { installViemMock, setLPPositionOverride } from './viem-mock';
88

99
process.env.ENVIO_DISABLE_EXTERNAL_CALLS = 'true';
1010
process.env.ENVIO_DISABLE_ETH_CALLS = 'true';
11+
process.env.ENVIO_DISABLE_BOOTSTRAP = 'true';
1112
installViemMock();
1213

1314
const TOKEN_ID = 1n;

src/__tests__/shared-accrual.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import fs from 'node:fs';
33
import path from 'node:path';
44
import { test } from 'node:test';
55

6+
process.env.ENVIO_DISABLE_BOOTSTRAP = 'true';
7+
68
import { LEADERBOARD_START_BLOCK } from '../helpers/constants';
79
import { createDefaultReserve } from '../helpers/entityHelpers';
810
import { accruePointsForUserReserve, syncUserReservePointsBaseline } from '../handlers/shared';

src/__tests__/shared-external.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import fs from 'node:fs';
33
import path from 'node:path';
44
import { test } from 'node:test';
55

6+
process.env.ENVIO_DISABLE_BOOTSTRAP = 'true';
7+
68
import { LEADERBOARD_START_BLOCK } from '../helpers/constants';
79
import { createDefaultReserve } from '../helpers/entityHelpers';
810
import { settlePointsForUser } from '../handlers/shared';

src/__tests__/shared-utils.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import assert from 'node:assert/strict';
22
import { test } from 'node:test';
33

4+
// Disable bootstrap in tests to use default config values
5+
process.env.ENVIO_DISABLE_BOOTSTRAP = 'true';
6+
47
import {
58
AUSD_ADDRESS,
69
DUST_LOCK_START_BLOCK,

0 commit comments

Comments
 (0)