You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
protectedvoidvalidateRanges(LongblockStart, LongblockEnd, LongtimestampStart, LongtimestampEnd) throwsBadRequestException {
booleanhasCompleteBlockRange = isCompleteRange(blockStart, blockEnd);
booleanhasCompleteTimestampRange = isCompleteRange(timestampStart, timestampEnd);
booleanhasPartialBlockRange = isPartialRange(blockStart, blockEnd);
booleanhasPartialTimestampRange = isPartialRange(timestampStart, timestampEnd);
if (!hasCompleteBlockRange && !hasCompleteTimestampRange) {
thrownewBadRequestException("Need either a complete block range or a complete timestamp range to export transactions.");
}
if (hasPartialBlockRange && hasPartialTimestampRange) {
thrownewBadRequestException("Cannot have both block and timestamp ranges.");
}
if (hasCompleteBlockRange && blockEnd - blockStart > ONE_YEAR_BLOCKS) {
thrownewBadRequestException("Block range must be less than " + ONE_YEAR_BLOCKS + " blocks.");
}
if (hasCompleteTimestampRange && timestampEnd - timestampStart > ONE_YEAR_MS) {
thrownewBadRequestException("Timestamp range must be less than one year.");
}
}
The text was updated successfully, but these errors were encountered:
Overview
Add the four range checks that the indexer performs for the export endpoint and prevent the user from exporting if they are not met.
Fixed here: #1001
Indexer checks are here:
https://github.com/telosnetwork/teloscan-indexer/blob/master/src/main/java/net/telos/indexer/api/resource/ExportResource.java#L57-L78
The text was updated successfully, but these errors were encountered: