Skip to content

fix(sdk): treat depositId 0 as a valid deposit id - #277

Open
AnkitSingh411 wants to merge 1 commit into
across-protocol:masterfrom
AnkitSingh411:fix/deposit-id-zero
Open

AnkitSingh411 wants to merge 1 commit into
across-protocol:masterfrom
AnkitSingh411:fix/deposit-id-zero

Conversation

@AnkitSingh411

Copy link
Copy Markdown

depositId is a bigint/number, so 0/0n is falsy. The truthiness guards in
getDeposit, waitForDepositTx, waitForAtomicTx and parseFillLogs treated
depositId 0 as missing: getDeposit threw before issuing any getLogs call
and the waiters threw NoDepositLogError. Deposit ID 0 is legitimate —
SpokePool starts numberOfDeposits at 0 — so the first deposit on any
SpokePool could not be awaited or looked up by id. Compare against
undefined instead of relying on truthiness.

depositId is a bigint/number, so 0/0n is falsy. The truthiness guards in
getDeposit, waitForDepositTx, waitForAtomicTx and parseFillLogs treated
depositId 0 as missing: getDeposit threw before issuing any getLogs call
and the waiters threw NoDepositLogError. Deposit ID 0 is legitimate —
SpokePool starts numberOfDeposits at 0 — so the first deposit on any
SpokePool could not be awaited or looked up by id. Compare against
undefined instead of relying on truthiness.
@vercel

vercel Bot commented Nov 7, 2026

Copy link
Copy Markdown

@AnkitSingh411 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 Nov 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c40c46f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@across-protocol/app-sdk Patch

Not sure what this means? Click here to learn what changesets are.

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

This branch has not been deployed

No deployments
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.

1 participant