Skip to content

Commit

Permalink
improve error/debug msg
Browse files Browse the repository at this point in the history
  • Loading branch information
pLabarta committed Dec 12, 2024
1 parent a7a9ded commit b7027bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions test/helpers/storageQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const startReport = (total: () => number) => {
const used = process.memoryUsage().heapUsed / 1024 / 1024;
log(
`🔍️ Queried ${total()} keys @ ${qps.toFixed(0)} keys/sec,` +
` ${used.toFixed(0)} MB heap used\n`
` ${used.toFixed(0)} MB heap used\n`
);

timer = setTimeout(report, 5000);
Expand Down Expand Up @@ -51,7 +51,7 @@ export async function processAllStorage(
prefixes.map(async (prefix) =>
limiter.schedule(async () => {
let startKey: string | undefined = undefined;
loop: for (;;) {
loop: for (; ;) {
// @ts-expect-error _rpcCore is not yet exposed
const keys: string = await api._rpcCore.provider.send("state_getKeysPaged", [
prefix,
Expand Down Expand Up @@ -121,7 +121,7 @@ export async function processRandomStoragePrefixes(
prefixes.map(async (prefix) =>
limiter.schedule(async () => {
let startKey: string | undefined = undefined;
loop: for (;;) {
loop: for (; ;) {
// @ts-expect-error _rpcCore is not yet exposed
const keys: string = await api._rpcCore.provider.send("state_getKeysPaged", [
prefix,
Expand Down Expand Up @@ -149,7 +149,7 @@ export async function processRandomStoragePrefixes(
);
} catch (e) {
console.log(`Error processing ${prefix}: ${e}`);
console.log(`Replace the empty string in smoke/test-ethereum-contract-code.ts:L51
console.log(`Replace the empty string in smoke/test-ethereum-contract-code.ts
with the prefix to reproduce`);
}

Expand Down
3 changes: 2 additions & 1 deletion test/suites/smoke/test-ethereum-contract-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ describeSuite({
}
}
totalContracts += BigInt(items.length);
// WHEN DEBUGGING REPLACE THE EMPTY STRING WITH A PREFIX TO FETCH

},
// WHEN DEBUGGING REPLACE THE EMPTY STRING WITH A PREFIX TO FETCH
""
);

Expand Down

0 comments on commit b7027bb

Please sign in to comment.