Skip to content

Commit

Permalink
tests: use legacy plugin id in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jordaniza committed Mar 14, 2024
1 parent 9f9cf27 commit a6afbd3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/subgraph/manifest/data/polygon.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"Plugin": {
"name": "TokenVotingPlugin",
"address": null,
"address": "0xae67aea0B830ed4504B36670B5Fa70c5C386Bb58",
"startBlock": 40817440
}
}
Expand Down
12 changes: 2 additions & 10 deletions packages/subgraph/src/osx/pluginSetupProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
18 changes: 10 additions & 8 deletions packages/subgraph/tests/osx/pluginSetupProcessor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand All @@ -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);
});
});
});
Expand Down

0 comments on commit a6afbd3

Please sign in to comment.