refactor(wt+sdk): S3776 long-tail in manager + bignumber + contacts#100
Merged
refactor(wt+sdk): S3776 long-tail in manager + bignumber + contacts#100
Conversation
Reduce cognitive complexity to ≤12 in all flagged functions across WalletPermissionsManager, CWIStyleWalletManager, BigNumber and ContactsManager. Extracts focused private helpers; no logic changes. BigNumber `| 0` integer-validation guarded by eslint-disable comment. Refs #38 #44. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Conflicts in ContactsManager.ts (4 hunks) and BigNumber.ts (2 hunks). Resolved by keeping HEAD's helper-method refactors which already incorporate the W3 S2486 catch renames and other origin/main changes into the extracted private helpers (loadCachedContacts, updateContactOutput, createContactOutput, trySpendContactOutput, _initFromString, _computeMod, _bigNumberFromSigned).
|
sirdeggen
added a commit
that referenced
this pull request
May 8, 2026
Conflict in BigNumber.ts resolved by taking origin/main's structure (uses _initFromString helper from W5 PR #100) and applying the W6 S2486 catch rename (_bigIntParseError) to the helper's BigInt parse path.
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.


Summary
BigNumber.ts| 0integer-validation preserved; eslint-disable comment added per playbookWalletPermissionsManagerleft intact — only structural decompositionFiles changed
WalletPermissionsManager.tsisBasketUsageRequired,isPiggybacking,piggybackOnExistingQueue,resolveGroupedFlow,enqueueAndFireEvent,buildProtocolFilterTags,collectProtocolTokens,collectCertificateTokens,collectNonPBaskets,enforceSignAndProcess,encryptActionMetadata,callCreateActionWithPModulesCWIStyleWalletManager.tsbuildUMPTokenFields,resolveOldTokenInput,createUMPAction,broadcastFinishedUMPAction,signAndBroadcastWithOldToken,signAndBroadcastNewToken,handleExistingUserPassword,handleNewUserPasswordBigNumber.ts_initFromString,_initFromHexString,_initFromNonHexString,_zeroPaddedChunk,_computeMod,_bigNumberFromSignedContactsManager.tsloadCachedContacts,buildIdentityKeyTags,decryptContactOutputs,hashIdentityKey,findExistingOutput,encryptAndLock,updateContactOutput,createContactOutput,trySpendContactOutputTest plan
pnpm --filter @bsv/sdk run build— passespnpm --filter @bsv/wallet-toolbox run build— passespnpm --filter @bsv/sdk exec jest --runInBand --testPathPatterns='BigNumber|Contacts'— 165/165 passpnpm --filter @bsv/wallet-toolbox exec jest --runInBand --testPathPatterns='WalletPermissions|CWIStyle'— 175/175 passRefs #38 #44.
🤖 Generated with Claude Code