Skip to content

Commit

Permalink
watcher: code inspection changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
panoel committed Nov 26, 2024
1 parent bce6b3d commit c0a6f62
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 616 deletions.
2 changes: 1 addition & 1 deletion watcher/src/watchers/AlgorandWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,6 @@ export class AlgorandWatcher extends Watcher {
if (!vaasByBlock[toBlockKey]) {
vaasByBlock[toBlockKey] = [];
}
return { vaasByBlock, optionalBlockHeight: undefined };
return { vaasByBlock };
}
}
2 changes: 1 addition & 1 deletion watcher/src/watchers/AptosWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class AptosWatcher extends Watcher {
vaasByBlock[blockKey] = [...(vaasByBlock[blockKey] ?? []), vaaKey];
})
);
return { vaasByBlock, optionalBlockHeight: undefined };
return { vaasByBlock };
}

isValidBlockKey(key: string) {
Expand Down
2 changes: 1 addition & 1 deletion watcher/src/watchers/CosmwasmWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export class CosmwasmWatcher extends Watcher {
}
}
}
return { vaasByBlock, optionalBlockHeight: undefined };
return { vaasByBlock };
}
}

Expand Down
2 changes: 1 addition & 1 deletion watcher/src/watchers/EVMWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,6 @@ export class EVMWatcher extends Watcher {
const blockKey = makeBlockKey(blockNumber.toString(), timestampsByBlock[blockNumber]);
vaasByBlock[blockKey] = [...(vaasByBlock[blockKey] || []), vaaKey];
}
return { vaasByBlock, optionalBlockHeight: undefined };
return { vaasByBlock };
}
}
2 changes: 1 addition & 1 deletion watcher/src/watchers/InjectiveExplorerWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class InjectiveExplorerWatcher extends Watcher {
);
vaasByBlock[blockKey] = [];
}
return { vaasByBlock, optionalBlockHeight: undefined };
return { vaasByBlock };
}
}

Expand Down
2 changes: 1 addition & 1 deletion watcher/src/watchers/NearArchiveWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class NearArchiveWatcher extends Watcher {
if (!response.vaasByBlock[blockKey]) {
response.vaasByBlock[blockKey] = [];
}
return { vaasByBlock: response.vaasByBlock, optionalBlockHeight: response.lastBlockHeight };
return response;
}

async getProvider(): Promise<Provider> {
Expand Down
1 change: 0 additions & 1 deletion watcher/src/watchers/NearWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export class NearWatcher extends Watcher {

return {
vaasByBlock: await getMessagesFromBlockResults(this.network, provider, blocks),
optionalBlockHeight: undefined,
};
}

Expand Down
2 changes: 1 addition & 1 deletion watcher/src/watchers/SeiExplorerWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,6 @@ export class SeiExplorerWatcher extends CosmwasmWatcher {
}
// NOTE: this does not set an empty entry for the latest block since we don't know if the graphql response
// is synced with the block height. Therefore, the latest block will only update when a new transaction appears.
return { vaasByBlock, optionalBlockHeight: undefined };
return { vaasByBlock };
}
}
2 changes: 1 addition & 1 deletion watcher/src/watchers/SolanaWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export class SolanaWatcher extends Watcher {
toSlot.toString(),
new Date(toBlock.blockTime! * 1000).toISOString()
);
return { vaasByBlock: { [lastBlockKey]: [], ...vaasByBlock }, optionalBlockHeight: undefined };
return { vaasByBlock: { [lastBlockKey]: [], ...vaasByBlock } };
}

isValidVaaKey(key: string) {
Expand Down
2 changes: 1 addition & 1 deletion watcher/src/watchers/SuiWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,6 @@ export class SuiWatcher extends Watcher {
vaasByBlock[blockKey] = [...(vaasByBlock[blockKey] || []), vaaKey];
}
} while (hasNextPage && lastCheckpoint && fromCheckpoint < lastCheckpoint);
return { vaasByBlock, optionalBlockHeight: undefined };
return { vaasByBlock };
}
}
2 changes: 1 addition & 1 deletion watcher/src/watchers/TerraExplorerWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export class TerraExplorerWatcher extends Watcher {
);
vaasByBlock[blockKey] = [];
}
return { vaasByBlock, optionalBlockHeight: undefined };
return { vaasByBlock };
}
}

Expand Down
2 changes: 1 addition & 1 deletion watcher/src/watchers/WormchainWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class WormchainWatcher extends CosmwasmWatcher {
}
}
}
return { vaasByBlock, optionalBlockHeight: undefined };
return { vaasByBlock };
}
}

Expand Down
604 changes: 0 additions & 604 deletions watcher/src/watchers/__tests__/parseVaa.test.ts

This file was deleted.

0 comments on commit c0a6f62

Please sign in to comment.