Skip to content

Commit

Permalink
feat: add helper function for
Browse files Browse the repository at this point in the history
  • Loading branch information
clauBv23 committed Mar 26, 2024
1 parent 1748672 commit baec9d3
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions packages/subgraph/tests/utils/events/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,17 @@ import {
import {
ProposalCreated,
ProposalExecuted,
MembershipContractAnnounced,
} from '../../../generated/templates/Plugin/Admin';
import {
ADDRESS_ZERO,
ADDRESS_ONE,
ADDRESS_TWO,
STRING_DATA,
PLUGIN_PROPOSAL_ID,
START_DATE,
ALLOW_FAILURE_MAP,
CONTRACT_ADDRESS,
DAO_ADDRESS,
} from '../constants';
import {AdminMembers} from './../../../generated/templates';
import {Address, BigInt, Bytes, ethereum} from '@graphprotocol/graph-ts';
import {newMockEvent} from 'matchstick-as';

Expand Down Expand Up @@ -175,6 +173,26 @@ export function createRevokedEvent(
return newRevokedEvent;
}

export function createMembershipContractAnnouncedEvent(
definingContract: string,
contractAddress: Address
): MembershipContractAnnounced {
let newMembershipContractAnnouncedEvent =
changetype<MembershipContractAnnounced>(newMockEvent());

newMembershipContractAnnouncedEvent.address = contractAddress;
newMembershipContractAnnouncedEvent.parameters = [];

let definingContractParam = new ethereum.EventParam(
'definingContract',
ethereum.Value.fromAddress(Address.fromString(definingContract))
);

newMembershipContractAnnouncedEvent.parameters.push(definingContractParam);

return newMembershipContractAnnouncedEvent;
}

// state

export function createAdminPluginState(
Expand Down

0 comments on commit baec9d3

Please sign in to comment.