From a6afbd3c3e761f7fba0a6805d5dd059ee15c8b2b Mon Sep 17 00:00:00 2001 From: jordaniza Date: Thu, 14 Mar 2024 16:07:13 +0400 Subject: [PATCH] tests: use legacy plugin id in tests --- packages/subgraph/manifest/data/polygon.json | 2 +- .../subgraph/src/osx/pluginSetupProcessor.ts | 12 ++---------- .../tests/osx/pluginSetupProcessor.test.ts | 18 ++++++++++-------- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/packages/subgraph/manifest/data/polygon.json b/packages/subgraph/manifest/data/polygon.json index c2180c20..cd873f2c 100644 --- a/packages/subgraph/manifest/data/polygon.json +++ b/packages/subgraph/manifest/data/polygon.json @@ -11,7 +11,7 @@ ], "Plugin": { "name": "TokenVotingPlugin", - "address": null, + "address": "0xae67aea0B830ed4504B36670B5Fa70c5C386Bb58", "startBlock": 40817440 } } diff --git a/packages/subgraph/src/osx/pluginSetupProcessor.ts b/packages/subgraph/src/osx/pluginSetupProcessor.ts index dcbdae57..1fa3465f 100644 --- a/packages/subgraph/src/osx/pluginSetupProcessor.ts +++ b/packages/subgraph/src/osx/pluginSetupProcessor.ts @@ -3,16 +3,8 @@ import {TokenVotingPlugin as TokenVotingPluginEntity} from '../../generated/sche import {TokenVoting} from '../../generated/templates'; import {TokenVoting as TokenVotingPluginContract} from '../../generated/templates/TokenVoting/TokenVoting'; import {PLUGIN_REPO_ADDRESS} from '../../imported/repo-address'; -import { - fetchOrCreateERC20Entity, - fetchOrCreateWrappedERC20Entity, - identifyAndFetchOrCreateERC20TokenEntity, - supportsERC20Wrapped, -} from '../utils/tokens/erc20'; -import { - generatePluginEntityId, - generatePluginInstallationEntityId, -} from '@aragon/osx-commons-subgraph'; +import {identifyAndFetchOrCreateERC20TokenEntity} from '../utils/tokens/erc20'; +import {generatePluginEntityId} from '@aragon/osx-commons-subgraph'; import { Address, BigInt, diff --git a/packages/subgraph/tests/osx/pluginSetupProcessor.test.ts b/packages/subgraph/tests/osx/pluginSetupProcessor.test.ts index 3035eeb7..64b756c7 100644 --- a/packages/subgraph/tests/osx/pluginSetupProcessor.test.ts +++ b/packages/subgraph/tests/osx/pluginSetupProcessor.test.ts @@ -29,7 +29,10 @@ import { PLUGIN_SETUP_ID, } from '../utils/constants'; import {createInstallationPreparedEvent} from '../utils/events'; -import {generatePluginInstallationEntityId} from '@aragon/osx-commons-subgraph'; +import { + generatePluginEntityId, + generatePluginInstallationEntityId, +} from '@aragon/osx-commons-subgraph'; import { Address, BigInt, @@ -131,7 +134,7 @@ describe('OSx', () => { handleInstallationPrepared(event1); - assert.notInStore('TokenVotingPlugin', installationId!); + assert.notInStore('TokenVotingPlugin', pluginAddress!); assert.entityCount('TokenVotingPlugin', 0); const thisPluginRepoAddress = PLUGIN_REPO_ADDRESS; @@ -150,13 +153,12 @@ describe('OSx', () => { handleInstallationPrepared(event2); - assert.entityCount('TokenVotingPlugin', 1); - assert.fieldEquals( - 'TokenVotingPlugin', - installationId!, - 'id', - installationId! + const pluginId = generatePluginEntityId( + Address.fromString(pluginAddress) ); + + assert.entityCount('TokenVotingPlugin', 1); + assert.fieldEquals('TokenVotingPlugin', pluginId, 'id', pluginId); }); }); });