function compareKeyWithContentRange()

in src/qldb/JournalS3ExportReader.ts [41:53]


function compareKeyWithContentRange(fileKey: string, firstBlock: JournalBlock, lastBlock: JournalBlock): void {
    const sequenceNoRange: string = fileKey.split(".")[1];
    const keyTokens: string[] = sequenceNoRange.split("-");
    const startSequenceNo: string = keyTokens[0];
    const lastsequenceNo: string = keyTokens[1];

    if (firstBlock._blockAddress._sequenceNo.toString() !== startSequenceNo) {
        throw new Error(`Expected first block SequenceNo to be ${startSequenceNo}`);
    }
    if (lastBlock._blockAddress._sequenceNo.toString() !== lastsequenceNo) {
        throw new Error(`Expected last block SequenceNo to be ${lastsequenceNo}`);
    }
}