Skip to content

fix(sdk): return undefined from parseFillLogs on empty logs - #272

Open
devtechedge wants to merge 1 commit into
across-protocol:masterfrom
devtechedge:fix/parse-fill-logs-empty-array
Open

fix(sdk): return undefined from parseFillLogs on empty logs#272
devtechedge wants to merge 1 commit into
across-protocol:masterfrom
devtechedge:fix/parse-fill-logs-empty-array

Conversation

@devtechedge

Copy link
Copy Markdown

Summary

parseFillLogs currently builds blockData from logs[0] before checking whether any fill event is present. When callers pass an empty logs array (a valid "no fill found" case), that access throws a TypeError instead of returning undefined.

This change adds an early return for logs.length === 0, matching the existing no-match behavior for non-empty logs that do not contain a fill event.

Changes

  • Guard parseFillLogs so an empty logs array returns undefined
  • Add unit tests covering empty logs and unrelated non-fill logs

Test plan

  • vitest run test/unit/actions/parseFillLogs.test.ts (empty array and non-fill logs both return undefined)
  • Reviewers: confirm callers that already treat a missing fill as undefined continue to work as expected

Fixes #268

Guard against reading logs[0] when the caller passes an empty array so
parseFillLogs returns undefined instead of throwing a TypeError.

Fixes across-protocol#268
@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

@devtechedge is attempting to deploy a commit to the UMA Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 986fdc6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

parseFillLogs throws TypeError on empty logs array instead of returning undefined

1 participant