Skip to content

Commit

Permalink
refactor: assert event types when parsing receipts
Browse files Browse the repository at this point in the history
  • Loading branch information
nvtaveras committed Aug 5, 2024
1 parent 34ffb1d commit 0927c95
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/parse-transaction-receipts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ export default function parseTransactionReceipts(
],
});

if (isProposalCreatedEvent(event)) {
result.push({
event,
txHash: log.transactionHash,
});
}
assert(isProposalCreatedEvent(event));

result.push({
event,
txHash: log.transactionHash,
});
break;
}
case EventType.MedianUpdated: {
Expand All @@ -86,13 +86,13 @@ export default function parseTransactionReceipts(
],
});

if (isHealthCheckEvent(event)) {
result.push({
block: Number(receipt.blockNumber),
event,
txHash: log.transactionHash,
});
}
assert(isHealthCheckEvent(event));

result.push({
block: Number(receipt.blockNumber),
event,
txHash: log.transactionHash,
});
break;
}
default:
Expand Down

0 comments on commit 0927c95

Please sign in to comment.