Repository navigation
chore(solana): replace in in the Solana transaction and fee code - #633
Open
ulissesferreira wants to merge 1 commit into
Open
ulissesferreira wants to merge 1 commit into
ulissesferreira wants to merge 1 commit into
Conversation
ulissesferreira
temporarily deployed
to
default-branch
November 17, 2026 02:14 — with
GitHub Actions
Inactive
|
This branch was previously deployed
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.



Description
Removes the 37 Oxlint suppressions covering the Solana fee calculator and the transaction services. The
internal-snaps/no-in-operatorviolations are replaced withhasProperty()from@metamask/utils(a drop-in own-property check with the same narrowing behaviour), and the remaining families are type-level or test-hygiene fixes: the namedBigNumberexport, missing return types, real types instead ofany, and argument-dependent test setup that no longer needs conditionals.This is behaviour-neutral.
hasProperty()and theinoperator agree for every value these guards actually receive; the only difference is thathasProperty()returnsfalsefornullinstead of throwing, which the pre-existingtypeof x === 'object'checks now cover explicitly where a nested value can benull. The single||→??switch is equivalent becauseTransactionErroris a union of non-empty string literals and an object type, someta.erris never a falsy non-nullish value.Changes
packages/solana-wallet-snap/src/core/fees/FeeCalculator.ts—hasProperty()in the four input type guards, namedBigNumberexport, dropped the two unusedcatchbindings (no-in-operator,import/no-named-as-default,no-unused-vars)packages/solana-wallet-snap/src/core/fees/normalizers/types.ts—ed25519Signatures: readonly any[]→readonly (SignatureBytes | string | null)[], the exact union the three normalizers produce (no-explicit-any)packages/solana-wallet-snap/src/core/fees/FeeCalculator.test.ts— the invalid-input fixture is typed asNormalizableInputinstead ofany(no-explicit-any,no-unsafe-argument)packages/solana-wallet-snap/src/core/fees/normalizers/normalizeKitTransaction.test.ts— the mock scenario'ssignedTransactionis typed as a kitTransaction(no-unsafe-argument)packages/solana-wallet-snap/src/core/services/transactions/TransactionMapper.ts—hasProperty()for theErrstatus check,??formeta.err,BigNumber.Valuenarrowing for the parsed transfer amount, and return types on#aggregateSameAssetMovements/#decodeOpcode(no-in-operator,prefer-nullish-coalescing,no-unsafe-assignment,no-unsafe-argument,explicit-function-return-type,import/no-named-as-default)packages/solana-wallet-snap/src/core/services/transactions/TransactionMapper.test.ts— the two disabledmaps swaps - #6 SOL -> USDC/#7 SOL -> OBRICcases assert mapping the code does not implement (their own comment says so), so they are nowit.todocarrying the same explanation and Solscan links, instead of.skip(no-disabled-tests)packages/solana-wallet-snap/src/core/services/transactions/TransactionsRepository.test.ts— return type oncreateMockTransaction(explicit-function-return-type)packages/solana-wallet-snap/src/core/services/transactions/TransactionsService.ts—hasProperty()for the two'mint' in assetchecks, reading the narrowedmintwithString()(no-in-operator)packages/solana-wallet-snap/src/core/services/transactions/TransactionsService.test.ts— typedglobalThis.snapassignment, and the four argument-dependent ternary mocks became total lookup tables keyed by account/program (no-explicit-any,no-unsafe-member-access,no-conditional-in-test)packages/solana-wallet-snap/src/core/services/transactions/utils/isSpam.ts— namedBigNumberexport (import/no-named-as-default)packages/solana-wallet-snap/src/core/services/transactions/utils/isSpam.test.ts— module-levelassertDefined()helper replaces the per-testif (!transaction) throw(no-conditional-in-test)Quality gates
yarn lint:oxlint packages/solana-wallet-snap— clean, 37 suppressions entries removed (repository total 2069 → 2032)tsc --noEmit— cleanvitest run— 88 files, 1124 passed, 2 skipped (was 4), 3 todo (was 1)oxfmt --check— cleanTwo disabled tests were converted to
it.todorather than deleted: they document an edge case the mapper does not handle (a swap that looks like a receive), and the file already usesit.todofor the same reason.