docs: add PR description for dedupe of defindex asset amount extracti… - #625
Open
Vivian-04 wants to merge 1 commit into
Open
docs: add PR description for dedupe of defindex asset amount extracti…#625Vivian-04 wants to merge 1 commit into
Vivian-04 wants to merge 1 commit into
Conversation
|
@Vivian-04 is attempting to deploy a commit to the Collins' projects Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
waiting... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #592
Summary
get_asset_amounts_per_sharesfirst-element extraction is already deduplicated onmain.buildDefindexWithdrawTxandfetchDefindexPositionalready call the shared helpergetDefindexAssetAmountPerShares, which owns the parsing logic (Array.isArray(...) && length > 0 ? toBigInt(v[0]) : <fallback>) in exactly one place indefindex.ts(lines 52-54).rate-sources.tsalso imports the same helper, so the response parse lives in a single location repo-wide. This was folded in via5aebacd.firstAssetAmount(value): bigint(returning0non empty) was deliberately not implemented:getDefindexAssetAmountPerSharesmust keep returningbigint | null, sincerate-sources.tsrelies onnullto signal an unavailable price (seerate-sources.tslines 315/324). Collapsing the fallback into the helper as0nwould be a behavior change outside the SDK/DeFindex scope.Acceptance criteria
getDefindexAssetAmountPerShares) already replaces both inline extractions.defindex.test.tscoverage for both call sites passes unchanged (20/20).Test plan
pnpm test— all 9 workspace test tasks pass (incl.defindex.test.ts20/20)pnpm typecheck— all 8 packages passpnpm lint— passespnpm format:check— noted: on this Windows machine it flags 187 files only becausecore.autocrlf=trueconverts LF→CRLF on checkout; CI runs on Linux with LF and passes. Not a code issue, no file changes.Closes #592