Skip to content

Commit

Permalink
Add DELETED_MULTISIG_TRANSACTION event
Browse files Browse the repository at this point in the history
  • Loading branch information
Uxio0 committed Jan 16, 2024
1 parent f8889b5 commit f074330
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,17 @@ Some parameters are common to every event:
}
```

## Multisig transaction deleted

```json
{
"address": "<Ethereum checksummed address>",
"type": "DELETED_MULTISIG_TRANSACTION",
"safeTxHash": "<0x-prefixed-hex-string>",
"chainId": "<stringified-int>"
}
```

### Incoming Ether

```json
Expand Down
3 changes: 2 additions & 1 deletion src/routes/events/event.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export type TxServiceEventType =
| 'OUTGOING_ETHER'
| 'OUTGOING_TOKEN'
| 'MESSAGE_CREATED'
| 'MESSAGE_CONFIRMATION';
| 'MESSAGE_CONFIRMATION'
| 'DELETED_MULTISIG_TRANSACTION';

export interface TxServiceEvent {
chainId: string;
Expand Down
7 changes: 7 additions & 0 deletions src/routes/webhook/entities/webhook.entity.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ describe('Webhook entity', () => {
expect(webhook.isEventRelevant(txServiceEvent)).toBe(false);
});

it('DELETED_MULTISIG_TRANSACTION should not be relevant if sendMultisigTxs is disabled', async () => {
txServiceEvent.type = 'DELETED_MULTISIG_TRANSACTION' as TxServiceEventType;
expect(webhook.isEventRelevant(txServiceEvent)).toBe(true);
webhook.sendMultisigTxs = false;
expect(webhook.isEventRelevant(txServiceEvent)).toBe(false);
});

it('INCOMING_ETHER should not be relevant if sendEtherTransfers is disabled', async () => {
txServiceEvent.type = 'INCOMING_ETHER' as TxServiceEventType;
expect(webhook.isEventRelevant(txServiceEvent)).toBe(true);
Expand Down
3 changes: 2 additions & 1 deletion src/routes/webhook/entities/webhook.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ export class Webhook extends BaseEntity {
message.type === 'CONFIRMATION_REQUEST')) ||
(this.sendMultisigTxs &&
(message.type === 'PENDING_MULTISIG_TRANSACTION' ||
message.type === 'EXECUTED_MULTISIG_TRANSACTION')) ||
message.type === 'EXECUTED_MULTISIG_TRANSACTION' ||
message.type === 'DELETED_MULTISIG_TRANSACTION')) ||
(this.sendEtherTransfers &&
(message.type === 'INCOMING_ETHER' ||
message.type === 'OUTGOING_ETHER')) ||
Expand Down

0 comments on commit f074330

Please sign in to comment.