Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: strip unnecessary deposit fields #134

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,7 @@ export class BlockchainEventRepository {
const repository = this.postgres.getRepository(entity);

if (!dbEntity) {
this.logger.debug({
at: "BlockchainEventRepository#saveAndHandleFinalisation",
message: `Found entity ${entity} where ${JSON.stringify(where)}`,
dbEntity,
data,
where,
});
await repository.insert(data);
this.logger.debug({
at: "BlockchainEventRepository#saveAndHandleFinalisation",
message: `Inserted entity ${entity} where ${JSON.stringify(where)}`,
dbEntity,
data,
where,
});
return {
data: (await repository.findOne({ where })) as Entity,
result: SaveQueryResultType.Inserted,
Expand Down
2 changes: 0 additions & 2 deletions packages/indexer/src/data-indexing/service/Indexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ export class Indexer {
}
blockRangeProcessedSuccessfully = true;
} catch (error) {
// TODO: remove this after testing
console.error(error);
this.logger.error({
at: "Indexer#start",
message: "Error processing block range",
Expand Down
6 changes: 6 additions & 0 deletions packages/indexer/src/database/SpokePoolRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ export class SpokePoolRepository extends dbUtils.BlockchainEventRepository {
lastFinalisedBlock: number,
) {
const formattedEvents = v3FundsDepositedEvents.map((event) => {
// delete fields that are not needed for the database table
delete event.speedUpSignature;
delete event.updatedRecipient;
delete event.updatedOutputAmount;
delete event.updatedMessage;

return {
...event,
relayHash: across.utils.getRelayHashFromEvent(event),
Expand Down
Loading