Skip to content

Commit

Permalink
refactor: removed deprecated SignatureValidatorSet event from subgraph (
Browse files Browse the repository at this point in the history
#473)

* refactor: removed SignatureValidatorSet event from subgraph

* refactor: remove unused handlers and tests related to the SignatureValidatorSet event
  • Loading branch information
heueristik authored Oct 24, 2023
1 parent e7ba460 commit c1c055d
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 66 deletions.
1 change: 0 additions & 1 deletion packages/contracts/test/core/dao/dao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ const EVENTS = {
Deposited: 'Deposited',
Executed: 'Executed',
NativeTokenDeposited: 'NativeTokenDeposited',
SignatureValidatorSet: 'SignatureValidatorSet',
StandardCallbackRegistered: 'StandardCallbackRegistered',
CallbackReceived: 'CallbackReceived',
};
Expand Down
1 change: 0 additions & 1 deletion packages/contracts/utils/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export const DAO_EVENTS = {
DEPOSITED: 'Deposited',
STANDARD_CALLBACK_REGISTERED: 'StandardCallbackRegistered',
TRUSTED_FORWARDER_SET: 'TrustedForwarderSet',
SIGNATURE_VALIDATOR_SET: 'SignatureValidatorSet',
NEW_URI: 'NewURI',
};

Expand Down
1 change: 1 addition & 0 deletions packages/subgraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

- Removed `SignatureValidatorSet` event.
- Removed `ContractPermissionId` entity.

## [1.3.0]
Expand Down
2 changes: 0 additions & 2 deletions packages/subgraph/manifest/subgraph.placeholder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,6 @@ templates:
handler: handleTrustedForwarderSet
- event: StandardCallbackRegistered(bytes4,bytes4,bytes4)
handler: handleStandardCallbackRegistered
- event: SignatureValidatorSet(address)
handler: handleSignatureValidatorSet
- event: NewURI(string)
handler: handleNewURI
- name: DaoTemplateV1_3_0
Expand Down
12 changes: 0 additions & 12 deletions packages/subgraph/src/dao/dao_v1_0_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
Granted,
Revoked,
TrustedForwarderSet,
SignatureValidatorSet,
StandardCallbackRegistered,
CallbackReceived,
NewURI,
Expand Down Expand Up @@ -218,17 +217,6 @@ export function handleTrustedForwarderSet(event: TrustedForwarderSet): void {
}
}

export function handleSignatureValidatorSet(
event: SignatureValidatorSet
): void {
let daoId = event.address.toHexString();
let entity = Dao.load(daoId);
if (entity) {
entity.signatureValidator = event.params.signatureValidator;
entity.save();
}
}

export function handleStandardCallbackRegistered(
event: StandardCallbackRegistered
): void {
Expand Down
28 changes: 0 additions & 28 deletions packages/subgraph/tests/dao/dao_v1_0_0.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
handleExecuted,
_handleMetadataSet,
handleTrustedForwarderSet,
handleSignatureValidatorSet,
handleStandardCallbackRegistered,
handleCallbackReceived,
handleNewURI,
Expand Down Expand Up @@ -69,7 +68,6 @@ import {
createNewExecutedEvent,
createDaoEntityState,
createTrustedForwarderSetEvent,
createSignatureValidatorSetEvent,
createStandardCallbackRegisteredEvent,
getSupportsInterface,
encodeWithFunctionSelector,
Expand Down Expand Up @@ -1391,32 +1389,6 @@ test('Run dao (handleTrustedForwarderSet) mappings with mock event', () => {
clearStore();
});

test('Run dao (handleSignatureValidatorSet) mappings with mock event', () => {
// create state
let entityID = Address.fromString(DAO_ADDRESS).toHexString();
createDaoEntityState(entityID, ADDRESS_ONE, DAO_TOKEN_ADDRESS);

let signatureValidator = ADDRESS_ONE;

let newEvent = createSignatureValidatorSetEvent(
signatureValidator,
DAO_ADDRESS
);
// handle event
handleSignatureValidatorSet(newEvent);

// checks
assert.fieldEquals('Dao', entityID, 'id', entityID);
assert.fieldEquals(
'Dao',
entityID,
'signatureValidator',
Address.fromString(ADDRESS_ONE).toHexString()
);

clearStore();
});

test('Run dao (handleStandardCallbackRegistered) mappings with mock event', () => {
// create state
let daoAddress = Address.fromString(DAO_ADDRESS).toHexString();
Expand Down
22 changes: 0 additions & 22 deletions packages/subgraph/tests/dao/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
Deposited,
Executed,
TrustedForwarderSet,
SignatureValidatorSet,
StandardCallbackRegistered,
CallbackReceived,
NewURI,
Expand Down Expand Up @@ -106,27 +105,6 @@ export function createTrustedForwarderSetEvent(
return newTrustedForwarderSetEvent;
}

export function createSignatureValidatorSetEvent(
signatureValidator: string,
contractAddress: string
): SignatureValidatorSet {
let newSignatureValidatorSetEvent = changetype<SignatureValidatorSet>(
newMockEvent()
);

newSignatureValidatorSetEvent.address = Address.fromString(contractAddress);
newSignatureValidatorSetEvent.parameters = [];

let trustedForwarderParam = new ethereum.EventParam(
'signatureValidator',
ethereum.Value.fromAddress(Address.fromString(signatureValidator))
);

newSignatureValidatorSetEvent.parameters.push(trustedForwarderParam);

return newSignatureValidatorSetEvent;
}

export function createNewNativeTokenDepositedEvent(
sender: string,
amount: string,
Expand Down

0 comments on commit c1c055d

Please sign in to comment.