Skip to content

Commit

Permalink
reject timestamps not divisible by 3600
Browse files Browse the repository at this point in the history
  • Loading branch information
0xngmi committed Jul 25, 2023
1 parent 17af538 commit 36657b7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/handlers/getBridgeStatsOnDay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ const getBridgeStatsOnDay = async (timestamp: string = "0", chain: string, bridg

const handler = async (event: AWSLambda.APIGatewayEvent): Promise<IResponse> => {
const timestamp = event.pathParameters?.timestamp;
if(Number(timestamp) % 3600 !== 0){
return errorResponse({
message: "timestamp must be divible by 3600"
})
}
const chain = event.pathParameters?.chain?.toLowerCase() ?? "";
const bridgeNetworkId = event.queryStringParameters?.id;
const response = await getBridgeStatsOnDay(timestamp, chain, bridgeNetworkId);
Expand Down

0 comments on commit 36657b7

Please sign in to comment.