Skip to content

Commit

Permalink
Make e2e tests pass with lake storage
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrichina committed Feb 19, 2024
1 parent db96b3b commit 8d30187
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions storage/lake/archive.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ async function *readBlocks(dataDir, shard, startBlockNumber, endBlockNumber) {
const extract = tar.extract();
const gunzip = zlib.createGunzip();
const readStream = fs.createReadStream(inFile);
const results = [];
const pipelinePromise = pipeline(readStream, gunzip, extract, async function *(extract, { signal }) {
for await (const entry of extract) {
if (signal.aborted) {
Expand All @@ -38,11 +39,11 @@ async function *readBlocks(dataDir, shard, startBlockNumber, endBlockNumber) {
});

const blockHeight = parseInt(entry.header.name.replace('.json', ''), 10);
yield { data, blockHeight };
results.push({ data, blockHeight });
}
});

await pipelinePromise;
yield *results;
}
}

Expand Down

0 comments on commit 8d30187

Please sign in to comment.