Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(v2-sdk): Use type-based undefined check for kLast #295

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

0xMasayoshi
Copy link

Description

There is a bug in the V2 SDK where kLast—which can be Bigintish or undefined—is checked using !!kLast. This causes issues when kLast = 0, as !!kLast evaluates to false, incorrectly triggering an invariant error. Since there is already existing logic for handling kLast = 0, the proper check should ensure kLast is not undefined.

How Has This Been Tested?

Manual Testing: Verified that when kLast = 0, no error is thrown.
Unit Tests: Existing unit tests were run to confirm no regressions.

Are there any breaking changes?

No, this is not a breaking change. It only adjusts the check to correctly handle 0 as a valid value for kLast.

@0xMasayoshi 0xMasayoshi requested review from a team as code owners February 4, 2025 09:51
@jsy1218
Copy link
Member

jsy1218 commented Feb 4, 2025

add a unit test?

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.

2 participants