Skip to content

Commit f6d2888

Browse files
committed
remove tokensnapshotlog indexing
1 parent 8cd51f3 commit f6d2888

File tree

3 files changed

+31
-27
lines changed

3 files changed

+31
-27
lines changed

packages/subgraph/schema.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2790,6 +2790,7 @@ type TokenStatistic @entity(immutable: false) {
27902790

27912791
"""
27922792
TokenStatisticLog: Historical entries of `TokenStatistic` updates.
2793+
WARNING: This entity has been deprecated. It is not indexed anymore. It's kept in schema to avoid breakage in the schema.
27932794
"""
27942795
type TokenStatisticLog @entity(immutable: true) {
27952796
id: ID!

packages/subgraph/src/mappingHelpers.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,9 @@ export function _createTokenStatisticLogEntity(
801801
tokenAddress: Address,
802802
eventName: string
803803
): void {
804+
// Note: we decided to deprecate TokenStatisticLogs based on high entity count and non-existent usage.
805+
return;
806+
804807
const tokenStatistic = getOrInitTokenStatistic(tokenAddress, event.block);
805808
const tokenStatisticLog = new TokenStatisticLog(
806809
createLogID("TSLog", tokenStatistic.id, event)

packages/subgraph/tests/superTokenFactory/superTokenFactory.test.ts

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -210,31 +210,31 @@ describe("SuperTokenFactory Mapper Unit Tests", () => {
210210
// really testing out getOrInitSuperToken at the core.
211211
});
212212

213-
describe("Aggregate Entity Mapping Tests", () => {
214-
test("handleSuperTokenCreated() - should create TokenStatistic and TokenStatisticLog entity", () => {
215-
const SuperTokenCreatedEvent =
216-
createSuperTokenCreatedEvent(maticXAddress);
217-
218-
mockedHandleSuperTokenInitRPCCalls(
219-
maticXAddress,
220-
DEFAULT_DECIMALS,
221-
ZERO_ADDRESS,
222-
maticXName,
223-
maticXSymbol
224-
);
225-
226-
handleSuperTokenCreated(SuperTokenCreatedEvent);
227-
228-
// Validate Created TokenStatistic properties
229-
assertEmptyTokenStatisticProperties(
230-
SuperTokenCreatedEvent,
231-
"SuperTokenCreated",
232-
maticXAddress,
233-
SuperTokenCreatedEvent.block.timestamp,
234-
SuperTokenCreatedEvent.block.number,
235-
BIG_INT_ZERO // totalSupply = 0
236-
);
237-
238-
});
239-
});
213+
// describe("Aggregate Entity Mapping Tests", () => {
214+
// test("handleSuperTokenCreated() - should create TokenStatistic and TokenStatisticLog entity", () => {
215+
// const SuperTokenCreatedEvent =
216+
// createSuperTokenCreatedEvent(maticXAddress);
217+
218+
// mockedHandleSuperTokenInitRPCCalls(
219+
// maticXAddress,
220+
// DEFAULT_DECIMALS,
221+
// ZERO_ADDRESS,
222+
// maticXName,
223+
// maticXSymbol
224+
// );
225+
226+
// handleSuperTokenCreated(SuperTokenCreatedEvent);
227+
228+
// // Validate Created TokenStatistic properties
229+
// assertEmptyTokenStatisticProperties(
230+
// SuperTokenCreatedEvent,
231+
// "SuperTokenCreated",
232+
// maticXAddress,
233+
// SuperTokenCreatedEvent.block.timestamp,
234+
// SuperTokenCreatedEvent.block.number,
235+
// BIG_INT_ZERO // totalSupply = 0
236+
// );
237+
238+
// });
239+
// });
240240
});

0 commit comments

Comments
 (0)