Skip to content

Commit

Permalink
Bugfix indexing pluginAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
nigeon committed Nov 16, 2023
1 parent a4d9452 commit a564579
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/subgraph/src/plugin/governance-erc20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ import {GovernanceERC20 as GovernanceERC20Contract} from '../../generated/templa
import {Address, BigInt, dataSource, store} from '@graphprotocol/graph-ts';

function getOrCreateMember(user: Address, pluginId: string): PluginMember {
let context = dataSource.context();
let id = [user.toHexString(), pluginId].join('_');
let member = PluginMember.load(id);
if (!member) {
member = new PluginMember(id);
member.address = user.toHexString();
member.balance = BigInt.zero();
member.plugin = pluginId;
member.pluginAddress = dataSource.address().toHexString();
member.pluginAddress = context.getString('pluginAddress');;
member.delegatee = null;
member.votingPower = BigInt.zero();
}
Expand Down
1 change: 1 addition & 0 deletions packages/subgraph/src/plugin/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export function handlePluginSettingsUpdated(
// Create template
const pluginContext = new DataSourceContext();
pluginContext.setString('pluginId', installationId.toHexString());
pluginContext.setString('pluginAddress', pluginAddress.toHexString());
GovernanceERC20.createWithContext(
event.params.daoTokenAddress,
pluginContext
Expand Down

0 comments on commit a564579

Please sign in to comment.