Skip to content

Commit

Permalink
feat: add assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
0xnigir1 committed Aug 8, 2024
1 parent 6b3139a commit a8bda96
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions libs/metrics/src/l1/l1MetricsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,15 +350,12 @@ export class L1MetricsService {
const values: string[] = [];

for (const value of Object.values(feeParamsFieldLengths)) {
values.push(strippedParamsData.slice(cursor - value, cursor));
const hexValue = strippedParamsData.slice(cursor - value, cursor);
assert(hexValue, "Error parsing fee params");
values.push(hexValue);
cursor -= value;
}

assert(
values.length === Object.keys(feeParamsFieldLengths).length,
"Error parsing fee params",
);

const [
pubdataPricingMode,
batchOverheadL1Gas,
Expand Down

0 comments on commit a8bda96

Please sign in to comment.